pandoc-docx

Universal document conversion using Pandoc with focus on DOCX format. Use when converting documents to or from DOCX format, including Markdown, HTML, PDF, and other formats. Supports: (1) Converting other formats to DOCX (Markdown, HTML, reStructuredText, etc.), (2) Converting DOCX to other formats, (3) Custom DOCX templates and styling, (4) Batch document processing

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "pandoc-docx" with this command: npx skills add mengbo/mengbo-skills/mengbo-mengbo-skills-pandoc-docx

Pandoc Docx

Prerequisites

Ensure Pandoc is installed:

pandoc --version
# If not installed: brew install pandoc (macOS) or apt-get install pandoc (Linux)

Directory Setup

Create working directories in your project root:

mkdir -p import export
  • import/ - Source files to convert
  • export/ - Converted output files

Convert to DOCX

Basic conversion:

pandoc import/input.md -o export/output.docx

Common options:

  • --reference-doc=template.docx - Apply custom styling
  • --toc - Generate table of contents
  • --toc-depth=2 - Set TOC depth
  • --metadata="title=My Document" - Set document metadata

Use skill's Chinese template:

# Path depends on where skill is installed:
# - Project local: .agents/skills/pandoc-docx/ (or your skill installation path)
# - Global: ~/.config/skills/pandoc-docx/ (varies by OS and tool)

pandoc import/input.md -o export/output.docx \
  --reference-doc=<skill-path>/assets/templates.docx

Convert from DOCX

pandoc import/document.docx -o export/document.md --extract-media=export/images/

Custom Templates

  1. Generate default template: pandoc --print-default-data-file reference.docx > reference.docx
  2. Edit styles in Word
  3. Apply: pandoc import/input.md -o export/output.docx --reference-doc=reference.docx

Batch Processing

SKILL_PATH="<skill-path>"  # Adjust to your skill installation path

for file in import/*.md; do
  pandoc "$file" -o "export/$(basename "${file%.md}").docx" \
    --reference-doc=$SKILL_PATH/assets/templates.docx
done

Resources

  • assets/templates.docx - Chinese DOCX template with title numbering and code highlighting
  • scripts/convert.sh - Helper script for conversions (see usage below)
  • references/pandoc-options.md - Complete option reference and advanced patterns

Using convert.sh

# Run from project root. Adjust <skill-path> to where skill is installed:
<skill-path>/scripts/convert.sh report.md report.docx

# With options
<skill-path>/scripts/convert.sh report.md report.docx --toc

# Absolute paths work as usual
<skill-path>/scripts/convert.sh /path/to/input.md /path/to/output.docx

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

minimax-coding-plan

No summary provided by upstream source.

Repository SourceNeeds Review
General

mcp-to-skill

No summary provided by upstream source.

Repository SourceNeeds Review
General

Jimeng AI Image Generation

即梦 AI 图片生成技能(火山引擎图片生成 4.0)。当用户想要 AI 生成图片、文生图、图生图、 字体设计、海报制作时使用。支持场景: - "帮我生成一张图片:..." - "用即梦画一张 16:9 的科技感壁纸" - "字体设计:新年快乐,红色背景" - "把这张图的背景换成星空" - "生成一组表情包" -...

Registry SourceRecently Updated
General

Oven

Lightweight Oven tracker. Add entries, view stats, search history, and export in multiple formats.

Registry SourceRecently Updated