Added 'title' diagram property

This commit is contained in:
Bartek Kryza
2023-10-09 13:53:14 +02:00
parent 03bd5ada31
commit 8a6b497cc9
52 changed files with 173 additions and 66 deletions

View File

@@ -131,6 +131,16 @@ public:
*/
void generate_metadata(std::ostream &ostr) const;
/**
* @brief Generate diagram title
*
* Generates a PlantUML diagram title directive if diagram title
* is provided in the diagram configuration.
*
* @param ostr Output stream
*/
void generate_title(std::ostream &ostr) const;
/**
* @brief Generate hyper link to element
*
@@ -241,6 +251,8 @@ void generator<C, D>::generate(std::ostream &ostr) const
ostr << "@startuml" << '\n';
generate_title(ostr);
generate_plantuml_directives(ostr, config.puml().before);
generate_diagram(ostr);
@@ -449,6 +461,16 @@ void generator<C, D>::generate_metadata(std::ostream &ostr) const
}
}
template <typename C, typename D>
void generator<C, D>::generate_title(std::ostream &ostr) const
{
const auto &config = generators::generator<C, D>::config();
if (config.title) {
ostr << "title " << config.title() << '\n';
}
}
template <typename C, typename D>
template <typename E>
void generator<C, D>::generate_link(std::ostream &ostr, const E &e) const