redhat-docs-toc
Skill4 starsChanged 4 months agoApache-2.0View on GitHub
Extract distinct article URLs from Red Hat documentation table of contents pages. Parse the TOC navigation to find all separate documentation articles. Useful for crawling and processing multi-page Red Hat documentation.
- Installs packages
In this repository53 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- action-commentsSkill
- article-extractorSkill
- docs-convert-gdoc-mdSkill
- docs-orchestratorSkill
- docs-review-content-qualitySkill
- docs-review-modular-docsSkill
- docs-review-securitySkill
- docs-review-styleSkill
- docs-review-technicalSkill
- docs-ticket-readinessSkill
- docs-workflow-code-analysisSkill
- docs-workflow-create-jiraSkill
- docs-workflow-create-merge-requestSkill
- docs-workflow-jira-readySkill
- docs-workflow-pipeline-diagnosticsSkill
- docs-workflow-planningSkill
- docs-workflow-pr-analysisSkill
- docs-workflow-quality-gateSkill
- docs-workflow-requirementsSkill
- docs-workflow-scope-req-auditSkill
- docs-workflow-security-reviewSkill
- docs-workflow-startSkill
- docs-workflow-style-reviewSkill
- docs-workflow-tech-reviewSkill
- docs-workflow-writingSkill
- git-pr-readerSkill
- ibm-sg-audience-and-mediumSkill
- ibm-sg-language-and-grammarSkill
- ibm-sg-legal-informationSkill
- ibm-sg-numbers-and-measurementSkill
- ibm-sg-punctuationSkill
- ibm-sg-referencesSkill
- ibm-sg-structure-and-formatSkill
- ibm-sg-technical-elementsSkill
- jira-readerSkill
- jira-writerSkill
- learn-codeSkill
- lint-with-valeSkill
- mdita-writeSkill
- query-codeSkill
- rh-ssg-accessibilitySkill
- rh-ssg-formattingSkill
- rh-ssg-grammar-and-languageSkill
- rh-ssg-gui-and-linksSkill
- rh-ssg-legal-and-supportSkill
- rh-ssg-release-notesSkill
- rh-ssg-structureSkill
- rh-ssg-technical-examplesSkill
- rn-known-issuesSkill
- understand-pull-requestSkill
- validate-plugin-prereqsSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
Filter Duplicates: Remove duplicate URLs and section anchors
- Distinctive: line 140
Automated Testing: Verify all documentation pages are accessible
- Distinctive: line 147
No rate limiting by default (respect Red Hat's robots.txt)
- Very specific: line 151
Only works with Red Hat documentation pages that use <nav id="toc"> structure
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Red Hat Docs TOC Extractor Skill
This skill extracts distinct article URLs from Red Hat documentation table of contents (TOC) pages. It parses the navigation element to find all separate documentation articles, making it easy to process or download entire documentation sections.
Capabilities
- Extract Article URLs: Find all distinct article pages from a docs index
- Parse TOC Navigation: Locate and parse
<nav id="toc">elements - Filter Duplicates: Remove duplicate URLs and section anchors
- Sort Results: Return alphabetically sorted article URLs
- JSON Output: Structured output with article count and URLs
Usage
The skill uses a Python script that downloads and parses Red Hat docs pages.
Basic Usage
Extract article URLs from a docs index:
uv run --script ${CLAUDE_SKILL_DIR}/scripts/toc_extractor.py --url "https://docs.redhat.com/en/documentation/product/version/html/guide/index"Save to file:
uv run --script ${CLAUDE_SKILL_DIR}/scripts/toc_extractor.py --url "https://docs.redhat.com/..." --output articles.jsonList format output:
uv run --script ${CLAUDE_SKILL_DIR}/scripts/toc_extractor.py --url "https://docs.redhat.com/..." --format listCommand Line Options
--url URL: The Red Hat docs URL to extract TOC from (required)--output FILE: Save output to file instead of stdout--format {json,list}: Output format (default: json)
Output Formats
JSON (default):
{
"source_url": "https://docs.redhat.com/...",
"article_count": 3,
"articles": [
"https://docs.redhat.com/.../article1",
"https://docs.redhat.com/.../article2",
"https://docs.redhat.com/.../article3"
]
}List:
https://docs.redhat.com/.../article1
https://docs.redhat.com/.../article2
https://docs.redhat.com/.../article3Examples
OpenShift Lightspeed Configure Documentation
# Extract all articles from the Configure guide
uv run --script ${CLAUDE_SKILL_DIR}/scripts/toc_extractor.py \
--url "https://docs.redhat.com/en/documentation/red_hat_openshift_lightspeed/1.0/html/configure/index"Output:
{
"source_url": "https://docs.redhat.com/en/documentation/red_hat_openshift_lightspeed/1.0/html/configure/index",
"article_count": 3,
"articles": [
"https://docs.redhat.com/en/documentation/red_hat_openshift_lightspeed/1.0/html/configure/legal-notice",
"https://docs.redhat.com/en/documentation/red_hat_openshift_lightspeed/1.0/html/configure/ols-configuring-openshift-lightspeed",
"https://docs.redhat.com/en/documentation/red_hat_openshift_lightspeed/1.0/html/configure/olsconfig-api"
]
}Combined with Article Extractor
Extract TOC URLs then download each article:
# Step 1: Extract article URLs
uv run --script ${CLAUDE_SKILL_DIR}/scripts/toc_extractor.py \
--url "https://docs.redhat.com/.../configure/index" \
--format list > /tmp/articles.txt
# Step 2: Download each article
while read url; do
filename=$(basename "$url").md
uv run --script ${CLAUDE_PLUGIN_ROOT}/skills/article-extractor/scripts/article_extractor.py \
--url "$url" \
--format markdown \
--output "$filename"
done < /tmp/articles.txtDependencies
This skill requires the following Python packages:
requests: For downloading HTML contentbeautifulsoup4: For parsing HTML
Install dependencies:
python3 -m pip install requests beautifulsoup4How It Works
- Download Page: Fetches the HTML from the provided Red Hat docs URL
- Locate TOC: Finds the
<nav id="toc" class="table-of-contents">element - Extract Links: Parses all
<a>tags within the TOC - Filter URLs:
- Removes anchor-only links (
#section) - Removes section fragments (
page#section→page) - Skips index pages
- Converts relative to absolute URLs
- Removes anchor-only links (
- Deduplicate: Removes duplicate URLs
- Sort: Returns alphabetically sorted list
Use Cases
- Documentation Crawling: Get all article URLs for batch processing
- Documentation Archival: Download entire documentation sections
- Content Analysis: Analyze documentation structure and organization
- Automated Testing: Verify all documentation pages are accessible
- Documentation Migration: Extract content for migration to different platforms
Performance
- Single page extraction: ~1-3 seconds depending on network
- Memory efficient: streams HTML parsing
- No rate limiting by default (respect Red Hat's robots.txt)
Limitations
- Only works with Red Hat documentation pages that use
<nav id="toc">structure - Requires the page to be publicly accessible (no authentication support)
- Returns only distinct article pages (not subsections within articles)
- Depends on Red Hat's documentation HTML structure
TOC Structure
Red Hat documentation uses a consistent TOC structure:
<nav id="toc" class="table-of-contents" aria-label="Table of contents">
<ol id="toc-list">
<li class="item chapter">
<a class="link" href="/path/to/article">Article Title</a>
</li>
<li class="item chapter">
<details>
<summary>Chapter Title</summary>
<ol class="sub-nav">
<li class="item sub-chapter">
<a class="link" href="/path/to/subarticle">Subarticle</a>
</li>
</ol>
</details>
</li>
</ol>
</nav>The script extracts all href attributes from links and filters for distinct article pages.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

