mdtoword

mdtoword 是一个强大的Markdown转Word工具,可将Markdown内容转换为专业格式的Word文档(.docx)。它支持所有标准Markdown语法,包括标题、段落、列表、表格、代码块和块引用。

  • 本地部署
  • 更新于

使用说明

mdtoword Tool Documentation (English)

Overview

mdtoword is a powerful Markdown to Word conversion tool that transforms Markdown content into professionally formatted Word documents (.docx). It supports all standard Markdown syntax including headers, paragraphs, lists, tables, code blocks, and blockquotes.

Key Features

  • Template System: Apply preset or custom templates for consistent document styling
  • Style Configuration: Fine-tune document appearance with detailed style settings
  • Chinese Document Standards: Default template follows Chinese typographic conventions
  • Batch Processing: Efficiently convert multiple Markdown files

Preset Templates

Template ID Category Description
customer-analysis business Default template with Chinese standards (2-character indent)
academic academic Formal template for academic papers
business business Professional business report format
technical technical Optimized for technical documentation
minimal minimal Clean and minimal styling

Usage Example

{
  "markdown": "# Document Title\n\nThis is a sample paragraph.",
  "filename": "output.docx",
  "template": {
    "type": "preset",
    "presetId": "business"
  }
}

Style Configuration Guide

Units

  • Twip (Tw): 1/1440 inch (used for spacing/margins)
  • Half-points: Font size unit (24 half-points = 12pt)

Color Codes (6-digit HEX)

  • 000000 - Pure black
  • 333333 - Dark gray
  • 666666 - Medium gray
  • 2E74B5 - Professional blue
  • D73A49 - Alert red

First-line Indent Calculation

  • Formula: Font size (half-points) × Character count × 10
  • Example for 24pt font (2 characters): 24 × 2 × 10 = 480 Tw

Configuration Snippet

{
  "styleConfig": {
    "paragraphStyles": {
      "normal": {
        "font": "SimSun",
        "size": 24,
        "color": "000000",
        "indent": { "firstLine": 480 },
        "spacing": { "line": 400, "after": 120 },
        "alignment": "justify"
      }
    }
  }
}

Advanced Features

  • Custom template support via base64-encoded DOCX files
  • Header/footer configuration
  • Table styling options
  • Code block syntax highlighting