reveal.js-eliminate-empty-lines

0.0.6 • Public • Published

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>

Readme

Keywords

none

Package Sidebar

Install

npm i reveal.js-eliminate-empty-lines

Weekly Downloads

0

Version

0.0.6

License

MIT

Unpacked Size

6.36 kB

Total Files

7

Last publish

Collaborators

  • guillem.cordoba