markdown-tools

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Markdown Tools

Markdown工具

Process, transform, and analyze markdown documents.
处理、转换和分析Markdown文档。

Quick Start

快速开始

bash
/job/.pi/skills/markdown-tools/markdown.js toc README.md
bash
/job/.pi/skills/markdown-tools/markdown.js toc README.md

Usage

使用方法

Generate Table of Contents

生成目录

bash
/job/.pi/skills/markdown-tools/markdown.js toc <file.md>
bash
/job/.pi/skills/markdown-tools/markdown.js toc <file.md>

Convert to HTML

转换为HTML

bash
/job/.pi/skills/markdown-tools/markdown.js html <file.md> <output.html>
bash
/job/.pi/skills/markdown-tools/markdown.js html <file.md> <output.html>

Extract Headings

提取标题

bash
/job/.pi/skills/markdown-tools/markdown.js headings <file.md>
bash
/job/.pi/skills/markdown-tools/markdown.js headings <file.md>

Extract Links

提取链接

bash
/job/.pi/skills/markdown-tools/markdown.js links <file.md>
bash
/job/.pi/skills/markdown-tools/markdown.js links <file.md>

Word Count

字数统计

bash
/job/.pi/skills/markdown-tools/markdown.js count <file.md>
bash
/job/.pi/skills/markdown-tools/markdown.js count <file.md>

Check Broken Links

检查失效链接

bash
/job/.pi/skills/markdown-tools/markdown.js check-links <file.md>
bash
/job/.pi/skills/markdown-tools/markdown.js check-links <file.md>

Strip Markdown

移除Markdown格式

bash
/job/.pi/skills/markdown-tools/markdown.js strip <file.md>
bash
/job/.pi/skills/markdown-tools/markdown.js strip <file.md>

Commands

命令说明

CommandDescription
toc
Generate table of contents
html
Convert to HTML
headings
Extract heading hierarchy
links
List all links
check-links
Verify internal links exist
count
Word/character count
strip
Remove markdown formatting
命令描述
toc
生成目录
html
转换为HTML
headings
提取标题层级
links
列出所有链接
check-links
验证内部链接是否存在
count
单词/字符统计
strip
移除Markdown格式

Output Formats

输出格式

  • toc: Markdown formatted list with anchor links
  • html: Valid HTML document
  • headings: JSON array of heading objects
  • links: JSON array of link objects
  • check-links: Report of valid/broken links
  • count: JSON with stats
  • toc: 带锚点链接的Markdown格式列表
  • html: 有效的HTML文档
  • headings: 标题对象的JSON数组
  • links: 链接对象的JSON数组
  • check-links: 有效/失效链接的报告
  • count: 包含统计数据的JSON

Examples

示例

bash
undefined
bash
undefined

Generate TOC for README

为README生成目录

/job/.pi/skills/markdown-tools/markdown.js toc README.md
/job/.pi/skills/markdown-tools/markdown.js toc README.md

Convert to HTML

转换为HTML

/job/.pi/skills/markdown-tools/markdown.js html article.md article.html
/job/.pi/skills/markdown-tools/markdown.js html article.md article.html

Extract all headings

提取所有标题

/job/.pi/skills/markdown-tools/markdown.js headings docs.md
/job/.pi/skills/markdown-tools/markdown.js headings docs.md

Check for broken internal links

检查内部失效链接

/job/.pi/skills/markdown-tools/markdown.js check-links README.md
/job/.pi/skills/markdown-tools/markdown.js check-links README.md

Get word count

获取字数统计

/job/.pi/skills/markdown-tools/markdown.js count blog-post.md
/job/.pi/skills/markdown-tools/markdown.js count blog-post.md

Strip formatting (get plain text)

移除格式(获取纯文本)

/job/.pi/skills/markdown-tools/markdown.js strip notes.md
undefined
/job/.pi/skills/markdown-tools/markdown.js strip notes.md
undefined

Table of Contents Format

目录格式

markdown
undefined
markdown
undefined

Table of Contents

Table of Contents

When to Use

使用场景

  • Processing documentation files
  • Generating README table of contents
  • Converting markdown to HTML
  • Validating documentation links
  • Analyzing markdown content structure
  • 处理文档文件
  • 生成README目录
  • 将Markdown转换为HTML
  • 验证文档链接
  • 分析Markdown内容结构