スキル一覧に戻る
tolgaio

obsidian-pdf-export

by tolgaio

My Personal AI System

0🍴 0📅 2025年12月30日
GitHubで見るManusで実行

SKILL.md


Obsidian PDF Export

Export Obsidian markdown notes to professionally formatted PDFs using Docker-based Pandoc/LaTeX.

When to Use This Skill

Activate when the user:

  • Wants to "export notes to PDF" or "generate PDF from notes"
  • Asks to "create a PDF" from their Obsidian vault
  • Needs to export a folder of notes as a combined document
  • Wants printable versions of their notes with working navigation
  • Requests specific PDF dimensions (A4, Letter, custom sizes)

Features

  • Single & Batch Export: Export one note or combine multiple notes into a single PDF
  • Clickable Internal Links: [[wikilinks]] become clickable anchors within the PDF
  • Auto-Generated TOC: Table of contents at the beginning based on headings
  • PDF Bookmarks: Sidebar navigation in PDF readers
  • Configurable Dimensions: A4, Letter, Legal, or custom width x height
  • Growth Stage Badges: Preserves seedling/sapling/evergreen indicators

Prerequisites

Docker (Required)

The skill uses a Docker container with Pandoc and LaTeX. Build the image first:

cd /home/tolga/src/tolgaio/neo/skills/obsidian-pdf-export/docker
docker build -t obsidian-pdf-export .

Python Dependencies

For running preprocessing outside Docker:

pip install PyYAML

Usage

Single Note Export

# Basic export (A4, default margins)
bash scripts/export.sh /path/to/note.md

# With output path
bash scripts/export.sh /path/to/note.md output.pdf

# Custom page size and margins
bash scripts/export.sh --page-size letter --margin 1.5in note.md

# Without table of contents
bash scripts/export.sh --no-toc note.md

Batch Export

# Export all notes in a folder
bash scripts/export.sh --batch "1_Projects/myproject/*.md" project-docs.pdf

# With custom ordering (file lists note paths)
bash scripts/export.sh --batch --order order.txt "*.md" combined.pdf

CLI Options

OptionValuesDefaultDescription
--presetnomad, remarkable, kindle, a4, letter(none)Device preset (sets page-size & margin)
--page-sizea4, letter, legal, WxHa4Page dimensions
--marginCSS units (1in, 2cm)1inPage margins
--top-marginCSS units(same as margin)Top margin override
--bottom-marginCSS units(same as margin)Bottom margin override
--toc-depth1-63Heading levels in TOC
--no-tocflag(toc enabled)Disable table of contents
--batchflagfalseCombine multiple notes
--orderfile path(none)Custom note ordering for batch
--titletextfrom frontmatterOverride PDF title
--vaultpath$BRAIN_HOMEPath to Obsidian vault

Device Presets

PresetDevicePage SizeMargin
nomadSupernote Nomad (1404x1872 @ 300 PPI)4.7" x 6.2"0.3in
remarkablereMarkable 2 (1404x1872 @ 226 PPI)6.2" x 8.3"0.4in
kindleKindle Paperwhite3.5" x 5.5"0.2in
a4Standard A4 paperA41in
letterUS Letter paperLetter1in

How It Works

Processing Pipeline

┌─────────────────┐    ┌────────────────────┐    ┌──────────────────┐
│  Input Notes    │ -> │  Preprocess        │ -> │  Docker/Pandoc   │
│  (markdown)     │    │  (resolve links)   │    │  (LaTeX → PDF)   │
└─────────────────┘    └────────────────────┘    └──────────────────┘
InputSingle ModeBatch Mode
[[note]]"note" (text)[note](#note) (clickable)
[[note|Display]]"Display"[Display](#note)
[[note#heading]]"note"[note](#note-heading)
[text](https://...)preservedpreserved
![[image.png]]![](image.png)![](image.png)

In batch mode, wikilinks to notes included in the export become clickable anchors that jump to that section. Links to notes NOT in the export become plain text.

TOC and Bookmarks

  • Table of Contents: Auto-generated from H1-H3 headings (configurable with --toc-depth)
  • PDF Bookmarks: Sidebar navigation automatically created from headings
  • Page Numbers: Added to footer

File Structure

obsidian-pdf-export/
├── SKILL.md                    # This file
├── scripts/
│   ├── preprocess.py           # Wikilink resolution
│   ├── merge_notes.py          # Batch: combine notes
│   └── export.sh               # Main orchestration
├── docker/
│   ├── Dockerfile              # pandoc/latex image
│   └── templates/
│       └── obsidian.latex      # PDF styling
└── references/
    └── page-sizes.md           # Dimension reference

Examples

Example 1: Export a Project README

# User: "Export my homelab project notes to PDF"
bash scripts/export.sh 1_Projects/Homelab/README.md ~/Desktop/homelab-docs.pdf

Example 2: Create a Book from Multiple Notes

# User: "Combine all my psychology notes into one PDF"
bash scripts/export.sh --batch --page-size 6x9 --title "Psychology Notes" \
    "3_Resources/Psychology/*.md" psychology-collection.pdf

Example 3: Letter-Size with Wide Margins

# User: "Export for US Letter paper with room for annotations"
bash scripts/export.sh --page-size letter --margin 1.5in note.md

Example 4: Export for Supernote Nomad

# User: "Create a PDF for my Nomad" or "Export notes for nomad"
bash scripts/export.sh --batch --preset nomad --title "My Notes" \
    "1_Projects/MyProject/*.md" notes-for-nomad.pdf

Example 5: Export for reMarkable

# User: "Export for reMarkable tablet"
bash scripts/export.sh --preset remarkable note.md

Troubleshooting

Docker Image Not Found

Build the image first:

cd /home/tolga/src/tolgaio/neo/skills/obsidian-pdf-export/docker
docker build -t obsidian-pdf-export .

Links to notes not in the vault appear in the broken_links output. In single mode, all wikilinks become plain text. In batch mode, only links to included notes become clickable.

Images Not Appearing

Ensure images are in the vault and use standard paths. The script copies images to a temp directory for Docker access.

LaTeX Errors

Usually caused by special characters. The preprocessor escapes most, but unusual Unicode may cause issues. Check the console output for specific errors.

Technical Details

Docker Image

Based on pandoc/latex:3.1 with:

  • XeLaTeX PDF engine (Unicode support)
  • Python 3 + PyYAML
  • LaTeX packages: bookmark, hyperref, geometry, fancyhdr, tocloft

LaTeX Template

Custom template (docker/templates/obsidian.latex) provides:

  • Obsidian-inspired purple link colors
  • Clean heading hierarchy
  • Automatic PDF bookmarks
  • Configurable geometry

Resources

  • scripts/preprocess.py - Wikilink parsing and anchor generation
  • scripts/merge_notes.py - Batch note merging with page breaks
  • scripts/export.sh - Main CLI orchestration
  • references/page-sizes.md - Standard page dimension reference

スコア

総合スコア

50/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です