@farberg/reveal-template 1.0.44 → 1.0.48
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.
package/init-reveal.js
CHANGED
|
@@ -8,6 +8,7 @@ import ModifyFontSize from './plugins/reveal-plugin-modify-font-size.js';
|
|
|
8
8
|
import ShowHTMLExample from './plugins/reveal-plugin-html-example.js';
|
|
9
9
|
import ToggleSolutionsPlugin from './plugins/reveal-plugin-toggle-solutions.js';
|
|
10
10
|
import DirTreePlugin from './plugins/reveal-plugin-dir-tree.js';
|
|
11
|
+
import PrefixUrlPlugin from './plugins/reveal-plugin-prefix-with-base-url.js';
|
|
11
12
|
|
|
12
13
|
const defaultOptions = {
|
|
13
14
|
revealOptions: {},
|
|
@@ -21,7 +22,7 @@ const defaultOptions = {
|
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
const externalJsLibs = [
|
|
24
|
-
'node_modules/qrcode/build/qrcode.
|
|
25
|
+
'node_modules/qrcode/build/qrcode.js',
|
|
25
26
|
'node_modules/file-saver/dist/FileSaver.min.js',
|
|
26
27
|
'node_modules/jszip/dist/jszip.min.js',
|
|
27
28
|
'node_modules/reveal.js-plugins/chalkboard/plugin.js'
|
|
@@ -40,7 +41,8 @@ const extraThemeCssStylesheets = [
|
|
|
40
41
|
|
|
41
42
|
const defaultDennisPlugins = [
|
|
42
43
|
ShowCodeSnippets, ShowToc, ShowAttribution, ShowQrCode, ShowTitle,
|
|
43
|
-
ModifyFontSize, ShowHTMLExample, ToggleSolutionsPlugin, DirTreePlugin
|
|
44
|
+
ModifyFontSize, ShowHTMLExample, ToggleSolutionsPlugin, DirTreePlugin,
|
|
45
|
+
PrefixUrlPlugin
|
|
44
46
|
]
|
|
45
47
|
|
|
46
48
|
const defaultRevealOptions = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farberg/reveal-template",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.48",
|
|
4
4
|
"homepage": "https://github.com/pfisterer/reveal-template",
|
|
5
5
|
"description": "Reveal.js template for Dennis' lectures",
|
|
6
6
|
"main": "index.js",
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
"connect": "^3.7.0",
|
|
19
19
|
"file-saver": "^2.0.5",
|
|
20
20
|
"jszip": "^3.7.1",
|
|
21
|
-
"qrcode": "^1.
|
|
22
|
-
"reveal.js": "^4.1
|
|
23
|
-
"reveal.js-plugins": "^4.1.
|
|
24
|
-
"serve-static": "^1.14.
|
|
21
|
+
"qrcode": "^1.5.0",
|
|
22
|
+
"reveal.js": "^4.2.1",
|
|
23
|
+
"reveal.js-plugins": "^4.1.5",
|
|
24
|
+
"serve-static": "^1.14.2"
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const dir_tree = {
|
|
2
|
+
id: 'prefix_url',
|
|
3
|
+
init: (deck) => {
|
|
4
|
+
|
|
5
|
+
deck.on('ready', () => {
|
|
6
|
+
for (let el of deck.getRevealElement().querySelectorAll("[data-prefix-url]")) {
|
|
7
|
+
const convertToInlineCode = el.getAttribute('data-convert-to-inline-code')
|
|
8
|
+
const attribute = el.getAttribute('data-prefix-url')
|
|
9
|
+
const urlPath = window.location.href.split('?')[0]
|
|
10
|
+
const prefix = attribute || urlPath
|
|
11
|
+
|
|
12
|
+
if (convertToInlineCode) {
|
|
13
|
+
el.outerHTML = `<code>${prefix + el.innerText}</code>`
|
|
14
|
+
} else {
|
|
15
|
+
el.innerText = prefix + el.innerText
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export default dir_tree;
|
|
@@ -56,7 +56,6 @@ export default () => {
|
|
|
56
56
|
init: (deck) => {
|
|
57
57
|
|
|
58
58
|
deck.on('ready', () => {
|
|
59
|
-
const highlightPlugin = deck.getPlugin("highlight")
|
|
60
59
|
|
|
61
60
|
for (let el of deck.getRevealElement().querySelectorAll("a[data-code]")) {
|
|
62
61
|
//console.log(`Loading code snippets, looking at`, el)
|
|
@@ -87,7 +86,9 @@ export default () => {
|
|
|
87
86
|
}
|
|
88
87
|
}
|
|
89
88
|
|
|
90
|
-
|
|
89
|
+
// Highlight all code snippets
|
|
90
|
+
const highlightPlugin = deck.getPlugin("highlight")
|
|
91
|
+
highlightPlugin.hljs.highlightAll()
|
|
91
92
|
})
|
|
92
93
|
|
|
93
94
|
}
|