feature/google-docs-editor
This commit introduces a complete overhaul of the application, replacing the previous simple Markdown editor with a powerful, Google Docs-style editor with a live preview and ODT export. The new features include: - A new three-pane UI with a Markdown editor, a live preview, and a styles panel. - A powerful styling engine that allows users to create, edit, and apply custom styles to the document. - A persistent storage mechanism for styles using a JSON file. - Support for advanced Markdown features, including code blocks and blockquotes. - A hyperlinked table of contents that is automatically generated from the headings in the document. - Auto-captioning for tables and images. - Pagination for large tables. - Secure image embedding with a domain whitelist and size limits to prevent SSRF and DoS attacks. - An improved live preview that correctly renders multi-line Markdown elements.
GhostEditor - Markdown to Word Converter
A web-based application that converts Markdown to Word documents with advanced features including real-time preview, styling options, auto-captioning, and table pagination.
Features
- Real-time Conversion: See your Markdown text convert to Word format in real-time
- Styling Options: Apply different styles to text elements (headings, quotes, code blocks, etc.)
- Auto Captioning: Automatic captions for images, tables, and figures
- Table Pagination: Support for tables that span across pages with repeating headers
- Custom Settings: Configure document settings and styling preferences
Requirements
- Python 3.7+
- Flask
- python-docx
- markdown
Installation
-
Install the required packages:
pip install -r requirements.txt -
Run the application:
python app.py -
Open your browser and navigate to
http://localhost:5000
Usage
- Enter or paste your Markdown content in the left editor panel
- See the real-time conversion in the right preview panel
- Use the settings panel to configure document options:
- Set document title
- Choose default text style
- Enable/disable auto-captioning for images, tables, and figures
- Enable/disable table pagination
- Use the toolbar buttons to format text directly in the editor
- Select block type and apply custom styles to specific elements
- Add custom captions to elements as needed
- Click "Export to Word" to download your document
Features Explained
Real-time Preview
- The application converts Markdown to Word format as you type
- Preview updates automatically as you make changes
Auto Captioning
- Images automatically receive "Figure X" captions
- Tables automatically receive "Table X" captions
- Captions are numbered sequentially
Table Pagination
- When enabled, tables that span multiple pages will repeat their header row
- This ensures readability when tables cross page boundaries
Block Styling
- Select different block types (paragraph, heading, list, etc.)
- Apply specific styles to different content blocks
- Add custom captions to any element
File Structure
/workspace/
├── app.py # Main Flask application
├── requirements.txt # Python dependencies
├── templates/
│ └── index.html # Main HTML template
└── static/
├── style.css # CSS styling
└── script.js # JavaScript functionality
Technologies Used
- Frontend: HTML, CSS, JavaScript, Bootstrap 5, Marked.js
- Backend: Flask (Python)
- Document Processing: python-docx
- Markdown Processing: markdown (Python library)
Customization
You can customize the application by modifying:
static/style.cssfor visual stylingstatic/script.jsfor client-side functionalityapp.pyfor server-side processing and document generation
Description
Languages
Python
98.2%
Batchfile
0.9%
TeX
0.3%
VBA
0.3%
HTML
0.2%