From 5cf55e09a402936062256cd5074f7e25eb0c6141 Mon Sep 17 00:00:00 2001 From: TennesseeTrash Date: Mon, 16 Jun 2025 05:31:13 +0200 Subject: [PATCH 1/2] [Tablegen] Fix wrong constant --- Libraries/Tablegen/Source/Tablegen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"; } From c15045562e74f5ddcdd10636b3406ff9c71968b2 Mon Sep 17 00:00:00 2001 From: TennesseeTrash Date: Mon, 16 Jun 2025 05:33:20 +0200 Subject: [PATCH 2/2] Update the README to reflect Tablegen API changes --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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", }, - }, }); ```