You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
📝 docs: add section deletion cookbook and cross-link section ops
Documents the section::filter_sections() + section::collect() pattern
for deleting a Markdown section by heading, which had no example in
docs/ or the processing-markdown skill despite being achievable with
existing built-ins.
mq -I raw 'identity()' data.json # Disable auto-parse
44
44
```
45
45
46
+
## Section Operations
47
+
48
+
Split/filter a document into sections by heading, then flatten back to Markdown with `section::collect()`. Needs all document nodes: use `-A` or pipe through `nodes`.
49
+
50
+
```bash
51
+
mq -A 'section::section("Installation")' README.md # Extract section by title
52
+
mq -A 'section::section("Installation") | section::bodies() | first()' README.md # Section body only (no header)
53
+
mq -A 'section::sections() | section::by_level(2)' README.md # h2 sections only
54
+
mq -A 'section::sections() | section::toc()' README.md # Table of contents
55
+
mq -A 'section::filter_sections(fn(s): section::title(s) != "Deprecated";) | section::collect()' README.md # Delete a section by heading
56
+
```
57
+
58
+
See [example.md](../../docs/books/src/start/example.md) for the full section reference (import/include forms, `-A` vs `nodes`, more filters).
0 commit comments