Markdown Stripper
Documentsmarkdown_stripperMarkdown Stripper is an Agent Skill for documents published in the cas-bigdatalab/piflow repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Markdown标记清除工具。读取Markdown文件,去除Markdown语法标记(标题#、加粗**、斜体*、链接[]()、代码块```、引用>、列表标记等),输出纯文本文件。 当用户提到Markdown清洗、去除MD标记、MD转纯文本等需求时使用此skill。 适用于Markdown文件的语法净化,不负责CSV/表格数据的结构清洗。
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/cas-bigdatalab/piflow/blob/HEAD/workspace/skills/markdown_stripper/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/markdown-stripper, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
markdown_stripper Markdown标记清除Skill
功能概述
读取 Markdown / 纯文本 文件,去除所有 Markdown 语法标记,输出纯文本。
去除的 12 类标记:(1) 标题 #;(2) 加粗 **;(3) 斜体 *;(4) 删除线 ~~;(5) 链接 []();(6) 图片 ![]();(7) 行内代码 `;(8) 围栏代码块 ``` ```;(9) 引用 >;(10) 列表 -/1.;(11) 水平线 ---;(12) 表格 |...|。
触发条件
- Markdown 清洗
- 去除 Markdown 标记
- MD 转纯文本
- 语料净化
输入文件格式
支持以下纯文本格式:
- Markdown (.md)
- 纯文本 (.txt)
不支持 .csv / .tsv / .jsonl 等结构化数据文件。会将不支持的扩展名直接拒绝。
使用方法
python scripts/markdown_stripper.py \
--input_path input.md \
--output_path output.txt
核心参数说明
必需参数
| 参数 | 说明 |
|---|---|
--input_path | 输入 Markdown 文件路径 |
--output_path | 输出纯文本文件路径 |
可选参数
| 参数 | 说明 | 默认 |
|---|---|---|
--no_code_blocks | 删除代码块内容 | 保留 |
--no_images | 删除图片 alt 文本 | 保留 |
--no_tables | 删除表格内容 | 转为纯文本 |
输出示例
[OK] Markdown标记清除完成 -> output.txt
keep_code_blocks=True, keep_images=True, keep_tables=False
环境要求
使用项目 Python 环境运行,无额外依赖。
注意事项
- 处理顺序:先保护代码块 → 处理行级标记 → 处理行内标记 → 恢复代码块
- 代码块默认保留内容(仅去除围栏标记),用
--no_code_blocks可完全删除 - 表格默认转为空格连接的纯文本
- 不支持 .csv / .tsv / .jsonl 等结构化数据文件,会将不支持的扩展名直接拒绝