A Python tool that converts Markdown documents into polished HTML, PDF, DOCX, and EPUB files using Pandoc. Includes a PySide6 desktop dashboard for real-time style customization, metadata editing, batch processing, and sanitization.
Status: Early development (v0.1.0). Core conversion pipeline is functional.
- Multi-format output — Convert
.mdto HTML, PDF, DOCX, and EPUB in a single run - YAML profiles — Define reusable conversion configurations
- UX Dashboard — New tabbed interface for single/batch conversion, grouped metadata, and Drag & Drop support.
- Style customization — Live-preview dashboard with theme presets and typography controls
- Markdown sanitization — Rule-based cleanup before conversion
- Quick Start — New
run_dashboard.batfor easy one-click launch on Windows.
# Clone and install
git clone https://github.com/YOUR_USER/docsconverter.git
cd docsconverter
# Easy launch (Windows)
run_dashboard.batDownload Pandoc and either:
- Install system-wide (auto-detected), or
- Place the binary at
pandoc-3.9-windows-x86_64/pandoc-3.9/pandoc.exe
# Single file conversion
python -m app.main convert \
--input samples/markdown/sample-report.md \
--profile configs/profiles/default.yaml
# Batch conversion (entire directory)
python -m app.main convert-dir \
--input-dir samples/markdown \
--profile configs/profiles/default.yaml
# Launch desktop dashboard
python -m app.main uiConverted files are written to build/output/ by default (configurable per profile).
web— Renders viawkhtmltopdf, maximizing visual parity with HTML outputnative— Renders via Pandoc + LaTeX (xelatex/pdflatex) for native PDF typesetting
If no pdf_engine is set in the profile, the tool auto-detects an available engine.
Launch with python -m app.main ui. The dashboard provides:
- Visual profile editor with live HTML preview
- Style customization dialog (themes, colors, typography, table density)
- Document presets (Draft, Internal, Approved, Confidential)
- Batch conversion with progress bar and summary table
- Conversion history with metrics (total, success, errors)
- Sanitization panel for markdown cleanup before conversion
docsconverter/
app/
core/
models.py Pydantic data models
pipeline.py Conversion engine (Pandoc subprocess)
preflight.py Validation and PDF engine detection
rules.py Markdown normalization
sanitizer.py Rule-based markdown cleanup
sanitizer_config.py Sanitization YAML loader
style_builder.py CSS override generator
history.py JSONL conversion log
batch.py Directory batch processing
config.py YAML profile loader/saver
ui/
window.py PySide6 dashboard
main.py CLI entry point
configs/
profiles/ Conversion profiles (YAML)
sanitization.yaml Sanitization rules
templates/
base.html Pandoc HTML template
styles/
report.css Base document stylesheet
samples/markdown/ Example markdown files
tests/ Unit and integration tests
Profiles are YAML files that bundle all conversion settings:
project_name: My Report
outputs:
- format: html
output_path: build/output/report.html
- format: pdf
output_path: build/output/report.pdf
style_profile:
pdf_layout_mode: web
template_html: ../../templates/base.html
css: ../../styles/report.css
options:
document_theme: light
zebra_tables: true
accent_color: '#0f766e'
metadata:
title: My Report
classification: internal
language: es
rules:
normalize_headings: true
fix_code_fences: trueBuilt-in profiles: default, auditoria, ue-audit, ue-architecture.
python -m pytest tests/ -vMIT. See LICENSE.