Bidirectional converter between GitHub Flavored Markdown and Atlassian Document Format
Project description
Marklas
Markdown ⇄ ADF
Installation
pip install marklas
Usage
Markdown → ADF
from marklas import to_adf
adf = to_adf("**Hello** world")
# {
# "type": "doc",
# "version": 1,
# "content": [
# {
# "type": "paragraph",
# "content": [
# {"type": "text", "text": "Hello", "marks": [{"type": "strong"}]},
# {"type": "text", "text": " world"}
# ]
# }
# ]
# }
ADF → Markdown
from marklas import to_md
md = to_md(adf)
# "**Hello** world\n"
Conversion Rules
Block
| ADF | Markdown |
|---|---|
paragraph |
inline content |
heading (level 1-6) |
# ~ ###### |
codeBlock (language?) |
```lang\ncode\n``` |
blockquote |
> text |
bulletList > listItem |
- item |
orderedList > listItem |
1. item |
taskList > taskItem |
- [x] / - [ ] |
decisionList > decisionItem |
- [x] / - [ ] |
rule |
--- |
table > tableRow > tableHeader/tableCell |
GFM table (merged cells are split, only paragraph content) |
mediaSingle > media (external) |
 |
mediaSingle > media (non-external) |
[Image: id] |
mediaGroup > media |
 / [Image: id] |
panel |
> text |
expand / nestedExpand (title?) |
> title\n> text |
layoutSection > layoutColumn |
columns flattened |
blockCard (url) |
[url](url) |
embedCard (url) |
[url](url) |
Inline
| ADF | Markdown |
|---|---|
text |
plain text |
text + strong mark |
**text** |
text + em mark |
*text* |
text + strike mark |
~~text~~ |
text + code mark |
`code` |
text + link mark |
[text](url) |
hardBreak |
\ + newline |
mention |
`@user` |
emoji |
:shortName: |
date |
`2024-01-01` |
status |
`status text` |
inlineCard (url) |
[url](url) |
Not Supported
| Element | Behavior |
|---|---|
ADF marks: underline, textColor, backgroundColor, subsup |
silently ignored |
ADF blocks: extension, bodiedExtension, syncBlock, bodiedSyncBlock |
[type] placeholder |
ADF inlines: placeholder, inlineExtension, mediaInline |
[type] placeholder |
| Markdown: raw HTML (block, inline) | silently ignored |
Development
uv sync --extra dev
uv run pytest -v
uv run black src/ tests/
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.2.1.tar.gz.
File metadata
- Download URL: marklas-0.2.1.tar.gz
- Upload date:
- Size: 11.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c0f896d8c1369710306e529de62c19e31f57d8d3161bec0532b3faa3556dad15
|
|
| MD5 |
a7022841741fcc91700283a8649b25bf
|
|
| BLAKE2b-256 |
8841668c471449bdf92fb66d0c891196394b8c55c1c98141ad69f89a6feb7e59
|
Provenance
The following attestation bundles were made for marklas-0.2.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.2.1.tar.gz -
Subject digest:
c0f896d8c1369710306e529de62c19e31f57d8d3161bec0532b3faa3556dad15 - Sigstore transparency entry: 1015447215
- Sigstore integration time:
-
Permalink:
byExist/marklas@4daf0be64074d72de6d1722e9a820c98ed4e8fca -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/byExist
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4daf0be64074d72de6d1722e9a820c98ed4e8fca -
Trigger Event:
release
-
Statement type:
File details
Details for the file marklas-0.2.1-py3-none-any.whl.
File metadata
- Download URL: marklas-0.2.1-py3-none-any.whl
- Upload date:
- Size: 15.7 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 |
bfd421f6700558044c974893f35dd9efbfedcf345ff70270cc7bc70a8044b603
|
|
| MD5 |
b75b84ad58d41bb4014ffb77e11cb5e5
|
|
| BLAKE2b-256 |
a4b315eab1f3bb17ece10d3913ff86103656a81446fe04f2b5052868d03943a5
|
Provenance
The following attestation bundles were made for marklas-0.2.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.2.1-py3-none-any.whl -
Subject digest:
bfd421f6700558044c974893f35dd9efbfedcf345ff70270cc7bc70a8044b603 - Sigstore transparency entry: 1015447295
- Sigstore integration time:
-
Permalink:
byExist/marklas@4daf0be64074d72de6d1722e9a820c98ed4e8fca -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/byExist
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4daf0be64074d72de6d1722e9a820c98ed4e8fca -
Trigger Event:
release
-
Statement type: