MD2DOC-Evolution is an open-source Markdown editing and conversion tool designed specifically for technical book authors and content creators. It bridges the gap between "engineer-friendly Markdown writing" and "publisher-required Word manuscripts," allowing you to focus on content creation while automating tedious layout tasks.
🔗 Live Demo: https://huangchiyu.com/MD2DOC-Evolution/
- 📖 Project Overview: Learn about the design philosophy and core features.
- 🤖 AI Generation Guide: How to quickly convert your existing manuscripts to this project's format using AI.
- 🏗️ Architecture: Tech stack, directory structure, and core workflows.
- ⚙️ Development Guide: Setup, testing, and debugging tips.
You can view the exported Word document effect here:
*(Screenshot of actual Word output)*If you have existing Markdown manuscripts, you can use AI tools (like ChatGPT or Claude) to quickly convert them to the optimized format for this project.
Copy the following command to your AI assistant along with your content:
I want to convert this Markdown content into the format for the "MD2DOC-Evolution" project. Please refer to this guide: https://github.com/eric861129/MD2DOC-Evolution/blob/main/docs/AI_GENERATION_GUIDE.md
Please help me:
- Add YAML Frontmatter (title, author).
- Convert standard tips/notes into specialized Callouts (e.g.,
> [!TIP]).- Convert UI operations (buttons, shortcuts) into
【】and[]styles.- Ensure all code blocks have language labels.
Here is my content: [Paste your content here]
This project is not just a Markdown converter; it is deeply optimized for "publishing" needs:
-
📚 Professional Word (DOCX) Export
- Automatically configures headings, paragraphs, line spacing, and borders.
- Built-in font settings: Microsoft JhengHei for Chinese, Consolas for English/Code.
- Supports multiple page sizes: Technical Book (17x23cm), A4, A5, B5.
- Automatic TOC: Supports generating clickable Table of Contents using
[TOC]syntax (Standard TOC field in Word).
-
💻 Enhanced Code Blocks
- Automatic Line Numbers: Line numbers displayed by default, matching IDE style (single line spacing).
- Language Labels: Automatically displays language name in the top-right corner.
- Flexible Control: Supports
js:ln(force show) orjs:no-ln(hide line numbers) syntax.
-
📈 Mermaid Chart Support
- Supports standard
mermaidsyntax for flowcharts, sequence diagrams, etc. - Auto-Image Conversion: Real-time SVG preview on web, auto-converts to high-res PNG in exported Word docs.
- Supports standard
-
🔗 Smart Links (QR Code)
- Auto QR Code Generation: Markdown links
[Text](URL)automatically generate a QR Code next to the text in the exported file. - Optimized for Physical Books: Convenient for readers to scan and jump to resources while reading printed or e-books.
- Auto QR Code Generation: Markdown links
-
📑 YAML Frontmatter Support
- Metadata Management: Define book title, author, and layout preferences at the beginning of the file using YAML syntax.
- Auto Document Properties: Defined
titleandauthorare automatically written to Word document properties.
-
📖 Dynamic Headers & Footers
- Professional Page Numbers: Automatically inserts page numbers centered in the footer.
- Header Navigation: Displays the book title automatically in the header.
- Flexible Toggle: Use Frontmatter to set
header: falseorfooter: falseto enable or disable them.
-
💬 Chat Dialogues
- Designed for "scenario simulation" or "AI conversations" common in technical books.
- Simply type
User:orAI:to generate left/right aligned, styled dialogue boxes.
-
⚠️ Rich Callouts- Supports GitHub/Obsidian style callout syntax:
[!TIP]Tip: Solid border[!NOTE]Note: Dashed border[!WARNING]Warning: Thick border emphasis
-
⌨️ Special Inline Styles
- UI Button: Use
【Settings】to generate button styles. - Shortcut: Use
[Ctrl]to generate keyboard key styles. - Book Title: Use
『Clean Code』for automatic bolding.
- UI Button: Use
-
📊 Rich Block Support
- Tables: Supports standard Markdown table syntax, auto-generating bordered Word tables.
- Ordered Lists: Supports
1.2.with automatic numbering.
-
👁️ WYSIWYG Editor
- Two-column layout: Writing on the left, real-time preview on the right.
- Resizable Layout: Draggable divider to freely adjust the ratio between editor and preview panes.
- Editor Optimizations: Supports
Tabindentation (inserts spaces) without losing focus. - Quick Import: Support for dragging and dropping
.mdfiles directly into the editor.
-
⚡ Slash Commands
- Notion-like
/command system. - Type
/to bring up a menu for quick insertion of Headings, Tables, Mermaid charts, Dialogues, and more, significantly boosting writing efficiency.
- Notion-like
When you open a Word document containing Mermaid charts, Word might pop up the following security alert:
"Word found unreadable content in the document. Do you want to recover the contents of this document?"
This is due to compatibility encoding issues when converting Mermaid charts to Word image formats. ✅ Please safely click "Yes". Word will automatically repair and correctly display all chart content. This does not affect the security or integrity of the document.
This project supports high customization. You can adjust fonts, colors, or add Markdown syntax based on your needs. For details, please refer to:
- Frontend Framework: React 19 (Hooks-based Modular Architecture)
- Build Tool: Vite 6
- Design System: Centralized Theming System (
theme.ts) - Language: TypeScript
- Document Generation: docx
- UI Icons: Lucide React
Contributions are welcome! If you find a bug or have a feature suggestion:
- Fork this project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.








