Skip to main content

CLI-first Markdown structure checker for repositories

Project description

docguard

CLI-first Markdown structure checker for repositories.

Docguard helps teams keep documentation from growing too large, becoming unreachable from index files, or drifting away from expected document types such as ADRs.

Quick start

Install from PyPI as docguard-structure. The CLI command remains docguard. This is not the unrelated docguard-cli package. Use uv add docguard-structure, then run uv run docguard --summary. Existing uv users can upgrade with uv add --upgrade docguard-structure; see Update an existing uv install. Equivalent with pip: pip install docguard-structure. Git-based install: usage guide — Install from Git.

Run docguard init for a starter [tool.docguard] snippet, or use the strict baseline without configuration. Full install commands, configuration, pytest integration, and exit codes: usage guide. To adopt docguard in another repository, see Use in another repository.

docguard --summary

What this tool checks

Docguard focuses on document structure and repository health. Prose style checks DG-STYLE001 and DG-STYLE002 flag decorative strong emphasis, conversational phrasing, and parenthetical asides in body text. DG-STYLE003 flags forbidden documentation expressions in headings, prose, and table headers. These checks are not a general Markdown formatter.

With no configuration, docguard applies the strict baseline: scan README.md, CONTEXT.md, and docs; require reachability from README.md; enforce 300-line documents, 120-line sections, and a 20-line floor for untyped non-index documents; and fail duplicate guidance plus prose and documentation style diagnostics as errors. Any relaxation from that baseline must be recorded in [[tool.docguard.relaxations]] with a reason.

Phase What you can check Diagnostics Typical default
Core Document and section size; stub detection; typed document shape; index reachability; prose and documentation style DG-SIZE001, DG-SIZE002, DG-SIZE003, DG-FORMAT001, DG-FORMAT003, DG-ORG003, DG-STYLE001, DG-STYLE002, DG-STYLE003 strict baseline, error
Phase 2 Link structure between files: orphans and hub dead ends DG-ORG001, DG-ORG002 opt-in, warning
Phase 3 Structure inside each file: mixed roles and heading level skips DG-SPLIT001, DG-FORMAT002 opt-in, warning
Duplicate guidance Repeated commands, list guidance, or prose paragraphs across the scan scope; headings and paragraphs opt-in DG-SPLIT002 strict baseline, error

Phase 2 details: organization rules. Phase 3 and duplicate guidance details: structure rules. Prose style details: prose style rules. To adopt docguard in another repository, see Use in another repository.

Development

Requires Python 3.11+ and uv on PATH:

uv pip install -e ".[dev]"
uv run pytest
uv run docguard README.md CONTEXT.md docs/ --summary

Documentation

Status

Alpha release with Trove classifier Development Status :: 3 - Alpha. Configuration keys, diagnostic JSON fields, and rule defaults may change; breaking changes are recorded in CHANGELOG.md. Exit codes and existing diagnostic meanings are preserved where practical.

Docguard uses a strict baseline by default. Relaxations require [[tool.docguard.relaxations]] entries with reasons. Release readiness is documented in docs/release-readiness.md.

Repository navigation

Relative links for clone checkouts and docguard reachability checks:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

docguard_structure-0.4.0.tar.gz (63.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

docguard_structure-0.4.0-py3-none-any.whl (43.7 kB view details)

Uploaded Python 3

File details

Details for the file docguard_structure-0.4.0.tar.gz.

File metadata

  • Download URL: docguard_structure-0.4.0.tar.gz
  • Upload date:
  • Size: 63.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for docguard_structure-0.4.0.tar.gz
Algorithm Hash digest
SHA256 7eff90b5a649c09e13b83aef81938c69771227c7d99cb571dfad1a35945d7e69
MD5 bbbfdcf629ab45a32d2ac3c97dd083fa
BLAKE2b-256 77fb79160ad829f6e40399209cc66df00886a0d327321d0ec4513ea94b670889

See more details on using hashes here.

Provenance

The following attestation bundles were made for docguard_structure-0.4.0.tar.gz:

Publisher: publish.yml on takuto-NA/docguard

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file docguard_structure-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for docguard_structure-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eb24bbc6e6d9b8b38b1b5802d26969d3036bbb5ada08fcee87ae3f8cca5175da
MD5 cbfd212618ee545257fb3aa9dfa859d4
BLAKE2b-256 618cf555fa1fd22c3217f50da52b518322c17e846f80a0d6bccd33de15205347

See more details on using hashes here.

Provenance

The following attestation bundles were made for docguard_structure-0.4.0-py3-none-any.whl:

Publisher: publish.yml on takuto-NA/docguard

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page