markdown-toc
Generate Table of Contents for Markdown
Manually creating and updating Table of Contents in markdown files is time-consuming and error-prone. This skill automatically generates and updates TOCs by parsing headers, supporting batch processing, configurable depth levels, and smart insertion modes.
下載技能 ZIP
在 Claude 中上傳
前往 設定 → 功能 → 技能 → 上傳技能
開啟並開始使用
測試它
正在使用「markdown-toc」。 python scripts/generate_toc.py README.md
預期結果:
- ## Table of Contents
- - [Installation](#installation)
- - [Usage](#usage)
- - [Basic Usage](#basic-usage)
- - [Advanced Usage](#advanced-usage)
- - [Contributing](#contributing)
正在使用「markdown-toc」。 python scripts/generate_toc.py --no-title docs/guide.md
預期結果:
- - [Getting Started](#getting-started)
- - [Configuration](#configuration)
- - [Troubleshooting](#troubleshooting)
安全審計
安全All 80 static findings are false positives. The 74 external_command detections are documentation code blocks showing bash examples (e.g., `python scripts/generate_toc.py`). The 6 weak_crypto detections are misidentified table formatting patterns. This is a documentation-only skill with no executable code or malicious patterns. Safe for publication.
風險因素
品質評分
你能建構什麼
Update all project documentation
Generate a complete table of contents for all markdown files in a project repository. Perfect for maintaining consistent navigation across large documentation sets.
Create README navigation
Add a clean table of contents to project README files. Helps users quickly navigate to relevant sections without scrolling through entire documents.
Standardize documentation markers
Add consistent TOC markers across multiple documentation files. Ensures uniform structure when building multi-page documentation guides.
試試這些提示
Generate a table of contents for README.md with headers H2 and H3.
Preview the TOC changes without applying them.
Generate a table of contents for all markdown files in the docs/ directory recursively.
Generate a TOC with only H2 headers for the contributing guide, and H2-H4 for the main README.
最佳實務
- Always use --dry-run first to preview changes before applying them
- Use --insert marker mode for precise TOC placement in complex documents
- Set appropriate --max-level to avoid overly detailed TOCs in large files
避免
- Running without preview on important documentation files
- Using deep header levels that create excessively long TOCs
- Forgetting to update TOCs after restructuring documentation
常見問題
What header levels are included by default?
Can I generate a TOC without modifying the file?
How does the auto insertion mode work?
Can I process multiple files at once?
What anchor format is generated?
Is the script portable to other projects?
開發者詳情
作者
Emasoft授權
MIT
儲存庫
https://github.com/Emasoft/ghe-marketplace/tree/main/plugins/marketplace-utils/skills/markdown-toc引用
main
檔案結構
📄 SKILL.md