Skip to content

feat: replace custom frontmatter parsing with linked-markdown-py#205

Merged
EthanThatOneKid merged 3 commits into
mainfrom
feat/linked-markdown-py
Jul 6, 2026
Merged

feat: replace custom frontmatter parsing with linked-markdown-py#205
EthanThatOneKid merged 3 commits into
mainfrom
feat/linked-markdown-py

Conversation

@EthanThatOneKid

Copy link
Copy Markdown
Collaborator

Summary

Replaces wiki's in-house frontmatter parsing (\src/wiki/parser.py, \src/wiki/document.py) with the canonical reference library \linked-markdown-py\ (wazootech/linked-markdown-py).

Closes #204.

Changes

  • parser.py: \parse_frontmatter()\ now delegates to \linked_markdown_py.extract()\ — supports all LMD spec delimiter variants (---, +++, = yaml =, ---yaml, ---json, ---toml) and formats (YAML, JSON, TOML). Error handling remains backward-compatible (returns \None\ on no frontmatter or parse failure).
  • document.py: \split_frontmatter_text()\ uses LMD for attrs parsing instead of the old \parse_frontmatter()\ function. Text-level split logic (raw ---\ delimiter) unchanged.
  • graph.py: _process_document_file()\ body extraction uses \extract().body\ instead of raw ---\ split, ensuring correct body extraction for all delimiter styles.
  • pyproject.toml: Added \linked-markdown-py\ dependency (git source until published to PyPI). Removed \pyyaml\ as a direct dependency (now transitive through LMD).

Testing

All 518 existing tests pass with zero regressions.

Notes

  • \\pyyaml\\ remains a direct dependency for non-markdown data files (.yaml, .yml) — these are not frontmatter and are not covered by LMD.
  • Once \linked-markdown-py\ is published to PyPI, the [tool.uv.sources]\ override can be removed.
  • The TypeScript NPM wrapper (
    pm/src/) is unchanged — this migration is Python-side only.

Replaces wiki's in-house frontmatter parsing (parser.py, document.py)
with the canonical linked-markdown-py reference library.

- parser.py: parse_frontmatter() delegates to linked_markdown_py.extract()
- document.py: split_frontmatter_text() uses LMD for attrs parsing
- graph.py: body extraction uses extract().body instead of raw --- split
- pyproject.toml: add linked-markdown-py dependency (git source)
- Removed ~50 lines of custom parsing logic

Closes #204
- Module renamed to match PyPI package name (linked-markdown → linked_markdown)
- Add pytest to dev dependencies
@EthanThatOneKid EthanThatOneKid merged commit 6b979f1 into main Jul 6, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace custom frontmatter parsing with linked-markdown-py

1 participant