[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[X] Feature request
[ ] Documentation issue or request
[ ] Support request => Please have a look to the support pages of our website : http://m2doc.org/support/
Current behavior
When specifying a link / bookmark reference in a template, we rely on the fact that somewhere else in the template, a bookmark with the specified ID will have been created. In order to only link / reference a bookmark only if it exists, the condition that constrains the existence of the bookmark must be duplicated (if it is even possible), making the template more complex and difficult to maintain.
Expected behavior
There should be at least one way to specify a safe bookmark reference that defaults to rendering the bookmark reference text.
Minimal reproduction of the problem with instructions
When condition is false, the Foo bookmark reference fails and renders as error "dangling reference for boomark Bar".
There should be a way to safely render the bookmark reference as text Foo without the hyperlink.
What is the motivation / use case for changing the behavior?
In Capella, most elements have a property visibleInDoc which may be used to determine whether a model element should have its own section in the generated documentation. In that case, referencing these sections (which may or may not exist depending on the value of visibleInDoc) safely requires duplicating the condition (checking the value of the visibleInDoc property).
I'm submitting a...
Current behavior
When specifying a link / bookmark reference in a template, we rely on the fact that somewhere else in the template, a bookmark with the specified ID will have been created. In order to only link / reference a bookmark only if it exists, the condition that constrains the existence of the bookmark must be duplicated (if it is even possible), making the template more complex and difficult to maintain.
Expected behavior
There should be at least one way to specify a safe bookmark reference that defaults to rendering the bookmark reference text.
Minimal reproduction of the problem with instructions
{m: 'Foo'.asBookmarkRef('Bar')}
{m:if(condition)}
{m:'Bar'.asBookmark()}
{m:endif}
condition
istrue
, everything is fine.condition
isfalse
, theFoo
bookmark reference fails and renders as error "dangling reference for boomark Bar". There should be a way to safely render the bookmark reference as textFoo
without the hyperlink.What is the motivation / use case for changing the behavior?
In Capella, most elements have a property
visibleInDoc
which may be used to determine whether a model element should have its own section in the generated documentation. In that case, referencing these sections (which may or may not exist depending on the value ofvisibleInDoc
) safely requires duplicating the condition (checking the value of thevisibleInDoc
property).