Skip to main content

Bidirectional converter between GitHub Flavored Markdown and Atlassian Document Format

Project description

Marklas

CI PyPI Python License

Bidirectional converter between Markdown and Atlassian Document Format (ADF).

한국어 · 日本語


Why Marklas?

Confluence and Jira store documents in ADF — a verbose JSON structure. Marklas converts it to readable Markdown and back:

Markdown ⇄ ADF

ADF-only features (panels, mentions, colored text, etc.) are preserved as HTML elements with adf attributes, so the full structure survives a roundtrip:

<aside adf="panel" params='{"panelType":"info"}'>

This is an info panel — readable as plain Markdown.

</aside>

User <span adf="mention" params='{"id":"abc123"}'>@John</span> approved this.

Pass plain=True to strip roundtrip metadata and get clean Markdown for LLM consumption.

Installation

pip install marklas

Usage

from marklas import to_adf, to_md

# Markdown → ADF
adf = to_adf("## Hello\n\nThis is **bold**.")

# ADF → Markdown (with roundtrip metadata)
md = to_md(adf_document)

# ADF → Markdown (clean, no metadata)
plain_md = to_md(adf_document, plain=True)

# Roundtrip
original_adf = fetch_confluence_page()
markdown = to_md(original_adf)          # edit in any Markdown editor
restored_adf = to_adf(markdown)         # push back — structure preserved

Token Efficiency

Markdown is significantly more compact than ADF JSON — critical for LLM-based workflows where every token counts.

ADF JSON Markdown Markdown (plain)
Tokens 243,217 76,332 47,794
Reduction 3.2x 5.1x

Measured on 7 real Confluence pages (pretty-printed JSON) using GPT-4o tokenizer (tiktoken).

Documentation

Development

uv sync --extra dev
uv run pytest -v

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

marklas-0.6.1.tar.gz (25.2 kB view details)

Uploaded Source

Built Distribution

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

marklas-0.6.1-py3-none-any.whl (28.7 kB view details)

Uploaded Python 3

File details

Details for the file marklas-0.6.1.tar.gz.

File metadata

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

File hashes

Hashes for marklas-0.6.1.tar.gz
Algorithm Hash digest
SHA256 34805b7d1d26af6d4bc0b7fe2f53383ebebbf79a27d3f7c1e378a3d07da8c82c
MD5 580de5bbad5ff5e420a3c7f60ebf76ee
BLAKE2b-256 481cb60dbcc4f9be9e89740d7ad1779bb0a19b991fcc54395b623f289048d040

See more details on using hashes here.

Provenance

The following attestation bundles were made for marklas-0.6.1.tar.gz:

Publisher: publish.yml on byExist/marklas

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

File details

Details for the file marklas-0.6.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for marklas-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e5d909014523a3a189646c59df10dad88ba9ce1fbae314d09259544c6a58c381
MD5 caa0c1419081f072171cb3377d574c2c
BLAKE2b-256 9ca569f1699846830ed9b029e9ec041a19c7e99b6266fcf467257091c4a68a41

See more details on using hashes here.

Provenance

The following attestation bundles were made for marklas-0.6.1-py3-none-any.whl:

Publisher: publish.yml on byExist/marklas

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