Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

- changing mermaid suport #2120

Closed
wants to merge 10 commits into from
14 changes: 5 additions & 9 deletions share/templates/reveal/index.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@
<script src="{{ resources.require_js_url }}"></script>
{%- endblock html_head_js_requirejs -%}
{%- block html_head_js_mermaidjs -%}
<script type="module">
import mermaid from '{{ resources.mermaid_js_url }}';
mermaid.initialize({ startOnLoad: true });
</script>
{%- endblock html_head_js_mermaidjs -%}
{%- endblock html_head_js -%}

Expand Down Expand Up @@ -145,21 +141,21 @@ require(
},
[
"{{ reveal_url_prefix }}/dist/reveal.js",
"{{ reveal_url_prefix }}/plugin/notes/notes.js"
"{{ reveal_url_prefix }}/plugin/notes/notes.js",
"https://cdn.jsdelivr.net/npm/reveal.js-mermaid-plugin@2.2.0/plugin/mermaid/mermaid.js"
franzhaas marked this conversation as resolved.
Show resolved Hide resolved
],

function(Reveal, RevealNotes){
function(Reveal, RevealNotes, RevealMermaid){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, missed this: the positional argument would need to be conditional as well:

function(
    Reveal, 
    RevealNotes, 
    {% if reveal_mermaid_js_url %}RevealMermaid,{% endif %}
){

Also feel free to normalize the whitespace: the "floating indent" style isn't necessary, just consistency with what's around (in this case four spaces).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea, i also did that...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can someone please assign the improvement label? I am sorry, i either don't have the right to set it, or i just don't find the feature...

// Full list of configuration options available here: https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: true,
progress: true,
history: true,
transition: "{{reveal_transition}}",
slideNumber: "{{reveal_number}}",
plugins: [RevealNotes],
plugins: [RevealNotes, RevealMermaid],
width: {{reveal_width}},
height: {{reveal_height}},

height: {{reveal_height}},
});

var update = function(event){
Expand Down
Loading