Skip to content

Commit

Permalink
first version of multi-step code highlights
Browse files Browse the repository at this point in the history
  • Loading branch information
hakimel committed Apr 5, 2019
1 parent c636b88 commit 7eb2cec
Show file tree
Hide file tree
Showing 5 changed files with 166 additions and 19 deletions.
10 changes: 10 additions & 0 deletions css/reveal.css
Original file line number Diff line number Diff line change
Expand Up @@ -1456,6 +1456,16 @@ body {
.reveal .hljs[data-line-numbers]:not([data-line-numbers=""]) tr:not(.highlight-line) {
opacity: 0.4; }

.reveal .hljs .highlight-line .hljs-ln-numbers {
font-weight: 600; }

.reveal .hljs:not(:first-child).fragment {
position: absolute;
top: 0;
left: 0;
width: 100%;
box-sizing: border-box; }

/*********************************************
* ROLLING LINKS
*********************************************/
Expand Down
12 changes: 12 additions & 0 deletions css/reveal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1594,6 +1594,18 @@ $controlsArrowAngleActive: 36deg;
opacity: 0.4;
}

.reveal .hljs .highlight-line .hljs-ln-numbers {
font-weight: 600;
}

.reveal .hljs:not(:first-child).fragment {
position: absolute;
top: 0;
left: 0;
width: 100%;
box-sizing: border-box;
}


/*********************************************
* ROLLING LINKS
Expand Down
4 changes: 2 additions & 2 deletions demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ <h2>Iframe Backgrounds</h2>

<section>
<h2>Pretty Code</h2>
<pre><code class="hljs" data-trim data-line-numbers="4,8-11">
<pre><code class="hljs" data-trim data-line-numbers="4|9|4,8-11">
import React, { useState } from 'react';

function Example() {
Expand Down Expand Up @@ -412,7 +412,7 @@ <h1>THE END</h1>
dependencies: [
{ 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/highlight/highlight.js', async: true },
{ src: 'plugin/highlight/highlight.js' },
{ src: 'plugin/search/search.js', async: true },
{ src: 'plugin/zoom-js/zoom.js', async: true },
{ src: 'plugin/notes/notes.js', async: true }
Expand Down
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
dependencies: [
{ src: 'plugin/markdown/marked.js' },
{ src: 'plugin/markdown/markdown.js' },
{ src: 'plugin/notes/notes.js', async: true },
{ src: 'plugin/highlight/highlight.js', async: true }
{ src: 'plugin/highlight/highlight.js' },
{ src: 'plugin/notes/notes.js', async: true }
]
});
</script>
Expand Down
155 changes: 140 additions & 15 deletions plugin/highlight/highlight.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7eb2cec

Please sign in to comment.