-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #133 from alvarmaciel/add-new-inicialization
Add new initialization
- Loading branch information
Showing
4 changed files
with
25 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# Hi from Markdown! | ||
|
||
```{mermaid} | ||
:align: center | ||
sequenceDiagram | ||
participant Alice | ||
participant Bob | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,12 +22,12 @@ def test_html_raw(index): | |
) | ||
assert '<script type="module">import mermaid from "https://cdn.jsdelivr.net/npm/[email protected]/dist/mermaid.esm.min.mjs";import elkLayouts from "https://cdn.jsdelivr.net/npm/@mermaid-js/[email protected]/dist/mermaid-layout-elk.esm.min.mjs";mermaid.registerLayoutLoaders(elkLayouts);mermaid.initialize({startOnLoad:false});</script>' in index | ||
assert ( | ||
"""<div class="mermaid"> | ||
"""<pre class="mermaid"> | ||
sequenceDiagram | ||
participant Alice | ||
participant Bob | ||
Alice->John: Hello John, how are you? | ||
</div>""" | ||
</pre>""" | ||
in index | ||
) | ||
|
||
|
@@ -40,13 +40,13 @@ def test_html_zoom_option(index, app): | |
assert "svg.call(zoom);" in zoom_page | ||
|
||
# the first diagram has no id | ||
assert '<div class="mermaid">\n sequenceDiagram' in zoom_page | ||
assert '<pre class="mermaid">\n sequenceDiagram' in zoom_page | ||
|
||
# the second has id and its loaded in the zooming code. | ||
div_id = re.findall( | ||
r'<div id="(id\-[a-fA-F0-9-]+)" class="mermaid">\n\s+flowchart TD', zoom_page | ||
pre_id = re.findall( | ||
r'<pre id="(id\-[a-fA-F0-9-]+)" class="mermaid">\n\s+flowchart TD', zoom_page | ||
) | ||
assert f'var svgs = d3.selectAll(".mermaid#{div_id[0]} svg")' in zoom_page | ||
assert f'var svgs = d3.selectAll(".mermaid#{pre_id[0]} svg")' in zoom_page | ||
|
||
|
||
@pytest.mark.sphinx("html", testroot="basic", confoverrides={"mermaid_d3_zoom": True}) | ||
|
@@ -127,11 +127,11 @@ def test_html_raw_from_markdown(index): | |
assert '<script type="module">import mermaid from "https://cdn.jsdelivr.net/npm/[email protected]/dist/mermaid.esm.min.mjs";import elkLayouts from "https://cdn.jsdelivr.net/npm/@mermaid-js/[email protected]/dist/mermaid-layout-elk.esm.min.mjs";mermaid.registerLayoutLoaders(elkLayouts);mermaid.initialize({startOnLoad:false});</script>' in index | ||
assert ( | ||
""" | ||
<div class="mermaid"> | ||
<pre align="center" class="mermaid align-center"> | ||
sequenceDiagram | ||
participant Alice | ||
participant Bob | ||
Alice->John: Hello John, how are you? | ||
</div>""" | ||
</pre>""" | ||
in index | ||
) |