Added diagram metadata to PlantUML and JSON generators
This commit is contained in:
@@ -116,6 +116,7 @@ void inheritable_diagram_options::inherit(
|
||||
combine_free_functions_into_file_participants.override(
|
||||
combine_free_functions_into_file_participants);
|
||||
debug_mode.override(parent.debug_mode);
|
||||
generate_metadata.override(parent.generate_metadata);
|
||||
}
|
||||
|
||||
std::string inheritable_diagram_options::simplify_template_type(
|
||||
|
||||
@@ -170,6 +170,7 @@ struct inheritable_diagram_options {
|
||||
"combine_free_functions_into_file_participants", false};
|
||||
option<std::vector<std::string>> participants_order{"participants_order"};
|
||||
option<bool> debug_mode{"debug_mode", false};
|
||||
option<bool> generate_metadata{"generate_metadata", true};
|
||||
|
||||
void inherit(const inheritable_diagram_options &parent);
|
||||
|
||||
@@ -292,7 +293,8 @@ YAML::Emitter &operator<<(YAML::Emitter &out, const option<T> &o)
|
||||
}
|
||||
|
||||
config load(const std::string &config_file,
|
||||
std::optional<bool> paths_relative_to_pwd = {});
|
||||
std::optional<bool> paths_relative_to_pwd = {},
|
||||
std::optional<bool> no_metadata = {});
|
||||
|
||||
config load_plain(const std::string &config_file);
|
||||
} // namespace config
|
||||
|
||||
@@ -381,6 +381,7 @@ template <typename T> bool decode_diagram(const Node &node, T &rhs)
|
||||
get_option(node, rhs.type_aliases);
|
||||
get_option(node, rhs.comment_parser);
|
||||
get_option(node, rhs.debug_mode);
|
||||
get_option(node, rhs.generate_metadata);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -595,6 +596,7 @@ template <> struct convert<config> {
|
||||
get_option(node, rhs.generate_system_headers);
|
||||
get_option(node, rhs.git);
|
||||
get_option(node, rhs.debug_mode);
|
||||
get_option(node, rhs.generate_metadata);
|
||||
rhs.base_directory.set(node["__parent_path"].as<std::string>());
|
||||
get_option(node, rhs.relative_to);
|
||||
|
||||
@@ -676,8 +678,8 @@ void resolve_option_path(YAML::Node &doc, const std::string &option)
|
||||
}
|
||||
} // namespace
|
||||
|
||||
config load(
|
||||
const std::string &config_file, std::optional<bool> paths_relative_to_pwd)
|
||||
config load(const std::string &config_file,
|
||||
std::optional<bool> paths_relative_to_pwd, std::optional<bool> no_metadata)
|
||||
{
|
||||
try {
|
||||
YAML::Node doc;
|
||||
@@ -727,6 +729,10 @@ config load(
|
||||
doc["relative_to"] = std::filesystem::current_path().string();
|
||||
}
|
||||
|
||||
if (no_metadata.has_value()) {
|
||||
doc["generate_metadata"] = !no_metadata.value();
|
||||
}
|
||||
|
||||
//
|
||||
// Resolve common path-like config options relative to `relative_to`
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user