/obsidian-pdf-exporter:obsidian-pdf-exporterfrom obsidian-pdf-exporter
Exports Obsidian vaults, folders, and notes to PDF using the ope CLI. Supports redline/diff PDFs between git commits, wiki links, embeds, Mermaid, math, Dataview, Excalidraw, custom templates, and more.
Ships in obsidian-pdf-exporter. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
ope)ope turns a folder of an Obsidian vault into one PDF, and ope redline turns two git commits of that folder into a tracked-changes PDF. It runs on the command line without Obsidian. ope and obsidian-pdf-exporter are the same command. Full docs: https://spenhouet.com/obsidian-pdf-exporter/ (for a page index, read https://spenhouet.com/obsidian-pdf-exporter/llms.txt).
If a flag is not covered here, run ope <command> --help; the help is authoritative.
ope if it is missingif ! command -v ope >/dev/null 2>&1; then
if command -v uv >/dev/null 2>&1; then
uv tool install obsidian-pdf-exporter
elif command -v pipx >/dev/null 2>&1; then
pipx install obsidian-pdf-exporter
else
curl -LsSf uvx.sh/obsidian-pdf-exporter/install.sh | sh # installs uv, then ope
fi
fi
command -v ope >/dev/null 2>&1 || export PATH="$HOME/.local/bin:$PATH"
ope setup --check || ope setup --yes # native libraries (Pango, HarfBuzz) and pandoc
On Windows PowerShell:
powershell -ExecutionPolicy ByPass -c "irm https://uvx.sh/obsidian-pdf-exporter/install.ps1 | iex; ope setup --yes"
ope setup uses the platform package manager (apt, dnf, pacman, zypper, apk, brew, winget) and may need sudo. If it cannot install, report the command it printed to the user instead of working around it. Mermaid diagrams need nothing else: they are drawn by Pele inside ope.
In container-based CI (GitLab CI, Kubernetes, Argo Workflows), use the image ghcr.io/spenhouet/obsidian-pdf-exporter:<version> instead of installing: it has ope, the native libraries, pandoc and git. See https://spenhouet.com/obsidian-pdf-exporter/getting-started/ci/.
ope export ./Vault/Handbook # -> ./.export/Handbook.pdf
ope export ./Vault/Handbook -o out/handbook.pdf \
--title "Team handbook" --subtitle "How we work" --version 1.2.0 --date 2026-04-01
ope export ./Vault/Handbook --include "Part A" --exclude Drafts --no-toc
ope export ./Vault/Handbook --tag security --tag onboarding # only notes with one of the tags
ope export ./Vault/Handbook -O tables.landscape=off -O mermaid.landscape=on
ope export ./Vault/Handbook --disable-plugin dataview
ROOT is a folder. Every subfolder becomes a numbered section, and Folder/Folder.md (the folder note) is its text. ROOT/ROOT.md is the first text. To export a single note, put it in its own folder named like the note.--tag TAG (repeatable, any tag matches) keeps the notes with the tag in the tags property or inline, at any depth, and the folders above them as headings. Case and a leading # do not matter; area matches area/docs but not area-docs. ANDed with --include/--exclude. No matching note: exit 1, no PDF..obsidian, else the git root).--version, a folder in a git repository shows the short commit hash as version.-O keys: toc.depth=1..6 (default 4, bookmarks keep all levels), line_breaks=hard|soft, links.outside=text|italic, footnotes=page|end, mermaid=off, mermaid.config=mermaid.json, mermaid.landscape=on, excalidraw.auto_export=off, citations.bibliography=refs.bib, citations.csl=style.csl, tables.landscape_min_cols=N. List: https://spenhouet.com/obsidian-pdf-exporter/reference/cli/0 ok, 1 export failed, 2 bad arguments (for example an unknown template).Lines starting with Warning: name content that could not be rendered: an embed that was not found, a canvas embed or a PDF that cannot be opened (kept as a link), a plugin code block nobody renders (tasks, ad-note, ...), a Dataview query or DataviewJS script that failed. Warning: Link to note outside the PDF: "Note" ... and Warning: Link to heading outside the PDF: "#heading" ... name a link whose target is not part of the PDF; nothing is missing, the link text is plain text in the PDF (-O links.outside=italic shows it in italics). Report them to the user. All messages: https://spenhouet.com/obsidian-pdf-exporter/reference/warnings/
A headline feature: a PDF of the folder in its newer version with a change summary, inserted text blue and underlined, removed text red and struck through, moved text purple, and a change bar in the margin. -O redline.style=side-by-side shows the old and the new document in two aligned columns, -O redline.collapse=on shows only the changes, --blame (also on ope export) adds author, date and commit message of each block next to the page. Docs: https://spenhouet.com/obsidian-pdf-exporter/redline/
cd Vault # must run inside the git repository that holds ROOT
ope redline ./Handbook --from-commit v1.0.0 --to-commit v1.1.0 # release vs previous release
ope redline ./Handbook --from-commit "$(git merge-base main HEAD)" # branch / pull request vs main
ope redline ./Handbook --from-commit HEAD~3 -o out/handbook_redline.pdf --subtitle "Review draft"
ope redline ./Handbook --from-path ./archive/Handbook # two folders on disk, no git
HEAD~n (not a..b ranges). --to-commit defaults to HEAD. Both sides come from git, so uncommitted changes are not included: commit first. ROOT may also be a single note.ope redline NEW --from-path OLD (not with --from-commit, --to-commit or --blame; each side resolves embeds in its own vault, the closest folder above it with .obsidian): https://spenhouet.com/obsidian-pdf-exporter/redline/compare/#without-git./.export/<title>_redline.pdf; the subtitle is Changes from <from> to <to>, the footer label has the short hashes. Same -T, -O, --title, --tag, --toc/--no-toc, --disable-plugin, --blame, --debug as export (no --version, --date, --include). With --tag, the newer version decides: a note that gained the tag is shown as inserted, one that lost it is left out, a deleted note that had it is shown as deleted.main. In CI, check out with full history (fetch-depth: 0). Workflows for pull requests and releases: https://spenhouet.com/obsidian-pdf-exporter/redline/usage/#in-ci--debug keeps redline_assembled.md (the diffed Markdown) and redline_final.html next to the PDF. Styling (ins, del, div.rl-block, --rl-ins, --rl-del ...): https://spenhouet.com/obsidian-pdf-exporter/redline/styling/ope list-templates
ope export ./Vault/Handbook -T ./brand.css # one CSS file, replaces the default CSS
ope export ./Vault/Handbook -T ./my-template/ # folder with template.yaml
ope export ./Vault/Handbook -T legal-pack # name from ~/.config/obsidian-pdf-exporter/templates/
A folder or CSS-file template replaces default completely, including its header and footer. Start from a copy of default.css:
curl -sL https://raw.githubusercontent.com/Spenhouet/obsidian-pdf-exporter/main/obsidian_pdf_exporter/templates/builtin/default/default.css > my-template/main.css
See references/templates.md for the folder layout, template.yaml keys, header and footer CSS, the classes to style and a Python template that extends default.
Always check the PDF before reporting success:
pdfinfo out/handbook.pdf # page count, page size
pdftotext -layout out/handbook.pdf - | head -80 # text, check headings and values
pdftotext out/handbook.pdf - | grep -n "VIEW\[\|\[\[\|!\[\[\|%%" # leftover raw syntax
pdftoppm -r 60 -png -f 1 -l 2 out/handbook.pdf /tmp/page # look at /tmp/page-1.png
Raw [[...]], ![[...]], VIEW[...] or %% in the text mean something was not resolved. Look at the rendered page images to check layout, header, footer and landscape pages.
ope export ./Vault/Handbook --debug -o out/handbook.pdf
Keeps out/_build_handbook/: assembled.md is what pandoc reads (after all steps and plugins), final.html is what WeasyPrint lays out. Wrong text: check assembled.md. Wrong look: check final.html and the CSS, or open final.html in a browser (it does not show page margins, headers or footers).
CALENDAR is a static month grid.-O dataview.js-timeout=N). Settings come from .obsidian/plugins/dataview/data.json; -O dataview.<setting>=value overrides one, -O dataview.now=2026-04-01 fixes date(today).-O pdf_embeds.max_pages=N, -O pdf_embeds=link).<https://...>.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
npx claudepluginhub spenhouet/obsidian-pdf-exporter --plugin obsidian-pdf-exporter