Scans the Juneau source tree for links to documentation topics (https://juneau.apache.org/docs/topics/<slug>">Title</a>) and reports any whose slug does not exist whose #anchor suffix names no heading in the target page, or whose link text differs from the topic‘s title (or, for an anchored link, from its anchor’s heading text).
title or slug, to find the Javadoc and source links that now point at the old name.build-docs.py runs it in its Links stage.verify-docs.py instead.python3 scripts/check-topic-links.py python3 scripts/check-topic-links.py --juneau-root ~/git/apache/juneau
| Option | Argument | Default | Meaning |
|---|---|---|---|
--docs-root | directory | parent of the scripts/ folder | The docs checkout whose pages/topics define the valid slugs and titles. |
--juneau-root | directory | $JUNEAU_ROOT, then ../master, then ../juneau next to the docs root | Juneau source checkout to scan. Must contain pom.xml when given explicitly. |
juneau_root.find_juneau_root (exits 1 if none is found).pages/topics/*.md except README.md and records slug and title from the frontmatter, plus the page's headings (extract_topic_info) as a map of heading id to heading text: an explicit {#id} or the generated Docusaurus id, ignoring code fences. Pages missing either one produce a warning line.find_topic_links), skipping dot-directories and target, node_modules, build, dist and scripts, and reads .java, .md, .xml, .properties, .txt, .adoc and .rst files. In Markdown files, code blocks and inline code are removed first.https://juneau.apache.org/docs/topics/<slug>">Title</a> and compares each hit with the topic table (check_links): an unknown slug is UNKNOWN SLUG, a different title is TITLE MISMATCH. A slug may end in #anchor: the slug part is resolved first, and an anchor that is not a heading id of that page is MISSING ANCHOR (a separate category; an unknown slug with an anchor stays UNKNOWN SLUG). A link whose anchor resolves may read either the page title or that anchor's heading text (backticks removed); a plain-slug link must read the page title.Stdout only: a line per topic found, counts, and the findings. Nothing is written.
| Code | Meaning |
|---|---|
| 0 | The scan completed, with or without warnings (Warnings are informational only and do not fail the build). |
| 1 | No topics were found in the docs, or the Juneau checkout could not be located. |
<a id> tags....topics/<slug>">Title</a> form are checked.scripts directory of the scanned tree is skipped, so links inside Juneau's own scripts are not checked.verify-docs.py, build-docs.py, juneau_root.py (checkout lookup)pages/developer-info/04.03.06.ScriptCheckTopicLinks.md)