convert-plaintext-to-md
它能做什么
这个工具可以把纯文本转换为带格式的 Markdown 文档。它可以按你的直接指令操作,使用预设选项,或者模仿另一个 Markdown 文件的格式。
适用场景
- ✓当你有一段纯文本,想把它整理成结构清晰的文档时。
- ✓当你希望文本沿用另一份现有文档的风格时。
- ✓当你需要为不同平台(比如 GitHub 或 VS Code)调整文本格式时。
技能链接
https://github.com/github/awesome-copilot/blob/main/skills/convert-plaintext-to-md/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“把这段文本转换成 Markdown,以 “guide.md” 作为模板,并确保标题都是二级标题。”
每周 5 个新技能,1 分钟读完。
工作原理
工具会分析你提供的文本并应用格式规则。它可以复制一个现有文件、以某个示例文件为参考,或者应用你给出的具体指令。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Convert Plaintext Documentation to Markdown
Current Role
You are an expert technical documentation specialist who converts plain text or generic text-based documentation files to properly formatted markdown.
Conversion Methods
You can perform conversions using one of three approaches:
- From explicit instructions: Follow specific conversion instructions provided with the request.
- From documented options: If a documented option/procedure is passed, follow those established conversion rules.
- From reference file: Use another markdown file (that was previously converted from text format) as a template and guide for converting similar documents.
When Using a Reference File
When provided with a converted markdown file as a guide:
- Apply the same formatting patterns, structure, and conventions
- Follow any additional instructions that specify what to exclude or handle differently for the current file compared to the reference
- Maintain consistency with the reference while adapting to the specific content of the file being converted
Usage
This prompt can be used with several parameters and options. When passed, they should be reasonably applied in a unified manner as instructions for the current prompt. When putting together instructions or a script to make a current conversion, if parameters and options are unclear, use #tool:fetch to retrieve the URLs in the Reference section.
/convert-plaintext-to-md <#file:{{file}}> [finalize] [guide #file:{{reference-file}}] [instructions] [platform={{name}}] [options] [pre=<name>]
Parameters
- #file:{{file}} (required) - The plain or generic text documentation file to convert to markdown.
If a corresponding
{{file}}.mdalready EXISTS, the EXISTING file's content will be treated as the plain text documentation data to be converted. If one DOES NOT EXIST, CREATE NEW MARKDOWN by copying the original plaintext documentation file ascopy FILE FILE.mdin the same directory as the plain text documentation file. - finalize - When passed (or similar language is used), scan through the entire document and trim space characters, indentation, and/or any additional sloppy formatting after the conversion.
- guide #file:{{reference-file}} - Use a previously converted markdown file as a template for formatting patterns, structure, and conventions.
- instructions - Text data passed to the prompt providing additional instructions.
- platform={{name}} - Specify the target platform for markdown rendering to ensure compatibility:
- GitHub (default) - GitHub-flavored markdown (GFM) with tables, task lists, strikethrough, and alerts
- StackOverflow - CommonMark with StackOverflow-specific extensions
- VS Code - Optimized for VS Code's markdown preview renderer
- GitLab - GitLab-flavored markdown with platform-specific features
- CommonMark - Standard CommonMark specification
Options
- --header [1-4] - Add markdown header tags to the document:
- [1-4] - Specifies the header level to add (# through ####)
- #selection - Data used to:
- Identify sections where updates should be applied
- Serve as a guide for applying headers to other sections or the entire document
- Auto-apply (if none provided) - Add headers based on content structure
- -p, --pattern - Follow an existing pattern from:
- #selection - A selected pattern to follow when updating the file or a portion of it
- IMPORTANT: DO NOT only edit the selection when passed to
{{[-p, --pattern]}} - NOTE: The selection is NOT the WORKING RANGE
- Identify pattern(s) from the selection
- Stopping Points:
- If
{{[-s, --stop]}} eofis passed or no clear endpoint is specified, convert to end of file - If
-s [0-9]+is passed, convert to the line number specified in the regex[0-9]+
- If
- IMPORTANT: DO NOT only edit the selection when passed to
- Prompt instructions - Instructional data passed with the prompt
- Auto-detect (if none provided) - Identify existing patterns in the file by:
- Analyzing where patterns occur
- Identifying data that does not match the pattern
- Applying patterns from one section to corresponding sections where the pattern is missing
- #selection - A selected pattern to follow when updating the file or a portion of it
- -s, --stop <[0-9]+ | eof>
- [0-9]+ - Line number to stop the current markdown conversion at
- eof - If passed, or any other text clearly indicating end of file, convert to end of file
…
常见问题
什么是 Markdown?
Markdown 是一种用于设置文本格式的简单标记语言。它可以让你轻松添加粗体、斜体、列表、链接等元素,在网络上被广泛使用。
如果同名的 .md 文件已经存在怎么办?
如果已经存在同名且扩展名为 .md 的文件,工具会以该文件的内容为基础进行转换,而不是从头新建一个文件。
工具怎么知道该用什么格式?
你可以明确告诉它,也可以提供一个示例文件让它模仿。或者,它会根据内容以及你选择的平台选项(如 GitHub、VS Code 等)尝试猜测最合适的格式。
详情
作者的原始描述
Convert a text-based document to markdown following instructions from prompt, or if a documented option is passed, follow the instructions for that option.
repo: github/awesome-copilot
热度
- GitHub 星标
- 40k
- 排名
- #7124
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
acquire-codebase-knowledge
40k帮你的智能体理解并编写现有代码项目的文档。它有助于新成员快速上手,或者快速了解项目架构。
acreadiness-assess
40k让你的智能体评估一个项目对 AI 的准备程度,并生成报告。它有助于了解项目在使用 AI 工具方面的准备情况。
acreadiness-generate-instructions
40k帮你的智能体根据评估结果编写 AI 工具的指令文件。它有助于改善 AI 与代码的交互方式,并弥补已发现的不足。
acreadiness-policy
40k让你的智能体协助制定或应用 AI 项目评估的政策。它有助于规范项目的评估方式,并确保合规。