New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@codemovie/code-movie-reveal-plugin

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@codemovie/code-movie-reveal-plugin

Reveal plugin for code.movie

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Code.Movie plugin for reveal.js

Integrate animated, syntax highlighted code from Code.Movie into your reveal.js presentations!

What this does

This plugin makes Reveal.js handle each animation keyframe like a fragment. You can navigate through an animated code sample using arrow keys or a remote, just like you would navigate through slides or regular fragments.

How to use

You can install the library as @codemovie/code-movie-reveal-plugin from NPM, download the latest release from GitHub or just grab either index.esm.js or index.js from the source code.

Then create a Reveal.js slide deck and import the plugin just like any other reveal.js plugin:

<!-- Using the plugin as a module -->
<script src="dist/reveal.js"></script>
<script type="module">
  import { CodeMovie } from "./plugin/code-movie/index.esm.js";
  Reveal.initialize({
    hash: true,
    plugins: [CodeMovie]
  });
</script>

<!-- Using the module as a plain script -->
<script src="dist/reveal.js"></script>
<script src="plugin/code-movie/index.esm.js"></script>
<script>
  Reveal.initialize({
    hash: true,
    plugins: [CodeMovie]
  });
</script>

Then either export your Code.Movie project to HTML or get an embed code. Add the exported HTML or the embed code to a slide:

<!-- A slide with the HTML export of a Code.Movie project -->
<section>
  <code-movie-runtime keyframes="0 1 2 3 4 5">
    <!-- Exported HTML content -->
  </code-movie-runtime>
</section>

And that's basically it! You can tweak details like the font size by setting the appropriate attributes on either the <code-movie-runtime> element or the <script> element containing the runtime code.

<!-- Setting the font size on an HTML export -->
<section>
  <code-movie-runtime keyframes="0 1 2 3 4 5" style="font-size:0.375em">
    <!-- Exported HTML content -->
  </code-movie-runtime>
</section>

The plugin bundles the <code-movie-runtime> element, so everything should work out of the box.

How this works

This plugin adds an invisible fragment for each keyframe or each <code-movie-runtime> in the presentation and performs a bit of event handling to tie the animation's state to the current fragment. It is extremely simple and basic :)

FAQs

Package last updated on 07 Dec 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc