presentable

Easily create formatted code snippets for presentations


License
ISC
Install
npm install presentable@0.3.1

Documentation

Presentable

Easily create formatted code snippets for presentations.

Installation

npm install --global presentable

Alternatively, prefix the below command with npx --yes.

Usage

presentable \
  --font 'JetBrains Mono' \
  --style 'stackoverflow-light' \
  path/to/snippets/*.js

would create an image (test-1.png) like:

Image of a formatted code sample

along with the HTML (test-1.html) used to render the image.

Arguments

As well as a positional list of files to process, the CLI accepts the following flags:

  • --background/-b: whether to include the background (default: true)
  • --font/-f: the name of a font on Google Fonts to use (default: undefined, accept the UI's default)
  • --output/-o: the directory to output to (default: "output/")
  • --style/-s: the Highlight.js style to use (default: "default") - you can preview these here
  • --width/-w: the target print width (default: 50, a reasonable fit for half a slide)

Snippets

If a file contains folding regions, e.g.:

// ... imports and setup

//#region: snippet
console.log("this is my example");
//#endregion

the code from each region is extracted and saved into a separate file.