@farberg/reveal-template 1.1.7 → 1.1.9
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
|
@@ -27,15 +27,19 @@ const externalJsLibs = [
|
|
|
27
27
|
'node_modules/easyqrcodejs/dist/easy.qrcode.min.js',
|
|
28
28
|
'node_modules/file-saver/dist/FileSaver.min.js',
|
|
29
29
|
'node_modules/jszip/dist/jszip.min.js',
|
|
30
|
-
|
|
31
|
-
'node_modules/
|
|
30
|
+
'node_modules/asciinema-player/dist/bundle/asciinema-player.min.js',
|
|
31
|
+
'node_modules/reveal.js-plugins/customcontrols/plugin.js',
|
|
32
|
+
'node_modules/reveal.js-plugins/chalkboard/plugin.js',
|
|
33
|
+
'node_modules/@fortawesome/fontawesome-free/js/all.min.js'
|
|
32
34
|
]
|
|
33
35
|
|
|
34
36
|
const extraStylesheets = [
|
|
35
37
|
{ href: 'node_modules/reveal.js/dist/reveal.css' },
|
|
36
38
|
{ href: 'node_modules/reveal.js/plugin/highlight/zenburn.css' },
|
|
37
|
-
|
|
38
|
-
{ href: 'node_modules/
|
|
39
|
+
{ href: 'node_modules/asciinema-player/dist/bundle/asciinema-player.css' },
|
|
40
|
+
{ href: 'node_modules/reveal.js-plugins/customcontrols/style.css' },
|
|
41
|
+
{ href: 'node_modules/reveal.js-plugins/chalkboard/style.css' },
|
|
42
|
+
{ href: 'node_modules/@fortawesome/fontawesome-free/css/all.min.css' },
|
|
39
43
|
]
|
|
40
44
|
|
|
41
45
|
const extraThemeCssStylesheets = [
|
|
@@ -69,6 +73,12 @@ const defaultRevealOptions = {
|
|
|
69
73
|
markdown: {
|
|
70
74
|
smartypants: true,
|
|
71
75
|
},
|
|
76
|
+
chalkboard: {
|
|
77
|
+
boardmarkerWidth: 2,
|
|
78
|
+
chalkWidth: 3,
|
|
79
|
+
chalkEffect: 0.4,
|
|
80
|
+
theme: "chalkboard" // or "whiteboard"
|
|
81
|
+
},
|
|
72
82
|
keyboard: {
|
|
73
83
|
33: function () { Reveal.left(); }, // Don't go up using the presenter
|
|
74
84
|
34: function () { Reveal.right(); }, // Don't go down using the presenter
|
|
@@ -210,8 +220,9 @@ export function initReveal(opts) {
|
|
|
210
220
|
finalOptions.plugins = [
|
|
211
221
|
...modules,
|
|
212
222
|
...defaultDennisPlugins,
|
|
213
|
-
|
|
214
|
-
|
|
223
|
+
...finalOptions.plugins,
|
|
224
|
+
RevealChalkboard,
|
|
225
|
+
RevealCustomControls
|
|
215
226
|
]
|
|
216
227
|
|
|
217
228
|
if (options.verbose)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farberg/reveal-template",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.9",
|
|
4
4
|
"homepage": "https://github.com/pfisterer/reveal-template",
|
|
5
5
|
"description": "Reveal.js template for Dennis' lectures",
|
|
6
6
|
"main": "index.js",
|
|
@@ -24,6 +24,8 @@
|
|
|
24
24
|
"pdf-merger-js": "^5.1.2",
|
|
25
25
|
"puppeteer": "^24.6.0",
|
|
26
26
|
"reveal.js": "^5.2.1",
|
|
27
|
-
"serve-static": "^2.2.0"
|
|
27
|
+
"serve-static": "^2.2.0",
|
|
28
|
+
"@fortawesome/fontawesome-free": "^6.4.1",
|
|
29
|
+
"reveal.js-plugins": "^4.6.0"
|
|
28
30
|
}
|
|
29
31
|
}
|
|
@@ -68,14 +68,19 @@ function extractBeginEndSnippet(code, beginMarker, endMarker) {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
export default () => {
|
|
71
|
-
|
|
72
71
|
return {
|
|
73
72
|
id: 'show_code_snippets',
|
|
74
73
|
init: (deck) => {
|
|
75
74
|
|
|
76
|
-
deck.on('ready', () => {
|
|
75
|
+
deck.on('ready', async () => {
|
|
77
76
|
const highlightPlugin = deck.getPlugin("highlight")
|
|
78
77
|
|
|
78
|
+
highlightPlugin.hljs.configure({
|
|
79
|
+
// This suppresses the specific console warning you are seeing
|
|
80
|
+
ignoreUnescapedHTML: true
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
|
|
79
84
|
for (let el of deck.getRevealElement().querySelectorAll("a[data-code]")) {
|
|
80
85
|
//console.log(`Loading code snippets, looking at`, el)
|
|
81
86
|
let language = el.getAttribute("data-code");
|
|
@@ -88,26 +93,25 @@ export default () => {
|
|
|
88
93
|
//console.log(`language = ${language}, url = ${url}, beginMarker = ${beginMarker}, endMarker = ${endMarker}, showLink = ${showLink} `)
|
|
89
94
|
|
|
90
95
|
if (url) {
|
|
91
|
-
fetch(url, { "cache": "no-store" })
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}).catch(err => {
|
|
102
|
-
showError(el, err)
|
|
103
|
-
})
|
|
96
|
+
const response = await fetch(url, { "cache": "no-store" })
|
|
97
|
+
const text = await response.text()
|
|
98
|
+
let code = extractBeginEndSnippet(text, beginMarker, endMarker)
|
|
99
|
+
|
|
100
|
+
if (outdentCode)
|
|
101
|
+
code = outdent(code)
|
|
102
|
+
|
|
103
|
+
const newEl = showCode(el, language, code, showLink ? url : null, outdent)
|
|
104
|
+
highlightPlugin.hljs.highlightElement(newEl)
|
|
105
|
+
|
|
104
106
|
} else {
|
|
105
107
|
showError(el, "No URL provided in elements innerText")
|
|
106
108
|
}
|
|
107
109
|
}
|
|
108
110
|
|
|
111
|
+
|
|
109
112
|
})
|
|
110
113
|
|
|
114
|
+
|
|
111
115
|
}
|
|
112
116
|
}
|
|
113
117
|
}
|