Skip to content

kselva/pandoc_win

Repository files navigation

Pandoc Win

A Windows GUI wrapper for Pandoc — convert Markdown files to DOCX with a system tray app, folder watching, context menu integration, and a built-in Markdown server.

Screenshots

Main Window System Tray
Main Page System Tray Menu
Settings Conversion Settings
Settings Page Conversion Settings
MD Server - File List MD Server - File Viewer
MD Server List MD Server Viewer
Start MD Server About
Start MD Server About Dialog

Features

  • File Conversion — Convert .md files to DOCX or HTML via Pandoc
  • System Tray — Runs minimized in the system tray for quick access
  • Folder Watcher — Automatically converts new/modified .md files in watched directories
  • Windows Context Menu — Right-click any .md file to convert directly from Explorer
  • Markdown Server — Built-in HTTP server with live preview (Pandoc or marked.js rendering), syntax highlighting, mermaid diagrams, and dark/light theme toggle
  • Conversion Settings — Per-format extra args, reference docs, and custom Lua filters
  • Start with Windows — Optional auto-start on login

Prerequisites

  • Python 3.12+
  • uv — Python package manager
  • Pandoc — installed and accessible (or configure path in settings)

Setup

# Clone the repository
git clone https://github.com/<your-username>/pandoc-win.git
cd pandoc-win

# Install dependencies
uv sync

# Run the application
uv run python main.py

On first run, a settings.json will be created. See settings.json.example for the expected format.

Usage

GUI Mode

uv run python main.py

The app starts in the system tray. Use the tray icon to:

  • Open the main window
  • Toggle folder watcher
  • Open Markdown server in browser
  • Access settings

Context Menu Mode

uv run python main.py --convert "path/to/file.md" --format docx

Supported formats: docx, html

Markdown Server

Enable in settings to serve a directory of .md files at http://localhost:8094 with:

  • /pandoc/<file> — server-side Pandoc rendering
  • /live/<file> — client-side marked.js rendering
  • Auto-reload on file changes
  • Syntax highlighting and mermaid diagram support

Build

Build a standalone Windows executable using PyInstaller:

uv run python build_single.py

Or use the batch script:

build_all.bat

Output: dist/PandocWin/PandocWin.exe

Project Structure

pandoc-win/
├── src/
│   ├── controllers/     # Conversion orchestration
│   ├── models/          # Data models (settings, conversion request/result)
│   ├── services/        # Converter, folder watcher, MD server, file selector
│   ├── qt_components/   # Reusable PyQt6 widgets and theming
│   ├── ui/              # Main window and settings dialogs
│   └── utils/           # Context menu, system tray, icon, colors
├── filters/             # Pandoc Lua filters
├── static/              # CSS/JS assets for MD server
├── templates/           # Reference documents for conversion
├── main.py              # Entry point
├── pyproject.toml       # Project config and dependencies
└── settings.json.example

Configuration

Copy settings.json.example to settings.json and adjust:

Setting Description
pandoc_path Path to pandoc executable (or just "pandoc" if on PATH)
default_format Default output format (docx, html, pdf)
watched_folders Directories to monitor for auto-conversion
md_server_directory Root directory for the Markdown server
md_server_port Port for the Markdown server
conversion_settings Per-format extra args and reference docs

License

MIT


Note: This project is a GUI wrapper that calls Pandoc as an external tool. Pandoc must be installed separately.

About

A Windows GUI wrapper for [Pandoc](https://pandoc.org/) — convert Markdown files to DOCX with a system tray app, folder watching, context menu integration, and a built-in Markdown server.

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages