文档

Doc Weaver

试用

Transform Markdown or outlines into polished Word/PDF documents with professional templates

它能做什么

Transform Markdown or outlines into polished Word/PDF documents with professional templates

技能文档

Doc Weaver

Convert Markdown documents or structured outlines into publication-ready Word (.docx) or PDF documents using built-in professional templates.

Quick Start

# Generate a Word document from Markdown
python3 scripts/weaver.py --input doc.md --template prd --output output.docx

# Generate a PDF
python3 scripts/weaver.py --input doc.md --template report --output output.pdf

# Auto-detect the best template
python3 scripts/weaver.py --input doc.md --output output.docx

# List all available templates
python3 scripts/weaver.py --show-templates

# Check local conversion dependencies
python3 scripts/weaver.py --doctor

# Preview without generating a file
python3 scripts/weaver.py --input doc.md --template proposal --preview

# Run release verification against bundled examples
python3 scripts/verify.py

Workflow

  1. Parse input — Read headings, lists, code blocks, tables, and blockquotes from Markdown.
  2. Auto-detect type — Identify document purpose from structure: PRD, proposal, resume, whitepaper, and more (10 types).
  3. Load template — Apply a matching template with covers, heading fonts, color schemes, and page styles.
  4. Auto-number headings — Multi-level heading numbering (1, 1.1, 1.1.1) with configurable starting level.
  5. Table of contents — Generate TOC field from heading hierarchy (clickable in Word, update field to populate).
  6. Format tables — Apply borders, styled header rows (white text on primary color), alternating row shading.
  7. Special elements — Code blocks → monospace (Courier New) + grey background; blockquotes → indented + left grey border; inline code → highlighted.
  8. Headers & footers — Running title in header; page numbers (Page X of Y) + date in footer.
  9. Export.docx via python-docx (native Word formatting); .pdf via pandoc + weasyprint.

Built-in Templates (10)

KeyNameCoverHeading FontPrimary
prdProduct Requirements DocYesArial#1a73e8
reportReportYesGeorgia#333333
academicAcademic PaperYesTimes New Roman#000000
manualUser ManualYesHelvetica#005a9e
contractContractYesTimes New Roman#000000
proposalBusiness ProposalYesHelvetica#2d5f8a
resumeResume / CVNoCalibri#2c3e50
newsletterEmail NewsletterYesGeorgia#c0392b
meeting-minutesMeeting MinutesYesArial#27ae60
whitepaperTechnical WhitepaperYesTimes New Roman#1a1a2e

Real-world Examples

Example 1: Product Requirements Document

Scenario: You have a feature spec written in Markdown and need to share it as a professional Word document with stakeholders.

Input (prd.md):

# Chat Feature PRD

## Overview
Add real-time chat to the dashboard. Supports **1:1** and **group** conversations.

## User Stories
- As a user, I can send messages in real time
- As an admin, I can moderate chat rooms

## API Design

| Endpoint       | Method | Description       |
|----------------|--------|-------------------|
| /chat/send     | POST   | Send a message    |
| /chat/history  | GET    | Get chat history  |

> **Note:** WebSocket connections require authentication tokens.

## Timeline
1. Alpha: Week 1-2
2. Beta: Week 3-4
3. Launch: Week 5

Command:

python3 scripts/weaver.py -i prd.md -t prd -o ChatFeaturePRD.docx

Expected output: A Word document with cover page showing "1 Chat Feature PRD", table of contents, blue-themed headings, numbered structure (1.1 User Stories, 1.2 API Design), styled table with blue header, grey-background code block, and indented blockquote. Header shows "Chat Feature PRD", footer shows "Page X of Y | 2026-06-15".


Example 2: Meeting Minutes → PDF

Scenario: You took meeting notes in Markdown and need to distribute a polished PDF.

Input (minutes.md):

# Sprint Planning Meeting

## Attendees
- Alice (Product)
- Bob (Engineering)
- Charlie (Design)

## Agenda
1. Sprint goal review
2. Backlog grooming
3. Capacity planning

## Decisions
- **Sprint goal**: Ship user dashboard v2
- **Scope**: 8 story points for frontend, 5 for backend

## Action Items
- [ ] Alice: Finalize mockups by Wednesday
- [ ] Bob: Set up CI/CD pipeline
- [ ] Charlie: Design system audit

## Next Meeting
Friday, 3:00 PM — Sprint Review

Command:

python3 scripts/weaver.py -i minutes.md -t meeting-minutes -o SprintPlanning.pdf

Expected output: Both .docx and .pdf files. Green (#27ae60) theme with Arial fonts. Cover page with meeting title and date. Green-styled table headers, proper list formatting. PDF rendered with green headings and professional typography.


Example 3: Technical Whitepaper with Auto-Detection

Scenario: You drafted a technical whitepaper and want the system to auto-detect and format it.

Input (architecture.md):

# Cloud-Native Architecture Whitepaper

## Executive Summary
This whitepaper presents a **benchmark analysis** of cloud-native patterns.

## Architecture Overview

The solution architecture consists of three tiers:

```yaml
tiers:
  - presentation: React SPA
  - application: Python microservices
  - data: PostgreSQL + Redis

Performance Benchmarks

PatternP99 LatencyThroughputCost/Month
Monolith450ms1.2K rps$1,200
Microservices120ms8.5K rps$3,800
Serverless80ms12K rps$2,100

Industry Analysis

Cloud-native adoption grew 47% YoY according to CNCF 2025 survey.

Conclusion

Serverless offers the best latency/cost ratio for variable workloads.


**Command:**
```bash
python3 scripts/weaver.py -i architecture.md -t auto -o Whitepaper.docx
# Output: [doc-weaver] Auto-detected document type: whitepaper (Technical Whitepaper)

Expected output: System auto-detects whitepaper type. Dark navy (#1a1a2e) theme with Times New Roman. Cover page with "1 Cloud-Native Architecture Whitepaper". Properly numbered sections (1.1 Architecture Overview, 1.2 Performance Benchmarks), YAML code block with grey background, styled table with dark header row and alternating row shading.

Requirements

  • python-docx (pip install python-docx) — for .docx generation
  • pandoc (brew install pandoc) — for .pdf generation
  • weasyprint (pip install weasyprint) — PDF engine for pandoc

Run python3 scripts/weaver.py --doctor before using PDF output. If PDF dependencies are missing, .docx generation can still work as long as python-docx is installed.

Verification

Before publishing or sharing a new package version, run:

python3 -m py_compile scripts/weaver.py scripts/verify.py
python3 scripts/weaver.py --doctor
python3 scripts/verify.py

The verification script renders a preview, generates a sample Word document, and generates a sample PDF when the optional PDF toolchain is available.

Safety

  • All input stays local; no data is sent to external conversion services.
  • Template engine uses built-in dictionaries; no external CSS files required.
  • PDF output uses local pandoc + weasyprint pipeline.

相关技能

将受支持的文档转为 Markdown,方便智能代理读取,并在源文件旁保存单个文件或转换包。

28 次安装7 星标

doc to video, word to video, markdown to video, document to video — parse the document, outline, storyboard, voiceover, build, validate. Use when the user gives a Doc / Word / Markdown file and wants an explainer, report broadcast, or training video.

Convert a Markdown file or raw Markdown string into a polished Word DOCX document. Supports custom Word template files, includes built-in DOCX templates, and...

23 次安装1 星标

Beautify Word documents (.docx) using a professional general template. Trigger when the user asks to: beautify/美化/排版/格式化 a Word document, apply a template/style to a .docx file, make a document look professional/clean/formatted, or clean up a document's formatting. Works by reading the source .docx,

Convert Word (.doc, .docx), PowerPoint (.ppt, .pptx), Excel (.xls, .xlsx), OpenDocument (.odt, .ods, .odp), RTF, EPUB, CSV, and PDF files to GitHub-Flavored Markdown. Use when a task needs the contents of an office document, spreadsheet, presentation, ebook, or PDF you cannot read directly.

1 次安装