0.1.0 • Published 4 years ago

@karuga/unified-slides v0.1.0

Weekly downloads
1
License
ISC
Repository
-
Last release
4 years ago

JavaScript library / npm script to convert markdown files to HTML presentations; based on unified.js and reveal.js

installation

npm install @karuga/unified-slides

running from the command line

simple slides

slide separator: --- (hr)

in.md:

this is slide 1

---

this is slide 2

- list item 1
- list item 2
- list item 3

build via:

npx @karuga/unified-slides -- in.md --output out.html

sectioned slides

section separator: h1

slide separator: h2

in.md:

# section 1

slide 1.0 content

## slide 1.1

slide 1.1 content

# section 2

slide 2.0 content

build via:

npx @karuga/unified-slides -- in.md --output out.html --use @karuga/rehype-slides=preset:"headings_compact"

using from JavaScript

const unifiedSlides = require("./index.js");
const fs = require("fs");

const main = async () => {
  const result = await unifiedSlides.process("# slide 1\n\n---\n\n# slide 2");
  await fs.writeFileSync("slides.html", result.toString());
};

main();