Metadata-Version: 2.4
Name: yaml-lex
Version: 0.2.2
Summary: A corpus-statutes YAML formatter with smart wrapping rules
Requires-Python: >=3.13
Description-Content-Type: text/markdown
Requires-Dist: click>=8.2.1
Requires-Dist: PyYAML>=6.0.3
Requires-Dist: rich>=14.1
Requires-Dist: watchdog>=6.0.0
Provides-Extra: dev
Requires-Dist: jupyter>=1.1.1; extra == "dev"
Requires-Dist: notebook>=7.4.3; extra == "dev"
Requires-Dist: mkdocs>=1.6.1; extra == "dev"
Requires-Dist: mkdocs-material>=9.6.20; extra == "dev"
Requires-Dist: mkdocstrings[python]>=0.30.1; extra == "dev"
Requires-Dist: pytest>=8.4; extra == "dev"
Requires-Dist: pytest-cov>=5.0; extra == "dev"

# YAML Lex Formatter

yaml-lex is a Python tool for reformatting YAML files with specific wrapping rules.

It is designed to make YAML files more readable and maintainable, particularly for content-heavy nodes like content, caption, and title.

## Features

✅ Wraps long strings at a configurable line width
✅ Preserves blank lines and paragraph breaks
✅ Converts long text into block scalars (|-) for YAML readability
✅ Special rules for common keys:
    - `content` → always block scalar unless it contains a Markdown table
    - `caption` / `title` → flattened into single line, then wrapped if too long
    - Other long strings → wrapped into block scalars
✅ Detects and preserves Markdown tables (avoids breaking table formatting)
✅ Works on a single file or recursively on a folder of YAML files
✅ In-place editing or output to a new file

## Notes

- Rich logging using rich.
- Fully compatible with doctest-style examples for testing.
- Supports CI/CD workflows with testing, linting, pre-commit hooks, and docs building.
