Skip to content

Document how to indent YAML block sequences - #134

Open
user01010111 wants to merge 1 commit into
eyeseast:mainfrom
user01010111:document-yaml-sequence-indentation
Open

Document how to indent YAML block sequences#134
user01010111 wants to merge 1 commit into
eyeseast:mainfrom
user01010111:document-yaml-sequence-indentation

Conversation

@user01010111

Copy link
Copy Markdown

Addresses #115 with a tested recipe using the existing Dumper keyword. It explains why indent=4 alone leaves sequences indentless and why the override must subclass Python's yaml.SafeDumper, including when LibYAML is installed.

The example checks exact indentation and round-trips nested metadata and content. It retains safe serialisation and explains that source formatting is not preserved. No dependencies, formatting defaults or handler APIs change.

Validation: 68 tests passed on Python 3.13 with PyYAML 6.0.3 and LibYAML; mypy and package build passed. The HTML docs build succeeds with the same 12 warnings as the base revision. All eight recipe doctests pass; the full Sphinx doctest run still has the existing API setup failure caused by >>> import frontmatter inside a testsetup block.

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