jokester / reveal.js-mermaid-plugin

A mermaid plugin for reveal.js.

Home Page:https://zjffun.github.io/reveal.js-mermaid-plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jsdelivr npm version

A Mermaid plugin for reveal.js.

Usage

<link
  rel="stylesheet"
  href="https://cdn.jsdelivr.net/npm/reveal.js@4.3.1/dist/reset.css"
/>
<link
  rel="stylesheet"
  href="https://cdn.jsdelivr.net/npm/reveal.js@4.3.1/dist/reveal.css"
/>
<link
  rel="stylesheet"
  href="https://cdn.jsdelivr.net/npm/reveal.js@4.3.1/dist/theme/black.css"
  id="theme"
/>

<div class="reveal">
  <div class="slides">
    <section>
      <h3>Flowchart</h3>
      <div class="mermaid">
        <pre>
          %%{init: {'theme': 'dark', 'themeVariables': { 'darkMode': true }}}%%
          flowchart TD
            A[Start] --> B{Is it?};
            B -- Yes --> C[OK];
            C --> D[Rethink];
            D --> B;
            B -- No ----> E[End];
        </pre>
      </div>
    </section>
  </div>
</div>

<script src="https://cdn.jsdelivr.net/npm/reveal.js@4.3.1/dist/reveal.js"></script>
<script src="https://cdn.jsdelivr.net/npm/reveal.js-mermaid-plugin@2.2.0/plugin/mermaid/mermaid.js"></script>
<script>
  Reveal.initialize({
    controls: true,
    progress: true,
    center: true,
    hash: true,

    // mermaid initialize config
    mermaid: {
      // flowchart: {
      //   curve: 'linear',
      // },
    },

    plugins: [RevealMermaid],
  });
</script>

About

A mermaid plugin for reveal.js.

https://zjffun.github.io/reveal.js-mermaid-plugin

License:MIT License


Languages

Language:HTML 71.3%Language:JavaScript 28.7%