Updated docs generation scripts

This commit is contained in:
Bartek Kryza
2023-09-10 00:03:47 +02:00
parent 2cc70bcd7e
commit 9a6def801c
6 changed files with 34 additions and 14 deletions

View File

@@ -124,6 +124,10 @@ void generate_diagram_impl(const std::string &od, const std::string &name,
generate_diagram_select_generator<diagram_config,
json_generator_tag>(od, name, diagram, model);
}
else if (generator_type == generator_type_t::mermaid) {
generate_diagram_select_generator<diagram_config,
mermaid_generator_tag>(od, name, diagram, model);
}
}
}
} // namespace detail

View File

@@ -254,18 +254,24 @@ void generator<C, D>::generate_link(std::ostream &ostr, const E &e) const
ostr << indent(1) << "click " << e.alias() << " href \"";
try {
std::string link{};
if (!config.generate_links().link.empty()) {
ostr << env().render(std::string_view{config.generate_links().link},
link = env().render(std::string_view{config.generate_links().link},
element_context(e));
}
if (link.empty())
link = " ";
ostr << link;
}
catch (const inja::json::parse_error &e) {
LOG_ERROR(
"Failed to parse Jinja template: {}", config.generate_links().link);
ostr << " ";
}
catch (const inja::json::exception &e) {
LOG_ERROR("Failed to render PlantUML directive: \n{}\n due to: {}",
LOG_ERROR("Failed to render comment directive: \n{}\n due to: {}",
config.generate_links().link, e.what());
ostr << " ";
}
ostr << "\"";
@@ -281,10 +287,12 @@ void generator<C, D>::generate_link(std::ostream &ostr, const E &e) const
catch (const inja::json::parse_error &e) {
LOG_ERROR("Failed to parse Jinja template: {}",
config.generate_links().link);
ostr << " ";
}
catch (const inja::json::exception &e) {
LOG_ERROR("Failed to render PlantUML directive: \n{}\n due to: {}",
config.generate_links().link, e.what());
ostr << " ";
}
ostr << "\"";