3.3.0 • Published 20 days ago

reveal-compiler-explorer v3.3.0

Weekly downloads
56
License
MIT
Repository
github
Last release
20 days ago

reveal-compiler-explorer

npm version npm publish

A Reveal.js plugin for opening code snippets in Compiler Explorer by clicking on them.

Check out the live demo.

For testing presentation code, see reveal-test package.


Installation

  1. Download and install the package in your project:

    npm install --save reveal-compiler-explorer

    or

    yarn add reveal-compiler-explorer

    or just download dist/reveal-compiler-explorer.js into the plugin folder of your reveal.js presentation, e.g.. plugins/reveal-compiler-explorer.

  2. Add the plugins to the dependencies in your presentation

    <script src="node_modules/reveal-compiler-explorer/dist/reveal-compiler-explorer.js"></script>
    // ...
    Reveal.initialize({
      // ...
      plugins: [
          RevealMarkdown,
          RevealCompilerExplorer,
          RevealHighlight,
      ]
    });

    Note that the plugin should come before the highlight plugin.

    If you're using reveal-md you can add a script to load the plugin:

    options.plugins.splice(options.plugins.indexOf(RevealHighlight), 0, RevealCompilerExplorer);

    and then add a reference to this script along with node_modules/reveal-compiler-explorer/dist/reveal-compiler-explorer.js to the scripts object inside reveal-md.json config file.

For reference, take a look at the demo package in this repo.


Configuration

To configure the plugin pass a compilerExplorer object to Reveal.initialize with any of the options from here.

For example

// ...
Reveal.initialize({
  // ...
  plugins: [
    // ...
    RevealCompilerExplorer
    // ...
  ],
  // ...
  compilerExplorer: {
    compiler: "g83",
    runMain: false
  }
});

Directives

In addition to the directives mentioned here, the following directives are supported:

///hide

Hides the following code, until the next ///unhide or end of the snippet, from presentation.

///unhide

Revert code hiding.

The directives will not be shown on the presentation.

3.3.0

20 days ago

3.2.1

27 days ago

3.1.0

1 year ago

3.0.0

2 years ago

2.0.0

2 years ago

1.6.2

3 years ago

1.6.1

3 years ago

1.5.0

3 years ago

1.4.1

3 years ago

1.4.0

3 years ago

1.3.4

3 years ago

1.3.3

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.2

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.1.0

4 years ago

0.0.4

4 years ago

0.0.1

4 years ago