@farberg/reveal-template 1.0.43 → 1.0.47
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.47",
|
|
4
4
|
"homepage": "https://github.com/pfisterer/reveal-template",
|
|
5
5
|
"description": "Reveal.js template for Dennis' lectures",
|
|
6
6
|
"main": "index.js",
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"connect": "^3.7.0",
|
|
19
19
|
"file-saver": "^2.0.5",
|
|
20
|
-
"jszip": "^3.
|
|
21
|
-
"qrcode": "^1.
|
|
22
|
-
"reveal.js": "^4.1
|
|
23
|
-
"reveal.js-plugins": "^4.1.
|
|
24
|
-
"serve-static": "^1.14.
|
|
20
|
+
"jszip": "^3.7.1",
|
|
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;
|
package/scripts/generate_pdfs.js
CHANGED
|
@@ -6,6 +6,7 @@ const path = require('path');
|
|
|
6
6
|
const fs = require('fs');
|
|
7
7
|
const { spawn } = require('child_process');
|
|
8
8
|
const { combined_pdf, pdf_exists_and_is_newer_than_markdown } = require('./helpers')
|
|
9
|
+
const decktape_image = 'astefanutti/decktape:3.1'
|
|
9
10
|
|
|
10
11
|
const cwd = process.cwd()
|
|
11
12
|
const slides_dir = cwd
|
|
@@ -35,7 +36,7 @@ function update_docker_image() {
|
|
|
35
36
|
return new Promise((resolve, reject) => {
|
|
36
37
|
|
|
37
38
|
let cmd = "docker"
|
|
38
|
-
let args = ["pull",
|
|
39
|
+
let args = ["pull", decktape_image]
|
|
39
40
|
let cmdLine = `${cmd} ${args.reduce((a, b) => `${a} '${b}'`, "")}`
|
|
40
41
|
|
|
41
42
|
if (verbose)
|
|
@@ -49,7 +50,7 @@ function update_docker_image() {
|
|
|
49
50
|
|
|
50
51
|
function spawn_convert_md_to_pdf(url, pdf_dir, pdf_name) {
|
|
51
52
|
let cmd = "docker"
|
|
52
|
-
let args = ["run", "--rm", "-u", `${os.userInfo().uid}`, "-v", `${pdf_dir}:/slides`,
|
|
53
|
+
let args = ["run", "--rm", "-u", `${os.userInfo().uid}`, "-v", `${pdf_dir}:/slides`, decktape_image, "--load-pause", "2000", "--pause", "500", "-s", "1200x800", "automatic", url, `/slides/${path.basename(pdf_name)}`]
|
|
53
54
|
|
|
54
55
|
let cmdLine = `${cmd} ${args.reduce((a, b) => `${a} '${b}'`, "")}`
|
|
55
56
|
|
package/scripts/helpers.js
CHANGED
|
@@ -35,7 +35,7 @@ module.exports.pdf_exists_and_is_newer_than_markdown = function (markdownpath, p
|
|
|
35
35
|
|
|
36
36
|
if (!pdf_newer) {
|
|
37
37
|
if (verbose)
|
|
38
|
-
console.error(`pdf is not newer than md`)
|
|
38
|
+
console.error(`Skipping ${markdownpath}: pdf is not newer than md`)
|
|
39
39
|
return false
|
|
40
40
|
}
|
|
41
41
|
return true
|