Skip to content

Implement initial LMD Core parser#1

Merged
EthanThatOneKid merged 11 commits into
mainfrom
initial-lmd-core
Jul 6, 2026
Merged

Implement initial LMD Core parser#1
EthanThatOneKid merged 11 commits into
mainfrom
initial-lmd-core

Conversation

@EthanThatOneKid

Copy link
Copy Markdown
Contributor

Summary

  • add uv/hatchling Python package configuration
  • implement Pydantic document/link models, frontmatter parsing, link extraction, and RDFLib helpers
  • add pytest conformance harness against the shared spec submodule
  • add CI for uv run pytest

Tests

  • uv run pytest

…al, fix test harness

- Rewrite _extract_frontmatter to support all LMD format markers:
  ---, ---yaml, ---json, ---toml, +++, = yaml =, = json =, = toml =
- Auto-detect JSON vs YAML for plain --- delimiter
- Add extract() public API that returns raw attrs + frontMatter + body
- Remove mandatory @id and @type guards (missing is valid per spec)
- Strip UTF-8 BOM before parsing
- Catch JSON/YAML/TOML parse errors and wrap as LMD_INVALID_FRONTMATTER
- Fix test harness: properly test extract() against conformance suite
…MarkdownError

- Remove rdf.py, links.py, types.py (over-engineering)
- Remove parse() and all helper functions
- Rename LmdError to LinkedMarkdownError (matches TS naming)
- Strip pydantic and rdflib dependencies from pyproject.toml
- Update README API example
- Python: rdflib dev dep, 5 tests proving extract() attrs load into Graph
- TypeScript: 5 tests using jsonld.toRDF() proving attrs produce valid quads
- No changes to distributed src/ — tests only
- Add ruff dev dependency and config (select E/F/I/N/W, line-length 100)
- Remove unused pytest import in test_rdf.py
- Auto-format parser.py
- Add ruff check + ruff format --check to CI
- Keep our CI (ruff + workflow_dispatch) and .gitignore
- Merge pyproject.toml: main's uv_build/structure + our ruff/rdflib/ruff dev deps
- Merge README.md: main's badges + our simplified API example
- Keep main's errors.py/extract.py/ExtractResult dataclass
- Update test_rdf.py to use .attrs (dataclass) instead of ['attrs'] (dict)
- Regenerate uv.lock after dependency resolution
@EthanThatOneKid EthanThatOneKid merged commit 44a6fd0 into main Jul 6, 2026
1 check passed
@EthanThatOneKid EthanThatOneKid deleted the initial-lmd-core branch July 6, 2026 05:22
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.

1 participant