SolveBeam Diagrams with Mermaid

Description

SolveBeam · GitHub

SolveBeam Diagrams with Mermaid adds a block for creating diagrams and visualizations with
Mermaid. Enter Mermaid syntax in the block editor and
the diagram is rendered in the editor and on the front end.

Mermaid is rendered locally in the browser. This plugin does not require an
external account or service to render diagrams.

Source Code

This plugin ships compiled (minified) JavaScript and CSS in the blocks/
folder. The human-readable source code of everything in that folder is
publicly available:

What is in the blocks/ folder?

  • blocks/mermaid-diagram/ – compiled from blocks-src/mermaid-diagram/
    (index.js, view.js, editor.css, style.css and block.json),
    including the core of the Mermaid library.
  • blocks/*.js (numbered files such as blocks/8726.js) – chunks that webpack
    splits off from Mermaid and are loaded on demand for the different diagram
    types. These files contain only code from Mermaid and its npm dependencies,
    not from this plugin.

The Mermaid dependencies bundled in these chunks, with their public source code:

Building from source

The compiled files are built with @wordpress/scripts
(webpack). Node.js and npm are required.

  1. Clone the repository or use the plugin folder:
    git clone https://github.com/solvebeam/solvebeam-diagrams-with-mermaid-for-wordpress.git
  2. Install the dependencies (including Mermaid from npm): npm install
  3. Build the production files: npm run build

This compiles blocks-src/ into blocks/. Use npm run start to build in
development mode and watch for changes; development builds are not minified.

Third-Party Licenses

This plugin bundles Mermaid, which is
available under the MIT License. The Mermaid license is available at
https://github.com/mermaid-js/mermaid/blob/develop/LICENSE.
The dependencies of Mermaid listed above are available under their own open
source licenses, which can be found in their repositories.

Blocks

This plugin provides 1 block.

  • Mermaid Enter Mermaid code and render it as diagrams or visualizations.

Installation

  1. Upload the plugin folder to /wp-content/plugins/
  2. Activate the plugin through the “Plugins” menu in WordPress

FAQ

How do I add a diagram?

Add the Mermaid block in the WordPress block editor and enter your Mermaid code
in the Mermaid code field. The preview updates in the editor and the diagram is
rendered on the front end.

Which Mermaid syntax is supported?

The block uses the Mermaid syntax supported by the version bundled with the
plugin. See the Mermaid documentation for the
available diagram types and syntax.

Is my Mermaid code sent to an external service?

No. Mermaid is bundled with the plugin and diagrams are rendered locally in the
browser. The plugin does not send Mermaid code to an external rendering service.

Does this plugin require a Mermaid account?

No. The plugin does not require an account, API key, or subscription.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“SolveBeam Diagrams with Mermaid” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

1.0.0

  • Initial release.