content: Markdown render mode (asMarkdown) + 20 tests (263/263)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 45s

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-07 01:13:44 +00:00
parent 9c1c8f6b75
commit 4fb4b04b21
7 changed files with 154 additions and 6 deletions

View File

@@ -49,7 +49,8 @@
(if (content/op? ops) (doc-apply doc ops) (doc-apply-all doc ops))))
;; ── render boundary ──
;; fmt is "html"/"sx" (or :html/:sx — keywords evaluate to their name).
;; fmt is "html"/"sx"/"md" (or :html/:sx/:md — keywords evaluate to their name).
;; "md" needs markdown.sx loaded.
(define
content/render
(fn
@@ -57,6 +58,8 @@
(cond
((= fmt "html") (asHTML doc))
((= fmt "sx") (asSx doc))
((= fmt "md") (asMarkdown doc))
((= fmt "markdown") (asMarkdown doc))
(else (error (str "unknown render format: " fmt))))))
(define content/html asHTML)