@farberg/reveal-template 1.1.8 → 1.1.10

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
@@ -77,7 +77,16 @@ const defaultRevealOptions = {
77
77
  boardmarkerWidth: 2,
78
78
  chalkWidth: 3,
79
79
  chalkEffect: 0.4,
80
- theme: "chalkboard" // or "whiteboard"
80
+ theme: "chalkboard", // or "whiteboard"
81
+ grid: { color: 'rgb(50,50,10,0.5)', distance: 100, width: 3 },
82
+ boardmarkers: [
83
+ { color: 'rgba(225, 2, 23, 1)' },
84
+ { color: 'rgba(100,100,100,1)' },
85
+ ],
86
+ chalks: [
87
+ { color: 'rgba(225, 2, 23, 0.6)' },
88
+ { color: 'rgba(100,100,100,0.6)' },
89
+ ]
81
90
  },
82
91
  keyboard: {
83
92
  33: function () { Reveal.left(); }, // Don't go up using the presenter
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farberg/reveal-template",
3
- "version": "1.1.8",
3
+ "version": "1.1.10",
4
4
  "homepage": "https://github.com/pfisterer/reveal-template",
5
5
  "description": "Reveal.js template for Dennis' lectures",
6
6
  "main": "index.js",
@@ -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
- .then(response => response.text()).then(text => {
93
- let code = extractBeginEndSnippet(text, beginMarker, endMarker)
94
-
95
- if (outdentCode)
96
- code = outdent(code)
97
-
98
- /* const newEl = */ showCode(el, language, code, showLink ? url : null, outdent)
99
- //highlightPlugin.highlightElement(newEl)
100
- }).catch(err => {
101
- showError(el, err)
102
- })
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
+
103
106
  } else {
104
107
  showError(el, "No URL provided in elements innerText")
105
108
  }
106
109
  }
107
110
 
108
- highlightPlugin.hljs.highlightAll()
111
+
109
112
  })
110
113
 
114
+
111
115
  }
112
116
  }
113
117
  }