Skip to content

Commit

Permalink
- icorporeted feedback from bollwyvl
Browse files Browse the repository at this point in the history
  • Loading branch information
franz haas committed Mar 3, 2024
1 parent dd5baff commit 7f57c67
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion nbconvert/exporters/slides.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ def _template_extension_default(self):
"""
).tag(config=True)

reveal_mermaid_js_url = Unicode(
default="https://cdn.jsdelivr.net/npm/reveal.js-mermaid-plugin@2.2.0/plugin/mermaid/mermaid.js",
help="specifies the mermaid reveal plugin url. defaults to cdn 2.2.0",
).tag(config=True)

@default("reveal_url_prefix")
def _reveal_url_prefix_default(self):
if "RevealHelpPreprocessor.url_prefix" in self.config:
Expand All @@ -129,7 +134,6 @@ def _reveal_url_prefix_default(self):
)
return self.config.RevealHelpPreprocessor.url_prefix
return "https://unpkg.com/reveal.js@4.0.2"

reveal_theme = Unicode(
"simple",
help="""
Expand Down
7 changes: 5 additions & 2 deletions share/templates/reveal/index.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ require(
[
"{{ reveal_url_prefix }}/dist/reveal.js",
"{{ reveal_url_prefix }}/plugin/notes/notes.js",
"https://cdn.jsdelivr.net/npm/reveal.js-mermaid-plugin@2.2.0/plugin/mermaid/mermaid.js"
{% if reveal_mermaid_js_url %}"{{ reveal_mermaid_js_url }}",{% endif %},
],
function(Reveal, RevealNotes, RevealMermaid){
Expand All @@ -153,7 +153,10 @@ require(
history: true,
transition: "{{reveal_transition}}",
slideNumber: "{{reveal_number}}",
plugins: [RevealNotes, RevealMermaid],
plugins: [
RevealNotes,
{% if reveal_mermaid_js_url %}RevealMermaid,{% endif %}
],
width: {{reveal_width}},
height: {{reveal_height}},
});
Expand Down

0 comments on commit 7f57c67

Please sign in to comment.