Skip to content

Commit

Permalink
academicpages#2303 add Mermaid and test deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
rjzupkoii committed Nov 11, 2024
1 parent e9f9c45 commit 574381e
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
9 changes: 9 additions & 0 deletions _includes/head/custom.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,13 @@
<script src="https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>

<!-- Support for Mermaid -->
<script type="module">
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs';
mermaid.initialize({
startOnLoad: true,
// theme: 'dark' # MARKER Location for setting the Mermaid theme
});
</script>

<!-- end custom head snippets -->
24 changes: 23 additions & 1 deletion _pages/markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ redirect_from:

## MathJax

Support for MathJax Version 3.0 is included in the template:
Support for [MathJax](https://www.mathjax.org/) v3.0 is included in the template:

$$
\displaylines{
Expand All @@ -55,6 +55,28 @@ The default delimiters of `$$...$$` and `\\[...\\]` are supported for displayed

**Note** that since Academic Pages uses Markdown which cases some interference with MathJax and LaTeX for escaping characters and new lines, although [some workarounds exist](https://math.codidact.com/posts/278763/278772#answer-278772).

## Mermaid

Support for Mermaid v11.x is included in the template though:

<pre class="mermaid">
flowchart TD
A-->B
</pre>

In order to render a [Mermaid](https://mermaid.js.org/) plot, the following syntax is required:

```HTML
<pre class="mermaid">
flowchart TD
A-->B
</pre>
```

Complete documentation for using Mermaid plots can be found [in their tutorials](https://mermaid.js.org/ecosystem/tutorials.html). The code necessary for rendering is delivered via a [content delivery network](https://en.wikipedia.org/wiki/Content_delivery_network) so it should stay current with the 11.x release branch.

**Note** that the Markdown syntax is not supported at this time due to how Jekyll renders and is unlikely to be supported in the future.

## Markdown guide

Academic Pages uses [kramdown](https://kramdown.gettalong.org/index.html) for Markdown rendering, which has some differences from other Markdown implementations such as GitHub's. In addition to this guide, please see the [kramdown Syntax page](https://kramdown.gettalong.org/syntax.html) for full documentation.
Expand Down

0 comments on commit 574381e

Please sign in to comment.