reveal-compiler-explorer v3.3.0
reveal-compiler-explorer
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
Download and install the package in your project:
npm install --save reveal-compiler-exploreror
yarn add reveal-compiler-exploreror just download dist/reveal-compiler-explorer.js into the plugin folder of your reveal.js presentation, e.g..
plugins/reveal-compiler-explorer.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.jsto thescriptsobject insidereveal-md.jsonconfig 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.
12 months ago
12 months ago
12 months ago
12 months ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago