Bidirectional converter between GitHub Flavored Markdown and Atlassian Document Format
Project description
Marklas
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 through a union AST:
Markdown ⇄ Union AST ⇄ 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
- Mapping Reference — how each ADF node maps to Markdown
- LLM Editing Guide — guide for LLMs editing marklas output
Development
uv sync --extra dev
uv run pytest -v
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file marklas-0.6.0.tar.gz.
File metadata
- Download URL: marklas-0.6.0.tar.gz
- Upload date:
- Size: 24.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f20679799404a530baa2e7e6462acbed0d5428f8d11bd4a3810afe7b36e9a88
|
|
| MD5 |
c6864479b7d5cfdb136d8494e789ea47
|
|
| BLAKE2b-256 |
e8fb13595ff123549fcd1005d36d2eb0094688e19ca7ae7d56fe36928ff6cc67
|
Provenance
The following attestation bundles were made for marklas-0.6.0.tar.gz:
Publisher:
publish.yml on byExist/marklas
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
marklas-0.6.0.tar.gz -
Subject digest:
1f20679799404a530baa2e7e6462acbed0d5428f8d11bd4a3810afe7b36e9a88 - Sigstore transparency entry: 1183501364
- Sigstore integration time:
-
Permalink:
byExist/marklas@b4029b19146b405996fb0844fbcc7e5fad27ff8d -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/byExist
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b4029b19146b405996fb0844fbcc7e5fad27ff8d -
Trigger Event:
release
-
Statement type:
File details
Details for the file marklas-0.6.0-py3-none-any.whl.
File metadata
- Download URL: marklas-0.6.0-py3-none-any.whl
- Upload date:
- Size: 28.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c25411746332ac77bd5eb4a6d9abedc4d04ee05770782d23af08ce268cbeab6
|
|
| MD5 |
6ffa2e13b943d7afe366f8a9d1616f3f
|
|
| BLAKE2b-256 |
bdc4a1ed3e0a3575c1a8a538b7bab293b350f50240bb0ecac57b751e157ff829
|
Provenance
The following attestation bundles were made for marklas-0.6.0-py3-none-any.whl:
Publisher:
publish.yml on byExist/marklas
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
marklas-0.6.0-py3-none-any.whl -
Subject digest:
8c25411746332ac77bd5eb4a6d9abedc4d04ee05770782d23af08ce268cbeab6 - Sigstore transparency entry: 1183501410
- Sigstore integration time:
-
Permalink:
byExist/marklas@b4029b19146b405996fb0844fbcc7e5fad27ff8d -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/byExist
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b4029b19146b405996fb0844fbcc7e5fad27ff8d -
Trigger Event:
release
-
Statement type: