Support latest es module mermaid, add support for ELK diagrams #151
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
mermaid
with switch for allowing older non-es moduleES Modules
Mermaid moved to es modules on version 10.3. As a first pass, I allowed for either >10.3 with code to use modules, or less than 10.3 and keep the existing code. This ended up pretty messy, so this PR officially removes support for
mermaid<10.3.0
. This is a breaking change.Explicit local files
I added explicit options for
mermaid_use_local
,mermaid_elk_use_local
, andd3_use_local
, to disambiguate the usage ofmermaid_version
.New Zoom
This is a little more complicated because I noticed a race condition between
mermaid
's auto initialization and the d3 processing step on window load. So now they're guaranteed sequential by forcing mermaid to run first, then doing a followup run to add zoom to either all mermaids on the page, or just those that have been annotated with:zoom:
Frontmatter
Mermaid frontmatter is working, albeit with a compromise of exploiting yaml/json compatibility. Thankfully, this works fine across sphinx/github:
GitHub
Sphinx
Docs
I validated that html/pdf docs worked locally including zoom. I added some information:
mermaid
directive the same (e.g.s/{mermaid}/mermaid
)