Compare commits

...

2 commits

2 changed files with 9 additions and 9 deletions

View file

@ -157,7 +157,7 @@ namespace Tablegen
////////////////////////////////////////////////////////////////////
// HTML
////////////////////////////////////////////////////////////////////
if (i % 3 == 0) {
if (i % settings.CharactersPerRow == 0) {
row = tableBody.append_child("tr");
row.append_attribute("class") = "kanji-table-row";
}

View file

@ -78,14 +78,18 @@ This library generates a table of kanji images from a specified list with variou
values. It's made up of the following interface:
```cpp
std::string GeneratePage(const Settings& settings = Settings::Default());
std::string GeneratePage(const std::vector<CharacterInfo>& characters,
const Settings& settings = Settings::Default());
void GeneratePage(const std::string& path, const Settings& settings = Settings::Default());
void GeneratePage(const std::string& path, const std::vector<CharacterInfo>& characters,
const Settings& settings = Settings::Default());
#ifdef TABLEGEN_EXPOSE_XML
void GenerateAsChild(pugi::xml_node& node, const Settings& settings = Settings::Default());
void GenerateAsChild(pugi::xml_node& node, const std::vector<CharacterInfo>& characters,
const Settings& settings = Settings::Default());
pugi::xml_document GenerateDocument(const Settings& settings = Settings::Default());
pugi::xml_document GenerateDocument(const std::vector<CharacterInfo>& characters,
const Settings& settings = Settings::Default());
#endif
```
@ -126,9 +130,5 @@ auto doc = GeneratePage({
.CharactersPerRow = 3,
.ImageFormat = "http://the.url/where/you/have/images/{}.svg",
.AnimationFormat = "http://the.url/where/you/have/animations/{}.svg",
.Characters = {
/* The actual characters you want in the table, example: */
{ .Label = "Day", .ImagePath = "%E6%97%A5", .AnimationPath = "%E6%97%A5", },
},
});
```