开源文档转换工具Pandoc的使用(创建Agent Skill)
Pandoc 是一个由 John MacFarlane 开发的通用文档转换工具,可以支持几十种不同的格式文档之间的相互转换。
Pandoc 可以从以下格式转换:
- Markdown (包括多种变体): `markdown`, `commonmark`, `gfm`, `commonmark_x`
- 文档格式: `docx`, `odt`, `epub`, `html`, `latex`, `texinfo`, `docbook`, `jats`
- 文本标记: `asciidoc`, `textile`, `mediawiki`, `dokuwiki`, `creole`, `org`, `rst`
- 笔记: `jupyter` (ipynb), `t2t`
- 演示文稿: `opml`
- 引用管理: `bibtex`, `biblatex`, `csljson`, `endnotexml`
- 数据格式: `csv`, `tsv`, `json`, `yaml`
- 其他: `fb2`, `haddock`, `typst`, `vimwiki`, `zimwiki`, `djot`
Pandoc 可以转换为以下格式:
- 文档格式: `docx`, `odt`, `epub`, `epub3`, `fb2`, `pdf`, `html`, `html5`, `latex`, `beamer`, `context`, `man`, `ms`, `plain`, `typst`
- 网页格式: `chunkedhtml`, `dzslides`, `revealjs`, `s5`, `slidy`, `slideous`
- 标记语言: `markdown`, `asciidoc`, `textile`, `mediawiki`, `dokuwiki`, `org`, `rst`, `vimwiki`, `zimwiki`, `creole`, `t2t`, `djot`
- 文档结构: `docbook`, `jats`, `opendocument`, `texinfo`, `opml`
- 数据格式: `csljson`, `bibtex`, `biblatex`, `json`, `yaml`
- 引用格式: `nroff`, `markdown_mmd`, `markdown_phpextra`, `markdown_strict`
官方资源
- [Pandoc 官方网站](https://pandoc.org)
- [用户手册](https://pandoc.org/MANUAL.html)
- [安装指南](https://pandoc.org/installing.html)
- [在线试用](https://pandoc.org/app)
- [GitHub 仓库](https://github.com/jgm/pandoc)
- [讨论组](https://groups.google.com/forum/#!forum/pandoc-discuss)
- [常见问题](https://pandoc.org/FAQ.html)
至于如何使用,你不必记住复杂的编程命令,只需要创建一个Pandoc技能就行了。具体操作方法如下:
在支持Agent Skill的工具(比如阶跃AI桌面助手、CodeBuddy、Trae、Claude Code等)中安装repo2skill技能:https://github.com/zhangyanxs/repo2skill
(文章:开源发布 | Repo2Skill:让你的 OpenCode 像“吸星大法”一样吞噬开源项目)
在AI对话框或者终端命令行中输入指令:请使用repo2skill技能,帮我把这个开源工具https://github.com/jgm/pandoc打包成一个Skill,技能名称为Pandoc。
接着,你就可以在AI对话框或者终端命令行使用Pandoc技能了。比如输入指令:请使用Pandoc技能将某某Markdown文件转换为Word文件进行另存。
期待WPS AI早日引入Agent Skill功能!
WPS社区反馈员