1
0
mirror of https://github.com/hakimel/reveal.js.git synced 2025-08-11 09:04:51 +02:00

update code example on chromeless page

This commit is contained in:
Hakim El Hattab
2019-05-28 12:19:06 +02:00
parent ce3ff2e125
commit 8f32e236f9

View File

@@ -224,20 +224,20 @@
<section> <section>
<h2>Pretty Code</h2> <h2>Pretty Code</h2>
<pre><code class="hljs" data-trim contenteditable> <pre><code class="hljs" data-trim data-line-numbers="4|9|4,8-11">
function linkify( selector ) { import React, { useState } from 'react';
if( supports3DTransforms ) {
var nodes = document.querySelectorAll( selector ); function Example() {
const [count, setCount] = useState(0);
for( var i = 0, len = nodes.length; i &lt; len; i++ ) { return (
var node = nodes[i]; &lt;div&gt;
&lt;p&gt;You clicked {count} times&lt;/p&gt;
if( !node.className ) { &lt;button onClick={() =&gt; setCount(count + 1)}&gt;
node.className += ' roll'; Click me
} &lt;/button&gt;
} &lt;/div&gt;
} );
} }
</code></pre> </code></pre>
<p>Code syntax highlighting courtesy of <a href="http://softwaremaniacs.org/soft/highlight/en/description/">highlight.js</a>.</p> <p>Code syntax highlighting courtesy of <a href="http://softwaremaniacs.org/soft/highlight/en/description/">highlight.js</a>.</p>
@@ -394,10 +394,9 @@ Reveal.addEventListener( 'customevent', function() {
// More info https://github.com/hakimel/reveal.js#dependencies // More info https://github.com/hakimel/reveal.js#dependencies
dependencies: [ dependencies: [
{ src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } }, { src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } }, { src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }, { src: 'plugin/highlight/highlight.js' },
{ src: 'plugin/search/search.js', async: true }, { src: 'plugin/search/search.js', async: true },
{ src: 'plugin/zoom-js/zoom.js', async: true }, { src: 'plugin/zoom-js/zoom.js', async: true },
{ src: 'plugin/notes/notes.js', async: true } { src: 'plugin/notes/notes.js', async: true }