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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: marklas
3
- Version: 0.5.2
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 invisible HTML comment annotations, so the full structure survives a roundtrip:
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
- <!-- adf:panel {"panelType": "info"} -->
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
- User <!-- adf:mention {"id": "abc123", "text": "@John"} -->`@John`<!-- /adf:mention --> approved this.
57
+ </aside>
58
+
59
+ User <span adf="mention" params='{"id":"abc123"}'>@John</span> approved this.
53
60
  ```
54
61
 
55
- Pass `annotate=False` to strip annotations and get clean Markdown.
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 annotations for lossless roundtrip)
78
+ # ADF → Markdown (with roundtrip metadata)
72
79
  md = to_md(adf_document)
73
80
 
74
- # ADF → Markdown (clean, no annotations)
75
- clean_md = to_md(adf_document, annotate=False)
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 (annotated) | Markdown (plain) |
94
+ | | ADF JSON | Markdown | Markdown (plain) |
88
95
  | --- | --- | --- | --- |
89
- | Tokens | 243,217 | 81,246 | 41,734 |
90
- | **Reduction** | — | **3.0x** | **5.8x** |
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
- - [ADF ↔ Markdown Mapping Reference](docs/mapping.md) — how each ADF node maps to Markdown
97
- - [LLM Editing Guide](docs/llm-guide.md) — rules for LLMs/MCP servers editing marklas output
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 invisible HTML comment annotations, so the full structure survives a roundtrip:
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
- <!-- adf:panel {"panelType": "info"} -->
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
- User <!-- adf:mention {"id": "abc123", "text": "@John"} -->`@John`<!-- /adf:mention --> approved this.
35
+ </aside>
36
+
37
+ User <span adf="mention" params='{"id":"abc123"}'>@John</span> approved this.
32
38
  ```
33
39
 
34
- Pass `annotate=False` to strip annotations and get clean Markdown.
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 annotations for lossless roundtrip)
56
+ # ADF → Markdown (with roundtrip metadata)
51
57
  md = to_md(adf_document)
52
58
 
53
- # ADF → Markdown (clean, no annotations)
54
- clean_md = to_md(adf_document, annotate=False)
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 (annotated) | Markdown (plain) |
72
+ | | ADF JSON | Markdown | Markdown (plain) |
67
73
  | --- | --- | --- | --- |
68
- | Tokens | 243,217 | 81,246 | 41,734 |
69
- | **Reduction** | — | **3.0x** | **5.8x** |
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
- - [ADF ↔ Markdown Mapping Reference](docs/mapping.md) — how each ADF node maps to Markdown
76
- - [LLM Editing Guide](docs/llm-guide.md) — rules for LLMs/MCP servers editing marklas output
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.5.2"
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 = ["mistune>=3.2"]
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
  ]