mirror of
https://github.com/hakimel/reveal.js.git
synced 2025-08-11 17:14:57 +02:00
update code example on chromeless page
This commit is contained in:
@@ -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 < len; i++ ) {
|
return (
|
||||||
var node = nodes[i];
|
<div>
|
||||||
|
<p>You clicked {count} times</p>
|
||||||
if( !node.className ) {
|
<button onClick={() => setCount(count + 1)}>
|
||||||
node.className += ' roll';
|
Click me
|
||||||
}
|
</button>
|
||||||
}
|
</div>
|
||||||
}
|
);
|
||||||
}
|
}
|
||||||
</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 }
|
||||||
|
Reference in New Issue
Block a user