Skip to content

Commit

Permalink
Scripting reference: Format both "Summary" and "Instances"
Browse files Browse the repository at this point in the history
Fixes a formatting issue, introduced with 2451a82.
  • Loading branch information
Vankata453 committed Dec 16, 2024
1 parent 2451a82 commit 9ee7976
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tools/scripting_docs_gen/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ int main(int argc, char** argv)
std::string target_data = Writer::write_file_notice(page_template_filename) + page_template;

// Entries
replace(target_data, "${SRG_CLASSSUMMARY}", cl.summary, "None.");
replace(target_data, "${SRG_CLASSINSTANCES}", cl.instances, "None.");
replace(target_data, "${SRG_CLASSSUMMARY}", Writer::format_description(std::move(cl.summary)), "None.");
replace(target_data, "${SRG_CLASSINSTANCES}", Writer::format_description(std::move(cl.instances)), "None.");
replace(target_data, "${SRG_CLASSINHERITANCE}", Writer::write_inheritance_list(classes, cl.base_classes, cl.derived_classes), "None.");
replace(target_data, "${SRG_CLASSCONSTANTS}", Writer::write_constants_table(cl.constants), "None.");
replace(target_data, "${SRG_CLASSVARIABLES}", Writer::write_variables_table(cl.variables), "None.");
Expand Down
3 changes: 2 additions & 1 deletion tools/scripting_docs_gen/writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@

namespace Writer {

static std::string format_description(std::string desc)
std::string format_description(std::string desc)
{
replace(desc, "\"\"", "`");
replace(desc, "NOTE:", "<br /><br />**NOTE:**");
replace(desc, "Note:", "<br /><br />**NOTE:**");
return desc;
}


std::string write_file_notice(const std::string& template_file)
{
std::stringstream notice;
Expand Down
2 changes: 2 additions & 0 deletions tools/scripting_docs_gen/writer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

namespace Writer
{
std::string format_description(std::string desc);

std::string write_file_notice(const std::string& template_file);

std::string write_inheritance_list(const std::vector<Class>& classes,
Expand Down

0 comments on commit 9ee7976

Please sign in to comment.