Skip to content
/ Penemue Public

Converts the content of a JavaScript file to a RunKit URL embedded in an iframe

License

Notifications You must be signed in to change notification settings

kyusu/Penemue

Repository files navigation

Penemue

Node.js CI Coverage Status Libraries.io dependency status for GitHub repo Maintainability Known Vulnerabilities Maintenance GitHub license DeepScan grade

Purpose

Penemue is just a small command-line application which is lets you convert the content of a JavaScript file to a RunKit URL embedded in an iframe. This iframe can then be embedded again into an HTML5 presentation frameworks like reveal.js.

Motivation

While HTML5 presentation frameworks usually have decent to excellent syntax highlighting, I've yet to see one which lets me actually execute the code to show the result. Sometimes having a little play button or something similar would be helpful if during a presentation one wants to show the result of running the code.

RunKit lets me execute my Node.js scripts in the browser which is exactly what I was looking for.

Since I usually save the code for a presentation in separate files, I was looking for a way to easily convert those files into embeddable RunKit URLs.

Usage

Say you have your code for your presentation saved in a file slide1.js with the following content:

console.log('פְּנִימִי');

You can run

$ ls slide1.js | node index.js

and you'll get back the output:

<iframe data-file-name="slide1.js" src="https://runkit.com/e?name=slide1.js&gutterStyle=outside&base64source=Y29uc29sZS5sb2coJ9ek1rDWvNeg1rTXmdee1rTXmScpOwo%3D"></iframe>

This can be then embedded into the HTML5 presentation framework of your choice.

To convert all files in a directory, simply run

$ ls *.js | node index.js

License

MIT

About

Converts the content of a JavaScript file to a RunKit URL embedded in an iframe

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •