# Redhat Docs Toc

> 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.

- **Type:** Skill
- **Install:** `agentstack add skill-opendatahub-io-docs-skills-redhat-docs-toc`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [opendatahub-io](https://agentstack.voostack.com/s/opendatahub-io)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [opendatahub-io](https://github.com/opendatahub-io)
- **Source:** https://github.com/opendatahub-io/docs-skills/tree/main/skills/redhat-docs-toc

## Install

```sh
agentstack add skill-opendatahub-io-docs-skills-redhat-docs-toc
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# 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 `` 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:**
```bash
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:**
```bash
uv run --script ${CLAUDE_SKILL_DIR}/scripts/toc_extractor.py --url "https://docs.redhat.com/..." --output articles.json
```

**List format output:**
```bash
uv run --script ${CLAUDE_SKILL_DIR}/scripts/toc_extractor.py --url "https://docs.redhat.com/..." --format list
```

### Command 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):**
```json
{
  "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/.../article3
```

## Examples

### OpenShift Lightspeed Configure Documentation
```bash
# 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:
```json
{
  "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:

```bash
# 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 ` element
3. **Extract Links**: Parses all `` tags within the TOC
4. **Filter URLs**:
   - Removes anchor-only links (`#section`)
   - Removes section fragments (`page#section` → `page`)
   - Skips index pages
   - Converts relative to absolute URLs
5. **Deduplicate**: Removes duplicate URLs
6. **Sort**: Returns alphabetically sorted list

## Use Cases

1. **Documentation Crawling**: Get all article URLs for batch processing
2. **Documentation Archival**: Download entire documentation sections
3. **Content Analysis**: Analyze documentation structure and organization
4. **Automated Testing**: Verify all documentation pages are accessible
5. **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 `` 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:

```html

  
    
      Article Title
    
    
      
        Chapter Title
        
          
            Subarticle
          
        
      
    
  

```

The script extracts all `href` attributes from links and filters for distinct article pages.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [opendatahub-io](https://github.com/opendatahub-io)
- **Source:** [opendatahub-io/docs-skills](https://github.com/opendatahub-io/docs-skills)
- **License:** Apache-2.0

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-opendatahub-io-docs-skills-redhat-docs-toc
- Seller: https://agentstack.voostack.com/s/opendatahub-io
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
