Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add support for ELK layout engine and update to latest mermaid dependency #61

Merged

Conversation

aztechead
Copy link
Contributor

@aztechead aztechead commented Feb 13, 2025

In the current version of backstage-plugin-techdocs-addon-mermaid there are two issues related to unsupported layouts related to the ELK layout engine:

It looks like prior to mermaid 11.0.X the elk layout engine was included as part of the core mermaid npm dependency. That has since been moved out and now requires an additional dependency @mermaid-js/layout-elk

I went ahead and incorporated that dependency into the plugin, and registered it to the layout engine. This now supports both the legacy and modern syntax for requesting the elk renderer. This is a no-op to existing mermaid syntax that does not make use of defining a custom renderer.

Legacy

%%{init: {"flowchart": {"defaultRenderer": "elk"}} }%%

Modern

---
config:
  layout: elk
---

Screenshot
image

@aztechead
Copy link
Contributor Author

@johanneswuerbach can you take a look and let me know your thoughts. It'd be really great to bring back support for the (superior) elk layout engine. 😄

@aztechead aztechead force-pushed the support_elk_layout_engine branch from 987d59c to dc07b5d Compare February 13, 2025 16:15
@aztechead
Copy link
Contributor Author

The GH Actions steps run locally, let me know what you think!

@johanneswuerbach johanneswuerbach merged commit 95a1299 into johanneswuerbach:main Feb 13, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants