Skip to content

Commit

Permalink
reenable bespoke prism plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
mojavelinux committed Oct 29, 2023
1 parent 08767f5 commit 2bdcd72
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 34 deletions.
21 changes: 10 additions & 11 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,16 @@ var PUGJS = 'Pug (formerly Jade)';
var ASCIIDOC = 'AsciiDoc (using Asciidoctor Bespoke)';

var optionalPlugins = [
// bespoke-prism seems to be broken
//{
// when: function (response) {
// return response.templatingLanguage !== ASCIIDOC;
// },
// name: 'prism',
// version: '~1.0',
// priority: 1,
// message: 'Will your presentation include code samples?',
// default: true
//},
{
when: function (response) {
return response.templatingLanguage !== ASCIIDOC;
},
name: 'prism',
version: '~1.0',
priority: 1,
message: 'Will your presentation include code samples?',
default: true
},
{
name: 'multimedia',
version: '~1.1',
Expand Down
20 changes: 9 additions & 11 deletions app/templates/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,21 @@ <h3>Powered by <a href="https://github.com/bespokejs/bespoke-bullets">bespoke-bu
</section>

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

<% } -%>
<section data-bespoke-hash="named-route">
<h2>Named Route</h2>
<h3>Powered by <a href="https://github.com/bespokejs/bespoke-hash">bespoke-hash</a></h3>
Expand Down
20 changes: 9 additions & 11 deletions app/templates/src/index.pug
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,21 @@ html
iframe(width="640", height="360", src="https://www.youtube.com/embed/AV3kYPutYfs?rel=0&amp;showinfo=0&amp;controls=0&amp;enablejsapi=1&amp;loop=1&amp;playlist=AV3kYPutYfs", frameborder="0", allowfullscreen, data-volume="0")

<% } -%>
<% if (usePluginPrism) { -%>
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() {
function hanoi(n, a, b, c) {
return n ? hanoi(n - 1, a, c, b)
.concat([[a, b]])
.concat(hanoi(n - 1, c, b, a)) : [];
}
return hanoi(3, 'left', 'right', 'mid')
.map(function(d) {
return d[0] + ' -&gt; ' + d[1];
});
})();
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(data-bespoke-hash='named-route')
h2 Named Route
h3 Powered by <a href="https://github.com/bespokejs/bespoke-hash">bespoke-hash</a>
Expand Down
2 changes: 1 addition & 1 deletion test/test-behaviour.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('bespoke generator', function () {
.withPrompts({
'title': 'Foobar Test Title',
'templatingLanguage': 'Pug (formerly Jade)',
//'prism': false,
'prism': false,
'multimedia': false,
});

Expand Down

0 comments on commit 2bdcd72

Please sign in to comment.