Skip to content

Latest commit

 

History

History
163 lines (119 loc) · 7.89 KB

File metadata and controls

163 lines (119 loc) · 7.89 KB

MD2DOC-Evolution | v1.3.0

License: MIT Version

🇹🇼 中文 | 🇺🇸 English

If you like this project, please give it a star 🌟🌟🌟

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/

📚 Documentation

📄 Sample Output

You can view the exported Word document effect here:

Cover & Header Chat Dialogues
Callouts & Styles Code Blocks
Tables & Lists Tables & Lists
Tables & Lists Tables & Lists
*(Screenshot of actual Word output)*

🤖 AI Assisted Generation

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.

Recommended Prompt

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:

  1. Add YAML Frontmatter (title, author).
  2. Convert standard tips/notes into specialized Callouts (e.g., > [!TIP]).
  3. Convert UI operations (buttons, shortcuts) into 【】 and [] styles.
  4. Ensure all code blocks have language labels.

Here is my content: [Paste your content here]


✨ Features

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) or js:no-ln (hide line numbers) syntax.
  • 📈 Mermaid Chart Support

    • Supports standard mermaid syntax for flowcharts, sequence diagrams, etc.
    • Auto-Image Conversion: Real-time SVG preview on web, auto-converts to high-res PNG in exported Word docs.
  • 🔗 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.
  • 📑 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 title and author are 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: false or footer: false to enable or disable them.
  • 💬 Chat Dialogues

    • Designed for "scenario simulation" or "AI conversations" common in technical books.
    • Simply type User: or AI: 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.
  • 📊 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 Tab indentation (inserts spaces) without losing focus.
    • Quick Import: Support for dragging and dropping .md files 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.

🚀 Getting Started

❓ Known Issues

About Mermaid Chart Export

When you open a Word document containing Mermaid charts, Word might pop up the following security alert:

Word 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.

🎨 Customization

This project supports high customization. You can adjust fonts, colors, or add Markdown syntax based on your needs. For details, please refer to:

🛠️ Tech Stack

  • 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

🤝 Contributing

Contributions are welcome! If you find a bug or have a feature suggestion:

  1. Fork this project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.