Skip to content

Commit

Permalink
Merge pull request #1 from gitaroktato/master
Browse files Browse the repository at this point in the history
Fixed HTML example for embedding diagrams
  • Loading branch information
ludwick committed Jan 15, 2018
2 parents 00c187c + ab6b229 commit d39b4da
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.md
Expand Up @@ -20,14 +20,18 @@ I preferred not to use markdown in my slides. I found just having mermaid tagged
3. Create diagram in slide. Example:
```
<section class="diagram-slide">
<span class="diagram-data">
<span class="diagram-data" style="display:none;">
graph LR;
A(AAAA)==> B(B node);
B==> C(SEE SEE);
class A diag-a-styles;
class B diag-b-styles
class C diag-c-styles;
</span>
<!-- Diagram will be displayed in this DIV -->
<div class="diagram-display">
</div>
</section>
```

Expand All @@ -37,7 +41,7 @@ This plugin uses CSS classes to figure out what to render.

* "diagram-slide" is used to mark a slide that has a mermaid diagram. Note that you can only have one diagram per slide (it doesn't seem like the audience can really comprehend more than one per slide anyway). This class tagging is used with Reveal's 'slidechanged' event.
* "diagram-data" should tag a span or other element containing the mermaid graph declaration. Note that you probably want to mark that as 'display: none' in your CSS.
* "diagram-div" class should mark an empty div where you want the diagram to appear.
* "diagram-display" class should mark an empty div where you want the diagram to appear.

Note: It's possible diagram-data & diagram-div could be combined but I went thru several iterations of making this work reliably.

Expand Down

0 comments on commit d39b4da

Please sign in to comment.