Skip to main content

MkDocs plugin to embed Reveal.js presentations with Markdown syntax

Project description

mkdocs-revealjs

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

PyPI License: MIT

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
  • 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/
├── mkdocs_revealjs/
│   ├── plugin.py                 ← all plugin logic
│   ├── assets/                   ← compiled CSS + JS
│   └── themes/                   ← custom Mermaid theme JS files
│       ├── mermaid-theme-sky.js
│       └── mermaid-theme-fire.js
├── docs/                         ← full documentation source
├── examplesite/                  ← demo MkDocs site
├── pyproject.toml
├── package.json
└── gulpfile.js

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
pip install -e ".[dev]" --break-system-packages
corepack enable && yarn install && yarn build
cd examplesite && mkdocs serve

License

MIT — see LICENSE.

Project details


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.1.tar.gz (52.7 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.1-py3-none-any.whl (53.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mkdocs_revealjs-0.8.1.tar.gz
  • Upload date:
  • Size: 52.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for mkdocs_revealjs-0.8.1.tar.gz
Algorithm Hash digest
SHA256 7d45a7581b9a1752de5605c8d079f10d3a25275fc786546b077ab7dce201c0d8
MD5 6239f7ac1f49197e676d2297fa1fcaa1
BLAKE2b-256 0cac08350dfff8ae965ac9bf7eb0ca642036a8f3b4699cd82700e878cc79fa36

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mkdocs_revealjs-0.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 005e8a0d73d5a753980ce26a94e440afae3ec8233ab4db81a5a02f9a9023082e
MD5 e33a2b418c1d461edf765a88e5eac9d8
BLAKE2b-256 c99c60864ca4b87308c17f7967b7a820c7dd8496dcefe95c3e805b9c99b30592

See more details on using hashes here.

Supported by

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