content: document flatten (flatten.sx) + 10 tests (645/645)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 18s

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-07 04:50:16 +00:00
parent a343f4ea60
commit 687f643d74
6 changed files with 120 additions and 5 deletions

View File

@@ -19,7 +19,7 @@ injected adapter, not core.
## Status (rolling)
`bash lib/content/conformance.sh`**635/635** (Phases 14 COMPLETE + extensions: HTML/SX escaping, Markdown render + import/export incl. tables & frontmatter (full round-trip), CRDT replication, tree-aware validation, snapshot cache, doc metadata, plain-text render, nested block trees + deep tree editing, doc stats, table block, HTML page wrapper + SEO page, doc composition + id-remap, portable data + wire serialization, block query + transforms + find/replace, TOC + anchored headings + outline, normalization)
`bash lib/content/conformance.sh`**645/645** (Phases 14 COMPLETE + ~28 extensions: HTML/SX escaping, Markdown render + import/export incl. tables & frontmatter (full round-trip), CRDT replication, tree-aware validation, snapshot cache, doc metadata, plain-text render, nested block trees + deep editing + flatten, doc stats, table block, HTML page wrapper + SEO page, doc composition + id-remap, portable data + wire serialization, block query + transforms + find/replace, TOC + anchored headings + outline, normalization)
## Ground rules
@@ -99,6 +99,7 @@ lib/content/api.sx ── (content/edit) (content/render) (content/history) ─
- [x] TOC rendering (`toc.sx`: content/toc-markdown + toc-html from headings)
- [x] anchored-heading render (`anchor.sx`: content/html-anchored, functional TOC links)
- [x] document outline (`outline.sx`: content/outline, nested heading tree)
- [x] document flatten (`flatten.sx`: content/flatten, un-nest sections; inverse of wrap-section)
- [x] document normalization (`normalize.sx`: content/normalize, drop empty blocks/sections)
- [x] global find/replace (`find-replace.sx`: content/find-replace across text-bearing blocks)
- [x] portable data serialization (`data.sx`: content/to-data + from-data, round-trips tree)
@@ -106,6 +107,11 @@ lib/content/api.sx ── (content/edit) (content/render) (content/history) ─
## Progress log
- 2026-06-07 — Extension: document flatten (`flatten.sx`). `content/flatten`
un-nests a sectioned doc into a flat block sequence (each section replaced
inline by its recursively-flattened children, wrapper dropped) — the inverse of
content/wrap-section, for flat export targets. Inline tree handling; immutable.
10 tests; suite 645/645.
- 2026-06-07 — Extension: nested document outline (`outline.sx`).
`content/outline` builds a hierarchical heading tree from content/headings —
each node `{:id :text :level :children}`, headings nesting under the nearest