Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
daymade avatar

Doc To Markdown

  • 605 installs
  • 1.3k repo stars
  • Updated August 4, 2026
  • daymade/claude-code-skills

doc-to-markdown is a Claude Code skill that converts Word, PDF, and rich office documents into clean Markdown for developers who need repo-ready docs without hand-fixing headings and tables.

About

doc-to-markdown is a documentation conversion skill from daymade/claude-code-skills that transforms Word documents, PDFs, and other rich office files into clean Markdown suitable for Git repositories, static docs sites, and agent-readable knowledge bases. Developers reach for doc-to-markdown when onboarding legacy specifications, compliance PDFs, or stakeholder Word drafts into a docs-as-code workflow without manually rebuilding every heading, list, and table. The skill focuses on structural fidelity—preserving headings, lists, and tabular data while stripping presentation cruft that breaks Markdown linters and static site generators.

  • Multi-format ingestion
  • Heading and list cleanup
  • Table preservation
  • Repo-ready Markdown output
  • Knowledge base migration

Doc To Markdown by the numbers

  • 605 all-time installs (skills.sh)
  • Ranked #143 of 688 Office & Documents skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/daymade/claude-code-skills --skill doc-to-markdown

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs605
repo stars1.3k
Last updatedAugust 4, 2026
Repositorydaymade/claude-code-skills

How do you convert Word or PDF docs to Markdown?

Convert Word, PDF, or rich office files into clean Markdown for repos, docs sites, and agent-readable knowledge without hand-reformatting every heading and table.

Who is it for?

Developers migrating legacy office documents into docs-as-code repositories or agent knowledge bases.

Skip if: Scanned-image PDFs needing OCR or workflows that require preserving complex Word macros and embedded OLE objects.

When should I use this skill?

A developer asks to convert Word, PDF, or office files to Markdown for a repo or documentation site.

What you get

Clean Markdown files with preserved headings, lists, tables, and repo-ready formatting.

  • Clean Markdown file
  • Repo-ready documentation

Files

SKILL.mdMarkdownGitHub ↗

Doc to Markdown

Convert documents to high-quality markdown with intelligent multi-tool orchestration and automatic DOCX post-processing.

Architecture: Pandoc (best-in-class extraction) + 8 post-processing fixes (our value-add).

Quick Start

# DOCX → Markdown (one command, zero manual fixes)
uv run --with pymupdf4llm --with markitdown scripts/convert.py document.docx -o output.md --assets-dir ./media

# PDF → Markdown
uv run --with pymupdf4llm --with markitdown scripts/convert.py document.pdf -o output.md

# Run tests
uv run --with pytest pytest scripts/test_convert.py -v

Dual Mode

ModeSpeedQualityUse Case
Quick (default)FastGoodDrafts, simple documents
HeavySlowerBestFinal documents, complex layouts

Tool Selection

FormatQuick ModeHeavy Mode
PDFpymupdf4llmpymupdf4llm + markitdown
DOCXpandoc + post-processingpandoc + markitdown
PPTXmarkitdownmarkitdown + pandoc
XLSXmarkitdownmarkitdown

DOCX Post-Processing (automatic)

When converting DOCX via pandoc, 8 cleanups are applied automatically:

ProblemFixTest coverage
Grid tables (+:---+)Single-column → blockquote, multi-column → pipe tableTestPostprocessPipeline
Simple tables ( ---- ----)Multi-column images → pipe table with captionsTestSimpleTable
Image path nesting (media/media/)Flatten to media/, absolute → relativetest_stats_tracking
Pandoc attributes ({width="..."})Removedtest_pandoc_attributes_removed
CJK bold spacing (**粗体**中文)Add space around ** for CJK bold spansTestCjkBoldSpacing (15 cases)
Indented dashed code blocks→ fenced ``` with language detectiontest_code_block_with_language
Escaped brackets (\[...\])[...]test_escaped_brackets_fixed
Double-bracket links ([[text]](url))[text](url)test_double_bracket_links_fixed

CJK Bold Spacing — why and how

DOCX uses run-level styling (no spaces between bold/normal runs in CJK text). Markdown renderers need whitespace around ** to recognize bold boundaries.

Rule: if a **content** span contains any CJK character, ensure both sides have a space — unless already spaced or at line boundary. This handles CJK punctuation, emoji adjacency, and mixed content.

Before: 打开**飞书**,就可以    → some renderers fail to bold
After:  打开 **飞书** ,就可以  → universally renders correctly

Heavy Mode Workflow

Heavy Mode runs multiple tools in parallel and selects the best segments:

1. Parallel Execution: Run all applicable tools simultaneously 2. Segment Analysis: Parse each output into segments (tables, headings, images, paragraphs) 3. Quality Scoring: Score each segment based on completeness and structure 4. Intelligent Merge: Select best version of each segment across tools

Merge Criteria

Segment TypeSelection Criteria
TablesMore rows/columns, proper header separator
ImagesAlt text present, local paths preferred
HeadingsProper hierarchy, appropriate length
ListsMore items, nested structure preserved
ParagraphsContent completeness

Image Extraction

# Extract images with metadata
uv run --with pymupdf scripts/extract_pdf_images.py document.pdf -o ./extracted-images

# Generate markdown references file
uv run --with pymupdf scripts/extract_pdf_images.py document.pdf --markdown refs.md

Output:

  • Images: extracted-images/img_page1_1.png, extracted-images/img_page2_1.jpg
  • Metadata: extracted-images/images_metadata.json (page, position, dimensions)

Quality Validation

# Validate conversion quality
uv run --with pymupdf scripts/validate_output.py document.pdf output.md

# Generate HTML report
uv run --with pymupdf scripts/validate_output.py document.pdf output.md --report report.html

Quality Metrics

MetricPassWarnFail
Text Retention>95%85-95%<85%
Table Retention100%90-99%<90%
Image Retention100%80-99%<80%

Merge Outputs Manually

# Merge multiple markdown files
python scripts/merge_outputs.py output1.md output2.md -o merged.md

# Show segment attribution
python scripts/merge_outputs.py output1.md output2.md -o merged.md --verbose

Path Conversion (Windows/WSL)

# Windows to WSL conversion
python scripts/convert_path.py "C:\Users\<windows-user>\Documents\file.pdf"
# Output: /mnt/c/Users/<windows-user>/Documents/file.pdf

Common Issues

"No conversion tools available"

# Install all tools
pip install pymupdf4llm
uv tool install "markitdown[pdf]"
brew install pandoc

FontBBox warnings during PDF conversion

  • Harmless font parsing warnings, output is still correct

Images missing from output

  • Use Heavy Mode for better image preservation
  • Or extract separately with scripts/extract_pdf_images.py

Tables broken in output

  • Use Heavy Mode - it selects the most complete table version
  • Or validate with scripts/validate_output.py

Bundled Scripts

ScriptPurpose
convert.pyMain orchestrator with Quick/Heavy mode + DOCX post-processing
test_convert.py31 tests covering all post-processing functions
merge_outputs.pyMerge multiple markdown outputs
validate_output.pyQuality validation with HTML report
extract_pdf_images.pyPDF image extraction with metadata
convert_path.pyWindows to WSL path converter

References

  • references/benchmark-2026-03-22.md - 5-tool benchmark (Docling/MarkItDown/Pandoc/Mammoth/ours)
  • references/heavy-mode-guide.md - Detailed Heavy Mode documentation
  • references/tool-comparison.md - Tool capabilities comparison
  • references/conversion-examples.md - Batch operation examples

Next Step: Clean Up Converted Content

After converting documents to markdown, suggest cleanup:

Conversion complete: [N] files converted to markdown.

Options:
A) Clean up docs — run /daymade-docs:docs-cleaner to consolidate redundant content (Recommended if multiple files)
B) Check facts — run /fact-checker to verify claims in the converted content
C) No thanks — the markdown conversion is sufficient

Related skills

FAQ

Which file types does doc-to-markdown support?

doc-to-markdown converts Word, PDF, and rich office files into clean Markdown. Output is structured for Git repositories, documentation sites, and agent-readable knowledge without manual reformatting.

Why use doc-to-markdown instead of manual copy-paste?

doc-to-markdown preserves headings, lists, and tables while removing presentation cruft that breaks Markdown linters. Developers avoid hand-rebuilding structure from legacy office documents.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.