@farberg/reveal-template 1.0.52 → 1.0.54
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 +7 -3
- package/package.json +1 -1
- package/plugins/reveal-plugin-asciinema.js +23 -17
package/init-reveal.js
CHANGED
|
@@ -9,6 +9,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
11
|
import PrefixUrlPlugin from './plugins/reveal-plugin-prefix-with-base-url.js';
|
|
12
|
+
import AsciinemaPlugin from './plugins/reveal-plugin-asciinema.js';
|
|
13
|
+
|
|
12
14
|
|
|
13
15
|
const defaultOptions = {
|
|
14
16
|
revealOptions: {},
|
|
@@ -25,13 +27,15 @@ const externalJsLibs = [
|
|
|
25
27
|
'node_modules/qrcode/build/qrcode.js',
|
|
26
28
|
'node_modules/file-saver/dist/FileSaver.min.js',
|
|
27
29
|
'node_modules/jszip/dist/jszip.min.js',
|
|
28
|
-
'node_modules/reveal.js-plugins/chalkboard/plugin.js'
|
|
30
|
+
'node_modules/reveal.js-plugins/chalkboard/plugin.js',
|
|
31
|
+
'node_modules/asciinema-player/dist/bundle/asciinema-player.min.js'
|
|
29
32
|
]
|
|
30
33
|
|
|
31
34
|
const extraStylesheets = [
|
|
32
35
|
{ href: 'node_modules/reveal.js/dist/reveal.css' },
|
|
33
36
|
{ href: 'node_modules/reveal.js/plugin/highlight/zenburn.css' },
|
|
34
|
-
{ href: 'node_modules/reveal.js-plugins/chalkboard/style.css' }
|
|
37
|
+
{ href: 'node_modules/reveal.js-plugins/chalkboard/style.css' },
|
|
38
|
+
{ href: 'node_modules/asciinema-player/dist/bundle/asciinema-player.css' }
|
|
35
39
|
]
|
|
36
40
|
|
|
37
41
|
const extraThemeCssStylesheets = [
|
|
@@ -42,7 +46,7 @@ const extraThemeCssStylesheets = [
|
|
|
42
46
|
const defaultDennisPlugins = [
|
|
43
47
|
ShowCodeSnippets, ShowToc, ShowAttribution, ShowQrCode, ShowTitle,
|
|
44
48
|
ModifyFontSize, ShowHTMLExample, ToggleSolutionsPlugin, DirTreePlugin,
|
|
45
|
-
PrefixUrlPlugin
|
|
49
|
+
PrefixUrlPlugin, AsciinemaPlugin
|
|
46
50
|
]
|
|
47
51
|
|
|
48
52
|
const defaultRevealOptions = {
|
package/package.json
CHANGED
|
@@ -6,23 +6,29 @@ export default () => {
|
|
|
6
6
|
init: (deck) => {
|
|
7
7
|
|
|
8
8
|
deck.on('ready', () => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
9
|
+
|
|
10
|
+
deck.addEventListener('slidechanged', function (event) {
|
|
11
|
+
|
|
12
|
+
// Workaround to get elements into an array before they are replaced
|
|
13
|
+
const els = []
|
|
14
|
+
for (let el of deck.getRevealElement().getElementsByTagName("asciinema")) {
|
|
15
|
+
els.push(el)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
for (let el of els) {
|
|
19
|
+
console.log("Looking @", el)
|
|
20
|
+
const source = el.getAttribute('src')
|
|
21
|
+
const conf = el.getAttribute('data-conf')
|
|
22
|
+
const div = document.createElement('div')
|
|
23
|
+
|
|
24
|
+
el.parentElement.replaceChild(div, el)
|
|
25
|
+
|
|
26
|
+
console.log("Playing", source, "with options", conf)
|
|
27
|
+
console.log(AsciinemaPlayer.create(source, div, JSON.parse(conf)));
|
|
28
|
+
}
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
|
|
26
32
|
})
|
|
27
33
|
|
|
28
34
|
}
|