feat: Add support for custom (or offline) Mermaid.ink server and support all parameters #8772
+293
−28
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.
Related Issues
Proposed Changes:
This PR is an attempt at adding support for offline pipeline
draw()
andshow()
calls for users in constrained environments where no requests to outside servers are allowed. This PR builds upon #8767 and introduces no breaking changes to regulardraw()
andshow()
calls (from what I've tested). Additionally, all parameters supported by Mermaid.ink are supported. The defaults remain as it was before (PNG image, neutral theme)How did you test it?
Unit and integration tests were added testing different combinations of parameters. No tests were added to test a remote server since there is no way to properly test that in the CI. I tested it myself using my own docker hosted Mermaid server, but further testing would be needed. The original tests were not modified significantly to show the changes are most likely not breaking changes.
Notes for the reviewer
Several notes:
_to_mermaid_image
to something else.request
either way.Checklist
fix:
,feat:
,build:
,chore:
,ci:
,docs:
,style:
,refactor:
,perf:
,test:
and added!
in case the PR includes breaking changes.