Added option style to plantuml config section
This commit is contained in:
@@ -168,6 +168,24 @@ std::string to_string(member_order_t mo)
|
||||
}
|
||||
}
|
||||
|
||||
std::optional<std::string> plantuml::get_style(
|
||||
const common::model::relationship_t relationship_type) const
|
||||
{
|
||||
if (style.count(to_string(relationship_type)) == 0)
|
||||
return {};
|
||||
|
||||
return style.at(to_string(relationship_type));
|
||||
}
|
||||
|
||||
std::optional<std::string> plantuml::get_style(
|
||||
const std::string &element_type) const
|
||||
{
|
||||
if (style.count(element_type) == 0)
|
||||
return {};
|
||||
|
||||
return style.at(element_type);
|
||||
}
|
||||
|
||||
void plantuml::append(const plantuml &r)
|
||||
{
|
||||
before.insert(before.end(), r.before.begin(), r.before.end());
|
||||
|
||||
@@ -109,6 +109,11 @@ enum class comment_parser_t {
|
||||
|
||||
std::string to_string(comment_parser_t cp);
|
||||
|
||||
struct plantuml_keyword_mapping_t {
|
||||
std::map<common::model::relationship_t, std::pair<std::string, std::string>>
|
||||
relationships;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief PlantUML diagram config section
|
||||
*
|
||||
@@ -123,6 +128,13 @@ struct plantuml {
|
||||
std::vector<std::string> after;
|
||||
/*! Command template to render diagram using PlantUML */
|
||||
std::string cmd;
|
||||
/*! Provide customized styles for various elements */
|
||||
std::map<std::string, std::string> style;
|
||||
|
||||
std::optional<std::string> get_style(
|
||||
const common::model::relationship_t relationship_type) const;
|
||||
|
||||
std::optional<std::string> get_style(const std::string &element_type) const;
|
||||
|
||||
void append(const plantuml &r);
|
||||
};
|
||||
|
||||
@@ -160,6 +160,7 @@ types:
|
||||
before: !optional [string]
|
||||
after: !optional [string]
|
||||
cmd: !optional string
|
||||
style: !optional map_t<string;string>
|
||||
mermaid: !optional
|
||||
before: !optional [string]
|
||||
after: !optional [string]
|
||||
|
||||
@@ -411,6 +411,9 @@ template <> struct convert<plantuml> {
|
||||
if (node["cmd"])
|
||||
rhs.cmd = node["cmd"].as<decltype(rhs.cmd)>();
|
||||
|
||||
if (node["style"])
|
||||
rhs.style = node["style"].as<decltype(rhs.style)>();
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user