Skip to content

Explicit list syntax (_ul / _ol); bare lists become paragraphs - #6

Merged
connorferster merged 1 commit into
mainfrom
features/explicit-list-syntax
Aug 13, 2026
Merged

Explicit list syntax (_ul / _ol); bare lists become paragraphs#6
connorferster merged 1 commit into
mainfrom
features/explicit-list-syntax

Conversation

@connorferster

Copy link
Copy Markdown
Contributor

Resolves the structural ambiguity where a YAML list under a heading meant either "several paragraphs" or "a bulleted list" depending on its contents.

Changes

  • A bare list is now always a sequence of content items: strings → paragraphs, mappings → subsections. It is never auto-bulleted. This fixes the bug where a single wrapped paragraph under a heading rendered as a one-item bullet.
  • Bullets/numbers are explicit via new _ul / _ol constructs, intercepted structurally in build_story (not registry blocks) so they compose with scoped text styles when those branches merge.
  • Implicit detection (string-list → bullets, integer-keyed mapping → numbers) retired from dispatch; the check functions remain.
  • convert_ol accepts a list (positional numbering, nesting) as well as a mapping (back-compat).

Breaking change

Pre-1.0 content break: documents relying on bare lists for bullets, or integer-keyed mappings for numbering, must adopt _ul / _ol. Migrates the test-data reports, all Examples, and the docs.

Testing

26 tests pass, incl. new tests/test_explicit_lists.py. Rendered checks confirm bullets/numbers/nesting appear and that previously mis-bulleted prose now renders as paragraphs.

Design doc: design/explicit-list-syntax.md.

Merge notes

Branched off main. Recommended to merge before features/scoped-text-styles (per intended order). Overlaps with the scoped-text-styles branch in story_builder.py / content_converters.py; expect a conflict on whichever merges second — the design doc notes where current_style threads into the _ul/_ol interception.

🤖 Generated with Claude Code

Resolve the structural ambiguity where a YAML list under a heading meant
either "several paragraphs" or "a bulleted list" depending on its contents.

- A bare list is now always a sequence of content items: strings become
  paragraphs, mappings become subsections. It is never auto-bulleted.
- Bullets and numbers are explicit: the new `_ul` and `_ol` constructs,
  intercepted structurally in build_story (not registry blocks) so they can
  compose with scoped text styles when those branches merge.
- The implicit detections (list-of-strings -> bullets, integer-keyed mapping
  -> numbered list) are retired from dispatch; the check functions remain.
- convert_ol accepts a list (positional numbering, nested lists nest) as well
  as a mapping (back-compat).

This is a breaking content change (pre-1.0): existing documents relying on
bare lists for bullets, or integer-keyed mappings for numbering, must adopt
_ul / _ol. Migrates the test-data reports, all Examples, and the docs
(document-structure, blocks reference); adds a design doc and tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@connorferster
connorferster merged commit 6e67be9 into main Aug 13, 2026
1 check passed
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.

2 participants