Replies: 6 comments 5 replies
-
For now, as I workaround, my filter script performs a Base64 encoding of the Mermaid.js code. Something like: <script>
// To prevent Doxygen from messing up the formatting of the Mermaid.js input,
// we use a Base64 encoded version of the input in the pre.mermaid-b64.
// Before calling mermaid.initialize(), we decode the content of all pre.mermaid-b64 elements
// and change the class to pre.mermaid.
document.querySelectorAll('pre.mermaid-b64').forEach((element) => {
const decoded = atob(element.textContent);
element.textContent = decoded;
element.classList.remove('mermaid-b64');
element.classList.add('mermaid');
});
mermaid.initialize({
startOnLoad: true,
theme: 'base',
});
</script> Of course, if I could just tell Doxygen to not bother with linking in the mermaid |
Beta Was this translation helpful? Give feedback.
-
There are no commands, to my knowledge, that would accomplish this. This would lead to that e.g.
should be rendered as Probably still not the easiest way but no extra software is needed. |
Beta Was this translation helpful? Give feedback.
-
Code has been integrated in master on GitHub. |
Beta Was this translation helpful? Give feedback.
-
@itavero Would you be willing to share your script? I have struggling with the same issue. And I don't think the special comment to doxygen above would be best way to go. I'm also using a script based on the script from tahyx that you linked in your initial post. In particular, how does your "filter script performs a Base64 encoding of the Mermaid.js code"? |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Indeed there is no support for Mermaid diagrams, to be able to do it an approach similar to plantuml could be used but this at least requires some easy to use, free, well maintained Mermaid renderer software. When at least these preconditions are satisfied someone still has to implement it ... |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
We have several Markdown (
.md
) files that contain Mermaid diagrams.I managed to get this working by using an filter script similar to this one.
However, if a diagram contains a name that Doxygen can link, it will mess up the mermaid code by adding an
<a>
tag in it.In general I like the idea of auto linking, but to my surprise I could not find a way to tell Doxygen to not perform auto linking in a certain section.
How can this be achieved?
Adding
%
doesn't work that well, as that would break rendering in other viewers, and symbols/names may change/be added after a diagram has been made.Beta Was this translation helpful? Give feedback.
All reactions