mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-08-02 10:00:17 +05:30
4.9 KiB
4.9 KiB
Pan Converter
Overview
Pan Converter is a cross-platform desktop application for editing and converting Markdown files using Pandoc. It features a rich markdown editor with live preview, multiple themes, and support for exporting to various formats.
Features
- Markdown Editor: Full-featured editor with syntax highlighting
- Live Preview: Real-time preview of your markdown content
- Multiple Themes: Light, Dark, Solarized, Monokai, and GitHub themes
- Format Conversion: Export to HTML, PDF, DOCX, LaTeX, RTF, ODT, and EPUB using Pandoc
- Cross-Platform: Runs on Windows, macOS, and Linux
- Auto-Save: Automatic saving every 30 seconds
Requirements
- Pandoc: Must be installed on the system for export functionality
- Ubuntu/Debian:
sudo apt-get install pandoc - macOS:
brew install pandoc - Windows: Download from https://pandoc.org/installing.html
- Ubuntu/Debian:
Development Setup
Prerequisites
- Node.js (v14 or higher)
- npm or yarn
- Pandoc (for export features)
Installation
# Clone the repository
git clone <repository-url>
cd pan-converter
# Install dependencies
npm install
# Generate icons
npm run generate-icons
# Start the application
npm start
Building
Build for Current Platform
npm run build
Build for Specific Platforms
# Windows
npm run build:win
# macOS
npm run build:mac
# Linux (generates .deb, .AppImage, and .snap)
npm run build:linux
Build for All Platforms
npm run dist:all
Project Structure
pan-converter/
├── src/
│ ├── main.js # Main process
│ ├── renderer.js # Renderer process
│ ├── index.html # Main window HTML
│ └── styles.css # Application styles
├── assets/
│ ├── icon.svg # Source icon
│ └── icon.png # Generated icons
├── scripts/
│ └── generate-icons.js # Icon generation script
├── package.json # Project configuration
└── CLAUDE.md # This file
Architecture
Main Process (src/main.js)
- Manages application lifecycle
- Creates and manages windows
- Handles file operations
- Manages menu bar
- Communicates with renderer via IPC
Renderer Process (src/renderer.js)
- Handles UI interactions
- Manages editor state
- Renders markdown preview
- Handles theme switching
- Communicates with main process via IPC
Key Libraries
- Electron: Desktop application framework
- marked: Markdown parsing
- highlight.js: Syntax highlighting
- DOMPurify: HTML sanitization
- electron-store: Persistent storage
- electron-builder: Application packaging
Features Implementation
Markdown Editor
- Uses native textarea with custom styling
- Supports common markdown shortcuts via toolbar
- Tab key inserts 4 spaces for code indentation
- Auto-save every 30 seconds when content changes
Live Preview
- Updates in real-time as you type
- Sanitized HTML output for security
- Syntax highlighting for code blocks
- GitHub-flavored markdown support
Theme System
- Themes stored in user preferences
- Applied via CSS classes on body element
- Persists across application restarts
- Five built-in themes
Export System
- Uses Pandoc command-line tool
- Supports multiple output formats
- Maintains original file structure
- Shows error messages if Pandoc not installed
Platform-Specific Branches
The repository maintains separate branches for platform-specific customizations:
master: Main development branchlinux: Linux-specific configurationsmacos: macOS-specific configurationswindows: Windows-specific configurations
Debian Package
The application can be built as a .deb package for Debian-based systems:
npm run build:linux
The generated .deb file will:
- Install to
/opt/pan-converter - Create desktop entry for application menu
- Set up proper file associations
- Declare Pandoc as dependency
Testing
Manual Testing
- File Operations: New, Open, Save, Save As
- Editor Features: Bold, Italic, Headings, Links, Code, Lists, Quotes
- Preview Toggle: Show/hide preview pane
- Theme Switching: Test all five themes
- Export Functions: Test each export format
- Auto-save: Verify 30-second auto-save works
Platform Testing
Test on:
- Windows 10/11
- macOS 11+ (Big Sur and later)
- Ubuntu 20.04+, Debian 11+
Known Issues
- ICO and ICNS icons need manual conversion from PNG
- Pandoc must be installed separately
- Large files may cause performance issues
Future Enhancements
- Add spell checking
- Implement find and replace
- Add custom CSS for preview
- Support for markdown extensions
- Plugin system for custom exporters
- Cloud sync capabilities
- Collaborative editing
License
MIT License
Support
For issues or feature requests, please open an issue on the GitHub repository.