diff --git a/Libraries/Tablegen/Source/Tablegen.cpp b/Libraries/Tablegen/Source/Tablegen.cpp index 2edb766..e136dd8 100644 --- a/Libraries/Tablegen/Source/Tablegen.cpp +++ b/Libraries/Tablegen/Source/Tablegen.cpp @@ -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"; } diff --git a/README.md b/README.md index 7c73ff6..39210af 100644 --- a/README.md +++ b/README.md @@ -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& 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& 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& characters, + const Settings& settings = Settings::Default()); -pugi::xml_document GenerateDocument(const Settings& settings = Settings::Default()); +pugi::xml_document GenerateDocument(const std::vector& 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", }, - }, }); ```