This commit is contained in:
Ladd Hoffman 2024-06-21 16:59:16 -05:00
parent 9459c25a38
commit 120a6ea805
5 changed files with 64 additions and 4 deletions

23
mathjax.html Normal file
View File

@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<head>
<title>MathJax AsciiMath Test Page</title>
<script>
MathJax = {
loader: {load: ['input/asciimath', 'output/chtml']}
}
</script>
<!-- <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script> -->
<script type="text/javascript" id="MathJax-script" async
src="./node_modules/mathjax/es5/startup.js">
</script>
<body>
<p>When `a != 0`, there are two solutions to `ax^2 + bx + c = 0` and
they are</p>
<p style="text-align:center">
`x = (-b +- sqrt(b^2-4ac))/(2a) .`
</p>
</body>
</html>

6
package-lock.json generated
View File

@ -9,9 +9,15 @@
"version": "1.0.0", "version": "1.0.0",
"license": "Unlicense", "license": "Unlicense",
"dependencies": { "dependencies": {
"mathjax": "^3.2.2",
"reveal.js": "^5.1.0" "reveal.js": "^5.1.0"
} }
}, },
"node_modules/mathjax": {
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/mathjax/-/mathjax-3.2.2.tgz",
"integrity": "sha512-Bt+SSVU8eBG27zChVewOicYs7Xsdt40qm4+UpHyX7k0/O9NliPc+x77k1/FEsPsjKPZGJvtRZM1vO+geW0OhGw=="
},
"node_modules/reveal.js": { "node_modules/reveal.js": {
"version": "5.1.0", "version": "5.1.0",
"resolved": "https://registry.npmjs.org/reveal.js/-/reveal.js-5.1.0.tgz", "resolved": "https://registry.npmjs.org/reveal.js/-/reveal.js-5.1.0.tgz",

View File

@ -8,6 +8,7 @@
"author": "Ladd Hoffman", "author": "Ladd Hoffman",
"license": "Unlicense", "license": "Unlicense",
"dependencies": { "dependencies": {
"mathjax": "^3.2.2",
"reveal.js": "^5.1.0" "reveal.js": "^5.1.0"
} }
} }

View File

@ -16,8 +16,28 @@
<body> <body>
<div class="reveal"> <div class="reveal">
<div class="slides"> <div class="slides">
<section>Slide 1</section> <section>
<section>Slide 2</section> <h2>Slide 1</h2>
<p>Content... `a = b / c`</p>
</section>
<section data-markdown>
<textarea data-template>
## Slide 2
- Item 1
- Item 2
<div id="d1"></div>
<script>
{
const d = new Drawing('d1');
d.setTitle('Test Drawing');
d.line([0, 0], [100, 100]);
d.render();
}
</script>
</textarea>
</section>
<section data-markdown="test.md"></section>
</div> </div>
</div> </div>
@ -25,15 +45,22 @@
<script src="./node_modules/reveal.js/plugin/notes/notes.js"></script> <script src="./node_modules/reveal.js/plugin/notes/notes.js"></script>
<script src="./node_modules/reveal.js/plugin/markdown/markdown.js"></script> <script src="./node_modules/reveal.js/plugin/markdown/markdown.js"></script>
<script src="./node_modules/reveal.js/plugin/highlight/highlight.js"></script> <script src="./node_modules/reveal.js/plugin/highlight/highlight.js"></script>
<script src="./node_modules/reveal.js/plugin/math/math.js"></script>
<script src="./draw.js"></script>
<script> <script>
// More info about initialization & config: // More info about initialization & config:
// - https://revealjs.com/initialization/ // - https://revealjs.com/initialization/
// - https://revealjs.com/config/ // - https://revealjs.com/config/
Reveal.initialize({ Reveal.initialize({
hash: true, hash: true,
mathjax3: {
mathjax: './node_modules/mathjax/es5/startup.js',
loader: {
load: ['input/asciimath', 'output/chtml'],
},
},
// Learn about plugins: https://revealjs.com/plugins/ // Learn about plugins: https://revealjs.com/plugins/
plugins: [ RevealMarkdown, RevealHighlight, RevealNotes ] plugins: [ RevealMarkdown, RevealHighlight, RevealNotes, RevealMath.MathJax3 ]
}); });
</script> </script>
</body> </body>

3
test.md Normal file
View File

@ -0,0 +1,3 @@
## Slide 3
Testing