← 返回 Skills 市场
liuwei1125

pandoc-convert

作者 Liuwei1125 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
56
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install pandoc-convert-pro
功能描述
Use when the user needs to convert documents between formats with Pandoc, including Markdown, DOCX, PDF, HTML, EPUB, LaTeX, Typst, RST, AsciiDoc, Org, ODT, R...
使用说明 (SKILL.md)

Pandoc Convert

Convert documents with Pandoc while keeping conversions predictable, validated, and easy to troubleshoot. Prefer the bundled wrappers for user-facing work because they add dependency checks, safer defaults, progress output, retries, and reports.

Quick Decision

  • Use scripts/convert.sh when the user gives one input file or asks for one output.
  • Use scripts/batch_convert.py when the user gives a directory, multiple files, a glob, or says “批量 / batch”.
  • Use scripts/validate.sh when the user asks whether a document is ready to convert or when a conversion needs citations, templates, CSS, resources, or PDF output.
  • Use scripts/install_pandoc.sh only when the user explicitly asks to install Pandoc or fix a missing Pandoc dependency.
  • If the target is PDF, mention that Pandoc needs a PDF engine. For Chinese documents, prefer --pdf-engine xelatex when available.

Installation Policy

Do not silently install Pandoc during conversion. If Pandoc is missing, report the validation error and ask whether the user wants installation help.

Run the installer in dry-run mode first unless the user explicitly requested installation:

bash ${CLAUDE_SKILL_DIR}/scripts/install_pandoc.sh

Only run installation with explicit user approval:

bash ${CLAUDE_SKILL_DIR}/scripts/install_pandoc.sh --yes

The installer detects existing pandoc, Homebrew, Conda, apt-get, dnf, or pacman, then prints or runs the recommended command. It does not install PDF engines such as xelatex; handle PDF engine setup separately.

Single File Workflow

  1. Confirm the input file exists and infer the requested output format.
  2. If the output path is missing, suggest a default beside the input file, for example README.mdREADME.docx.
  3. Run the wrapper from the skill directory:
bash ${CLAUDE_SKILL_DIR}/scripts/convert.sh input.md -o output.docx
bash ${CLAUDE_SKILL_DIR}/scripts/convert.sh input.md -o output.pdf --pdf-engine xelatex --toc
bash ${CLAUDE_SKILL_DIR}/scripts/convert.sh input.md -o output.pdf --citeproc --bibliography refs.bib --csl style.csl
  1. Report the generated file path. If the command fails, show the actionable error and recommend the smallest fix.

Batch Workflow

Use the Python batch wrapper for retries, fault tolerance, progress, and reports:

python3 ${CLAUDE_SKILL_DIR}/scripts/batch_convert.py docs --output-dir out --to docx
python3 ${CLAUDE_SKILL_DIR}/scripts/batch_convert.py docs --output-dir out --to pdf --pdf-engine xelatex --retries 2
python3 ${CLAUDE_SKILL_DIR}/scripts/batch_convert.py docs --output-dir out --to html --continue-on-error --report out/report.md --json-report out/report.json

Batch behavior:

  • Preserves relative paths: docs/a/b.md becomes out/a/b.pdf.
  • Skips hidden directories, .git, node_modules, dist, build, target, and the output directory.
  • Shows progress like [3/28] converting docs/a.md -> out/a.pdf.
  • Retries failed files with --retries N and --retry-delay SEC.
  • Continues after failures by default, unless --fail-fast is passed.
  • Summarizes success, failure, and skipped counts and can write Markdown/JSON reports.

If any files fail, never say the whole batch succeeded. List failed files, report paths, and a retry command.

Common Options

Need Option
Input format override --from markdown, --from gfm, --from docx
Output format override --to html, --to docx, --to pdf, --to epub
Standalone document --standalone or -s
Table of contents --toc --toc-depth 3
Numbered sections --number-sections
Citations --citeproc --bibliography refs.bib --csl style.csl
DOCX style --reference-doc reference.docx
HTML/LaTeX template --template template.html or --template template.tex
HTML/EPUB CSS --css style.css
PDF engine --pdf-engine xelatex
Images/resources --resource-path .:assets:images
Extract DOCX media --extract-media media

Format Notes

Load references/formats.md when format support or extension mapping matters. Load references/workflows.md for step-by-step conversion recipes. Load references/troubleshooting.md when a conversion fails.

Best Practices

  • Prefer Markdown plus YAML frontmatter as the source of truth; treat DOCX/PDF/EPUB as generated outputs.
  • Validate citations, templates, and resource paths before long conversions.
  • For batch conversion, start with a small sample before converting a large directory.
  • For PDF, choose the engine explicitly when output quality matters.
  • For Word styling, use a Pandoc-generated reference.docx as the base for custom styles.

Common Mistakes

  • Running Markdown→PDF without a PDF engine installed.
  • Using pdflatex for Chinese text; use xelatex instead.
  • Converting DOCX→Markdown without --extract-media, which loses embedded images.
  • Forgetting --resource-path when Markdown references images in sibling directories.
  • Claiming a batch succeeded when only some files converted.
安全使用建议
Before installing, be aware that Pandoc may need to be installed even though the registry does not list it as a required binary. Review any package-manager command before approving installation, and choose conversion input/output paths carefully, especially for batch jobs.
功能分析
Type: OpenClaw Skill Name: pandoc-convert-pro Version: 1.0.0 The skill bundle provides a comprehensive and well-structured set of wrappers for Pandoc document conversion. It includes robust input validation (validate.sh), a safe installation helper (install_pandoc.sh) that requires explicit user consent before modifying the system, and a Python-based batch processor (batch_convert.py). No evidence of data exfiltration, malicious execution, or prompt injection was found; the code logic is strictly aligned with the stated purpose of document format conversion.
能力评估
Purpose & Capability
The skill purpose, instructions, and visible scripts align around converting user-selected documents with Pandoc, including batch conversion. The supplied batch_convert.py content is truncated in the review input, which limits confidence in the file tail.
Instruction Scope
The instructions are user-directed and explicitly say not to silently install Pandoc; installation requires explicit approval.
Install Mechanism
There is no install spec and the registry lists no required binaries, but the skill may require Pandoc at runtime and includes an optional dry-run installer that can run package-manager commands with --yes.
Credentials
Bash/Python wrappers, direct pandoc use, and Read/Glob/Grep are proportionate for document conversion, but they can read selected documents/directories and write converted outputs or reports.
Persistence & Privilege
No background persistence or autonomous service behavior is shown. The main lasting effect is optional system package installation if the user approves it.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install pandoc-convert-pro
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /pandoc-convert-pro 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of pandoc-convert-pro. - Provides wrappers for reliable Pandoc-based document conversion (Markdown, DOCX, PDF, HTML, EPUB, LaTeX, Typst, RST, AsciiDoc, Org, ODT, RTF, ipynb, and more). - Features single-file and batch conversion workflows with progress, validation, retries, and reporting. - Includes tools for citation and template handling, table of contents, PDF engine troubleshooting, and resource management. - Enforces safe defaults, explicit installation policies for Pandoc, and actionable error reporting. - Documents best practices, common options, and frequent mistakes to improve conversion reliability.
元数据
Slug pandoc-convert-pro
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

pandoc-convert 是什么?

Use when the user needs to convert documents between formats with Pandoc, including Markdown, DOCX, PDF, HTML, EPUB, LaTeX, Typst, RST, AsciiDoc, Org, ODT, R... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 56 次。

如何安装 pandoc-convert?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install pandoc-convert-pro」即可一键安装,无需额外配置。

pandoc-convert 是免费的吗?

是的,pandoc-convert 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

pandoc-convert 支持哪些平台?

pandoc-convert 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 pandoc-convert?

由 Liuwei1125(@liuwei1125)开发并维护,当前版本 v1.0.0。

💬 留言讨论