diff --git a/docs/site.json b/docs/site.json index a9058d8761..89193d5e29 100644 --- a/docs/site.json +++ b/docs/site.json @@ -26,7 +26,8 @@ "codeBlockWrapButtons", "web3Form", "codeBlockCopyButtons", - "dataTable" + "dataTable", + "mermaid" ], "pluginsContext" : { "filterTags" : { diff --git a/docs/userGuide/plugins/mermaid.md b/docs/userGuide/plugins/mermaid.md new file mode 100644 index 0000000000..b9441572d3 --- /dev/null +++ b/docs/userGuide/plugins/mermaid.md @@ -0,0 +1,112 @@ +### Plugin: Mermaid + +
+ +This plugin allows you to utilize [Mermaid](https://mermaid-js.github.io/mermaid/) by automatically importing the library and initializing the rendering of the diagrams. + +> Mermaid is a JavaScript based diagramming and charting tool that renders Markdown-inspired text definitions to create and modify diagrams dynamically. + + + +All supported diagrams are available in [the Mermaid official documentation](https://mermaid-js.github.io/mermaid/). + + + +To enable this plugin, add `mermaid` to your site's plugins. + +```js {heading="site.json"} +{ + ... + "plugins": [ + "mermaid" + ] +} +``` + + + +By default, the plugin loads the Mermaid code from a CDN URL. However, you can optionally specify an alternative URL to load the Mermaid code from a different source. + +```js {heading="site.json"} +{ + ... + "plugins": [ + "mermaid" + ], + "pluginsContext": { + "mermaid": { + "address": "https://unpkg.com/mermaid@10/dist/mermaid.esm.min.mjs" // replace with URL of your choice + } + } +} +``` + + + +To create a Mermaid diagram, use the `` tag and provide the diagram definition within the tag. + +{{ icon_example }} Pie Chart: + + +html + + +pie title Pets adopted by volunteers + "Dogs" : 386 + "Cats" : 85 + "Rats" : 15 + + + + +{{ icon_example }} Flowchart: + + +html + + +flowchart TD + A[Start] --> B{Is it?} + B -->|Yes| C[OK] + C --> D[Rethink] + D --> B + B ---->|No| E[End] + + + + +{{ icon_example }} User Journey Diagram: + + +html + + +journey + title My working day + section Go to work + Make tea: 5: Me + Go upstairs: 3: Me + Do work: 1: Me, Cat + + + + +{{ icon_example }} Gitgraph Diagram: + + +html + + +gitGraph + commit + branch develop + checkout develop + commit + checkout main + merge develop + + + + +The plugin automatically converts the `` tags into appropriate `
` elements with the necessary classes and attributes for rendering the diagrams using the Mermaid library. +
diff --git a/docs/userGuide/syntax/diagrams.md b/docs/userGuide/syntax/diagrams.md index 92d2c026d9..efa96c9ed2 100644 --- a/docs/userGuide/syntax/diagrams.md +++ b/docs/userGuide/syntax/diagrams.md @@ -1,5 +1,6 @@ ## Diagrams +### PlantUML Diagrams You can use the [PlantUML](http://plantuml.com/) syntax to add diagrams. @@ -159,3 +160,7 @@ bob -> bob ++ : self call
+ +### Mermaid Diagrams + + diff --git a/docs/userGuide/usingPlugins.md b/docs/userGuide/usingPlugins.md index bbbc59bcf8..9f7cc9fdd9 100644 --- a/docs/userGuide/usingPlugins.md +++ b/docs/userGuide/usingPlugins.md @@ -65,6 +65,7 @@ MarkBind has a set of built-in plugins that can be used immediately without inst + ## Using External Plugins diff --git a/packages/cli/test/functional/test_site/expected/bugs/index.html b/packages/cli/test/functional/test_site/expected/bugs/index.html index 057cc6dfb4..dfefc5fd9d 100644 --- a/packages/cli/test/functional/test_site/expected/bugs/index.html +++ b/packages/cli/test/functional/test_site/expected/bugs/index.html @@ -279,5 +279,18 @@

Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/index.html b/packages/cli/test/functional/test_site/expected/index.html index 5104aef732..f04affec87 100644 --- a/packages/cli/test/functional/test_site/expected/index.html +++ b/packages/cli/test/functional/test_site/expected/index.html @@ -945,5 +945,18 @@

Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/siteData.json b/packages/cli/test/functional/test_site/expected/siteData.json index 2541fd2312..7a2ca9c0da 100644 --- a/packages/cli/test/functional/test_site/expected/siteData.json +++ b/packages/cli/test/functional/test_site/expected/siteData.json @@ -468,6 +468,12 @@ "h1-text": "\n\n\n h1 text\n \n" }, "headingKeywords": {} + }, + { + "src": "testMermaid.md", + "title": "Rendering of diagrams via mermaid-js", + "headings": {}, + "headingKeywords": {} } ] } diff --git a/packages/cli/test/functional/test_site/expected/sub_site/index.html b/packages/cli/test/functional/test_site/expected/sub_site/index.html index d16df81a54..621504b292 100644 --- a/packages/cli/test/functional/test_site/expected/sub_site/index.html +++ b/packages/cli/test/functional/test_site/expected/sub_site/index.html @@ -286,5 +286,18 @@

Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/sub_site/nested_sub_site/index.html b/packages/cli/test/functional/test_site/expected/sub_site/nested_sub_site/index.html index cea632ed1b..d066e55fda 100644 --- a/packages/cli/test/functional/test_site/expected/sub_site/nested_sub_site/index.html +++ b/packages/cli/test/functional/test_site/expected/sub_site/nested_sub_site/index.html @@ -277,5 +277,18 @@

Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/sub_site/nested_sub_site/testNunjucksPathResolving.html b/packages/cli/test/functional/test_site/expected/sub_site/nested_sub_site/testNunjucksPathResolving.html index 0476a7b136..90ab9f8712 100644 --- a/packages/cli/test/functional/test_site/expected/sub_site/nested_sub_site/testNunjucksPathResolving.html +++ b/packages/cli/test/functional/test_site/expected/sub_site/nested_sub_site/testNunjucksPathResolving.html @@ -283,5 +283,18 @@

Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/sub_site/testNunjucksPathResolving.html b/packages/cli/test/functional/test_site/expected/sub_site/testNunjucksPathResolving.html index 0476a7b136..90ab9f8712 100644 --- a/packages/cli/test/functional/test_site/expected/sub_site/testNunjucksPathResolving.html +++ b/packages/cli/test/functional/test_site/expected/sub_site/testNunjucksPathResolving.html @@ -283,5 +283,18 @@

Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testAltFrontMatterInvalidKeyValue.html b/packages/cli/test/functional/test_site/expected/testAltFrontMatterInvalidKeyValue.html index 2394a781ce..997d7ab4e5 100644 --- a/packages/cli/test/functional/test_site/expected/testAltFrontMatterInvalidKeyValue.html +++ b/packages/cli/test/functional/test_site/expected/testAltFrontMatterInvalidKeyValue.html @@ -277,5 +277,18 @@

Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testAltFrontMatterParsing.html b/packages/cli/test/functional/test_site/expected/testAltFrontMatterParsing.html index b0f96e8fad..e3b41f6151 100644 --- a/packages/cli/test/functional/test_site/expected/testAltFrontMatterParsing.html +++ b/packages/cli/test/functional/test_site/expected/testAltFrontMatterParsing.html @@ -276,5 +276,18 @@

Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testAnchorGeneration.html b/packages/cli/test/functional/test_site/expected/testAnchorGeneration.html index 9f86039578..9d8cd05bcb 100644 --- a/packages/cli/test/functional/test_site/expected/testAnchorGeneration.html +++ b/packages/cli/test/functional/test_site/expected/testAnchorGeneration.html @@ -345,5 +345,18 @@

Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testAnnotate.html b/packages/cli/test/functional/test_site/expected/testAnnotate.html index 94877f920c..9d1880942c 100644 --- a/packages/cli/test/functional/test_site/expected/testAnnotate.html +++ b/packages/cli/test/functional/test_site/expected/testAnnotate.html @@ -456,5 +456,18 @@

Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testAntiFOUCStyles.html b/packages/cli/test/functional/test_site/expected/testAntiFOUCStyles.html index f3f7a30ae1..4d8c6baa02 100644 --- a/packages/cli/test/functional/test_site/expected/testAntiFOUCStyles.html +++ b/packages/cli/test/functional/test_site/expected/testAntiFOUCStyles.html @@ -300,5 +300,18 @@

Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testBootstrapIconInPage.html b/packages/cli/test/functional/test_site/expected/testBootstrapIconInPage.html index b0e4ddb8c6..47573f4c07 100644 --- a/packages/cli/test/functional/test_site/expected/testBootstrapIconInPage.html +++ b/packages/cli/test/functional/test_site/expected/testBootstrapIconInPage.html @@ -115,5 +115,18 @@ }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testCenterText.html b/packages/cli/test/functional/test_site/expected/testCenterText.html index 8c6070cd64..dd652b3d42 100644 --- a/packages/cli/test/functional/test_site/expected/testCenterText.html +++ b/packages/cli/test/functional/test_site/expected/testCenterText.html @@ -276,5 +276,18 @@

Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testCodeBlocks.html b/packages/cli/test/functional/test_site/expected/testCodeBlocks.html index 24989e8bd9..10b26bc6a8 100644 --- a/packages/cli/test/functional/test_site/expected/testCodeBlocks.html +++ b/packages/cli/test/functional/test_site/expected/testCodeBlocks.html @@ -499,5 +499,18 @@

Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testDates.html b/packages/cli/test/functional/test_site/expected/testDates.html index 71b850bf53..930a0ce412 100644 --- a/packages/cli/test/functional/test_site/expected/testDates.html +++ b/packages/cli/test/functional/test_site/expected/testDates.html @@ -282,5 +282,18 @@

Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testEmptyAltFrontMatter.html b/packages/cli/test/functional/test_site/expected/testEmptyAltFrontMatter.html index 32c839fbf9..1212d4b90f 100644 --- a/packages/cli/test/functional/test_site/expected/testEmptyAltFrontMatter.html +++ b/packages/cli/test/functional/test_site/expected/testEmptyAltFrontMatter.html @@ -283,5 +283,18 @@

Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testEmptyFrontmatter.html b/packages/cli/test/functional/test_site/expected/testEmptyFrontmatter.html index fd8c60d424..2899040183 100644 --- a/packages/cli/test/functional/test_site/expected/testEmptyFrontmatter.html +++ b/packages/cli/test/functional/test_site/expected/testEmptyFrontmatter.html @@ -283,5 +283,18 @@

Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testExternalScripts.html b/packages/cli/test/functional/test_site/expected/testExternalScripts.html index 987a8a8675..1fa6f4a5dc 100644 --- a/packages/cli/test/functional/test_site/expected/testExternalScripts.html +++ b/packages/cli/test/functional/test_site/expected/testExternalScripts.html @@ -287,5 +287,18 @@

Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testFontAwesomeInPage.html b/packages/cli/test/functional/test_site/expected/testFontAwesomeInPage.html index 659abc4857..06f46f49b2 100644 --- a/packages/cli/test/functional/test_site/expected/testFontAwesomeInPage.html +++ b/packages/cli/test/functional/test_site/expected/testFontAwesomeInPage.html @@ -120,5 +120,18 @@ }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testGlyphiconInPage.html b/packages/cli/test/functional/test_site/expected/testGlyphiconInPage.html index b7dfed599f..6a5fcdba1f 100644 --- a/packages/cli/test/functional/test_site/expected/testGlyphiconInPage.html +++ b/packages/cli/test/functional/test_site/expected/testGlyphiconInPage.html @@ -117,5 +117,18 @@ }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testHr.html b/packages/cli/test/functional/test_site/expected/testHr.html index f477a99c48..7066dfbc48 100644 --- a/packages/cli/test/functional/test_site/expected/testHr.html +++ b/packages/cli/test/functional/test_site/expected/testHr.html @@ -285,5 +285,18 @@

Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testIconsInSiteLayout.html b/packages/cli/test/functional/test_site/expected/testIconsInSiteLayout.html index 46c2949e5f..280d9158fd 100644 --- a/packages/cli/test/functional/test_site/expected/testIconsInSiteLayout.html +++ b/packages/cli/test/functional/test_site/expected/testIconsInSiteLayout.html @@ -119,5 +119,18 @@ }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testImages.html b/packages/cli/test/functional/test_site/expected/testImages.html index 82030358b8..3e5b7ccc6f 100644 --- a/packages/cli/test/functional/test_site/expected/testImages.html +++ b/packages/cli/test/functional/test_site/expected/testImages.html @@ -283,5 +283,18 @@

Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testIncludeBoilerplate.html b/packages/cli/test/functional/test_site/expected/testIncludeBoilerplate.html index 6a03165efa..17dbfa78bd 100644 --- a/packages/cli/test/functional/test_site/expected/testIncludeBoilerplate.html +++ b/packages/cli/test/functional/test_site/expected/testIncludeBoilerplate.html @@ -367,5 +367,18 @@

Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testIncludeMultipleModals.html b/packages/cli/test/functional/test_site/expected/testIncludeMultipleModals.html index 01c2f798d8..13999a7bc7 100644 --- a/packages/cli/test/functional/test_site/expected/testIncludeMultipleModals.html +++ b/packages/cli/test/functional/test_site/expected/testIncludeMultipleModals.html @@ -282,5 +282,18 @@

Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testIncludePluginsRendered.html b/packages/cli/test/functional/test_site/expected/testIncludePluginsRendered.html index e0ab4eb839..c9800e4fa1 100644 --- a/packages/cli/test/functional/test_site/expected/testIncludePluginsRendered.html +++ b/packages/cli/test/functional/test_site/expected/testIncludePluginsRendered.html @@ -277,5 +277,18 @@

Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testLayouts.html b/packages/cli/test/functional/test_site/expected/testLayouts.html index cf8feb8d68..364932648a 100644 --- a/packages/cli/test/functional/test_site/expected/testLayouts.html +++ b/packages/cli/test/functional/test_site/expected/testLayouts.html @@ -283,5 +283,18 @@

Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testLayoutsOverride.html b/packages/cli/test/functional/test_site/expected/testLayoutsOverride.html index 00545cce33..55459e2d8d 100644 --- a/packages/cli/test/functional/test_site/expected/testLayoutsOverride.html +++ b/packages/cli/test/functional/test_site/expected/testLayoutsOverride.html @@ -283,5 +283,18 @@

Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testLayoutsOverrideWithAltFrontmatter.html b/packages/cli/test/functional/test_site/expected/testLayoutsOverrideWithAltFrontmatter.html index 70dcfca773..e4caaea7a9 100644 --- a/packages/cli/test/functional/test_site/expected/testLayoutsOverrideWithAltFrontmatter.html +++ b/packages/cli/test/functional/test_site/expected/testLayoutsOverrideWithAltFrontmatter.html @@ -283,5 +283,18 @@

Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testLayoutsWithAltFrontMatter.html b/packages/cli/test/functional/test_site/expected/testLayoutsWithAltFrontMatter.html index 578fc81c8e..4344244909 100644 --- a/packages/cli/test/functional/test_site/expected/testLayoutsWithAltFrontMatter.html +++ b/packages/cli/test/functional/test_site/expected/testLayoutsWithAltFrontMatter.html @@ -283,5 +283,18 @@

Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testLinks.html b/packages/cli/test/functional/test_site/expected/testLinks.html index 34576fda88..6b6db68b49 100644 --- a/packages/cli/test/functional/test_site/expected/testLinks.html +++ b/packages/cli/test/functional/test_site/expected/testLinks.html @@ -286,5 +286,18 @@

Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testList.html b/packages/cli/test/functional/test_site/expected/testList.html index 0e56efce94..a00c88bd0a 100644 --- a/packages/cli/test/functional/test_site/expected/testList.html +++ b/packages/cli/test/functional/test_site/expected/testList.html @@ -1214,5 +1214,18 @@

Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testMaterialIconsInPage.html b/packages/cli/test/functional/test_site/expected/testMaterialIconsInPage.html index 9c2dc6b8a5..486399e937 100644 --- a/packages/cli/test/functional/test_site/expected/testMaterialIconsInPage.html +++ b/packages/cli/test/functional/test_site/expected/testMaterialIconsInPage.html @@ -115,5 +115,18 @@ }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testMath.html b/packages/cli/test/functional/test_site/expected/testMath.html index 19e743fa01..115d6b3477 100644 --- a/packages/cli/test/functional/test_site/expected/testMath.html +++ b/packages/cli/test/functional/test_site/expected/testMath.html @@ -542,5 +542,18 @@

Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testMermaid.html b/packages/cli/test/functional/test_site/expected/testMermaid.html new file mode 100644 index 0000000000..344eed1ddf --- /dev/null +++ b/packages/cli/test/functional/test_site/expected/testMermaid.html @@ -0,0 +1,369 @@ + + + + + + + + + + + + + Rendering of diagrams via mermaid-js + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + +
  • Open Bugs
  • +
    +
    +
    + Test Jumbotron
    +
    +
    +
    +

    Relative Link Test This is a relative Intra-Site link in a layout (see link)

    +
    +
    + + + + +
    + +

    Mermaid Test

    +
    + %%{init: { "theme": "neutral" } }%% + + graph TD; + A-->B; + A-->C; + B-->D; + C-->D; +
    +
    + graph TD; + A-->B; + A-->C; + B-->D; + C-->D; +
    +
    + sequenceDiagram + participant Alice + participant Bob + Alice->>John: Hello John, how are you? + loop Healthcheck + John->>John: Fight against hypochondria + end + Note right of John: Rational thoughts
    prevail! + John-->>Alice: Great! + John->>Bob: How about you? + Bob-->>John: Jolly good! +
    +
    + gantt + dateFormat YYYY-MM-DD + title Adding GANTT diagram to mermaid + section A section + Completed task :done, des1, 2014-01-06,2014-01-08 + Active task :active, des2, 2014-01-09, 3d + Future task : des3, after des2, 5d + Future task2 : des4, after des3, 5d + + section Critical tasks + Completed task in the critical line :crit, done, 2014-01-06,24h + Implement parser and jison :crit, done, after des1, 2d + Create tests for parser :crit, active, 3d + Future task in critical line :crit, 5d + Create tests for renderer :2d + Add to mermaid :1d + + section Documentation + Describe gantt syntax :active, a1, after des1, 3d + Add gantt diagram to demo page :after a1 , 20h + Add another diagram to demo page :doc1, after a1 , 48h + + section Last section + Describe gantt syntax :after doc1, 3d + Add gantt diagram to demo page : 20h + Add another diagram to demo page : 48h +
    + +
    + pie title Pets adopted by volunteers + "Dogs" : 386 + "Cats" : 85 + "Rats" : 15 +
    +
    +
    +
    + graph TD; + A-->B; + A-->C; + B-->D; + C-->D; +
    +
    + +
    + + + + +
    +
    +
    +

    Heading in footer should not be indexed

    +
    + This is a dynamic height footer that supports markdown 😄! +
    +
    +
    +
    + + + + + + + + + + + + + + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testMermaid.page-vue-render.js b/packages/cli/test/functional/test_site/expected/testMermaid.page-vue-render.js new file mode 100644 index 0000000000..b8790fbee2 --- /dev/null +++ b/packages/cli/test/functional/test_site/expected/testMermaid.page-vue-render.js @@ -0,0 +1,19 @@ + + var pageVueRenderFn = function anonymous( +) { +with(this){return _c('div',{attrs:{"id":"app"}},[_c('div',[_c('header',[_c('navbar',{attrs:{"type":"dark","default-highlight-on":"sibling-or-child"},scopedSlots:_u([{key:"brand",fn:function(){return [_c('a',{staticClass:"navbar-brand",attrs:{"href":"/","title":"Home"}},[_v("MarkBind Test Site")])]},proxy:true}])},[_v(" "),_c('li',[_c('a',{staticClass:"nav-link",attrs:{"href":"/test_site/bugs/index.html"}},[_v("Open Bugs")])])]),_v(" "),_m(0)],1),_v(" "),_m(1)]),_v(" "),_c('div',{attrs:{"id":"flex-body"}},[_c('overlay-source',{attrs:{"id":"site-nav","tag-name":"nav","to":"site-nav"}},[_c('div',{staticClass:"site-nav-top"},[_c('div',{staticClass:"fw-bold mb-2",staticStyle:{"font-size":"1.25rem"}},[_c('div',[_c('h2',{attrs:{"id":"default-layout"}},[_v("Default Layout"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#default-layout","onclick":"event.stopPropagation()"}})])])])]),_v(" "),_c('div',{staticClass:"nav-component slim-scroll"},[_c('div',[_c('site-nav',[_c('overlay-source',{staticClass:"site-nav-list site-nav-list-root",attrs:{"tag-name":"ul","to":"mb-site-nav"}},[_c('li',[_c('div',{staticClass:"site-nav-default-list-item site-nav-list-item-0",attrs:{"onclick":"handleSiteNavClick(this)"}},[_c('a',{attrs:{"href":"/test_site/index.html"}},[_v("Home 🏠")])])]),_v(" "),_c('li',[_c('div',{staticClass:"site-nav-default-list-item site-nav-list-item-0",attrs:{"onclick":"handleSiteNavClick(this)"}},[_c('a',{attrs:{"href":"/test_site/bugs/index.html"}},[_v("Open Bugs 🐛")])])]),_v(" "),_c('li',{staticClass:"site-nav-custom-list-item site-nav-list-item-0"},[_c('h3',{attrs:{"id":"testing-site-nav"}},[_v("Testing Site-Nav"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#testing-site-nav","onclick":"event.stopPropagation()"}})])]),_v(" "),_c('li',[_c('div',{staticClass:"site-nav-default-list-item site-nav-list-item-0",attrs:{"onclick":"handleSiteNavClick(this)"}},[_c('strong',[_v("Dropdown ")]),_v(" "),_c('span',{staticClass:"glyphicon glyphicon-search",attrs:{"aria-hidden":"true"}}),_v(" title ✏️ "),_v(" "),_c('div',{staticClass:"site-nav-dropdown-btn-container"},[_c('i',{staticClass:"site-nav-dropdown-btn-icon site-nav-rotate-icon",attrs:{"onclick":"handleSiteNavClick(this.parentNode.parentNode, false); event.stopPropagation();"}},[_c('span',{staticClass:"glyphicon glyphicon-menu-down",attrs:{"aria-hidden":"true"}})])])]),_c('ul',{staticClass:"site-nav-dropdown-container site-nav-dropdown-container-open site-nav-list"},[_c('li',[_c('div',{staticClass:"site-nav-default-list-item site-nav-list-item-1",attrs:{"onclick":"handleSiteNavClick(this)"}},[_c('a',{attrs:{"href":"https://www.google.com/"}},[_v("Dropdown link one")])])]),_v(" "),_c('li',[_c('div',{staticClass:"site-nav-default-list-item site-nav-list-item-1",attrs:{"onclick":"handleSiteNavClick(this)"}},[_c('a',{attrs:{"href":"https://www.google.com/"}},[_v("Html within site-nav "),_c('span',{staticStyle:{"color":"red"}},[_v("should")]),_v(" be displayed properly")])])]),_v(" "),_c('li',[_c('div',{staticClass:"site-nav-default-list-item site-nav-list-item-1",attrs:{"onclick":"handleSiteNavClick(this)"}},[_v("Nested Dropdown title 📐\n\n"),_c('div',{staticClass:"site-nav-dropdown-btn-container"},[_c('i',{staticClass:"site-nav-dropdown-btn-icon",attrs:{"onclick":"handleSiteNavClick(this.parentNode.parentNode, false); event.stopPropagation();"}},[_c('span',{staticClass:"glyphicon glyphicon-menu-down",attrs:{"aria-hidden":"true"}})])])]),_c('ul',{staticClass:"site-nav-dropdown-container site-nav-list"},[_c('li',[_c('div',{staticClass:"site-nav-default-list-item site-nav-list-item-2",attrs:{"onclick":"handleSiteNavClick(this)"}},[_c('a',{attrs:{"href":"https://www.google.com/"}},[_c('strong',[_v("Nested")]),_v(" Dropdown link one")])])]),_v(" "),_c('li',[_c('div',{staticClass:"site-nav-default-list-item site-nav-list-item-2",attrs:{"onclick":"handleSiteNavClick(this)"}},[_c('a',{attrs:{"href":"https://www.google.com/"}},[_c('strong',[_v("Nested")]),_v(" Dropdown link two")])])])])]),_v(" "),_c('li',[_c('div',{staticClass:"site-nav-default-list-item site-nav-list-item-1",attrs:{"onclick":"handleSiteNavClick(this)"}},[_c('a',{attrs:{"href":"https://www.google.com/"}},[_v("Dropdown link two")])])])])]),_v(" "),_c('li',[_c('div',{staticClass:"site-nav-default-list-item site-nav-list-item-0",attrs:{"onclick":"handleSiteNavClick(this)"}},[_c('a',{attrs:{"href":"https://www.google.com/"}},[_c('mark',[_v("Third Link")]),_v(" 📋")])])]),_v(" "),_c('li',[_c('div',{staticClass:"site-nav-default-list-item site-nav-list-item-0",attrs:{"onclick":"handleSiteNavClick(this)"}},[_v("Filler text "),_c('a',{attrs:{"href":"https://www.youtube.com/"}},[_c('span',{staticClass:"glyphicon glyphicon-facetime-video",attrs:{"aria-hidden":"true"}}),_v(" Youtube 📺")]),_v(" filler text"),_v(" "),_c('div',{staticClass:"site-nav-dropdown-btn-container"},[_c('i',{staticClass:"site-nav-dropdown-btn-icon",attrs:{"onclick":"handleSiteNavClick(this.parentNode.parentNode, false); event.stopPropagation();"}},[_c('span',{staticClass:"glyphicon glyphicon-menu-down",attrs:{"aria-hidden":"true"}})])])]),_c('ul',{staticClass:"site-nav-dropdown-container site-nav-list"},[_c('li',[_c('div',{staticClass:"site-nav-default-list-item site-nav-list-item-1",attrs:{"onclick":"handleSiteNavClick(this)"}},[_c('a',{attrs:{"href":"https://www.youtube.com/watch?v=dQw4w9WgXcQ"}},[_v("The answer to everything in the universe")])])]),_v(" "),_c('li',[_c('div',{staticClass:"site-nav-default-list-item site-nav-list-item-1",attrs:{"onclick":"handleSiteNavClick(this)"}},[_c('mark',[_v("Dropdown title")]),_v(" "),_c('span',{staticClass:"glyphicon glyphicon-comment",attrs:{"aria-hidden":"true"}}),_v(" ✏️ "),_v(" "),_c('div',{staticClass:"site-nav-dropdown-btn-container"},[_c('i',{staticClass:"site-nav-dropdown-btn-icon site-nav-rotate-icon",attrs:{"onclick":"handleSiteNavClick(this.parentNode.parentNode, false); event.stopPropagation();"}},[_c('span',{staticClass:"glyphicon glyphicon-menu-down",attrs:{"aria-hidden":"true"}})])])]),_c('ul',{staticClass:"site-nav-dropdown-container site-nav-dropdown-container-open site-nav-list"},[_c('li',[_c('div',{staticClass:"site-nav-default-list-item site-nav-list-item-2",attrs:{"onclick":"handleSiteNavClick(this)"}},[_c('a',{attrs:{"href":"https://www.google.com/"}},[_c('strong',[_v("Nested")]),_v(" Dropdown link one")])])])])])])]),_v(" "),_c('li',[_c('div',{staticClass:"site-nav-default-list-item site-nav-list-item-0",attrs:{"onclick":"handleSiteNavClick(this)"}},[_v("Really Long Dropdown Title Really Long Dropdown Title Really Long Dropdown Title Really Long Dropdown\n\n"),_c('div',{staticClass:"site-nav-dropdown-btn-container"},[_c('i',{staticClass:"site-nav-dropdown-btn-icon",attrs:{"onclick":"handleSiteNavClick(this.parentNode.parentNode, false); event.stopPropagation();"}},[_c('span',{staticClass:"glyphicon glyphicon-menu-down",attrs:{"aria-hidden":"true"}})])])]),_c('ul',{staticClass:"site-nav-dropdown-container site-nav-list"},[_c('li',{staticClass:"site-nav-custom-list-item site-nav-list-item-1"},[_v("Really Really Long Text Really Really Long Text Really Really Long Text Really Really Long Text Really Really Long Text Really Really Long Text Really Really Long Text Really Really Long Text Really Really Long Text Really Really Long Text Really Really Long Text Really Really Long Text Really Really Long Text Really Really Long Text Really Really Long Text Really Really Long Text Really Really Long Text Really Really Long Text Really Really Long Text Really Really Long Text Really Really Long Text Really Really Long Text Really Really Long Text Really Really Long Text Really Really Long Text Really Really Long Text Really Really Long Text Really Really Long Text Really Really Long Text Really Really Long Text Really Really Long Text")]),_v(" "),_c('li',[_c('div',{staticClass:"site-nav-default-list-item site-nav-list-item-1",attrs:{"onclick":"handleSiteNavClick(this)"}},[_v("Nested Dropdown Title\n\n"),_c('div',{staticClass:"site-nav-dropdown-btn-container"},[_c('i',{staticClass:"site-nav-dropdown-btn-icon",attrs:{"onclick":"handleSiteNavClick(this.parentNode.parentNode, false); event.stopPropagation();"}},[_c('span',{staticClass:"glyphicon glyphicon-menu-down",attrs:{"aria-hidden":"true"}})])])]),_c('ul',{staticClass:"site-nav-dropdown-container site-nav-list"},[_c('li',{staticClass:"site-nav-custom-list-item site-nav-list-item-2"},[_v("Hello Doge Hello Doge 🐶")]),_v(" "),_c('li',[_c('div',{staticClass:"site-nav-default-list-item site-nav-list-item-2",attrs:{"onclick":"handleSiteNavClick(this)"}},[_c('a',{attrs:{"href":"/test_site/index.html"}},[_c('strong',[_v("NESTED LINK")]),_v(" Home 🏠")])])]),_v(" "),_c('li',{staticClass:"site-nav-custom-list-item site-nav-list-item-2"},[_v("Text cut off from height limit Text cut off from height limit Text cut off from height limit Text cut off from height limit Text cut off from height limit Text cut off from height limit Text cut off from height limit Text cut off from height limit Text cut off from height limit Text cut off from height limit Text cut off from height limit Text cut off from height limit Text cut off from height limit Text cut off from height limit Text cut off from height limit Text cut off from height limit Text cut off from height limit Text cut off from height limit Text cut off from height limit Text cut off from height limit Text cut off from height limit")])])])])]),_v(" "),_c('li',[_c('div',{staticClass:"site-nav-default-list-item site-nav-list-item-0",attrs:{"onclick":"handleSiteNavClick(this)"}},[_v("Test line break in navigation layout\n\n"),_c('div',{staticClass:"site-nav-dropdown-btn-container"},[_c('i',{staticClass:"site-nav-dropdown-btn-icon",attrs:{"onclick":"handleSiteNavClick(this.parentNode.parentNode, false); event.stopPropagation();"}},[_c('span',{staticClass:"glyphicon glyphicon-menu-down",attrs:{"aria-hidden":"true"}})])])]),_c('ul',{staticClass:"site-nav-dropdown-container site-nav-list"},[_c('li',{staticClass:"site-nav-custom-list-item site-nav-list-item-1"},[_v("Nested line break text ✂️")]),_v(" "),_c('li',[_c('div',{staticClass:"site-nav-default-list-item site-nav-list-item-1",attrs:{"onclick":"handleSiteNavClick(this)"}},[_c('a',{attrs:{"href":"/test_site/index.html"}},[_v("Nested line break href")]),_v(" "),_c('div',{staticClass:"site-nav-dropdown-btn-container"},[_c('i',{staticClass:"site-nav-dropdown-btn-icon",attrs:{"onclick":"handleSiteNavClick(this.parentNode.parentNode, false); event.stopPropagation();"}},[_c('span',{staticClass:"glyphicon glyphicon-menu-down",attrs:{"aria-hidden":"true"}})])])]),_c('ul',{staticClass:"site-nav-dropdown-container site-nav-list"},[_c('li',{staticClass:"site-nav-custom-list-item site-nav-list-item-2"},[_v("Nested Nested line break text ✂️")])])]),_v(" "),_c('li',[_c('div',{staticClass:"site-nav-default-list-item site-nav-list-item-1",attrs:{"onclick":"handleSiteNavClick(this)"}},[_v("Nested line break dropdown menu\n\n"),_c('div',{staticClass:"site-nav-dropdown-btn-container"},[_c('i',{staticClass:"site-nav-dropdown-btn-icon",attrs:{"onclick":"handleSiteNavClick(this.parentNode.parentNode, false); event.stopPropagation();"}},[_c('span',{staticClass:"glyphicon glyphicon-menu-down",attrs:{"aria-hidden":"true"}})])])]),_c('ul',{staticClass:"site-nav-dropdown-container site-nav-list"},[_c('li',{staticClass:"site-nav-custom-list-item site-nav-list-item-2"},[_v("Line break item 2 📘")])])])])])])],1)],1)])]),_v(" "),_c('div',{attrs:{"id":"content-wrapper"}},[_c('breadcrumb'),_v(" "),_m(2),_v(" "),_c('div',{directives:[{name:"mermaid",rawName:"v-mermaid"}],staticClass:"mermaid"},[_v("\n%%{init: { \"theme\": \"neutral\" } }%%\n\ngraph TD;\nA-->B;\nA-->C;\nB-->D;\nC-->D;\n")]),_v(" "),_c('div',{directives:[{name:"mermaid",rawName:"v-mermaid"}],staticClass:"mermaid"},[_v("\ngraph TD;\n A-->B;\n A-->C;\n B-->D;\n C-->D;\n")]),_v(" "),_c('div',{directives:[{name:"mermaid",rawName:"v-mermaid"}],staticClass:"mermaid"},[_v("\nsequenceDiagram\n participant Alice\n participant Bob\n Alice->>John: Hello John, how are you?\n loop Healthcheck\n John->>John: Fight against hypochondria\n end\n Note right of John: Rational thoughts "),_c('br'),_v("prevail!\n John-->>Alice: Great!\n John->>Bob: How about you?\n Bob-->>John: Jolly good!\n")]),_v(" "),_c('div',{directives:[{name:"mermaid",rawName:"v-mermaid"}],staticClass:"mermaid"},[_v("\ngantt\ndateFormat YYYY-MM-DD\ntitle Adding GANTT diagram to mermaid\nsection A section\nCompleted task :done, des1, 2014-01-06,2014-01-08\nActive task :active, des2, 2014-01-09, 3d\nFuture task : des3, after des2, 5d\nFuture task2 : des4, after des3, 5d\n\nsection Critical tasks\nCompleted task in the critical line :crit, done, 2014-01-06,24h\nImplement parser and jison :crit, done, after des1, 2d\nCreate tests for parser :crit, active, 3d\nFuture task in critical line :crit, 5d\nCreate tests for renderer :2d\nAdd to mermaid :1d\n\nsection Documentation\nDescribe gantt syntax :active, a1, after des1, 3d\nAdd gantt diagram to demo page :after a1 , 20h\nAdd another diagram to demo page :doc1, after a1 , 48h\n\nsection Last section\nDescribe gantt syntax :after doc1, 3d\nAdd gantt diagram to demo page : 20h\nAdd another diagram to demo page : 48h\n")]),_v(" "),_c('panel',{attrs:{"type":"minimal"},scopedSlots:_u([{key:"header",fn:function(){return [_c('p',[_v("This is to test Mermaid diagrams work in panel.")])]},proxy:true}])},[_v(" "),_c('div',{directives:[{name:"mermaid",rawName:"v-mermaid"}],staticClass:"mermaid"},[_v("\npie title Pets adopted by volunteers\n \"Dogs\" : 386\n \"Cats\" : 85\n \"Rats\" : 15\n")])]),_v(" "),_c('div',[_c('div',{directives:[{name:"mermaid",rawName:"v-mermaid"}],staticClass:"mermaid"},[_v("\ngraph TD;\n A-->B;\n A-->C;\n B-->D;\n C-->D;\n")])]),_v(" "),_c('panel',{attrs:{"type":"minimal","src":"/test_site/testMermaidInclude._include_.html"},scopedSlots:_u([{key:"header",fn:function(){return [_c('p',[_v("This is to test Mermaid diagrams works when included inside a panel.")])]},proxy:true}])})],1),_v(" "),_c('overlay-source',{attrs:{"id":"page-nav","tag-name":"nav","to":"page-nav"}},[_c('div',{staticClass:"nav-component slim-scroll"})]),_v(" "),_c('scroll-top-button')],1),_v(" "),_m(3)])} +}; + var pageVueStaticRenderFns = [function anonymous( +) { +with(this){return _c('div',{staticClass:"bg-info display-4 text-center text-white"},[_c('br'),_v("\n Test Jumbotron"),_c('br'),_v(" "),_c('br')])} +},function anonymous( +) { +with(this){return _c('p',[_c('strong',[_v("Relative Link Test")]),_v(" This is a relative Intra-Site link in a layout (see "),_c('a',{attrs:{"href":"/test_site/index.html#heading-with-hidden-keyword"}},[_v("link")]),_v(")")])} +},function anonymous( +) { +with(this){return _c('p',[_c('strong',[_v("Mermaid Test")])])} +},function anonymous( +) { +with(this){return _c('div',[_c('footer',[_c('h1',{attrs:{"id":"heading-in-footer-should-not-be-indexed"}},[_v("Heading in footer should not be indexed"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#heading-in-footer-should-not-be-indexed","onclick":"event.stopPropagation()"}})]),_v(" "),_c('div',{staticClass:"text-center"},[_v("\n This is a dynamic height footer that supports markdown "),_c('span',[_v("😄")]),_v("!\n ")])])])} +}]; + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testMermaidInclude._include_.html b/packages/cli/test/functional/test_site/expected/testMermaidInclude._include_.html new file mode 100644 index 0000000000..b5538e9215 --- /dev/null +++ b/packages/cli/test/functional/test_site/expected/testMermaidInclude._include_.html @@ -0,0 +1,7 @@ +
    + graph TD; + A-->B; + A-->C; + B-->D; + C-->D; +
    \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testModals.html b/packages/cli/test/functional/test_site/expected/testModals.html index 2af69c5ea4..c92838b5ae 100644 --- a/packages/cli/test/functional/test_site/expected/testModals.html +++ b/packages/cli/test/functional/test_site/expected/testModals.html @@ -418,5 +418,18 @@

    Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testNunjucksPathResolving.html b/packages/cli/test/functional/test_site/expected/testNunjucksPathResolving.html index 0476a7b136..90ab9f8712 100644 --- a/packages/cli/test/functional/test_site/expected/testNunjucksPathResolving.html +++ b/packages/cli/test/functional/test_site/expected/testNunjucksPathResolving.html @@ -283,5 +283,18 @@

    Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testOcticonInPage.html b/packages/cli/test/functional/test_site/expected/testOcticonInPage.html index 00b83de4db..74696ec3d9 100644 --- a/packages/cli/test/functional/test_site/expected/testOcticonInPage.html +++ b/packages/cli/test/functional/test_site/expected/testOcticonInPage.html @@ -128,5 +128,18 @@ }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testPageNav.html b/packages/cli/test/functional/test_site/expected/testPageNav.html index cdb1f4fd30..46b00caf2e 100644 --- a/packages/cli/test/functional/test_site/expected/testPageNav.html +++ b/packages/cli/test/functional/test_site/expected/testPageNav.html @@ -291,5 +291,18 @@

    Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testPageNavPrint.html b/packages/cli/test/functional/test_site/expected/testPageNavPrint.html index 5142d16ad5..c634ef1daf 100644 --- a/packages/cli/test/functional/test_site/expected/testPageNavPrint.html +++ b/packages/cli/test/functional/test_site/expected/testPageNavPrint.html @@ -289,5 +289,18 @@

    Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testPageNavTarget.html b/packages/cli/test/functional/test_site/expected/testPageNavTarget.html index bb24c7a4cb..031c067c3d 100644 --- a/packages/cli/test/functional/test_site/expected/testPageNavTarget.html +++ b/packages/cli/test/functional/test_site/expected/testPageNavTarget.html @@ -279,5 +279,18 @@

    Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testPageNavWithOnlyTitle.html b/packages/cli/test/functional/test_site/expected/testPageNavWithOnlyTitle.html index 2745f67e77..7770c8f5f9 100644 --- a/packages/cli/test/functional/test_site/expected/testPageNavWithOnlyTitle.html +++ b/packages/cli/test/functional/test_site/expected/testPageNavWithOnlyTitle.html @@ -279,5 +279,18 @@

    Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testPageNavWithoutTitleAndNavHeadings.html b/packages/cli/test/functional/test_site/expected/testPageNavWithoutTitleAndNavHeadings.html index 83d1cc25c0..e410bff748 100644 --- a/packages/cli/test/functional/test_site/expected/testPageNavWithoutTitleAndNavHeadings.html +++ b/packages/cli/test/functional/test_site/expected/testPageNavWithoutTitleAndNavHeadings.html @@ -275,5 +275,18 @@

    Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testPanelMarkdownParsing.html b/packages/cli/test/functional/test_site/expected/testPanelMarkdownParsing.html index e06287b5e9..5cd8a99f29 100644 --- a/packages/cli/test/functional/test_site/expected/testPanelMarkdownParsing.html +++ b/packages/cli/test/functional/test_site/expected/testPanelMarkdownParsing.html @@ -333,5 +333,18 @@

    Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testPanels.html b/packages/cli/test/functional/test_site/expected/testPanels.html index 225f7a9757..0386acb763 100644 --- a/packages/cli/test/functional/test_site/expected/testPanels.html +++ b/packages/cli/test/functional/test_site/expected/testPanels.html @@ -291,5 +291,18 @@

    Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testPanelsClosingTransition.html b/packages/cli/test/functional/test_site/expected/testPanelsClosingTransition.html index 1cea9e5c8a..c9d5b82cda 100644 --- a/packages/cli/test/functional/test_site/expected/testPanelsClosingTransition.html +++ b/packages/cli/test/functional/test_site/expected/testPanelsClosingTransition.html @@ -319,5 +319,18 @@

    Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testPlantUML.html b/packages/cli/test/functional/test_site/expected/testPlantUML.html index e048a41e44..540a20e8cd 100644 --- a/packages/cli/test/functional/test_site/expected/testPlantUML.html +++ b/packages/cli/test/functional/test_site/expected/testPlantUML.html @@ -281,5 +281,18 @@

    Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testPopoverTrigger.html b/packages/cli/test/functional/test_site/expected/testPopoverTrigger.html index 265d901104..3f563286e9 100644 --- a/packages/cli/test/functional/test_site/expected/testPopoverTrigger.html +++ b/packages/cli/test/functional/test_site/expected/testPopoverTrigger.html @@ -281,5 +281,18 @@

    Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testPopovers.html b/packages/cli/test/functional/test_site/expected/testPopovers.html index 7add324f63..29251d31eb 100644 --- a/packages/cli/test/functional/test_site/expected/testPopovers.html +++ b/packages/cli/test/functional/test_site/expected/testPopovers.html @@ -366,5 +366,18 @@

    Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testSingleAltFrontMatter.html b/packages/cli/test/functional/test_site/expected/testSingleAltFrontMatter.html index 630f086a2d..3051984a21 100644 --- a/packages/cli/test/functional/test_site/expected/testSingleAltFrontMatter.html +++ b/packages/cli/test/functional/test_site/expected/testSingleAltFrontMatter.html @@ -274,5 +274,18 @@

    Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testSourceContainScript.html b/packages/cli/test/functional/test_site/expected/testSourceContainScript.html index ea8eb34df3..65af97cafc 100644 --- a/packages/cli/test/functional/test_site/expected/testSourceContainScript.html +++ b/packages/cli/test/functional/test_site/expected/testSourceContainScript.html @@ -285,5 +285,18 @@

    Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testThumbnails.html b/packages/cli/test/functional/test_site/expected/testThumbnails.html index 4535319263..ddc79dbe2a 100644 --- a/packages/cli/test/functional/test_site/expected/testThumbnails.html +++ b/packages/cli/test/functional/test_site/expected/testThumbnails.html @@ -373,5 +373,18 @@

    Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testTooltipSpacing.html b/packages/cli/test/functional/test_site/expected/testTooltipSpacing.html index ca27a9bcd8..c84ec4f94a 100644 --- a/packages/cli/test/functional/test_site/expected/testTooltipSpacing.html +++ b/packages/cli/test/functional/test_site/expected/testTooltipSpacing.html @@ -283,5 +283,18 @@

    Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testTree.html b/packages/cli/test/functional/test_site/expected/testTree.html index 4c4f33ccc9..f798b88399 100644 --- a/packages/cli/test/functional/test_site/expected/testTree.html +++ b/packages/cli/test/functional/test_site/expected/testTree.html @@ -348,5 +348,18 @@

    Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testVariableContainsInclude.html b/packages/cli/test/functional/test_site/expected/testVariableContainsInclude.html index 3a509cb17b..71c31a328b 100644 --- a/packages/cli/test/functional/test_site/expected/testVariableContainsInclude.html +++ b/packages/cli/test/functional/test_site/expected/testVariableContainsInclude.html @@ -273,5 +273,18 @@

    Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/testWeb3FormPlugin.html b/packages/cli/test/functional/test_site/expected/testWeb3FormPlugin.html index d814f49596..ededfc422a 100644 --- a/packages/cli/test/functional/test_site/expected/testWeb3FormPlugin.html +++ b/packages/cli/test/functional/test_site/expected/testWeb3FormPlugin.html @@ -327,5 +327,18 @@

    Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/expected/test_md_fragment.html b/packages/cli/test/functional/test_site/expected/test_md_fragment.html index 57f0360600..7130a16932 100644 --- a/packages/cli/test/functional/test_site/expected/test_md_fragment.html +++ b/packages/cli/test/functional/test_site/expected/test_md_fragment.html @@ -273,5 +273,18 @@

    Heading in footer should not be }) } + \ No newline at end of file diff --git a/packages/cli/test/functional/test_site/site.json b/packages/cli/test/functional/test_site/site.json index 7335e68bbe..078ae8007a 100644 --- a/packages/cli/test/functional/test_site/site.json +++ b/packages/cli/test/functional/test_site/site.json @@ -201,6 +201,10 @@ { "src": "testSourceContainScript.md", "title": "Test: If source contains script or css, when included, the script or css should be included" + }, + { + "src": "testMermaid.md", + "title": "Rendering of diagrams via mermaid-js" } ], "pagesExclude": ["**/*-fragment.md"], @@ -227,7 +231,8 @@ "filterTags", "googleAnalytics", "mathDelimiters", - "web3Form" + "web3Form", + "mermaid" ], "pluginsContext": { "testMarkbindPlugin": { diff --git a/packages/cli/test/functional/test_site/testMermaid.md b/packages/cli/test/functional/test_site/testMermaid.md new file mode 100644 index 0000000000..559e0ee522 --- /dev/null +++ b/packages/cli/test/functional/test_site/testMermaid.md @@ -0,0 +1,75 @@ +**Mermaid Test** + + +%%{init: { "theme": "neutral" } }%% + +graph TD; +A-->B; +A-->C; +B-->D; +C-->D; + + + +graph TD; + A-->B; + A-->C; + B-->D; + C-->D; + + + +sequenceDiagram + participant Alice + participant Bob + Alice->>John: Hello John, how are you? + loop Healthcheck + John->>John: Fight against hypochondria + end + Note right of John: Rational thoughts
    prevail! + John-->>Alice: Great! + John->>Bob: How about you? + Bob-->>John: Jolly good! +
    + + +gantt +dateFormat YYYY-MM-DD +title Adding GANTT diagram to mermaid +section A section +Completed task :done, des1, 2014-01-06,2014-01-08 +Active task :active, des2, 2014-01-09, 3d +Future task : des3, after des2, 5d +Future task2 : des4, after des3, 5d + +section Critical tasks +Completed task in the critical line :crit, done, 2014-01-06,24h +Implement parser and jison :crit, done, after des1, 2d +Create tests for parser :crit, active, 3d +Future task in critical line :crit, 5d +Create tests for renderer :2d +Add to mermaid :1d + +section Documentation +Describe gantt syntax :active, a1, after des1, 3d +Add gantt diagram to demo page :after a1 , 20h +Add another diagram to demo page :doc1, after a1 , 48h + +section Last section +Describe gantt syntax :after doc1, 3d +Add gantt diagram to demo page : 20h +Add another diagram to demo page : 48h + + + + +pie title Pets adopted by volunteers + "Dogs" : 386 + "Cats" : 85 + "Rats" : 15 + + + + + + diff --git a/packages/cli/test/functional/test_site/testMermaidInclude.md b/packages/cli/test/functional/test_site/testMermaidInclude.md new file mode 100644 index 0000000000..2b65a816ce --- /dev/null +++ b/packages/cli/test/functional/test_site/testMermaidInclude.md @@ -0,0 +1,7 @@ + +graph TD; + A-->B; + A-->C; + B-->D; + C-->D; + diff --git a/packages/core/src/plugins/mermaid.ts b/packages/core/src/plugins/mermaid.ts new file mode 100644 index 0000000000..f703e450a6 --- /dev/null +++ b/packages/core/src/plugins/mermaid.ts @@ -0,0 +1,39 @@ +import cheerio from 'cheerio'; +import { PluginContext, FrontMatter } from './Plugin'; + +const DEFAULT_CDN_ADDRESS = 'https://unpkg.com/mermaid@10/dist/mermaid.esm.min.mjs'; + +function genScript(address: string) { + return ``; +} + +export = { + tagConfig: { + mermaid: { + isSpecial: true, + }, + }, + getScripts: (pluginContext: PluginContext) => [genScript(pluginContext.address)], + postRender: (pluginContext: PluginContext, frontmatter: FrontMatter, content: string) => { + const $ = cheerio.load(content); + + $('mermaid').each((index: number, node: cheerio.Element) => { + const $node = $(node); + $node.replaceWith(`
    ${$node.html()}
    `); + }); + + return $.html(); + }, +}; diff --git a/packages/core/test/unit/plugins/default/mermaid.test.ts b/packages/core/test/unit/plugins/default/mermaid.test.ts new file mode 100644 index 0000000000..924262ac3b --- /dev/null +++ b/packages/core/test/unit/plugins/default/mermaid.test.ts @@ -0,0 +1,82 @@ +import cheerio from 'cheerio'; +import { PluginContext, FrontMatter } from '../../../../src/plugins/Plugin'; +import mermaid from '../../../../src/plugins/mermaid'; + +test('postRender should replace mermaid tags with appropriate divs', () => { + const content = ` + + flowchart TD + A[Start] --> B{Is it?} + B -->|Yes| C[OK] + C --> D[Rethink] + D --> B + B ---->|No| E[End] + + `; + + const expected = ` +
    + flowchart TD + A[Start] --> B{Is it?} + B -->|Yes| C[OK] + C --> D[Rethink] + D --> B + B ---->|No| E[End] +
    + `; + + const pluginContext: PluginContext = {}; + const frontmatter: FrontMatter = {}; + const renderedContent = mermaid.postRender(pluginContext, frontmatter, content); + const $ = cheerio.load(renderedContent); + + expect($('div.mermaid').length).toBe(1); + expect($('div.mermaid').attr('v-mermaid')).toBeDefined(); + expect($('div.mermaid').html()).toEqual(cheerio.load(expected)('div.mermaid').html()); +}); + +test('getScripts should return the correct script tag', () => { + const pluginContext: PluginContext = { + address: 'https://unpkg.com/mermaid@8/dist/mermaid.esm.min.mjs', + }; + + const expectedScript = ``; + + const scripts = mermaid.getScripts(pluginContext); + expect(scripts.length).toBe(1); + expect(scripts[0]).toEqual(expectedScript); +}); + +test('getScripts should use the default CDN address if not provided', () => { + const pluginContext: PluginContext = {}; + + const expectedScript = ``; + + const scripts = mermaid.getScripts(pluginContext); + expect(scripts.length).toBe(1); + expect(scripts[0]).toEqual(expectedScript); +});