mdhtml 0.1.41__tar.gz → 0.1.43__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.
- {mdhtml-0.1.41 → mdhtml-0.1.43}/.github/workflows/ci.yml +2 -2
- {mdhtml-0.1.41 → mdhtml-0.1.43}/Cargo.lock +48 -52
- {mdhtml-0.1.41 → mdhtml-0.1.43}/Cargo.toml +6 -2
- {mdhtml-0.1.41 → mdhtml-0.1.43}/DEV.md +13 -11
- {mdhtml-0.1.41 → mdhtml-0.1.43}/PKG-INFO +57 -34
- {mdhtml-0.1.41 → mdhtml-0.1.43}/README.md +55 -33
- {mdhtml-0.1.41 → mdhtml-0.1.43}/docs/DIALECT.md +24 -22
- {mdhtml-0.1.41 → mdhtml-0.1.43}/docs/sample.html +38 -72
- {mdhtml-0.1.41 → mdhtml-0.1.43}/examples/README.md +1 -1
- mdhtml-0.1.43/examples/legal_demo-bound.docx +0 -0
- mdhtml-0.1.43/examples/legal_demo-form.docx +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/examples/legal_demo-render.md +40 -19
- mdhtml-0.1.43/examples/legal_demo.docx +0 -0
- mdhtml-0.1.43/examples/legal_demo.html +52 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/examples/legal_demo.ipynb +2 -2
- {mdhtml-0.1.41 → mdhtml-0.1.43}/examples/legal_demo.md +1 -1
- mdhtml-0.1.43/examples/legal_demo.pdf +837 -1
- {mdhtml-0.1.41 → mdhtml-0.1.43}/examples/legal_demo.typ +12 -11
- {mdhtml-0.1.41 → mdhtml-0.1.43}/examples/render_demo.py +4 -4
- {mdhtml-0.1.41 → mdhtml-0.1.43}/examples/sample-clean.md +7 -1
- {mdhtml-0.1.41 → mdhtml-0.1.43}/examples/sample-render.md +14 -2
- {mdhtml-0.1.41 → mdhtml-0.1.43}/examples/sample.md +7 -1
- {mdhtml-0.1.41 → mdhtml-0.1.43}/py/Cargo.toml +3 -3
- mdhtml-0.1.43/py/src/lib.rs +830 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/pyproject.toml +1 -1
- {mdhtml-0.1.41 → mdhtml-0.1.43}/python/mdhtml/__init__.py +35 -22
- {mdhtml-0.1.41 → mdhtml-0.1.43}/python/mdhtml/chunk.py +3 -4
- {mdhtml-0.1.41 → mdhtml-0.1.43}/python/mdhtml/export.py +15 -43
- {mdhtml-0.1.41 → mdhtml-0.1.43}/python/mdhtml/fill.py +13 -8
- mdhtml-0.1.43/python/mdhtml/md.py +84 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/python/mdhtml/md2html.py +1 -1
- mdhtml-0.1.43/python/mdhtml/mustache.py +29 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/python/mdhtml/readme.py +2 -1
- mdhtml-0.1.43/python/mdhtml/typst.py +251 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/python/mdhtml/viewmd.py +2 -2
- mdhtml-0.1.43/rustfmt.toml +1 -0
- mdhtml-0.1.43/src/ast.rs +303 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/src/attrs.rs +19 -59
- {mdhtml-0.1.41 → mdhtml-0.1.43}/src/block.rs +310 -804
- {mdhtml-0.1.41 → mdhtml-0.1.43}/src/chunk.rs +44 -75
- {mdhtml-0.1.41 → mdhtml-0.1.43}/src/diagnostic.rs +2 -10
- {mdhtml-0.1.41 → mdhtml-0.1.43}/src/entity.rs +4 -7
- mdhtml-0.1.43/src/export_html.rs +322 -0
- mdhtml-0.1.43/src/frontmatter.rs +99 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/src/highlight.rs +13 -34
- mdhtml-0.1.43/src/html.rs +124 -0
- mdhtml-0.1.43/src/import.rs +239 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/src/inline.rs +184 -276
- {mdhtml-0.1.41 → mdhtml-0.1.43}/src/inline_spans.rs +11 -23
- {mdhtml-0.1.41 → mdhtml-0.1.43}/src/lib.rs +15 -20
- {mdhtml-0.1.41 → mdhtml-0.1.43}/src/line.rs +5 -25
- mdhtml-0.1.43/src/markdown.rs +103 -0
- mdhtml-0.1.43/src/render.rs +648 -0
- mdhtml-0.1.43/src/resolve.rs +550 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/src/scan.rs +5 -37
- {mdhtml-0.1.41 → mdhtml-0.1.43}/src/template.rs +12 -24
- {mdhtml-0.1.41 → mdhtml-0.1.43}/src/wikitext.rs +87 -143
- {mdhtml-0.1.41 → mdhtml-0.1.43}/src/wrap.rs +18 -29
- mdhtml-0.1.43/src/write_md.rs +635 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/canonical.rs +42 -1
- mdhtml-0.1.43/tests/helpers.py +81 -0
- mdhtml-0.1.43/tests/resolve.rs +177 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/cmark-gfm/extensions.txt +2 -4
- {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/cmark-gfm/spec.txt +37 -46
- {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/mf.txt +7 -7
- {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/test_chunk.py +0 -7
- {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/test_conformance.py +1 -64
- mdhtml-0.1.43/tests/test_export.py +542 -0
- mdhtml-0.1.43/tests/test_fill.py +131 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/test_focused.py +16 -63
- {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/test_python.py +121 -347
- mdhtml-0.1.43/tests/test_readme.py +24 -0
- mdhtml-0.1.43/tests/test_typst.py +112 -0
- mdhtml-0.1.43/tests/test_wrap.py +17 -0
- mdhtml-0.1.41/examples/legal_demo-bound.docx +0 -0
- mdhtml-0.1.41/examples/legal_demo-form.docx +0 -0
- mdhtml-0.1.41/examples/legal_demo.docx +0 -0
- mdhtml-0.1.41/examples/legal_demo.html +0 -42
- mdhtml-0.1.41/examples/legal_demo.pdf +0 -813
- mdhtml-0.1.41/py/src/lib.rs +0 -969
- mdhtml-0.1.41/python/mdhtml/md.py +0 -327
- mdhtml-0.1.41/python/mdhtml/mustache.py +0 -29
- mdhtml-0.1.41/python/mdhtml/typst.py +0 -354
- mdhtml-0.1.41/rustfmt.toml +0 -4
- mdhtml-0.1.41/src/ast.rs +0 -273
- mdhtml-0.1.41/src/export_html.rs +0 -580
- mdhtml-0.1.41/src/frontmatter.rs +0 -57
- mdhtml-0.1.41/src/markdown.rs +0 -722
- mdhtml-0.1.41/src/render.rs +0 -692
- mdhtml-0.1.41/src/resolve.rs +0 -400
- mdhtml-0.1.41/src/write_md.rs +0 -335
- mdhtml-0.1.41/tests/test_export.py +0 -615
- mdhtml-0.1.41/tests/test_fill.py +0 -222
- mdhtml-0.1.41/tests/test_readme.py +0 -52
- mdhtml-0.1.41/tests/test_typst.py +0 -136
- mdhtml-0.1.41/tests/test_wrap.py +0 -42
- {mdhtml-0.1.41 → mdhtml-0.1.43}/.cargo/config.toml +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/.gitignore +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/.nojekyll +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/CHANGELOG.md +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/LICENSE +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/_config.yml +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/_layouts/default.html +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/docs/puppy.jpg +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/examples/demo.md +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/examples/examples.ipynb +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/examples/filldemo.py +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/examples/legal_demo-filled.md +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/examples/legal_demo-filled.pdf +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/examples/nbsample.ipynb +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/examples/puppy.jpg +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/examples/sample.css +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/examples/sample.js +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/py/build.rs +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/python/mdhtml/__main__.py +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/python/mdhtml/_cli.py +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/python/mdhtml/controls.html +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/python/mdhtml/page.css +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/python/mdhtml/tools.py +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/python/mdhtml/view.css +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/python/mdhtml/view.js +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/python/mdhtml/wrap.py +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/src/preview.css +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/src/tmpl.css +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/fixtures/dialect.html +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/fixtures/dialect.md +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/cmark-gfm/README.md +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/kramdown.txt +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/markdowntests.md +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/pandoc-grid-tables.txt +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Abbr.text +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Abbr.xhtml +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Backtick Fenced Code Blocks Special Cases.text +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Backtick Fenced Code Blocks Special Cases.xhtml +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Backtick Fenced Code Blocks.text +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Backtick Fenced Code Blocks.xhtml +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Definition Lists.text +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Definition Lists.xhtml +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Emphasis.text +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Emphasis.xhtml +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Footnotes.text +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Footnotes.xhtml +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Headers with attributes.text +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Headers with attributes.xhtml +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Inline HTML with Markdown content.text +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Inline HTML with Markdown content.xhtml +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Link & Image Attributes.text +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Link & Image Attributes.xhtml +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Tables.text +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Tables.xhtml +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Tilde Fenced Code Blocks Special Cases.text +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Tilde Fenced Code Blocks Special Cases.xhtml +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Tilde Fenced Code Blocks.text +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Tilde Fenced Code Blocks.xhtml +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/test_pathological.py +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/wasm.mjs +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/wikitext.rs +0 -0
- {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/wrap.rs +0 -0
|
@@ -42,7 +42,7 @@ jobs:
|
|
|
42
42
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
43
43
|
strategy:
|
|
44
44
|
matrix:
|
|
45
|
-
os: [ubuntu-latest, macos-latest]
|
|
45
|
+
os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest]
|
|
46
46
|
runs-on: ${{ matrix.os }}
|
|
47
47
|
steps:
|
|
48
48
|
- uses: actions/checkout@v7
|
|
@@ -102,7 +102,7 @@ jobs:
|
|
|
102
102
|
- uses: dtolnay/rust-toolchain@stable
|
|
103
103
|
- uses: rust-lang/crates-io-auth-action@v1
|
|
104
104
|
id: auth
|
|
105
|
-
- run: cargo publish -p mdhtml-crate
|
|
105
|
+
- run: cargo publish -p mdhtml-crate --no-verify
|
|
106
106
|
env:
|
|
107
107
|
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
|
|
108
108
|
|
|
@@ -28,9 +28,9 @@ checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600"
|
|
|
28
28
|
|
|
29
29
|
[[package]]
|
|
30
30
|
name = "equivalent"
|
|
31
|
-
version = "1.0.
|
|
31
|
+
version = "1.0.3"
|
|
32
32
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
33
|
-
checksum = "
|
|
33
|
+
checksum = "00d174d5400e5e8fd687ad1049e2f578285fa914201b1af7e8b112a4546bd826"
|
|
34
34
|
|
|
35
35
|
[[package]]
|
|
36
36
|
name = "fast5ever"
|
|
@@ -47,6 +47,12 @@ version = "2.5.0"
|
|
|
47
47
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
48
48
|
checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223"
|
|
49
49
|
|
|
50
|
+
[[package]]
|
|
51
|
+
name = "foldhash"
|
|
52
|
+
version = "0.2.0"
|
|
53
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
54
|
+
checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb"
|
|
55
|
+
|
|
50
56
|
[[package]]
|
|
51
57
|
name = "hashbrown"
|
|
52
58
|
version = "0.17.1"
|
|
@@ -61,9 +67,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
|
|
|
61
67
|
|
|
62
68
|
[[package]]
|
|
63
69
|
name = "html-escape"
|
|
64
|
-
version = "0.
|
|
70
|
+
version = "0.3.0"
|
|
65
71
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
66
|
-
checksum = "
|
|
72
|
+
checksum = "491194d601b4fa9fac3c9571e014070a0ad1bc3392d1bc10419695196a8b3cc3"
|
|
67
73
|
|
|
68
74
|
[[package]]
|
|
69
75
|
name = "html5ever"
|
|
@@ -93,9 +99,9 @@ checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
|
|
|
93
99
|
|
|
94
100
|
[[package]]
|
|
95
101
|
name = "libc"
|
|
96
|
-
version = "0.2.
|
|
102
|
+
version = "0.2.191"
|
|
97
103
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
98
|
-
checksum = "
|
|
104
|
+
checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a"
|
|
99
105
|
|
|
100
106
|
[[package]]
|
|
101
107
|
name = "lock_api"
|
|
@@ -125,7 +131,7 @@ dependencies = [
|
|
|
125
131
|
|
|
126
132
|
[[package]]
|
|
127
133
|
name = "mdhtml-crate"
|
|
128
|
-
version = "0.1.
|
|
134
|
+
version = "0.1.43"
|
|
129
135
|
dependencies = [
|
|
130
136
|
"base64",
|
|
131
137
|
"fast5ever",
|
|
@@ -135,7 +141,7 @@ dependencies = [
|
|
|
135
141
|
|
|
136
142
|
[[package]]
|
|
137
143
|
name = "mdhtml-py"
|
|
138
|
-
version = "0.1.
|
|
144
|
+
version = "0.1.43"
|
|
139
145
|
dependencies = [
|
|
140
146
|
"mdhtml-crate",
|
|
141
147
|
"pyo3",
|
|
@@ -144,7 +150,7 @@ dependencies = [
|
|
|
144
150
|
|
|
145
151
|
[[package]]
|
|
146
152
|
name = "mdhtml-wasm"
|
|
147
|
-
version = "0.1.
|
|
153
|
+
version = "0.1.43"
|
|
148
154
|
dependencies = [
|
|
149
155
|
"mdhtml-crate",
|
|
150
156
|
]
|
|
@@ -252,9 +258,9 @@ dependencies = [
|
|
|
252
258
|
|
|
253
259
|
[[package]]
|
|
254
260
|
name = "pyo3"
|
|
255
|
-
version = "0.
|
|
261
|
+
version = "0.30.1"
|
|
256
262
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
257
|
-
checksum = "
|
|
263
|
+
checksum = "229ca13b8a15bb0d1487b81ab975bfcd97513416499a8312011b6036e42e0de4"
|
|
258
264
|
dependencies = [
|
|
259
265
|
"libc",
|
|
260
266
|
"once_cell",
|
|
@@ -266,18 +272,18 @@ dependencies = [
|
|
|
266
272
|
|
|
267
273
|
[[package]]
|
|
268
274
|
name = "pyo3-build-config"
|
|
269
|
-
version = "0.
|
|
275
|
+
version = "0.30.1"
|
|
270
276
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
271
|
-
checksum = "
|
|
277
|
+
checksum = "70130e2b6dd1ee589a8788026a429561ca5c40fa7a2fa7914c2282eddae24700"
|
|
272
278
|
dependencies = [
|
|
273
279
|
"target-lexicon",
|
|
274
280
|
]
|
|
275
281
|
|
|
276
282
|
[[package]]
|
|
277
283
|
name = "pyo3-ffi"
|
|
278
|
-
version = "0.
|
|
284
|
+
version = "0.30.1"
|
|
279
285
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
280
|
-
checksum = "
|
|
286
|
+
checksum = "5e7ff73c555c286d212d4ce7e5fbda845a973c4f61bd5f160f5f2c3c2a04d1c4"
|
|
281
287
|
dependencies = [
|
|
282
288
|
"libc",
|
|
283
289
|
"pyo3-build-config",
|
|
@@ -285,26 +291,26 @@ dependencies = [
|
|
|
285
291
|
|
|
286
292
|
[[package]]
|
|
287
293
|
name = "pyo3-macros"
|
|
288
|
-
version = "0.
|
|
294
|
+
version = "0.30.1"
|
|
289
295
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
290
|
-
checksum = "
|
|
296
|
+
checksum = "c46d2e5862c7bb8207e3b639f713dda3c499933444784154c11d013c5a691b60"
|
|
291
297
|
dependencies = [
|
|
292
298
|
"proc-macro2",
|
|
293
299
|
"pyo3-macros-backend",
|
|
294
300
|
"quote",
|
|
295
|
-
"syn
|
|
301
|
+
"syn",
|
|
296
302
|
]
|
|
297
303
|
|
|
298
304
|
[[package]]
|
|
299
305
|
name = "pyo3-macros-backend"
|
|
300
|
-
version = "0.
|
|
306
|
+
version = "0.30.1"
|
|
301
307
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
302
|
-
checksum = "
|
|
308
|
+
checksum = "38b89f066f2ae72a2aef52d1537ca2fcd104440ebfadee06e97aa90738a25b9b"
|
|
303
309
|
dependencies = [
|
|
304
310
|
"heck",
|
|
305
311
|
"proc-macro2",
|
|
306
312
|
"quote",
|
|
307
|
-
"syn
|
|
313
|
+
"syn",
|
|
308
314
|
]
|
|
309
315
|
|
|
310
316
|
[[package]]
|
|
@@ -357,15 +363,16 @@ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
|
|
|
357
363
|
dependencies = [
|
|
358
364
|
"proc-macro2",
|
|
359
365
|
"quote",
|
|
360
|
-
"syn
|
|
366
|
+
"syn",
|
|
361
367
|
]
|
|
362
368
|
|
|
363
369
|
[[package]]
|
|
364
370
|
name = "serde_json"
|
|
365
|
-
version = "1.0.
|
|
371
|
+
version = "1.0.154"
|
|
366
372
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
367
|
-
checksum = "
|
|
373
|
+
checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6"
|
|
368
374
|
dependencies = [
|
|
375
|
+
"foldhash",
|
|
369
376
|
"indexmap",
|
|
370
377
|
"itoa",
|
|
371
378
|
"memchr",
|
|
@@ -376,9 +383,9 @@ dependencies = [
|
|
|
376
383
|
|
|
377
384
|
[[package]]
|
|
378
385
|
name = "serde_spanned"
|
|
379
|
-
version = "1.1.
|
|
386
|
+
version = "1.1.2"
|
|
380
387
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
381
|
-
checksum = "
|
|
388
|
+
checksum = "4e7523beb55eece201a2356bee0bbca0d1ab466c14c07703b2e0ee6d42cb0c2c"
|
|
382
389
|
dependencies = [
|
|
383
390
|
"serde_core",
|
|
384
391
|
]
|
|
@@ -391,9 +398,9 @@ checksum = "33f4fe9184a62d842c9ef383018f3306d8ba224fd9d836f56d7288308847c256"
|
|
|
391
398
|
|
|
392
399
|
[[package]]
|
|
393
400
|
name = "smallvec"
|
|
394
|
-
version = "1.16.
|
|
401
|
+
version = "1.16.4"
|
|
395
402
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
396
|
-
checksum = "
|
|
403
|
+
checksum = "d0d5d4b1981b8bbbb7aed204cae5726d683d5d6ac7e74ec54122ea28f315e7c8"
|
|
397
404
|
|
|
398
405
|
[[package]]
|
|
399
406
|
name = "string_cache"
|
|
@@ -421,20 +428,9 @@ dependencies = [
|
|
|
421
428
|
|
|
422
429
|
[[package]]
|
|
423
430
|
name = "syn"
|
|
424
|
-
version = "
|
|
425
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
426
|
-
checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297"
|
|
427
|
-
dependencies = [
|
|
428
|
-
"proc-macro2",
|
|
429
|
-
"quote",
|
|
430
|
-
"unicode-ident",
|
|
431
|
-
]
|
|
432
|
-
|
|
433
|
-
[[package]]
|
|
434
|
-
name = "syn"
|
|
435
|
-
version = "3.0.6"
|
|
431
|
+
version = "3.0.9"
|
|
436
432
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
437
|
-
checksum = "
|
|
433
|
+
checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b"
|
|
438
434
|
dependencies = [
|
|
439
435
|
"proc-macro2",
|
|
440
436
|
"quote",
|
|
@@ -458,9 +454,9 @@ dependencies = [
|
|
|
458
454
|
|
|
459
455
|
[[package]]
|
|
460
456
|
name = "toml"
|
|
461
|
-
version = "1.1.
|
|
457
|
+
version = "1.1.8+spec-1.1.0"
|
|
462
458
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
463
|
-
checksum = "
|
|
459
|
+
checksum = "20489e00e4d8741d6be680764cc12e270655e375a20d1011e844a9c3379e678d"
|
|
464
460
|
dependencies = [
|
|
465
461
|
"indexmap",
|
|
466
462
|
"serde_core",
|
|
@@ -473,33 +469,33 @@ dependencies = [
|
|
|
473
469
|
|
|
474
470
|
[[package]]
|
|
475
471
|
name = "toml_datetime"
|
|
476
|
-
version = "1.1.
|
|
472
|
+
version = "1.1.2+spec-1.1.0"
|
|
477
473
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
478
|
-
checksum = "
|
|
474
|
+
checksum = "2b86d767906c6c42421dcba507eb9d203e779497710a47782a224bb871653053"
|
|
479
475
|
dependencies = [
|
|
480
476
|
"serde_core",
|
|
481
477
|
]
|
|
482
478
|
|
|
483
479
|
[[package]]
|
|
484
480
|
name = "toml_parser"
|
|
485
|
-
version = "1.1.
|
|
481
|
+
version = "1.1.5+spec-1.1.0"
|
|
486
482
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
487
|
-
checksum = "
|
|
483
|
+
checksum = "baa693a8032d7e1cada7d0041e96126df243179ff061456783ac7f12bda4744c"
|
|
488
484
|
dependencies = [
|
|
489
485
|
"winnow",
|
|
490
486
|
]
|
|
491
487
|
|
|
492
488
|
[[package]]
|
|
493
489
|
name = "toml_writer"
|
|
494
|
-
version = "1.1.
|
|
490
|
+
version = "1.1.3+spec-1.1.0"
|
|
495
491
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
496
|
-
checksum = "
|
|
492
|
+
checksum = "06bdbd8cfc056b8d2e2e85f29b56a3bdbecb527cef81eb39e3e7b98af4652770"
|
|
497
493
|
|
|
498
494
|
[[package]]
|
|
499
495
|
name = "unicode-ident"
|
|
500
|
-
version = "1.0.
|
|
496
|
+
version = "1.0.27"
|
|
501
497
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
502
|
-
checksum = "
|
|
498
|
+
checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563"
|
|
503
499
|
|
|
504
500
|
[[package]]
|
|
505
501
|
name = "unicode-properties"
|
|
@@ -533,7 +529,7 @@ checksum = "23b97319f7b8343df12cc98938e5c3eb436064524c8d2b4e30a1d3a36eecdf81"
|
|
|
533
529
|
|
|
534
530
|
[[package]]
|
|
535
531
|
name = "xtask"
|
|
536
|
-
version = "0.1.
|
|
532
|
+
version = "0.1.43"
|
|
537
533
|
dependencies = [
|
|
538
534
|
"anyhow",
|
|
539
535
|
"serde_json",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
members = ["py"]
|
|
3
3
|
|
|
4
4
|
[workspace.package]
|
|
5
|
-
version = "0.1.
|
|
5
|
+
version = "0.1.43"
|
|
6
6
|
edition = "2024"
|
|
7
7
|
rust-version = "1.91"
|
|
8
8
|
license = "Apache-2.0"
|
|
@@ -58,9 +58,13 @@ incremental = false
|
|
|
58
58
|
inherits = "dist"
|
|
59
59
|
opt-level = "z"
|
|
60
60
|
|
|
61
|
+
[features]
|
|
62
|
+
default = ["dom"]
|
|
63
|
+
dom = ["dep:fast5ever"]
|
|
64
|
+
|
|
61
65
|
[dependencies]
|
|
62
66
|
base64 = ">=0.23"
|
|
63
|
-
fast5ever = ">=0.1.5"
|
|
67
|
+
fast5ever = { version = ">=0.1.5", optional = true }
|
|
64
68
|
html-escape = ">=0.2"
|
|
65
69
|
unicode-properties = ">=0.1"
|
|
66
70
|
|
|
@@ -22,7 +22,7 @@ The `release` profile is optimized and incremental for fast local iteration. CI
|
|
|
22
22
|
## Testing
|
|
23
23
|
|
|
24
24
|
```bash
|
|
25
|
-
cargo
|
|
25
|
+
cargo fastfmt
|
|
26
26
|
cargo check --workspace
|
|
27
27
|
cargo clippy --workspace --all-targets
|
|
28
28
|
cargo clippy -p mdhtml-wasm --target wasm32-unknown-unknown
|
|
@@ -49,21 +49,23 @@ The repository is a Cargo workspace with one published crate and one binding cra
|
|
|
49
49
|
|
|
50
50
|
`node --test tests/wasm.mjs` runs Node's built-in test runner against the package in `wasm/pkg/`, through `mdhtml.js`. It checks rendering and Unicode string transfer, including across memory growth. After Rust changes, run `cargo wasm` before the test, because the test doesn't rebuild.
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
The Python binding uses public semantic model, encoder, writer and resolver APIs. Its dictionary projection is shared by Document inspection and encoder callbacks. Source-position inspection uses its separate trace serializers.
|
|
53
53
|
|
|
54
54
|
## Shared MDHTML core
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
`Document` is the shared semantic model. Panels, references and operations have explicit types; table cells, definitions, Figure bodies and operation operands contain blocks. MDHTML is its browser-readable import/encoding boundary. Source drafts, scanner tokens and rewrite traces remain separate from the semantic model. Importers and exporters share the Rust interpretation of raw payloads, metadata, plain text and references.
|
|
57
57
|
|
|
58
|
-
Public conversion names use `x2y`, with both representations explicit: `md2mdhtml`, `mdhtml2md`, `wiki2mdhtml`, `md2gfm`, `mdhtml2html`, `mdhtml2typst`, `mdhtml2pdf`, external `mdhtml2docx`, `md2dom`, and `mdhtml2dom`.
|
|
58
|
+
Public conversion names use `x2y`, with both representations explicit: `md2mdhtml`, `mdhtml2md`, `wiki2mdhtml`, `md2gfm`, `mdhtml2gfm`, `mdhtml2html`, `mdhtml2typst`, `mdhtml2pdf`, external `mdhtml2docx`, `md2dom`, and `mdhtml2dom`. Operations within a representation, including `bake_mdhtml`, `blocks`, `rewrite`, and `fill_md`, keep ordinary verbs.
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
`src/write_md.rs` contains one Document-based md/GFM writer. `mdhtml2md` and `dom2md` import HTML then call it; they have no separate serializer. `resolve::bake_document` assigns numbers and static reference text for HTML/GFM. `ReferenceIndex::plan` supplies validation, target kinds, prefixes, grouping and variants to live-reference Typst/DOCX exporters without baking their references. Python retains an immutable native Document and projects values for format-specific emission.
|
|
61
|
+
|
|
62
|
+
`Document.frontmatter` retains the complete recognized fenced YAML. `Document::meta()` derives simple flat string pairs. Python's MDHTML result carries the same `frontmatter` and exposes a derived read-only `meta` mapping. Recognition and splitting live in `src/frontmatter.rs`; filling parses the selected payload with the existing string-preserving loader. Notebook metadata selection and merging remain notebook-specific.
|
|
61
63
|
|
|
62
64
|
The wikitext importer is a lower-level scanner in `src/wikitext.rs`. It emits the shared `Document` model directly, using the same block and inline types as the `md` parser. Balanced multiline templates, references, math, links, and the common literal-HTML subset are recognized without a source-rewriting prepass. Expansion-dependent islands are explicit raw `wikitext` carriers. A wikitext table that cannot lower structurally instead becomes visible document text, so recognized children such as templates and links remain available to downstream cleanup. Template resolution and article-content policy belong to downstream importers such as `parse-wiki`, which clean the `Document` before serialization.
|
|
63
65
|
|
|
64
66
|
`src/chunk.rs` contains the historical textual Wikipedia chunker plus two parsed-block alternatives: the same hierarchical passes over safe top-level boundaries, and a local score-guided greedy picker. Their PyO3 results record each chunk's true starting boundary. `python/mdhtml/chunk.py` contains the shared experimental scorer; it counts visible rendered words and reports boundary and length components independently.
|
|
65
67
|
|
|
66
|
-
`document_chunk_ranges_structural`
|
|
68
|
+
`document_chunk_ranges_structural` returns `(md, chunks)` from an existing `Document`. The Markdown writer records top-level block ranges during serialization. Chunking uses those ranges without cloning or re-serializing blocks. `document_chunks_structural` materializes the ranges. Footnote definitions remain in `md` but outside chunk ranges. `md_chunks_structural` is the standalone source-text path.
|
|
67
69
|
|
|
68
70
|
## Docs
|
|
69
71
|
|
|
@@ -76,23 +78,23 @@ gen_docs()
|
|
|
76
78
|
|
|
77
79
|
## HTML tree
|
|
78
80
|
|
|
79
|
-
|
|
81
|
+
The optional `dom` feature enables fast5ever-backed HTML import and finished-HTML postprocessing. `import::parse_md` normalizes md containing embedded HTML as one complete HTML5 body fragment before semantic import. `import::from_mdhtml` imports symbolic MDHTML; already numbered presentation output is not an interchange format. Final HTML encoding runs from the prepared Document, followed by DOM-only work such as highlighting, navigation ids, namespace prefixes and table layout. It does not reimport or resolve the document again. Rust's direct `parse`, wikitext import, source tools, reference baking and Markdown serializers work without `dom`. The browser binding uses this direct path and relies on the browser's HTML parser.
|
|
80
82
|
|
|
81
83
|
Non-Markdown syntax highlighting is an optional Python-layer adapter rather than a Rust dependency. Python imports fastpylight lazily and passes its result through `HtmlExportOptions::hl_fn`; the base Rust crate therefore carries no fastpylight or tree-sitter code. Without the `hl` extra, `mdhtml2html` leaves those code blocks plain and reports a warning, while Markdown fences continue to use mdhtml's own highlighter.
|
|
82
84
|
|
|
83
|
-
`ops()`
|
|
85
|
+
`ops()` searches a mutable MDHTML DOM, including inert `template.content`. It returns live fast5ever nodes for source-specific cleanup. Exporters consume semantic Document values instead; `ops()` does not define their traversal or mutation policy.
|
|
84
86
|
|
|
85
87
|
## Render callbacks
|
|
86
88
|
|
|
87
|
-
|
|
89
|
+
`Document.mdhtml(callbacks=...)` uses the Rust encoder's child-first hook. Python receives the same semantic dictionaries as `Document.blocks`, plus the default rendered HTML. Returning None keeps the default; replacement HTML replaces that node. Operation operands are inert and are not traversed by callbacks. Image alt is plain text; Figure body and caption are independent structured fields. The bridge does not construct or transform a second tree, or add Figure snapshot fields.
|
|
88
90
|
|
|
89
91
|
## Template tokens
|
|
90
92
|
|
|
91
|
-
Configured
|
|
93
|
+
Configured delimiters are recognized by `src/template.rs`. The block parser isolates whole-line `auto` and `block` tokens; the inline scanner handles `auto` and `inline` tokens elsewhere. Source traces retain delimiter spelling and offsets. The semantic model contains `Operation { syntax, action, name, args, content }`, with inert block-capable operands and an optional selected operand index. MDHTML encodes operations as `template[data-op][data-name]` elements. Python validates `TemplateDelimiter` objects and passes compact tuples to the scanner.
|
|
92
94
|
|
|
93
95
|
## Source rewriting
|
|
94
96
|
|
|
95
|
-
|
|
97
|
+
Source editing and template `tokens` find inline positions with `inlines`. During the block parse, `ContainerBuilder` records the line ranges of paragraphs, headings, and pipe tables, including those nested in containers. Opaque blocks such as code, raw HTML, and block math produce no editable inline ranges. The inline source collector runs the inline parser over each of those ranges, using the content segments that `highlight_md` also scans (`LineMap` in `src/inline_spans.rs`), and maps each node back to source offsets. Raw HTML blocks contribute only their template tokens. GFM export does not use these source-edit regions.
|
|
96
98
|
|
|
97
99
|
`rewrite` accepts any block or inline type through the native `source_nodes` inventory. One block parse and its trace supply the nested blocks and inline collector, with uniform UTF-8 byte ranges; the PyO3 bridge reuses the inspection APIs' metadata serializers. Whole-line block ranges include container prefixes and the terminating newline. Template ownership comes from the parsed delimiter form: auto tokens belong to the inline collector, while explicit block-only tokens own opaque regions. No duplicate inventory needs reconciliation. Block and inline targets share the source-order replacement loop; replacing a parent suppresses its descendants. No replacement is reindented or serialized.
|
|
98
100
|
|