Module
linting
Content linting for Patitas — a ruff-for-Markdown over the typed AST.
Lint rules are stateless objects implementing theLintRuleprotocol.
Each receives one immutableLintContext(the parsed Document, the raw
source, and a precomputed document-order node sequence) and yields
Diagnostic objects that reuse the existing SourceLocation.
The headline entrypoint islint(), which accepts either a Markdown string
(parsed internally) or a pre-parsed Document plus its raw source.
Thread Safety:
Rules are stateless and the runner is created fresh per `lint`() call,
so one `Linter` (or one `LintRuleRegistry`) is safe to share
across threads.
Example:
>>> from patitas import lint, Diagnostic
>>> from patitas.linting import LintRule, Severity, LintContext, LintRuleRegistryBuilder
>>> diags = lint("# Title\n\n### Skipped ")
>>> sorted({d.rule_id for d in diags})
['heading-increment', 'trailing-whitespace']