Skip to content

Commit

Permalink
add prism plugin and add slide with code block
Browse files Browse the repository at this point in the history
  • Loading branch information
mojavelinux committed Oct 29, 2023
1 parent fd8d120 commit 6a563a0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"bespoke-hash": "~1.1",
"bespoke-nav": "~1.0",
"bespoke-overview": "~1.0",
"bespoke-prism": "~1.0",
"bespoke-scale": "~1.0",
"browserify": "~17.0",
"del": "~6.1",
Expand Down
13 changes: 13 additions & 0 deletions src/index.pug
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,19 @@ html(lang='en')
section
img(src='images/html5.svg')

section
h2 Syntax Highlighting
h3 Powered by <a href="https://twitter.com/LeaVerou">Lea Verou</a>'s <a href="https://github.com/PrismJS/prism">Prism</a>
pre
code.language-javascript.
function hanoi (n, a, b, c) {
return n ? hanoi(n - 1, a, c, b)
.concat([[a, b]])
.concat(hanoi(n - 1, c, b, a)) : []
}
console.log(hanoi(3, 'left', 'right', 'mid')
.map((d) => `${d[0]} -&gt; ${d[1]}`))

section
h2 The End

Expand Down
4 changes: 3 additions & 1 deletion src/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ var isWebKit = 'webkitAppearance' in document.documentElement.style,
hash = require('bespoke-hash'),
nav = require('bespoke-nav'),
overview = require('bespoke-overview'),
prism = require('bespoke-prism'),
scale = require('bespoke-scale');

bespoke.from({ parent: 'article.deck', slides: 'section' }, [
Expand All @@ -18,5 +19,6 @@ bespoke.from({ parent: 'article.deck', slides: 'section' }, [
(scaleMethod ? scale(scaleMethod) : function(deck) {}),
overview({ columns: 4 }),
bullets('.build, .build-items > *:not(.build-items)'),
hash()
hash(),
prism()
]);

0 comments on commit 6a563a0

Please sign in to comment.