Mermaid Shortcode Codeberg
Register the [mermaid] shortcode within WordPress for rendering diagrams written using Mermaid.
by Steve Grunwell · codeberg.org/stevegrunwell/mermaid-shortcode · website
★ 0stars
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://codeberg.org/stevegrunwell/mermaid-shortcode/archive/main.zipFrom the readme
Mermaid Shortcode
This plugin defines a [mermaid] shortcode within WordPress, allowing posts to dynamically define and render visualizations using Mermaid.
Installation
You may either clone this entire repo or simply grab the mermaid-shortcode.php file and drop it into wp-content/plugins/.
This plugin has not yet been submitted to the WordPress.org repository.
Usage
The way the shortcode gets used will depend on whether you're using the default Block (a.k.a. "Gutenberg") or Classic (TinyMCE) editor within WordPress; when using the former, you should use the "Shortcode" block to ensure that WordPress understands that the content is meant to be a shortcode.
Regardless, the end result will be the same:
When rendered, this should produce a Mermaid diagram like the following:
Configuration can also be handled via frontmatter:
This will result in a similar diagram, but with a different theme and font-family:
For a full list of supported diagram types and options, please review the Mermaid documentation.
License (MIT)
Copyright © 2026 Steve Grunwell
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation file