Metadata-Version: 2.4
Name: markdown-gost
Version: 1.0.0
Summary: Markdown to GOST 7.32 DOCX/PDF converter with an HTML preview engine
License-Expression: MIT
License-File: LICENSE
Author: Arseniy Mikheev
Requires-Python: >=3.13,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Provides-Extra: pdf
Requires-Dist: click (>=8.1.0,<9.0.0)
Requires-Dist: freetype-py (>=2.5.0,<3.0.0)
Requires-Dist: latex2mathml (>=3.76.0,<4.0.0)
Requires-Dist: lxml (>=5.0.0,<6.0.0)
Requires-Dist: marko (>=2.1.0,<3.0.0)
Requires-Dist: pillow (>=11.0.0,<12.0.0)
Requires-Dist: pydantic (>=2.10.0,<3.0.0)
Requires-Dist: pygments (>=2.18.0,<3.0.0)
Requires-Dist: python-docx (>=1.2.0,<2.0.0)
Requires-Dist: pyyaml (>=6.0.2,<7.0.0)
Requires-Dist: unoserver (>=3.0,<4.0) ; extra == "pdf"
Description-Content-Type: text/markdown

# markdown-gost

Markdown to GOST 7.32 DOCX/PDF converter with a paginated HTML preview.

- [Syntax reference](skills/markdown-gost/syntax.md) — extended Markdown: tables, listings, equations, appendices, bibliography, templates
- [Architecture](docs/architecture.md) — pipeline, config system, storage protocol, testing tiers

## Install

```bash
pipx install markdown-gost            # DOCX + preview
pipx install "markdown-gost[pdf]"     # + unoserver tooling
```

PDF output requires a running [unoserver](https://github.com/unoconv/unoserver)
(`pipx install unoserver && unoserver &`), reachable via `UNOSERVER_HOST` /
`UNOSERVER_PORT` (default `127.0.0.1:2003`).
Import requires pandoc >= 2.19 in PATH (`PANDOC_BINARY` to override).
Fonts for accurate pagination: `apt install fontconfig fonts-liberation
fonts-dejavu` (macOS: `brew install fontconfig font-liberation`).

Docker image with LibreOffice, unoserver, pandoc and fonts included:

```bash
docker run --rm -v "$PWD":/work -w /work ghcr.io/grenition/markdown-gost:0.2.2 \
  convert paper.md -o paper.docx
```

## Agent skill

```bash
npx skills add grenition/markdown-gost          # skills.sh registry: Claude Code, Cursor, Codex, opencode, ...
cp -r skills/markdown-gost ~/.claude/skills/    # or copy into your harness skills directory
```

## Commands

```bash
markdown-gost convert input.md -o out.docx
markdown-gost convert input.md -o out.pdf                 # needs unoserver
markdown-gost convert input.md -o out.docx --config my.yaml
markdown-gost convert input.md -o out.docx --config gost-7-32-2017
markdown-gost validate input.md
markdown-gost import legacy.docx -o imported.md           # needs pandoc
markdown-gost import legacy.pdf -o imported.md            # needs pandoc + unoserver
```

Config: `--config` accepts a YAML file or a built-in preset name
(`gost-7-32-2017`); inside a YAML file the preset is chosen via
`preset: gost-7-32-2017`, any field overridable.
Full schema: `markdown_gost.config.schema.Config.model_json_schema()`.

Preview API:

```python
from markdown_gost.preview import build_preview_model, render_preview_html

document = build_preview_model(markdown_text, config)
html = render_preview_html(document)
```

Object stores are not bundled: implement the `Storage` protocol and pass your
implementation to the conversion APIs.

## Development

Python 3.13, Poetry 2.x.

```bash
poetry install
make test-unit
make test-integration
make test-screenshot      # pixel-diff merge gate
make lint typecheck
make test-in-docker       # full suite in the test image
```

## License

MIT — see [LICENSE](LICENSE).

