reveal.js-eliminate-empty-lines
v0.0.6
Published
Webcomponent reveal.js-eliminate-empty-lines following open-wc recommendations
Downloads
5
Readme
reveal.js-eliminate-empty-lines
A Reveal.js plugin to eliminate line breaks in <pre> tags in lines that don't contain anything other than an html tag.
Installation
npm i reveal.js-eliminate-empty-lines
Usage
Add the plugin:
<script type="module">
import RevealEliminateEmptyLines from "reveal.js-eliminate-empty-lines";
import Reveal from "reveal.js";
let deck = new Reveal({
plugins: [RevealEliminateEmptyLines],
});
deck.initialize();
</script>
Now you can write this HTML (much easier to read):
<section>
<pre>
<code class="rust">
<span class="fragment fade-in">
struct Person {
<span class="fragment fade-in">
name: String,
age: u32
</span>
}
</span>
<span class="fragment fade-in">
struct C;
</span>
</code>
</pre>
</section>
And it would be rendered like this:
<section>
<pre><code class="rust"><span class="fragment fade-in visible" data-fragment-index="0">struct Person {
<span class="fragment fade-in visible" data-fragment-index="1"> name: String,
age: u32</span>
}</span>
<span class="fragment fade-in visible current-fragment" data-fragment-index="2">struct C;</span></code></pre>
</section>