@farberg/reveal-template 1.1.12 → 1.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,9 +2,11 @@
2
2
 
3
3
  <head>
4
4
  <meta charset="utf-8">
5
+ <meta name="mobile-web-app-capable" content="yes" />
5
6
  <meta name="apple-mobile-web-app-capable" content="yes" />
6
7
  <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
7
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=yes, minimal-ui">
8
+ <meta name="viewport"
9
+ content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=yes, minimal-ui">
8
10
 
9
11
  <script type="module">
10
12
  import { initReveal } from '../init-reveal.js'
package/init-reveal.js CHANGED
@@ -35,7 +35,7 @@ const externalJsLibs = [
35
35
 
36
36
  const extraStylesheets = [
37
37
  { href: 'node_modules/reveal.js/dist/reveal.css' },
38
- { href: 'node_modules/reveal.js/plugin/highlight/zenburn.css' },
38
+ { href: 'node_modules/reveal.js/dist/plugin/highlight/zenburn.css' },
39
39
  { href: 'node_modules/asciinema-player/dist/bundle/asciinema-player.css' },
40
40
  { href: 'node_modules/reveal.js-plugins/customcontrols/style.css' },
41
41
  { href: 'node_modules/reveal.js-plugins/chalkboard/style.css' },
@@ -126,19 +126,19 @@ function windowOnLoadPromise() {
126
126
  // Load reveal and its plugins
127
127
  function loadRevealAndPlugins(options) {
128
128
  const imports = [
129
- "dist/reveal.esm.js" /*must be the first one*/,
130
- "plugin/markdown/markdown.esm.js",
131
- "plugin/highlight/highlight.esm.js",
132
- "plugin/search/search.esm.js",
133
- "plugin/notes/notes.esm.js",
134
- "plugin/math/math.esm.js",
135
- "plugin/zoom/zoom.esm.js"
129
+ "dist/reveal.mjs" /*must be the first one*/,
130
+ "dist/plugin/markdown.mjs",
131
+ "dist/plugin/highlight.mjs",
132
+ "dist/plugin/search.mjs",
133
+ "dist/plugin/notes.mjs",
134
+ "dist/plugin/math.mjs",
135
+ "dist/plugin/zoom.mjs"
136
136
  ]
137
137
 
138
138
  if (options.verbose)
139
139
  console.log("Importing the following plugins: ", imports)
140
140
 
141
- return Promise.all(imports.map(i => import(options.revealPath + "/" + i)))
141
+ return Promise.all(imports.map(i => import(options.revealPath + i)))
142
142
  }
143
143
 
144
144
  // Add js tags to the header and resolve
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farberg/reveal-template",
3
- "version": "1.1.12",
3
+ "version": "1.1.13",
4
4
  "homepage": "https://github.com/pfisterer/reveal-template",
5
5
  "description": "Reveal.js template for Dennis' lectures",
6
6
  "main": "index.js",
@@ -1,8 +1,16 @@
1
- import mermaid from '../../../mermaid/dist/mermaid.esm.min.mjs';
1
+ // When installed as an npm package the plugin lives at node_modules/@farberg/reveal-template/plugins/
2
+ // and mermaid is 3 levels up. When running from the template root directly it is 1 level up.
3
+ const mermaidUrl = new URL(
4
+ new URL(import.meta.url).pathname.includes('/node_modules/')
5
+ ? '../../../mermaid/dist/mermaid.esm.min.mjs'
6
+ : '../node_modules/mermaid/dist/mermaid.esm.min.mjs',
7
+ import.meta.url
8
+ ).href;
2
9
 
3
10
  export default {
4
11
  id: 'mermaid',
5
- init: (deck) => {
12
+ init: async (deck) => {
13
+ const { default: mermaid } = await import(mermaidUrl);
6
14
  mermaid.initialize({
7
15
  'startOnLoad': false,
8
16
  'theme': 'base',