Added comment() inja function - Fixes #30
This commit is contained in:
@@ -19,6 +19,8 @@
|
||||
|
||||
#include "enums.h"
|
||||
|
||||
#include <type_safe/optional_ref.hpp>
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
@@ -36,6 +38,9 @@ public:
|
||||
|
||||
virtual diagram_t type() const = 0;
|
||||
|
||||
virtual type_safe::optional_ref<const element> get(
|
||||
const std::string &full_name) const = 0;
|
||||
|
||||
diagram(const diagram &) = delete;
|
||||
diagram(diagram &&);
|
||||
diagram &operator=(const diagram &) = delete;
|
||||
|
||||
@@ -80,6 +80,9 @@ inja::json element::context() const
|
||||
ctx["alias"] = alias();
|
||||
ctx["full_name"] = full_name(false);
|
||||
ctx["namespace"] = get_namespace().to_string();
|
||||
if (comment().has_value())
|
||||
ctx["comment"] = comment().value();
|
||||
|
||||
return ctx;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user