CesiumGS / cesium-native

Apache License 2.0
438 stars 215 forks source link

Include Mermaid diagrams in Doxygen #997

Open azrogers opened 3 days ago

azrogers commented 3 days ago

Mermaid is a JavaScript-based diagramming tool that would be very useful for us to have in our documentation. It would make it easier to create and maintain flow charts, sequence diagrams, and any other sorts of diagrams and charts we need. Implementing Mermaid in Doxygen is very possible, but not trivial. This repository contains an example of one approach to implementing Mermaid, but it might not be the best. We should investigate our options here and implement a way to generate and include these charts in our documentation.

kring commented 3 days ago

It would be great to have access to at least one icon pack, too: https://mermaid.js.org/config/icons.html

azrogers commented 2 days ago

Did some investigating on this issue:

kring commented 2 days ago

Instead, we can just grab a copy of the latest mermaid.min.js and latest icon pack .json file and include them in the repo. This would reduce the assets loaded by splitting apart the Mermaid code and the icons pack, to allow the icons to be lazy loaded.

Do you know of any downside to this? It sounds like a solid option.

My only small concern with generating the charts dynamically is that this could (but hopefully doesn't!) prevent them from working when the docs are loaded from a file URL. For example, if a user generates the docs locally and opens the index.html directly without hosting them with a web server.

azrogers commented 2 days ago

The main downside is that it would be slightly more work (as in, three minutes of work versus two minutes) to keep it updated, as compared to changing the version number in the package.json. Not much of a downside. I believe if we include both the Mermaid JS file and the icons pack JSON file in the built docs, it should work offline.