Skip to main content

A markdown toolbox

Project description

marksmith

A Markdown toolbox — write docs in Markdown, ship them as polished DOCX.

PyPI Python CI License: MIT

Installation

pip install marksmith

Optional extras for template support (coming soon):

pip install marksmith[template]

Quick start

# Using the installed script
marksmith convert my-doc.md output.docx

# Or via python -m
python -m marksmith convert my-doc.md output.docx

Markdown front-matter

You can add a YAML front-matter block at the top of your Markdown file. The metadata is written to the DOCX core properties (title, author, etc.) and will be used to populate template placeholders once template support is available.

---
title:          My Document
version:        1.0
author:         Paul Cummings
date:           2026-03-16
classification: Internal
---

# My Document

Content goes here...

Supported Markdown elements

Element Status
Headings H1 – H6
Bold / italic / inline code
Fenced and indented code blocks
Unordered lists (nested)
Ordered lists (nested)
Block-quotes
Tables
Thematic breaks (horizontal rules)
Strikethrough
Links (text rendered, no hyperlink) ⚠️
Images ⚠️ placeholder text only
Inline HTML ➖ ignored

Roadmap

Template support (next milestone)

The goal is to allow teams to maintain brand-consistent DOCX output without leaving Markdown. The workflow will be:

  1. A corporate .docx template carries the company's styles, logo, header, footer, and cover page. Jinja2-style tags act as placeholders:

    {{ title }}        {{ version }}      {{ author }}
    {{ date }}         {{ classification }}
    
  2. A special {{ marksmith_content }} tag marks the exact point in the template where the converted Markdown body will be inserted.

  3. Run the conversion:

    marksmith convert my-doc.md output.docx --template company-template.docx
    

    marksmith will:

    • Render all front-matter metadata into the Jinja2 placeholders.
    • Convert the Markdown body to DOCX-native content.
    • Insert the converted content at {{ marksmith_content }}.
    • Save the merged document as output.docx.

Implemented via docxtpl — install the marksmith[template] extra when this ships.

Planned future actions

Action Description
convert Markdown → DOCX (available now)
convert --template Merge into branded DOCX template (coming soon)
lint Validate Markdown style and structure
toc Generate / update table of contents
diff Show structural diff between two Markdown files

Development

git clone https://github.com/tkdpython/marksmith
cd marksmith
pip install -e .[dev]

# Run tests
pytest

# Lint
ruff check .

Releasing

  1. Bump __version__ in marksmith/__init__.py.
  2. Commit and push.
  3. Create a GitHub Release with a tag matching the version (e.g. v0.2.0).
  4. The publish workflow fires automatically and publishes to PyPI via OIDC Trusted Publisher — no API tokens needed.

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

marksmith-0.1.0.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

marksmith-0.1.0-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file marksmith-0.1.0.tar.gz.

File metadata

  • Download URL: marksmith-0.1.0.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for marksmith-0.1.0.tar.gz
Algorithm Hash digest
SHA256 db7cae55514e7f770f67a79a80e6116b8f3cce30040bc9a1df447322aa284878
MD5 b74615b7a8c15e308fc2b5159ec87d3e
BLAKE2b-256 97a4f49dce52db7e87c6d180cb6f29d51d5ab0f3f5fa187aa831580070e8fe97

See more details on using hashes here.

Provenance

The following attestation bundles were made for marksmith-0.1.0.tar.gz:

Publisher: publish.yml on tkdpython/marksmith

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file marksmith-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: marksmith-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for marksmith-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dfa8bfa2b5bfdd905cdc9417d3f505702b3c0bb720c36fec080318938f0f979c
MD5 40cb843aecee3a70e79a9c5529ffe682
BLAKE2b-256 caa6ce2848c49b6249529aa13baf42fea969300b17eb96a812d9950956eb4343

See more details on using hashes here.

Provenance

The following attestation bundles were made for marksmith-0.1.0-py3-none-any.whl:

Publisher: publish.yml on tkdpython/marksmith

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page