Release review
One Markdown file. A document in the docs route, a deck in the talk route.
No export step
- The deck is a React component
- The notes ship in the DOM, hidden
Ship it
Questions?
First, what this doesn't do. Marp and Slidev
export decks to PDF, PNG and PPTX from the command line, and
reveal.js prints to PDF from the browser.
@react-markdown-kit/slides has no command line. It writes PPTX through its /pptx
entry and prints to PDF from the browser, but if a file is the whole point, one of
those three is probably less work.
What it does is turn Markdown your React app already renders into a deck, on the same
page and through the same <Markdown> component. You don't need a second toolchain or a
second copy of the content, and there's no separate static site to deploy next to your
app.
npm install @react-markdown-kit/renderer @react-markdown-kit/slidesimport Markdown, { defineMarkdownPreset } from '@react-markdown-kit/renderer'
import { slides } from '@react-markdown-kit/slides/present'
import '@react-markdown-kit/slides/styles.css'
const preset = defineMarkdownPreset({ extensions: [slides()] })
<div className="rmk-document">
<Markdown preset={preset}>{deck}</Markdown>
</div>| Marp | Slidev | reveal.js | @react-markdown-kit/slides | |
|---|---|---|---|---|
| Runs as | a CLI, a VS Code extension, a bundled HTML file | a Vite dev server and a built single-page app | a page you host | a component in a React tree you already have |
| Deck source | Markdown, --- breaks, directives in HTML comments | Markdown, --- breaks, per-slide front matter, Vue components | HTML sections, or Markdown through its plugin | the same Markdown file, --- breaks, ??? notes, -- fragments (DIALECT.md) |
| Export | HTML, PDF, PPTX, PNG (Marp CLI) | PDF, PNG, PPTX (exporting) | print to PDF (PDF export) | browser print, one slide per page (90-print.css); PPTX from the /pptx entry (pptx.test.ts) |
| Present mode | presenter view in the editor and the CLI preview | presenter mode with notes (UI) | speaker view plugin | present mode, presenter view with a timer, overview, drawing, cross-window sync (present.dom.test.tsx, present-features.dom.test.tsx) |
| Server rendering | a build step writes the HTML | a build step writes the HTML | the page ships the deck | the deck is built from the parsed tree, so a server component emits it (same suite) |
| Styling | a theme is a CSS file of Marp's classes | UnoCSS and Vue components | a theme is a CSS file of reveal's classes | data attributes and --rmk-slide-* properties, no class from the kit (extension.test.tsx) |
| Editing | your editor, with a preview | your editor, with hot reload | your editor | the same file, plus a rich editor with four deck commands (editor-toolbar.test.tsx) |
Each entry in the last column links to the test or file it comes from.
The deck below isn't a screenshot. It was rendered when this page was built, by the same renderer that draws this paragraph. Click Present and use the arrow keys to move through it.
| Marp | Here |
|---|---|
--- between slides | the same, at the root of the document |
<!-- _class: lead --> on one slide | <!-- class: center, middle -->, one directive per comment |
<!-- theme: gaia --> | a stylesheet of yours, set through --rmk-slide-* properties |
| notes in an HTML comment | a paragraph that is exactly ???, then the notes |
fragments from the list marker, * for bullets and ) for ordered lists (fragmented list) | a paragraph that is exactly -- between the blocks to reveal |
background images through  | <!-- background: … -->, run through the renderer's URL policy |
paginate: true, footer: … | the same keys, in the front matter or as a comment on one slide |
| front matter for the whole deck | front matter for the whole deck: title, aspect, and the default of any deck-wide directive (class, background, layout, transition, footer, paginate, incremental) |
The dialect is written out in DIALECT.md and on the slides page. If the plugin doesn't accept a construct, it reports a diagnostic with the source range instead of silently dropping it.
javascript: background loses its src the
same as any other URL in the document
(extension.test.tsx), under
the same security model as the rest of your content.slide-<name> ids, the deck doesn't emit any
class, inline style or id, so your stylesheet doesn't need anything from the kit.The slides demo · The demo without its chrome, for an iframe · Markdown presentations in React · @react-markdown-kit/slides on npm · The renderer · Security model
Last updated on