From acff200ac19bd16af68501f4cc7a57d6c5b38d1a Mon Sep 17 00:00:00 2001 From: Relintai Date: Sat, 6 Jan 2024 13:44:59 +0100 Subject: [PATCH] Use class templates. --- tools/doc/index_template.md.html | 7 ------- tools/doc/main.cpp | 6 +++++- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/tools/doc/index_template.md.html b/tools/doc/index_template.md.html index 6d9c2a6..917ecdf 100644 --- a/tools/doc/index_template.md.html +++ b/tools/doc/index_template.md.html @@ -19,14 +19,7 @@ ENUMS ==================================================================================== -ClockDirection ----------------------------------------------------------------------------------------- - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ |||ENUM_ClockDirection||| -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - diff --git a/tools/doc/main.cpp b/tools/doc/main.cpp index ebcbb5c..16c1c34 100644 --- a/tools/doc/main.cpp +++ b/tools/doc/main.cpp @@ -512,6 +512,7 @@ void process_file(const String &path) { //print_class_index_keys(class_index); String index_template = f.read_file("index_template.md.html"); + String code_template = f.read_file("code_template.md.html"); List index_template_keywords = get_template_keywords(index_template); HashSet used_keywords; @@ -526,7 +527,10 @@ void process_file(const String &path) { String keyword = "|||" + E->get() + "|||"; - index_str = index_str.replace(keyword, class_index[c]); + String class_str = class_index[c]; + String class_name = get_structure_name(class_str); + + index_str = index_str.replace(keyword, code_template.replace("$CODE$", class_str).replace("$NAME$", class_name)); used_keywords.insert(c); }