Skip to content

Piyushdas1624/AI-to-Docx-Converter

Repository files navigation

AI-Doc Converter

A powerful web application that converts AI chatbot outputs (from ChatGPT, Gemini, DeepSeek, etc.) into perfectly formatted, editable documents.

AI-Doc Converter License

✨ Features

Core Features

  • Split-Screen Editor: Dark-themed code editor with line numbers on the left, live preview on the right
  • Markdown Rendering: Full GFM support (tables, strikethrough, task lists)
  • LaTeX Math: Beautiful equation rendering with KaTeX
  • Code Highlighting: Syntax highlighting for 100+ languages
  • Smart Paste Detection: Automatically detects AI-generated content

Export Options

Format Extension Features
Word Document .docx Via Pandoc, perfect editable math
Excel .xlsx Editable cells, tables parsed
HTML .html Full styled export
Plain Text .txt Clean text
Markdown .md Raw source

UI Features

  • Notes Sidebar: Create, search, and manage multiple notes
  • Statistics Panel: Word count, character count, reading time
  • Formatting Toolbar: Quick markdown formatting buttons
  • Settings Panel:
    • Dark/Light mode toggle
    • Auto-save toggle
    • Live preview toggle
    • Pandoc engine status
    • Keyboard shortcuts reference
  • Pandoc Status Indicator: Shows engine connection status

🚀 Quick Start

Prerequisites

Installation

# Clone the repository
git clone https://github.com/yourusername/ai-doc-converter.git
cd ai-doc-converter/web-app

# Install dependencies
npm install

# Start development server
npm run dev

Open http://localhost:3000 in your browser.

📦 Setting Up Pandoc (Required for DOCX)

Pandoc is required for generating Word documents with perfect mathematical equations.

  1. Install Pandoc:

    • Windows: winget install pandoc (or download from website)
    • macOS: brew install pandoc
    • Linux: sudo apt install pandoc
  2. Verify Configuration: The application tries to find Pandoc automatically. If you installed it in a custom location or it's not found:

    • Open app/api/convert/route.ts
    • Look for the pandocPaths array
    • Update the path with your username:
      'C:\\Users\\YOUR_USERNAME\\AppData\\Local\\Pandoc\\pandoc.exe',
    • Restart the server (npm run dev) after changes.

🐳 Docker (Alternative)

If you don't want to install Pandoc locally, use Docker:

# Build and run with Docker
docker build -t ai-doc-converter .
docker run -p 3000:3000 ai-doc-converter

⚠️ Known Limitations & Community Notes

  • PDF Export: The PDF export feature has been removed from the core to simplify the project.
    • Contribution Opportunity: If you want PDF export, you can implement it using wkhtmltopdf or by re-enabling LaTeX support. See app/api/convert/route.ts for where conversion logic lives.
  • Text Alignment: Markdown doesn't support text alignment (center, right) by default.
  • Underline: Uses HTML <u> tag.

🔧 How It Works

Math Rendering (Preview)

  1. Raw LaTeX (e.g., \vec{a} \times \vec{b}) is detected
  2. Delimiters are normalized (\($, \[$$)
  3. KaTeX renders beautiful equations in the browser

DOCX Export (Pandoc)

  1. Frontend sends markdown to /api/convert
  2. Server writes content to temp file
  3. Pandoc converts: markdown → docx with full LaTeX support (equations become editable Word math regions)
  4. Generated DOCX is streamed back to browser

⌨️ Keyboard Shortcuts

Shortcut Action
Ctrl + B Bold
Ctrl + I Italic
Ctrl + S Save (auto-save enabled)
Ctrl + E Export DOCX
Ctrl + N New Note

🤝 Contributing

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

📄 License

MIT License - see LICENSE for details.

About

Convert AI chat outputs (ChatGPT, Gemini, DeepSeek) into perfectly formatted editable documents (DOCX, Excel, HTML). Preserves LaTeX math, tables, and code blocks.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages