Skip to content

✨ feat(section): improve section module with bodies, by_level, and auto-expand#1488

Merged
harehare merged 3 commits intomainfrom
feat/section-module-improvements
Mar 24, 2026
Merged

✨ feat(section): improve section module with bodies, by_level, and auto-expand#1488
harehare merged 3 commits intomainfrom
feat/section-module-improvements

Conversation

@harehare
Copy link
Copy Markdown
Owner

  • Add body() / bodies() for extracting section content without header
  • Add by_level(sections, l) to filter sections by heading level (scalar or range)
  • Add section(md_nodes, pattern) shorthand for sections | title_contains
  • Auto-expand section dicts to Markdown nodes in CLI output (no collect() needed)
  • Add collect_markdown_nodes, expand_typed_dict, runtime_value_to_nodes in cli.rs
  • Add integration tests for auto-expand, no-match empty output, and bodies pipe
  • Add module tests for section pattern, no-match, bodies, and by_level variants
  • Update example.md with -A flag, import+nodes, include, and code usage patterns
  • Update README.md with section usage examples including by_level range pattern

#1480

…to-expand

- Add `body()` / `bodies()` for extracting section content without header
- Add `by_level(sections, l)` to filter sections by heading level (scalar or range)
- Add `section(md_nodes, pattern)` shorthand for sections | title_contains
- Auto-expand section dicts to Markdown nodes in CLI output (no collect() needed)
- Add `collect_markdown_nodes`, `expand_typed_dict`, `runtime_value_to_nodes` in cli.rs
- Add integration tests for auto-expand, no-match empty output, and bodies pipe
- Add module tests for section pattern, no-match, bodies, and by_level variants
- Update example.md with -A flag, import+nodes, include, and code usage patterns
- Update README.md with section usage examples including by_level range pattern
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 24, 2026

Merging this PR will not alter performance

✅ 29 untouched benchmarks


Comparing feat/section-module-improvements (6647e68) with main (689dd0d)

Open in CodSpeed

Add `is_typed_dict()` helper that checks if a dict is expandable
without doing the actual node expansion. Replace the `expand_typed_dict().is_some()`
call in `has_expandable` detection with the lighter-weight check.
@harehare harehare merged commit edc228e into main Mar 24, 2026
6 checks passed
@harehare harehare deleted the feat/section-module-improvements branch March 24, 2026 05:41
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