Stage 1: Vault Operations¶
obsidian_export.pipeline.stage1_vault
¶
Stage 1: Vault operations — frontmatter, embed resolution, Obsidian syntax stripping.
EmbedContext
dataclass
¶
Immutable context for recursive embed resolution.
Source code in obsidian_export/pipeline/stage1_vault.py
parse_frontmatter
¶
Extract YAML frontmatter. Returns (metadata_dict, body_text).
Source code in obsidian_export/pipeline/stage1_vault.py
clean_frontmatter
¶
Strip Obsidian-only keys; convert tags list to keywords string for Pandoc.
Source code in obsidian_export/pipeline/stage1_vault.py
resolve_embeds
¶
Recursively resolve ![[embed]] blocks with cycle detection.
- Text embeds: resolved inline (with depth cap)
- Section embeds (![[note#Heading]]): extract section
- Image embeds (extensions in IMAGE_EXTENSIONS): converted to
refs
- Missing embeds: raise EmbedNotFoundError
- Circular embeds: raise CircularEmbedError
Source code in obsidian_export/pipeline/stage1_vault.py
strip_leading_title
¶
Remove the first h1 heading if it matches the document title.
Source code in obsidian_export/pipeline/stage1_vault.py
strip_obsidian_syntax
¶
Remove/simplify Obsidian-specific syntax for export.
- ![[embed]] → removed (use resolve_embeds first for inline resolution)
- [[Entity|Display]] → Display
- [[Entity]] → Entity
-
Relations section → removed with all content below¶
Callout syntax (> [!type]) is preserved for downstream processing by stage2.