Markdown to DOCX and PDF Converter
This repository contains the foundation for a service that will convert Markdown documents to DOCX and PDF. It currently provides local authentication, administrative account management, revocable sessions, health endpoints, and durable standalone or distributed storage profiles. It also provides a versioned template API with ownership, visibility-aware search, preferences, full T10 Pandoc/LibreOffice activation, immutable font-validation evidence, safe downloads, optimistic concurrency, immutable history, restoration, audit, and guarded deletion across both storage profiles. The internal conversion component now validates standalone Markdown or bounded ZIP packages, binds and normalizes approved local images, sanitizes and rasterizes untrusted SVG, renders bounded Mermaid diagrams through local sandboxed Chromium, runs Pandoc in an isolated workspace, and converts validated DOCX to bounded PDF through an isolated LibreOffice profile. The versioned API persists owner-scoped conversion requests, exposes deterministic job state, supports idempotent submission and cancellation, and uses lease-owning embedded or external worker loops over SQLite or PostgreSQL. The authenticated server-rendered conversion page now provides upload and drag-and-drop, active-template search with preferred/fallback visibility, DOCX/PDF/both selection, asynchronous status and cancellation, expiration handling, and safe downloads. The template administration page provides owner and administrator lifecycle controls, preferences, version history, and an administrator-only local-account tab. Configurable quotas and resource policy are assembled. Structured JSON logs, durable request-to-worker correlation, low-cardinality queue and worker metrics, bounded immutable-audit reads, version traceability, and cheap profile readiness are available; final-container features remain under development.
The project is licensed under Apache-2.0. The approved first public version is 0.3.0,
published on PyPI as markweave with the matching public Python import markweave. See
the release process for the protected PyPI and GHCR publication contract and
required one-time external configuration. A reviewed version-change pull request merged to
protected main starts the automatic release; repository edits without a version transition do not.
Requirements
uv- A platform supported by the Python 3.14 distribution managed by
uv - Pandoc 3.10.2 for real DOCX conversion, Mermaid CLI 11.16.0 with Chrome 151.0.7922.173 for diagram rendering, LibreOffice 26.2.5.2 for PDF conversion, and the Cairo shared library for SVG rasterization; the validated UBI toolchain image provides these engines
- A reachable ClamAV
clamdservice for fail-closed pre-persistence upload scanning
uv reads .python-version, installs Python 3.14 when needed, and creates the project environment.
No manually managed virtual environment or direct pip invocation is required.
Set up the project
git clone git@github.com:Guillaume-Lombardo/simple-md-to-docx-converter.git
cd simple-md-to-docx-converter
uv sync --all-groups
Run the canonical local checks:
uv run ruff format .
uv run ruff check .
uv run ty check
npm ci --ignore-scripts
npm run test:web
uv run pytest -m "not requires_pandoc and not requires_mermaid and not requires_libreoffice"
uv run pytest
These Pytest commands independently enforce at least 90% overall coverage and 90% branch-only
coverage for the markweave application package. Pull-request CI also enforces 90% coverage of
changed executable application lines. Tests use pytest-mock; direct imports from unittest.mock
are rejected.
The lock file is committed. Use uv sync --locked --all-groups to require the committed dependency
resolution. Build dependencies are a locked project group and are also constrained explicitly for
isolated builds. Build distributions with the generated, hash-checked constraints:
uv build --build-constraint build-constraints.txt --require-hashes
Repository map
src/markweave/: installable Python packagetests/: automated testsbuild-constraints.txt: hash-checked constraints exported from the build dependency groupdocs/architecture.md: target architecture and component boundariesdocs/authentication.md: local accounts, sessions, configuration, and current limitationsdocs/storage-profiles.md: profile configuration, backup, and restore proceduresdocs/jobs.md: conversion API, durable state machine, queue, worker, and recovery contractdocs/resource-policy.md: quotas, budgets, retention, recovery, and cleanup configurationdocs/container-deployment.md: final-image build, hardening, runtime profiles, and SBOM scansdocs/observability.md: JSON logging, correlation, metrics, audit, and readiness contractsdocs/releasing.md: version, tag, PyPI Trusted Publishing, GHCR, SBOM, and provenance proceduredocs/conversion-ui.md: authenticated conversion-page workflow, security, and validation scopedocs/administration-ui.md: template-owner and administrator browser workflowsdocs/templates.md: template identity, visibility, selection, and T15 boundariesdocs/golden-testing.md: reference corpus and deterministic DOCX/PDF comparison helpersdocs/pandoc-docx.md: approved Markdown dialect and isolated Pandoc DOCX boundarydocs/archive-images.md: secure archive and local-image preparation contractdocs/mermaid.md: bounded local Mermaid/Chromium preprocessing contractdocs/word-templates-fonts.md: bounded template activation and pinned font contractdocs/pdf-conversion.md: isolated LibreOffice PDF and traceability contractdocs/local-development.md: detailed local workflowtickets/: repository-reviewed project ticket mirrors
See CONTRIBUTING.md before proposing a change. The normative product decisions and delivery plan are in docs/product-specification.md.
Metadata
Release files for markweave 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| markweave-0.3.0.tar.gz | 127.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| markweave-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 294.2 kB
Release files / markweave-0.3.0.tar.gz
| Download URL | markweave-0.3.0.tar.gz |
|---|---|
| Size | 127.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ec7b97d9fff9530e7110051604029024014eb425faeced812c815d9c846c4403
|
|
BLAKE2b-256 checksum How to use checksums |
094fa3bc06312a282d38b634cd5dfffddca2aefabe4ad75fcd023253721fde11
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.
Transparency logRelease files / markweave-0.3.0-py3-none-any.whl
| Download URL | markweave-0.3.0-py3-none-any.whl |
|---|---|
| Size | 166.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
863c540cab620e861eebb2841ee3da6b4417a43ba10bd594663a8cd2bd700898
|
|
BLAKE2b-256 checksum How to use checksums |
5b555ac6bcea9454a2b30ec7ddb802647275dbe3b010ea41a54b7ed129fbbc0f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.
Transparency log