Skip to main content

mkdocs-revealjs

Embed Reveal.js presentations — written in Markdown — directly inside your MkDocs site, with full light / dark theme support.

PyPI License: GPLv3+

Documentation & live demo → https://rod2ik.gitlab.io/mkdocs-revealjs/


What it does

  • Write slides in plain Markdown inside any MkDocs page
  • Presentations render as embedded Reveal.js decks — no separate site needed
  • Horizontal and vertical slide navigation
  • Light / dark themes swap automatically when the MkDocs Material colour scheme toggles — no page reload
  • Three independent theming scopes: Reveal.js visual theme, Highlight.js code theme, Mermaid diagram theme
  • Mermaid diagrams with per-scheme themes (opt-in)
  • Auto-animate code transitions with a simple fence annotation
  • Automatic runtime compatibility with mkdocs-maths-admonitions after slide creation
  • TikZJax compatibility in ordinary slides, admonitions, collapsible details and Material content tabs
  • Fragments, speaker notes, fullscreen, keyboard shortcuts
  • Per-page overrides for every option
  • Import slides from a separate .md file

Quick start

Install

pip install mkdocs-revealjs

Enable in mkdocs.yml

plugins:
  - search
  - revealjs:
      transition: slide
      controls: true

Write a presentation page

---
revealjs:
  presentation: true
---

## Slide 1

Hello world!

---

## Slide 2

- Point A
- Point B

Note: Speaker notes — press **S** to open speaker view.

That page now renders as an embedded Reveal.js presentation. Press F for fullscreen, O for overview, S for speaker view.


Slide syntax

Horizontal separator  →  blank line + --- + blank line
Vertical separator    →  blank line + ---- + blank line
Speaker notes         →  Note: at start of line
End of presentation   →  blank line + ===== + blank line

Content after ===== is rendered as normal MkDocs page content below the presentation (useful for page titles, summaries, etc.).


Theming

Each of the three scopes (theme, highlight, mermaid) supports a three-layer pipeline per scheme:

starter  →  hack (inline CSS overrides)  →  custom (CSS file)
plugins:
  - revealjs:
      theme:
        light: solarized
        dark:  dracula
      highlight:
        light: github
        dark:  github-dark
      mermaid:
        activate: true
        light: sky      # bundled custom theme
        dark:  fire     # bundled custom theme

Custom Mermaid themes

The plugin ships two ready-made Mermaid themes (sky and fire) and auto-discovers any additional theme you add: just drop a file named mermaid-theme-NAME.js into mkdocs_revealjs/themes/ and use NAME in your config. No Python editing required.

Full theming reference → https://rod2ik.gitlab.io/mkdocs-revealjs/documentation/theming/


Mermaid diagrams

mermaid:
  activate: true
  light: sky
  dark:  fire
<div class="mermaid">
flowchart LR
    A[Client] --> B[API] --> C[Database]
</div>

Diagrams re-render on every slide change and on every scheme switch.

Full Mermaid reference → https://rod2ik.gitlab.io/mkdocs-revealjs/documentation/mermaid/


Repository layout

mkdocs-revealjs/
├── src/
│   ├── mkdocs_revealjs/          # Python plugin and packaged assets
│   └── frontend/                 # SCSS sources compiled by Vite
├── site/                         # MkDocs documentation source
├── tests/
├── scripts/
├── dist/                         # generated wheel and source distribution
├── public/                       # generated GitLab Pages artifact
├── package.json                  # sole version source of truth
├── pyproject.toml
└── vite.config.mjs

Documentation

The full documentation lives at https://rod2ik.gitlab.io/mkdocs-revealjs/ and covers:


Development

git clone https://gitlab.com/rod2ik/mkdocs-revealjs
cd mkdocs-revealjs
corepack enable
yarn install
yarn dev

Main workflow commands:

yarn build
yarn build:full
yarn build:full:check
yarn bfc
yarn zip

package.json is the only version source of truth. The generated Python __version__ file and the documentation token __REVEALJS_VERSION__ are synchronized automatically by the build.


License

GNU GPLv3 or later — see LICENSE.

Dynamic MkDocs content inside Reveal.js

Rich MkDocs fragments such as admonitions and content tabs are transported as opaque HTML islands and hydrated only after Reveal.js has initialized. This prevents Reveal's Markdown parser from changing radio groups, labels, nested HTML, executable source blocks or third-party widget markup.

Browser libraries can integrate through the public lifecycle API:

window.MkDocsRevealJS.registerContentAdapter("my-plugin", {
  refresh(root, context) {
    window.MyPlugin?.refresh?.(root, context)
  }
})

See site/docs/documentation/content-lifecycle.md for events and the build-time REVEALJS_MANAGED_PATTERNS compatibility contract.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mkdocs_revealjs-0.8.9.tar.gz (54.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mkdocs_revealjs-0.8.9-py3-none-any.whl (46.5 kB view details)

Uploaded Python 3

File details

Details for the file mkdocs_revealjs-0.8.9.tar.gz.

File metadata

  • Download URL: mkdocs_revealjs-0.8.9.tar.gz
  • Upload date:
  • Size: 54.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for mkdocs_revealjs-0.8.9.tar.gz
Algorithm Hash digest
SHA256 4fb96af08c61c5a5402f6e3c3b3b5227086978f2c36898f7d711f50a4ec5bf5a
MD5 0232d6e8e15378075e25645e81aa53a4
BLAKE2b-256 6c002618c3e23ece22e4baca5b76bbaf0b33b428655555d360029e512621c190

See more details on using hashes here.

File details

Details for the file mkdocs_revealjs-0.8.9-py3-none-any.whl.

File metadata

File hashes

Hashes for mkdocs_revealjs-0.8.9-py3-none-any.whl
Algorithm Hash digest
SHA256 1a6365ac40c1558d4cad663e1cde5143cbbcc84da53e304b945ea5656f438eb3
MD5 04b6af8e3e764119415cdb29b5a5228d
BLAKE2b-256 2e2a638f8969df0e7818f7c560a81f046d741ac3e1fb7c2b51587af2284e9b25

See more details on using hashes here.

Release history Release notifications | RSS feed

0.11.4

2 files

0.11.2

2 files

0.11.1

2 files

0.11.0

2 files

0.10.10

2 files

0.10.8

2 files

0.10.7

2 files

0.10.6

2 files

0.10.5

2 files

0.10.1

2 files

0.10.0

2 files

0.9.7

2 files

0.9.6

2 files

0.9.5

2 files

0.9.4

2 files

0.9.3

2 files

0.9.1

2 files

0.9.0

2 files

This release

0.8.9 This release

2 files

0.8.8

2 files

0.8.7

2 files

0.8.6

2 files

0.8.5

2 files

0.8.4

2 files

0.8.3

2 files

0.8.2

2 files

0.8.1

2 files

0.8.0

2 files

0.7.0

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

1 file

0.0.1

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page