1
0
Fork
You've already forked sigil-markdown
0
CommonMark-style Markdown parser for Sigil
Find a file
David Wilson 20e0de7bae Migrate to 0.9.1 transitive deps with version ranges and lockfile
Replace tag-pinned dependency URLs with version ranges (^0.9.0),
generate sigil.lock for reproducible builds, and update README
to show sigil deps install in the standard build workflow.
2026年04月01日 12:10:58 +03:00
docs docs: Add package documentation for sigil-markdown and sigil-publish 2026年02月19日 21:56:25 +02:00
src/sigil Review and fix procedure specs against CLAUDE.md conventions 2026年02月25日 17:38:49 +02:00
test test(markdown): Add test coverage for sigil-markdown package (Phase 3.3) 2026年02月15日 18:49:15 +02:00
.gitignore Convert to standalone package 2026年03月31日 10:06:34 +03:00
CHANGELOG.md Release v0.7.0 2026年03月01日 15:21:58 +02:00
dev-redirects.sgl Convert to standalone package 2026年03月31日 10:06:34 +03:00
package.sgl Migrate to 0.9.1 transitive deps with version ranges and lockfile 2026年04月01日 12:10:58 +03:00
README.md Migrate to 0.9.1 transitive deps with version ranges and lockfile 2026年04月01日 12:10:58 +03:00
sigil.lock Migrate to 0.9.1 transitive deps with version ranges and lockfile 2026年04月01日 12:10:58 +03:00

sigil-markdown

A CommonMark-style Markdown parser for Sigil with YAML front matter support. Produces SXML output for use with (sigil sxml).

Features

  • CommonMark-style Markdown parsing
  • YAML front matter extraction
  • SXML AST output
  • PEG-based inline parsing

Supported syntax

Element Syntax
Headers # H1 through ###### H6
Paragraphs Blank-line separated text
Code blocks Fenced (```) or indented (4 spaces)
Blockquotes > quoted text
Unordered lists - item, * item, + item
Ordered lists 1. item, 2. item
Horizontal rule ---, ***, ___
Tables `
Inline code `code`
Bold **bold** or __bold__
Italic *italic* or _italic_
Links [text](url)
Images ![alt](src)

Usage

(import (sigil markdown))
;; Parse a Markdown string to SXML
(markdown->sxml "# Hello\n\nWorld")
;; => (document (h1 "Hello") (p "World"))
;; Parse a Markdown file
(markdown-file->sxml "README.md")
;; Front matter is parsed into SXML attributes
(markdown->sxml "---\ntitle: Hello\n---\n\n# Content")
;; => (document (@ (title "Hello")) (h1 "Content"))

API

  • markdown->sxml - Parse a Markdown string to SXML
  • markdown-file->sxml - Parse a Markdown file to SXML
  • parse-front-matter - Extract YAML front matter from text
  • parse-blocks - Lower-level block parser
  • parse-inline - Lower-level inline parser

Dependencies

Development

sigil deps install
sigil build
sigil test

License

BSD-3-Clause