Skip to content

Add shortcode mermaid plugin#463

Open
stephmnt wants to merge 2 commits into
getnikola:masterfrom
stephmnt:add-shortcode-mermaid
Open

Add shortcode mermaid plugin#463
stephmnt wants to merge 2 commits into
getnikola:masterfrom
stephmnt:add-shortcode-mermaid

Conversation

@stephmnt
Copy link
Copy Markdown

This PR adds a Mermaid shortcode plugin for Nikola.

The plugin allows embedding Mermaid.js diagrams directly inside Nikola content using shortcode blocks.

Features:

  • Mermaid diagram rendering
  • Automatic guarded Mermaid.js loader injection
  • Optional theme support through shortcode arguments
  • Optional Mermaid.js configuration through MERMAID_CONFIG
  • No Nikola theme modification required

Documentation, sample configuration and screenshot are included.

Tested with Nikola v8.

cdn_url = _to_script_json(settings["cdn_url"])
initialize = _to_script_json(settings["initialize"], sort_keys=True)

return (
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider providing a sample .js file that can be copied into a site to make the auto_load option usable.

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