marklas 0.5.2__tar.gz → 0.6.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {marklas-0.5.2 → marklas-0.6.0}/PKG-INFO +21 -16
- {marklas-0.5.2 → marklas-0.6.0}/README.md +19 -15
- {marklas-0.5.2 → marklas-0.6.0}/pyproject.toml +5 -2
- marklas-0.6.0/src/marklas/adf/parser.py +608 -0
- marklas-0.6.0/src/marklas/adf/renderer.py +623 -0
- marklas-0.6.0/src/marklas/ast.py +660 -0
- marklas-0.6.0/src/marklas/convert.py +18 -0
- marklas-0.6.0/src/marklas/md/parser.py +1110 -0
- marklas-0.6.0/src/marklas/md/renderer.py +1073 -0
- marklas-0.5.2/src/marklas/adf/__init__.py +0 -4
- marklas-0.5.2/src/marklas/adf/parser.py +0 -905
- marklas-0.5.2/src/marklas/adf/renderer.py +0 -893
- marklas-0.5.2/src/marklas/adf/schema.py +0 -694
- marklas-0.5.2/src/marklas/convert.py +0 -16
- marklas-0.5.2/src/marklas/md/__init__.py +0 -4
- marklas-0.5.2/src/marklas/md/parser.py +0 -1673
- marklas-0.5.2/src/marklas/md/renderer.py +0 -1096
- marklas-0.5.2/src/marklas/nodes/base.py +0 -6
- marklas-0.5.2/src/marklas/nodes/blocks.py +0 -386
- marklas-0.5.2/src/marklas/nodes/inlines.py +0 -176
- {marklas-0.5.2 → marklas-0.6.0}/src/marklas/__init__.py +0 -0
- {marklas-0.5.2/src/marklas/nodes → marklas-0.6.0/src/marklas/adf}/__init__.py +0 -0
- /marklas-0.5.2/src/marklas/py.typed → /marklas-0.6.0/src/marklas/md/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: marklas
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.0
|
|
4
4
|
Summary: Bidirectional converter between GitHub Flavored Markdown and Atlassian Document Format
|
|
5
5
|
Author: byExist
|
|
6
6
|
Author-email: byExist <jongbeom.kwon@gmail.com>
|
|
@@ -13,6 +13,7 @@ Classifier: License :: OSI Approved :: MIT License
|
|
|
13
13
|
Classifier: Typing :: Typed
|
|
14
14
|
Requires-Dist: mistune>=3.2
|
|
15
15
|
Requires-Dist: black>=26.1.0 ; extra == 'dev'
|
|
16
|
+
Requires-Dist: jsonschema>=4.26.0 ; extra == 'dev'
|
|
16
17
|
Requires-Dist: pytest>=8.0.0 ; extra == 'dev'
|
|
17
18
|
Requires-Dist: pytest-cov>=4.1.0 ; extra == 'dev'
|
|
18
19
|
Requires-Python: >=3.11
|
|
@@ -32,6 +33,10 @@ Description-Content-Type: text/markdown
|
|
|
32
33
|
Bidirectional converter between <b>Markdown</b> and <b>Atlassian Document Format (ADF)</b>.
|
|
33
34
|
</p>
|
|
34
35
|
|
|
36
|
+
<p align="center">
|
|
37
|
+
<a href="README.ko.md">한국어</a> · <a href="README.ja.md">日本語</a>
|
|
38
|
+
</p>
|
|
39
|
+
|
|
35
40
|
---
|
|
36
41
|
|
|
37
42
|
## Why Marklas?
|
|
@@ -42,17 +47,19 @@ Confluence and Jira store documents in [ADF](https://developer.atlassian.com/clo
|
|
|
42
47
|
Markdown ⇄ Union AST ⇄ ADF
|
|
43
48
|
```
|
|
44
49
|
|
|
45
|
-
ADF-only features (panels, mentions, colored text, etc.) are preserved as
|
|
50
|
+
ADF-only features (panels, mentions, colored text, etc.) are preserved as HTML elements with `adf` attributes, so the full structure survives a roundtrip:
|
|
46
51
|
|
|
47
52
|
```markdown
|
|
48
|
-
|
|
53
|
+
<aside adf="panel" params='{"panelType":"info"}'>
|
|
54
|
+
|
|
49
55
|
This is an info panel — readable as plain Markdown.
|
|
50
|
-
<!-- /adf:panel -->
|
|
51
56
|
|
|
52
|
-
|
|
57
|
+
</aside>
|
|
58
|
+
|
|
59
|
+
User <span adf="mention" params='{"id":"abc123"}'>@John</span> approved this.
|
|
53
60
|
```
|
|
54
61
|
|
|
55
|
-
Pass `
|
|
62
|
+
Pass `plain=True` to strip roundtrip metadata and get clean Markdown for LLM consumption.
|
|
56
63
|
|
|
57
64
|
## Installation
|
|
58
65
|
|
|
@@ -68,11 +75,11 @@ from marklas import to_adf, to_md
|
|
|
68
75
|
# Markdown → ADF
|
|
69
76
|
adf = to_adf("## Hello\n\nThis is **bold**.")
|
|
70
77
|
|
|
71
|
-
# ADF → Markdown (with
|
|
78
|
+
# ADF → Markdown (with roundtrip metadata)
|
|
72
79
|
md = to_md(adf_document)
|
|
73
80
|
|
|
74
|
-
# ADF → Markdown (clean, no
|
|
75
|
-
|
|
81
|
+
# ADF → Markdown (clean, no metadata)
|
|
82
|
+
plain_md = to_md(adf_document, plain=True)
|
|
76
83
|
|
|
77
84
|
# Roundtrip
|
|
78
85
|
original_adf = fetch_confluence_page()
|
|
@@ -84,19 +91,17 @@ restored_adf = to_adf(markdown) # push back — structure preserved
|
|
|
84
91
|
|
|
85
92
|
Markdown is significantly more compact than ADF JSON — critical for LLM-based workflows where every token counts.
|
|
86
93
|
|
|
87
|
-
| | ADF JSON | Markdown
|
|
94
|
+
| | ADF JSON | Markdown | Markdown (plain) |
|
|
88
95
|
| --- | --- | --- | --- |
|
|
89
|
-
| Tokens | 243,217 |
|
|
90
|
-
| **Reduction** | — | **3.
|
|
96
|
+
| Tokens | 243,217 | 76,332 | 47,794 |
|
|
97
|
+
| **Reduction** | — | **3.2x** | **5.1x** |
|
|
91
98
|
|
|
92
99
|
*Measured on 7 real Confluence pages (pretty-printed JSON) using GPT-4o tokenizer (tiktoken).*
|
|
93
100
|
|
|
94
101
|
## Documentation
|
|
95
102
|
|
|
96
|
-
- [
|
|
97
|
-
- [LLM Editing Guide](docs/llm-guide.md) —
|
|
98
|
-
|
|
99
|
-
> **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.
|
|
103
|
+
- [Mapping Reference](docs/mapping.md) — how each ADF node maps to Markdown
|
|
104
|
+
- [LLM Editing Guide](docs/llm-guide.md) — guide for LLMs editing marklas output
|
|
100
105
|
|
|
101
106
|
## Development
|
|
102
107
|
|
|
@@ -11,6 +11,10 @@
|
|
|
11
11
|
Bidirectional converter between <b>Markdown</b> and <b>Atlassian Document Format (ADF)</b>.
|
|
12
12
|
</p>
|
|
13
13
|
|
|
14
|
+
<p align="center">
|
|
15
|
+
<a href="README.ko.md">한국어</a> · <a href="README.ja.md">日本語</a>
|
|
16
|
+
</p>
|
|
17
|
+
|
|
14
18
|
---
|
|
15
19
|
|
|
16
20
|
## Why Marklas?
|
|
@@ -21,17 +25,19 @@ Confluence and Jira store documents in [ADF](https://developer.atlassian.com/clo
|
|
|
21
25
|
Markdown ⇄ Union AST ⇄ ADF
|
|
22
26
|
```
|
|
23
27
|
|
|
24
|
-
ADF-only features (panels, mentions, colored text, etc.) are preserved as
|
|
28
|
+
ADF-only features (panels, mentions, colored text, etc.) are preserved as HTML elements with `adf` attributes, so the full structure survives a roundtrip:
|
|
25
29
|
|
|
26
30
|
```markdown
|
|
27
|
-
|
|
31
|
+
<aside adf="panel" params='{"panelType":"info"}'>
|
|
32
|
+
|
|
28
33
|
This is an info panel — readable as plain Markdown.
|
|
29
|
-
<!-- /adf:panel -->
|
|
30
34
|
|
|
31
|
-
|
|
35
|
+
</aside>
|
|
36
|
+
|
|
37
|
+
User <span adf="mention" params='{"id":"abc123"}'>@John</span> approved this.
|
|
32
38
|
```
|
|
33
39
|
|
|
34
|
-
Pass `
|
|
40
|
+
Pass `plain=True` to strip roundtrip metadata and get clean Markdown for LLM consumption.
|
|
35
41
|
|
|
36
42
|
## Installation
|
|
37
43
|
|
|
@@ -47,11 +53,11 @@ from marklas import to_adf, to_md
|
|
|
47
53
|
# Markdown → ADF
|
|
48
54
|
adf = to_adf("## Hello\n\nThis is **bold**.")
|
|
49
55
|
|
|
50
|
-
# ADF → Markdown (with
|
|
56
|
+
# ADF → Markdown (with roundtrip metadata)
|
|
51
57
|
md = to_md(adf_document)
|
|
52
58
|
|
|
53
|
-
# ADF → Markdown (clean, no
|
|
54
|
-
|
|
59
|
+
# ADF → Markdown (clean, no metadata)
|
|
60
|
+
plain_md = to_md(adf_document, plain=True)
|
|
55
61
|
|
|
56
62
|
# Roundtrip
|
|
57
63
|
original_adf = fetch_confluence_page()
|
|
@@ -63,19 +69,17 @@ restored_adf = to_adf(markdown) # push back — structure preserved
|
|
|
63
69
|
|
|
64
70
|
Markdown is significantly more compact than ADF JSON — critical for LLM-based workflows where every token counts.
|
|
65
71
|
|
|
66
|
-
| | ADF JSON | Markdown
|
|
72
|
+
| | ADF JSON | Markdown | Markdown (plain) |
|
|
67
73
|
| --- | --- | --- | --- |
|
|
68
|
-
| Tokens | 243,217 |
|
|
69
|
-
| **Reduction** | — | **3.
|
|
74
|
+
| Tokens | 243,217 | 76,332 | 47,794 |
|
|
75
|
+
| **Reduction** | — | **3.2x** | **5.1x** |
|
|
70
76
|
|
|
71
77
|
*Measured on 7 real Confluence pages (pretty-printed JSON) using GPT-4o tokenizer (tiktoken).*
|
|
72
78
|
|
|
73
79
|
## Documentation
|
|
74
80
|
|
|
75
|
-
- [
|
|
76
|
-
- [LLM Editing Guide](docs/llm-guide.md) —
|
|
77
|
-
|
|
78
|
-
> **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.
|
|
81
|
+
- [Mapping Reference](docs/mapping.md) — how each ADF node maps to Markdown
|
|
82
|
+
- [LLM Editing Guide](docs/llm-guide.md) — guide for LLMs editing marklas output
|
|
79
83
|
|
|
80
84
|
## Development
|
|
81
85
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "marklas"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.6.0"
|
|
4
4
|
description = "Bidirectional converter between GitHub Flavored Markdown and Atlassian Document Format"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
license = "MIT"
|
|
@@ -16,11 +16,14 @@ classifiers = [
|
|
|
16
16
|
"License :: OSI Approved :: MIT License",
|
|
17
17
|
"Typing :: Typed",
|
|
18
18
|
]
|
|
19
|
-
dependencies = [
|
|
19
|
+
dependencies = [
|
|
20
|
+
"mistune>=3.2",
|
|
21
|
+
]
|
|
20
22
|
|
|
21
23
|
[project.optional-dependencies]
|
|
22
24
|
dev = [
|
|
23
25
|
"black>=26.1.0",
|
|
26
|
+
"jsonschema>=4.26.0",
|
|
24
27
|
"pytest>=8.0.0",
|
|
25
28
|
"pytest-cov>=4.1.0",
|
|
26
29
|
]
|