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 invisible HTML comment annotations, so the full structure survives a roundtrip:
<!-- adf:panel {"panelType": "info"} -->
This is an info panel — readable as plain Markdown.
<!-- /adf:panel -->
User <!-- adf:mention {"id": "abc123", "text": "@John"} -->`@John`<!-- /adf:mention --> approved this.
Pass annotate=False to strip annotations and get clean Markdown.
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 annotations for lossless roundtrip)
md = to_md(adf_document)
# ADF → Markdown (clean, no annotations)
clean_md = to_md(adf_document, annotate=False)
# 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 (annotated) | Markdown (plain) | |
|---|---|---|---|
| Tokens | 243,217 | 81,246 | 41,734 |
| Reduction | — | 3.0x | 5.8x |
Measured on 7 real Confluence pages (pretty-printed JSON) using GPT-4o tokenizer (tiktoken).
Documentation
- ADF ↔ Markdown Mapping Reference — how each ADF node maps to Markdown
- LLM Editing Guide — rules for LLMs/MCP servers editing marklas output
Note: Table cells use inline HTML (
<ul>,<code>,<br>) for block-level content. Raw HTML and other Markdown-only constructs are dropped during ADF conversion. See the mapping reference for details.
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.5.1.tar.gz.
File metadata
- Download URL: marklas-0.5.1.tar.gz
- Upload date:
- Size: 29.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf105307ef4624f058fe925198311ddc3375854c085e3f24540213136005e7e1
|
|
| MD5 |
d2f64751b0ac023442a1d9bb30713c22
|
|
| BLAKE2b-256 |
56822d7980fa3c66701e0c92358faae37808914cc7dc2d1735c12b8f68cefdb5
|
Provenance
The following attestation bundles were made for marklas-0.5.1.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.5.1.tar.gz -
Subject digest:
bf105307ef4624f058fe925198311ddc3375854c085e3f24540213136005e7e1 - Sigstore transparency entry: 1090769255
- Sigstore integration time:
-
Permalink:
byExist/marklas@5f8760752fa2ec45a49e5e42e3a36d4717f0bdb0 -
Branch / Tag:
refs/tags/v0.5.1 - Owner: https://github.com/byExist
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5f8760752fa2ec45a49e5e42e3a36d4717f0bdb0 -
Trigger Event:
release
-
Statement type:
File details
Details for the file marklas-0.5.1-py3-none-any.whl.
File metadata
- Download URL: marklas-0.5.1-py3-none-any.whl
- Upload date:
- Size: 33.6 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 |
7d792a1c45c6d3c6a5ecfe2e700af85649800fe4deba245025a58a835923dc6f
|
|
| MD5 |
4d6ad4423d49de47ac113c390624fafe
|
|
| BLAKE2b-256 |
e575aa4f708ed1d0a57a8c5d99f35bd6d03d90dbf5c2b8226eb7eb7fcf102bdc
|
Provenance
The following attestation bundles were made for marklas-0.5.1-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.5.1-py3-none-any.whl -
Subject digest:
7d792a1c45c6d3c6a5ecfe2e700af85649800fe4deba245025a58a835923dc6f - Sigstore transparency entry: 1090769301
- Sigstore integration time:
-
Permalink:
byExist/marklas@5f8760752fa2ec45a49e5e42e3a36d4717f0bdb0 -
Branch / Tag:
refs/tags/v0.5.1 - Owner: https://github.com/byExist
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5f8760752fa2ec45a49e5e42e3a36d4717f0bdb0 -
Trigger Event:
release
-
Statement type: