Digital Sovereignty for everyone

Using the library from other plugins

LH Mermaid bundles Mermaid.js (assets/js/mermaid.min.js, version in Lh_Mermaid::BUNDLED_MERMAID_VERSION) so other plugins don’t each ship a copy. The library is registered but never enqueued globally; a plugin asks for it only when it knows a diagram is on the request. Guard calls with class_exists( 'Lh_Mermaid' ).

Method Use
Lh_Mermaid::enqueue( $in_footer = true ) Enqueue the library. Any element with the mermaid class is drawn on page load.
Lh_Mermaid::script_handle() The script handle. A page that never calls wp_footer() prints the library itself with wp_scripts()->do_items( array( Lh_Mermaid::script_handle() ) ) after enqueue().
Lh_Mermaid::script_url() URL of the bundled library.
Lh_Mermaid::block_name() The block’s name (lh-mermaid/diagram), for has_block() checks and allowed-block lists.

Current users: the Schema Diagram block in LH Schema Tools, and LH Presentations, which prints the library in its Reveal.js page and draws diagrams per slide with mermaid.run() after mermaid.initialize( { startOnLoad: false } ).

If you like this plugin please consider making a donation to further development

Install LHero.org

lhero.org

Open it straight from your home screen, full screen and quicker to load.

  1. Tap the Share button . If you cannot see it, tap ••• first.
  2. Scroll down and tap Add to Home Screen.
  3. Tap Add.
  1. Tap the browser menu â‹®.
  2. Tap Install app or Add to Home screen.
  1. In the menu bar, choose File, then Add to Dock.

Use your browser's menu to install this site or add it to your home screen.