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.0.tar.gz (17.1 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.0-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: juniper_doc_tools-0.1.0.tar.gz
  • Upload date:
  • Size: 17.1 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.0.tar.gz
Algorithm Hash digest
SHA256 750827804a0042a207fa6e587bc7baa28d86326660e91a6689b54077dcf5c76a
MD5 7f140b4bbae9273a47b4fcc1f0fe2186
BLAKE2b-256 1c872e3f080540b519b571105ba247b61a01c99ee3db743d2ec7c7069373e11b

See more details on using hashes here.

Provenance

The following attestation bundles were made for juniper_doc_tools-0.1.0.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.0-py3-none-any.whl.

File metadata

File hashes

Hashes for juniper_doc_tools-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 75602c0dbfdead0f97a037a85338fa06050cbdbfa8fa03d5723ade635a821737
MD5 ca6d2702ea16f6ba8bbd8b2563080c66
BLAKE2b-256 90464743282ea862a16caefb9004ddc64e61476cd9238c1b089d32823c2414af

See more details on using hashes here.

Provenance

The following attestation bundles were made for juniper_doc_tools-0.1.0-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