An Obsidian plugin that renders your Markdown notes in the visual style of a D&D 5e sourcebook — two-column layout, stat blocks, spell cards, ornate styling, and one-click Print to PDF.
Inspired by Homebrewery, GM Binder, and brewdown.
- D&D Preview Tab — Live preview that updates as you type, rendered in D&D book style inside an isolated iframe
- CSS Editor Tab — Edit your theme CSS live with instant preview; save, switch, and create multiple themes
- Print to PDF — One button opens the Chromium print dialog scoped to just your D&D page
- Two-column layout — Automatic PHB-style two-column page layout
- Stat blocks, spell cards, note boxes — Special markdown syntax (see below)
- Custom themes — Themes are plain
.cssfiles stored in your vault — version them, share them, edit them
This plugin is not yet in the Obsidian Community Plugins directory. Install manually:
- Clone or download this repository into your vault's plugins folder:
<your vault>/.obsidian/plugins/rpg-print/ - In that folder, run:
npm install npm run prepare-assets npm run build
- In Obsidian: Settings → Community Plugins → Installed Plugins → enable RPG Print
- Ribbon — Click the open-book icon for the Preview, or the paintbrush icon for the CSS Editor
- Command palette (
Cmd/Ctrl + P) — Search for "RPG Print"
- Open a Markdown note
- Run "Open RPG Print Preview" — the preview tab appears showing your note styled as a D&D book
- Edit your note — the preview updates within ~300ms
- Run "Open RPG Print CSS Editor" — edit the CSS live; the preview updates immediately
- Click Save in the CSS Editor to write your changes to disk
- Click Print to PDF in the Preview to open the print dialog
All special syntax is processed by brewdown.
\newpage
Starts a new page <div class="page">. Everything after this marker is on a fresh page.
\newcolumn
Forces a column break in the two-column layout.
::: stats
**Armor Class** 13 (leather armor)
**Hit Points** 45 (7d8 + 14)
**Speed** 30 ft.
{abilities: STR=16, DEX=12, CON=14, INT=10, WIS=8, CHA=8}
**Skills** Stealth +3
**Senses** passive Perception 9
**Languages** Common
**Challenge** 1 (200 XP)
:::
The {abilities: ...} line auto-calculates ability score modifiers.
::: stats-wide
...
:::
"""description
This creature lurks in the shadows of ruined temples, feeding on fear.
"""
"""note
**Multiattack.** The creature makes two attacks: one with its bite and one with its claws.
"""
::: classtable
| Level | Proficiency | Features |
|-------|-------------|---------|
| 1st | +2 | Rage |
:::
::: cover
# My Homebrew Compendium
### A Supplement for D&D 5e
:::
Themes are .css files stored in the RPG-Themes/ folder inside your vault (configurable in Settings).
Open the CSS Editor tab and use the dropdown at the top.
Click New Theme in the CSS Editor — it copies your current theme as a starting point.
Edit the CSS directly in the CSS Editor textarea. Changes apply live to the preview. Click Save to write to disk.
The plugin ships a starter theme styled like the D&D 5e Player's Handbook. It uses Cinzel and EB Garamond from Google Fonts — requires an internet connection. For offline use, remove the @import line and rely on system serif fonts.
Settings → RPG Print
| Setting | Default | Description |
|---|---|---|
| Themes folder | RPG-Themes |
Vault-relative path where theme .css files are stored |
| Page size | letter |
letter, a4, or legal |
npm install # Install dependencies
npm run prepare-assets # Base64-inline brewdown images into src/assets/brewdown-base.css
npm run dev # Watch mode — auto-rebuilds on save
npm run build # Production buildAfter npm run dev, reload Obsidian (or use the Hot-Reload plugin) to pick up changes.
src/
main.ts — Plugin entry point
renderer.ts — markdown-it + brewdown integration
theme-manager.ts — Theme file I/O + event bus
settings.ts — Settings tab UI
constants.ts — View type strings, defaults
types.ts — TypeScript interfaces
views/
preview-view.ts — D&D preview (iframe-based)
css-editor-view.ts — CSS editor tab
assets/
brewdown-base.css — Generated: brewdown CSS with images base64-inlined
default-theme.css — Starter PHB-style theme
scripts/
prepare-assets.mjs — One-time asset preparation script
- brewdown by Tom Wolfe — D&D markdown-it rules (MIT)
- Homebrewery — inspiration for styling and layout
- GM Binder — inspiration for the editing workflow