reveal-ce is a plugin for reveal.js (v4+) that transforms C++ <code> blocks into interactive links to Compiler Explorer, allowing presenters to click code to open it in CE for live compilation and assembly. Current stable version is 1.3.0 (April 2026), with a release cadence of minor updates every few months. Key differentiators: supports hiding regions, setup regions, executor pane mode, regex-based code filtering, and per-block or global configuration of compilers and options. It integrates seamlessly with Highlight plugin and works with ESM modules in modern browsers. Compared to static code snippets, it enables on-the-fly exploration of compiler output and execution results directly from presentations.
npm install reveal-ceNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Installs and configures the reveal-ce plugin with a default compiler, options, and language; then shows a code block that opens in Compiler Explorer on click.
Ensure plugins array is [CompilerExplorer, Highlight] (or CompilerExplorer before any other code-modifying plugin).
Wrap all <code data-ce> blocks in <pre> tags: <pre><code data-ce>...</code></pre>
Use an object with keys as language names: { 'c++': 'g142', rust: 'r1650' }Upgrade to v1.2.0 or later to use data-ce-remove-regex.
Use import syntax and ensure a modern browser or bundler that supports ES modules.
Check reveal.js version; use reveal.js 4.x for guaranteed compatibility.
Use consistent indentation (spaces recommended) within each code block.
Replace require('./reveal-ce/index.js') with import CompilerExplorer from './reveal-ce/index.js'Add CompilerExplorer to plugins array before Highlight: plugins: [CompilerExplorer, Highlight]
Set the ce.baseUrl option in Reveal.initialize if using a self-hosted CE; otherwise ensure code block is not malformed.
Wrap the code block in <pre> tags: <pre><code data-ce>...</code></pre>
Escape HTML entities in code blocks: use < and > for < and >.