-
Notifications
You must be signed in to change notification settings - Fork 83
/
reveal.js
33 lines (26 loc) · 886 Bytes
/
reveal.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import 'reveal.js/dist/reveal.css'
import 'reveal.js/dist/theme/dracula.css'
import Reveal from 'reveal.js'
import Markdown from 'reveal.js/plugin/markdown/markdown.esm.js'
import RevealHighlight from 'reveal.js/plugin/highlight/highlight.esm.js'
const url = new URL(document.URL)
const slidesFolder = url.searchParams.get('p') || 'intro'
const markdownFilename = './slides/' + slidesFolder + '/slides.md'
console.log(markdownFilename)
fetch(markdownFilename)
.then((r) => r.text())
.then((markdownContents) => {
document.querySelector('.slides').innerHTML =
'<section data-markdown><textarea data-template>' +
markdownContents +
'</textarea></section>'
const deck = new Reveal({
plugins: [Markdown, RevealHighlight]
})
deck.initialize({
width: 1280,
height: 720,
slideNumber: true,
embedded: false,
})
})