Skip to main content

Shared documentation tooling for the Juniper ML platform (markdown link validator with cross-repo and ecosystem-root awareness)

Project description

juniper-doc-tools

Shared documentation tooling for the Juniper ML platform: a markdown link validator with cross-repo and ecosystem-root awareness.

This is the long-term replacement for the standalone scripts/check_doc_links.py script that historically lived in every Juniper repo. See JUNIPER_DOC_TOOLS_PYPI_MIGRATION_PLAN_2026-05-18.md in the parent juniper-ml repo for the design rationale and migration plan.

Install

pip install juniper-doc-tools

No runtime dependencies — pure stdlib.

CLI usage

Two invocation forms are supported:

juniper-check-doc-links \
  --exclude templates --exclude history --exclude legacy \
  --cross-repo skip

# or, equivalently:
python -m juniper_doc_tools \
  --exclude templates --exclude history --exclude legacy \
  --cross-repo skip

Common flags:

Flag Description
--exclude DIR Directory name to exclude from scanning (repeatable).
--cross-repo {skip,warn,check} How to handle cross-repo / ecosystem-root links. check (default) validates them against the filesystem; skip is the typical CI mode.
--strict-repo-boundary Disable ecosystem-root link classification. Links like ../../CLAUDE.md are flagged as "outside repository boundary" instead of being subject to --cross-repo policy. Off by default.
--repo-root PATH Repository root for resolving paths (default: CWD).
-v, --verbose Print every link checked.
--version Print the package version.

Exit codes: 0 if all links valid, 1 if broken links found or arguments are invalid.

Library usage

from pathlib import Path
from juniper_doc_tools import validate_directory

result = validate_directory(
    Path("."),
    exclude_dirs={"templates", "history"},
    cross_repo_mode="skip",
)
if not result.ok:
    for error in result.errors:
        print(error)
    raise SystemExit(1)
print(f"All {result.scanned_files} files OK ({result.cross_repo_skipped} cross-repo links skipped)")

What it validates

For every .md (and .markdown / .rst / .txt) file under the repo root:

  • Relative file links[text](path/to/file.md) — the target must exist on disk.
  • Same-file anchors[text](#some-heading) — the heading must exist in the source file.
  • Cross-repo links../juniper-X/path/in/sibling.md — classified by regex against the known Juniper ecosystem repo set; subject to --cross-repo policy.
  • Ecosystem-root links../../CLAUDE.md, ../../notes/..., etc. — paths into the Juniper parent directory; also subject to --cross-repo policy (unless --strict-repo-boundary is set).

External URLs (http://, https://, mailto:) and embedded images (data:, //) are skipped.

License

MIT. See LICENSE.

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

juniper_doc_tools-0.1.1.tar.gz (17.6 kB view details)

Uploaded Source

Built Distribution

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

juniper_doc_tools-0.1.1-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file juniper_doc_tools-0.1.1.tar.gz.

File metadata

  • Download URL: juniper_doc_tools-0.1.1.tar.gz
  • Upload date:
  • Size: 17.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for juniper_doc_tools-0.1.1.tar.gz
Algorithm Hash digest
SHA256 dee4525b7d3d76f3c381feac975ef87a7cdda6cbd2d96bd8062efffef3b12952
MD5 f0c9b4feae6dec5f06b8e2b85a125f45
BLAKE2b-256 b7955e403ad6de296b6e0ab3666de81aa51c55e68b9841f8d47370538099a8c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for juniper_doc_tools-0.1.1.tar.gz:

Publisher: publish-doc-tools.yml on pcalnon/juniper-ml

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

File details

Details for the file juniper_doc_tools-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for juniper_doc_tools-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0dd910761a213b5e17bda0b83669f36f07a555da0f551619e43bdd2a67c5fb60
MD5 df4812e8663819613abcf839e284497c
BLAKE2b-256 ffbfb97df14858ef6a78c0bd1ffbd242a2e977d934ae1ee09eb0dbe85ea90e28

See more details on using hashes here.

Provenance

The following attestation bundles were made for juniper_doc_tools-0.1.1-py3-none-any.whl:

Publisher: publish-doc-tools.yml on pcalnon/juniper-ml

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