mdhtml 0.1.45__tar.gz → 0.1.48__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.
Files changed (154) hide show
  1. {mdhtml-0.1.45 → mdhtml-0.1.48}/.github/workflows/ci.yml +28 -5
  2. {mdhtml-0.1.45 → mdhtml-0.1.48}/.gitignore +2 -0
  3. {mdhtml-0.1.45 → mdhtml-0.1.48}/Cargo.lock +12 -26
  4. {mdhtml-0.1.45 → mdhtml-0.1.48}/Cargo.toml +1 -4
  5. {mdhtml-0.1.45 → mdhtml-0.1.48}/DEV.md +2 -0
  6. {mdhtml-0.1.45 → mdhtml-0.1.48}/PKG-INFO +3 -1
  7. {mdhtml-0.1.45 → mdhtml-0.1.48}/README.md +2 -0
  8. {mdhtml-0.1.45 → mdhtml-0.1.48}/docs/sample.html +35 -7
  9. {mdhtml-0.1.45 → mdhtml-0.1.48}/examples/README.md +1 -1
  10. {mdhtml-0.1.45 → mdhtml-0.1.48}/examples/sample-clean.md +33 -17
  11. {mdhtml-0.1.45 → mdhtml-0.1.48}/examples/sample-render.md +48 -17
  12. {mdhtml-0.1.45 → mdhtml-0.1.48}/examples/sample.md +26 -8
  13. mdhtml-0.1.48/lite/LICENSE +201 -0
  14. mdhtml-0.1.48/lite/README.md +55 -0
  15. mdhtml-0.1.48/lite/demo/activity.js +30 -0
  16. mdhtml-0.1.48/lite/demo.html +78 -0
  17. mdhtml-0.1.48/lite/dialect-mini.md +63 -0
  18. mdhtml-0.1.48/lite/index.d.ts +30 -0
  19. mdhtml-0.1.48/lite/index.js +81 -0
  20. mdhtml-0.1.48/lite/inline.js +191 -0
  21. mdhtml-0.1.48/lite/package.json +43 -0
  22. mdhtml-0.1.48/lite/parse.js +213 -0
  23. mdhtml-0.1.48/lite/scripts/dev.js +13 -0
  24. mdhtml-0.1.48/lite/test/fixtures.js +26 -0
  25. mdhtml-0.1.48/lite/test/parser.test.js +171 -0
  26. mdhtml-0.1.48/package-lock.json +291 -0
  27. mdhtml-0.1.48/package.json +4 -0
  28. {mdhtml-0.1.45 → mdhtml-0.1.48}/python/mdhtml/tools.py +5 -5
  29. {mdhtml-0.1.45 → mdhtml-0.1.48}/src/block.rs +36 -26
  30. mdhtml-0.1.48/src/entity.rs +145 -0
  31. mdhtml-0.1.48/src/entity_table.bin +0 -0
  32. {mdhtml-0.1.45 → mdhtml-0.1.48}/src/export_html.rs +4 -6
  33. {mdhtml-0.1.45 → mdhtml-0.1.48}/src/inline.rs +44 -2
  34. {mdhtml-0.1.45 → mdhtml-0.1.48}/src/lib.rs +3 -0
  35. {mdhtml-0.1.45 → mdhtml-0.1.48}/src/render.rs +6 -4
  36. {mdhtml-0.1.45 → mdhtml-0.1.48}/src/resolve.rs +1 -1
  37. {mdhtml-0.1.45 → mdhtml-0.1.48}/src/write_md.rs +16 -4
  38. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/wasm.mjs +7 -0
  39. mdhtml-0.1.45/src/entity.rs +0 -64
  40. {mdhtml-0.1.45 → mdhtml-0.1.48}/.cargo/config.toml +0 -0
  41. {mdhtml-0.1.45 → mdhtml-0.1.48}/.nojekyll +0 -0
  42. {mdhtml-0.1.45 → mdhtml-0.1.48}/CHANGELOG.md +0 -0
  43. {mdhtml-0.1.45 → mdhtml-0.1.48}/LICENSE +0 -0
  44. {mdhtml-0.1.45 → mdhtml-0.1.48}/_config.yml +0 -0
  45. {mdhtml-0.1.45 → mdhtml-0.1.48}/_layouts/default.html +0 -0
  46. {mdhtml-0.1.45 → mdhtml-0.1.48}/docs/DIALECT.md +0 -0
  47. {mdhtml-0.1.45 → mdhtml-0.1.48}/docs/puppy.jpg +0 -0
  48. {mdhtml-0.1.45 → mdhtml-0.1.48}/examples/demo.md +0 -0
  49. {mdhtml-0.1.45 → mdhtml-0.1.48}/examples/examples.ipynb +0 -0
  50. {mdhtml-0.1.45 → mdhtml-0.1.48}/examples/filldemo.py +0 -0
  51. {mdhtml-0.1.45 → mdhtml-0.1.48}/examples/legal_demo-bound.docx +0 -0
  52. {mdhtml-0.1.45 → mdhtml-0.1.48}/examples/legal_demo-filled.md +0 -0
  53. {mdhtml-0.1.45 → mdhtml-0.1.48}/examples/legal_demo-filled.pdf +0 -0
  54. {mdhtml-0.1.45 → mdhtml-0.1.48}/examples/legal_demo-form.docx +0 -0
  55. {mdhtml-0.1.45 → mdhtml-0.1.48}/examples/legal_demo-render.md +0 -0
  56. {mdhtml-0.1.45 → mdhtml-0.1.48}/examples/legal_demo.docx +0 -0
  57. {mdhtml-0.1.45 → mdhtml-0.1.48}/examples/legal_demo.html +0 -0
  58. {mdhtml-0.1.45 → mdhtml-0.1.48}/examples/legal_demo.ipynb +0 -0
  59. {mdhtml-0.1.45 → mdhtml-0.1.48}/examples/legal_demo.md +0 -0
  60. {mdhtml-0.1.45 → mdhtml-0.1.48}/examples/legal_demo.pdf +0 -0
  61. {mdhtml-0.1.45 → mdhtml-0.1.48}/examples/legal_demo.typ +0 -0
  62. {mdhtml-0.1.45 → mdhtml-0.1.48}/examples/nbsample.ipynb +0 -0
  63. {mdhtml-0.1.45 → mdhtml-0.1.48}/examples/puppy.jpg +0 -0
  64. {mdhtml-0.1.45 → mdhtml-0.1.48}/examples/render_demo.py +0 -0
  65. {mdhtml-0.1.45 → mdhtml-0.1.48}/examples/sample.css +0 -0
  66. {mdhtml-0.1.45 → mdhtml-0.1.48}/examples/sample.js +0 -0
  67. {mdhtml-0.1.45 → mdhtml-0.1.48}/py/Cargo.toml +0 -0
  68. {mdhtml-0.1.45 → mdhtml-0.1.48}/py/build.rs +0 -0
  69. {mdhtml-0.1.45 → mdhtml-0.1.48}/py/src/lib.rs +0 -0
  70. {mdhtml-0.1.45 → mdhtml-0.1.48}/pyproject.toml +0 -0
  71. {mdhtml-0.1.45 → mdhtml-0.1.48}/python/mdhtml/__init__.py +0 -0
  72. {mdhtml-0.1.45 → mdhtml-0.1.48}/python/mdhtml/__main__.py +0 -0
  73. {mdhtml-0.1.45 → mdhtml-0.1.48}/python/mdhtml/_cli.py +0 -0
  74. {mdhtml-0.1.45 → mdhtml-0.1.48}/python/mdhtml/chunk.py +0 -0
  75. {mdhtml-0.1.45 → mdhtml-0.1.48}/python/mdhtml/controls.html +0 -0
  76. {mdhtml-0.1.45 → mdhtml-0.1.48}/python/mdhtml/export.py +0 -0
  77. {mdhtml-0.1.45 → mdhtml-0.1.48}/python/mdhtml/fill.py +0 -0
  78. {mdhtml-0.1.45 → mdhtml-0.1.48}/python/mdhtml/md.py +0 -0
  79. {mdhtml-0.1.45 → mdhtml-0.1.48}/python/mdhtml/md2html.py +0 -0
  80. {mdhtml-0.1.45 → mdhtml-0.1.48}/python/mdhtml/mustache.py +0 -0
  81. {mdhtml-0.1.45 → mdhtml-0.1.48}/python/mdhtml/page.css +0 -0
  82. {mdhtml-0.1.45 → mdhtml-0.1.48}/python/mdhtml/readme.py +0 -0
  83. {mdhtml-0.1.45 → mdhtml-0.1.48}/python/mdhtml/typst.py +0 -0
  84. {mdhtml-0.1.45 → mdhtml-0.1.48}/python/mdhtml/view.css +0 -0
  85. {mdhtml-0.1.45 → mdhtml-0.1.48}/python/mdhtml/view.js +0 -0
  86. {mdhtml-0.1.45 → mdhtml-0.1.48}/python/mdhtml/viewmd.py +0 -0
  87. {mdhtml-0.1.45 → mdhtml-0.1.48}/python/mdhtml/wrap.py +0 -0
  88. {mdhtml-0.1.45 → mdhtml-0.1.48}/rustfmt.toml +0 -0
  89. {mdhtml-0.1.45 → mdhtml-0.1.48}/src/ast.rs +0 -0
  90. {mdhtml-0.1.45 → mdhtml-0.1.48}/src/attrs.rs +0 -0
  91. {mdhtml-0.1.45 → mdhtml-0.1.48}/src/chunk.rs +0 -0
  92. {mdhtml-0.1.45 → mdhtml-0.1.48}/src/diagnostic.rs +0 -0
  93. {mdhtml-0.1.45 → mdhtml-0.1.48}/src/frontmatter.rs +0 -0
  94. {mdhtml-0.1.45 → mdhtml-0.1.48}/src/highlight.rs +0 -0
  95. {mdhtml-0.1.45 → mdhtml-0.1.48}/src/html.rs +0 -0
  96. {mdhtml-0.1.45 → mdhtml-0.1.48}/src/import.rs +0 -0
  97. {mdhtml-0.1.45 → mdhtml-0.1.48}/src/inline_spans.rs +0 -0
  98. {mdhtml-0.1.45 → mdhtml-0.1.48}/src/line.rs +0 -0
  99. {mdhtml-0.1.45 → mdhtml-0.1.48}/src/markdown.rs +0 -0
  100. {mdhtml-0.1.45 → mdhtml-0.1.48}/src/preview.css +0 -0
  101. {mdhtml-0.1.45 → mdhtml-0.1.48}/src/scan.rs +0 -0
  102. {mdhtml-0.1.45 → mdhtml-0.1.48}/src/template.rs +0 -0
  103. {mdhtml-0.1.45 → mdhtml-0.1.48}/src/tmpl.css +0 -0
  104. {mdhtml-0.1.45 → mdhtml-0.1.48}/src/wikitext.rs +0 -0
  105. {mdhtml-0.1.45 → mdhtml-0.1.48}/src/wrap.rs +0 -0
  106. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/canonical.rs +0 -0
  107. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/fixtures/dialect.html +0 -0
  108. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/fixtures/dialect.md +0 -0
  109. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/helpers.py +0 -0
  110. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/resolve.rs +0 -0
  111. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/source/cmark-gfm/README.md +0 -0
  112. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/source/cmark-gfm/extensions.txt +0 -0
  113. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/source/cmark-gfm/spec.txt +0 -0
  114. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/source/kramdown.txt +0 -0
  115. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/source/markdowntests.md +0 -0
  116. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/source/mf.txt +0 -0
  117. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/source/pandoc-grid-tables.txt +0 -0
  118. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/source/php-markdown-extra.mdtest/Abbr.text +0 -0
  119. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/source/php-markdown-extra.mdtest/Abbr.xhtml +0 -0
  120. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/source/php-markdown-extra.mdtest/Backtick Fenced Code Blocks Special Cases.text +0 -0
  121. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/source/php-markdown-extra.mdtest/Backtick Fenced Code Blocks Special Cases.xhtml +0 -0
  122. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/source/php-markdown-extra.mdtest/Backtick Fenced Code Blocks.text +0 -0
  123. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/source/php-markdown-extra.mdtest/Backtick Fenced Code Blocks.xhtml +0 -0
  124. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/source/php-markdown-extra.mdtest/Definition Lists.text +0 -0
  125. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/source/php-markdown-extra.mdtest/Definition Lists.xhtml +0 -0
  126. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/source/php-markdown-extra.mdtest/Emphasis.text +0 -0
  127. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/source/php-markdown-extra.mdtest/Emphasis.xhtml +0 -0
  128. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/source/php-markdown-extra.mdtest/Footnotes.text +0 -0
  129. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/source/php-markdown-extra.mdtest/Footnotes.xhtml +0 -0
  130. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/source/php-markdown-extra.mdtest/Headers with attributes.text +0 -0
  131. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/source/php-markdown-extra.mdtest/Headers with attributes.xhtml +0 -0
  132. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/source/php-markdown-extra.mdtest/Inline HTML with Markdown content.text +0 -0
  133. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/source/php-markdown-extra.mdtest/Inline HTML with Markdown content.xhtml +0 -0
  134. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/source/php-markdown-extra.mdtest/Link & Image Attributes.text +0 -0
  135. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/source/php-markdown-extra.mdtest/Link & Image Attributes.xhtml +0 -0
  136. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/source/php-markdown-extra.mdtest/Tables.text +0 -0
  137. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/source/php-markdown-extra.mdtest/Tables.xhtml +0 -0
  138. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/source/php-markdown-extra.mdtest/Tilde Fenced Code Blocks Special Cases.text +0 -0
  139. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/source/php-markdown-extra.mdtest/Tilde Fenced Code Blocks Special Cases.xhtml +0 -0
  140. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/source/php-markdown-extra.mdtest/Tilde Fenced Code Blocks.text +0 -0
  141. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/source/php-markdown-extra.mdtest/Tilde Fenced Code Blocks.xhtml +0 -0
  142. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/test_bibliography.py +0 -0
  143. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/test_chunk.py +0 -0
  144. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/test_conformance.py +0 -0
  145. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/test_export.py +0 -0
  146. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/test_fill.py +0 -0
  147. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/test_focused.py +0 -0
  148. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/test_pathological.py +0 -0
  149. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/test_python.py +0 -0
  150. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/test_readme.py +0 -0
  151. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/test_typst.py +0 -0
  152. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/test_wrap.py +0 -0
  153. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/wikitext.rs +0 -0
  154. {mdhtml-0.1.45 → mdhtml-0.1.48}/tests/wrap.rs +0 -0
@@ -7,6 +7,19 @@ on:
7
7
  pull_request:
8
8
 
9
9
  jobs:
10
+ lite:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v7
14
+ - uses: actions/setup-node@v7
15
+ with:
16
+ node-version: lts/*
17
+ cache: npm
18
+ cache-dependency-path: package-lock.json
19
+ - run: npm ci
20
+ - run: npm test --workspace mdhtml-lite
21
+ - run: npm pack --workspace mdhtml-lite --dry-run
22
+
10
23
  test:
11
24
  runs-on: ubuntu-latest
12
25
  steps:
@@ -30,6 +43,7 @@ jobs:
30
43
  targets: wasm32-unknown-unknown
31
44
  - run: cargo generate-lockfile
32
45
  - uses: Swatinem/rust-cache@v2
46
+ - run: sudo apt-get update && sudo apt-get install -y binaryen
33
47
  - run: cargo wasm --profile wasm
34
48
  - run: node --test tests/wasm.mjs
35
49
  # The `npm` job publishes this package on a `v*` tag.
@@ -108,13 +122,20 @@ jobs:
108
122
 
109
123
  npm:
110
124
  if: startsWith(github.ref, 'refs/tags/v')
111
- needs: [test, wasm]
125
+ needs: [test, wasm, lite]
112
126
  runs-on: ubuntu-latest
113
- # npm accepts this job's upload through trusted publishing. The `@answerdotai/mdhtml` package's settings on npmjs.com name this workflow as its trusted publisher.
127
+ strategy:
128
+ fail-fast: false
129
+ matrix:
130
+ directory: [wasm/pkg, lite]
131
+ # Both npm packages trust this workflow and share the Cargo release version.
114
132
  permissions:
133
+ contents: read
115
134
  id-token: write
116
135
  steps:
117
- - uses: actions/download-artifact@v8
136
+ - uses: actions/checkout@v7
137
+ - if: matrix.directory == 'wasm/pkg'
138
+ uses: actions/download-artifact@v8
118
139
  with:
119
140
  name: wasm-pkg
120
141
  path: wasm/pkg
@@ -122,5 +143,7 @@ jobs:
122
143
  with:
123
144
  node-version: lts/*
124
145
  registry-url: https://registry.npmjs.org
125
- - run: npm publish
126
- working-directory: wasm/pkg
146
+ - run: |
147
+ npm pkg set version="${GITHUB_REF_NAME#v}"
148
+ npm publish --access public --ignore-scripts
149
+ working-directory: ${{ matrix.directory }}
@@ -92,6 +92,8 @@ target/
92
92
 
93
93
  # `cargo wasm` writes the npm package here: the browser module, its loader, `package.json` and `README.md`.
94
94
  wasm/pkg/
95
+ node_modules/
96
+ lite/*.tgz
95
97
 
96
98
  # Jupyter Notebook
97
99
  .ipynb_checkpoints
@@ -65,12 +65,6 @@ version = "0.5.0"
65
65
  source = "registry+https://github.com/rust-lang/crates.io-index"
66
66
  checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
67
67
 
68
- [[package]]
69
- name = "html-escape"
70
- version = "0.3.0"
71
- source = "registry+https://github.com/rust-lang/crates.io-index"
72
- checksum = "491194d601b4fa9fac3c9571e014070a0ad1bc3392d1bc10419695196a8b3cc3"
73
-
74
68
  [[package]]
75
69
  name = "html5ever"
76
70
  version = "0.39.0"
@@ -93,9 +87,9 @@ dependencies = [
93
87
 
94
88
  [[package]]
95
89
  name = "itoa"
96
- version = "1.0.18"
90
+ version = "1.0.19"
97
91
  source = "registry+https://github.com/rust-lang/crates.io-index"
98
- checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
92
+ checksum = "3bd1574e617a9a6c1f8f8181bd7e841e1f20e4277607ef28945765188d6284d4"
99
93
 
100
94
  [[package]]
101
95
  name = "libc"
@@ -131,17 +125,15 @@ dependencies = [
131
125
 
132
126
  [[package]]
133
127
  name = "mdhtml-crate"
134
- version = "0.1.45"
128
+ version = "0.1.48"
135
129
  dependencies = [
136
130
  "base64",
137
131
  "fast5ever",
138
- "html-escape",
139
- "unicode-properties",
140
132
  ]
141
133
 
142
134
  [[package]]
143
135
  name = "mdhtml-py"
144
- version = "0.1.45"
136
+ version = "0.1.48"
145
137
  dependencies = [
146
138
  "mdhtml-crate",
147
139
  "pyo3",
@@ -150,7 +142,7 @@ dependencies = [
150
142
 
151
143
  [[package]]
152
144
  name = "mdhtml-wasm"
153
- version = "0.1.45"
145
+ version = "0.1.48"
154
146
  dependencies = [
155
147
  "mdhtml-crate",
156
148
  ]
@@ -398,9 +390,9 @@ checksum = "33f4fe9184a62d842c9ef383018f3306d8ba224fd9d836f56d7288308847c256"
398
390
 
399
391
  [[package]]
400
392
  name = "smallvec"
401
- version = "1.16.5"
393
+ version = "1.16.6"
402
394
  source = "registry+https://github.com/rust-lang/crates.io-index"
403
- checksum = "149309498a5f7334b12ddae0cad8aba81ce785fe91755068867e017cf98fee46"
395
+ checksum = "3244542535d5de959d90ec55d1b5ff0fd2bb7b1310223907d5f11932847f7b59"
404
396
 
405
397
  [[package]]
406
398
  name = "string_cache"
@@ -428,9 +420,9 @@ dependencies = [
428
420
 
429
421
  [[package]]
430
422
  name = "syn"
431
- version = "3.0.9"
423
+ version = "3.0.10"
432
424
  source = "registry+https://github.com/rust-lang/crates.io-index"
433
- checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b"
425
+ checksum = "4ae9ccbea3a7b0b09443036490c8f34a8b1b760fd345e5c0dae0aac718faea79"
434
426
  dependencies = [
435
427
  "proc-macro2",
436
428
  "quote",
@@ -439,9 +431,9 @@ dependencies = [
439
431
 
440
432
  [[package]]
441
433
  name = "target-lexicon"
442
- version = "0.13.5"
434
+ version = "0.13.6"
443
435
  source = "registry+https://github.com/rust-lang/crates.io-index"
444
- checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca"
436
+ checksum = "8c447be3a2abfa84b2d91680c56600bd6b2873866de27b36ec911be705e291da"
445
437
 
446
438
  [[package]]
447
439
  name = "tendril"
@@ -497,12 +489,6 @@ version = "1.0.27"
497
489
  source = "registry+https://github.com/rust-lang/crates.io-index"
498
490
  checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563"
499
491
 
500
- [[package]]
501
- name = "unicode-properties"
502
- version = "0.1.5"
503
- source = "registry+https://github.com/rust-lang/crates.io-index"
504
- checksum = "993ad287eb20e8ba755312801cfe1413e0f25d604075863acaddca10b04c1833"
505
-
506
492
  [[package]]
507
493
  name = "web_atoms"
508
494
  version = "0.2.6"
@@ -529,7 +515,7 @@ checksum = "8c3b93199df0ab874cdf0c6a94f0a0dc3423fe41f1cafb62b8bd7b1deb277aef"
529
515
 
530
516
  [[package]]
531
517
  name = "xtask"
532
- version = "0.1.45"
518
+ version = "0.1.48"
533
519
  dependencies = [
534
520
  "anyhow",
535
521
  "serde_json",
@@ -2,7 +2,7 @@
2
2
  members = ["py"]
3
3
 
4
4
  [workspace.package]
5
- version = "0.1.45"
5
+ version = "0.1.48"
6
6
  edition = "2024"
7
7
  rust-version = "1.91"
8
8
  license = "Apache-2.0"
@@ -19,7 +19,6 @@ rust-version.workspace = true
19
19
  license.workspace = true
20
20
  description = "A bounded-time, Pandoc-leaning Markdown parser with GFM, Extra/kramdown, math, fenced divs, and MDHTML output."
21
21
  repository.workspace = true
22
- homepage = "https://github.com/AnswerDotAI/mdhtml"
23
22
  documentation = "https://github.com/AnswerDotAI/mdhtml"
24
23
  keywords = ["markdown", "parser", "html", "commonmark", "gfm"]
25
24
  categories = ["parser-implementations", "text-processing"]
@@ -65,8 +64,6 @@ dom = ["dep:fast5ever"]
65
64
  [dependencies]
66
65
  base64 = ">=0.23"
67
66
  fast5ever = { version = ">=0.1.5", optional = true }
68
- html-escape = ">=0.2"
69
- unicode-properties = ">=0.1"
70
67
 
71
68
  [lints]
72
69
  workspace = true
@@ -21,6 +21,8 @@ The `release` profile is optimized and incremental for fast local iteration. CI
21
21
 
22
22
  ## Testing
23
23
 
24
+ The independent `mdhtml-lite` npm package lives in `lite/`. Run `npm install` there once, then `npm test` or `npm run test:watch`; no Python or Rust build is needed. `npm run dev` serves its streaming/tool-wrapping demo. The tests curate cases from the existing mdhtml fixtures, and `npm pack --dry-run` checks the published file set. See `lite/dialect-mini.md` for its preview contract.
25
+
24
26
  ```bash
25
27
  cargo fastfmt
26
28
  cargo check --workspace
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mdhtml
3
- Version: 0.1.45
3
+ Version: 0.1.48
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
6
  Requires-Dist: fast5ever>=0.1.5
@@ -90,6 +90,8 @@ Write attributes for raw HTML blocks in the HTML itself. `md` attribute lists do
90
90
 
91
91
  ## Usage
92
92
 
93
+ For client-side previews of streaming LLM output, [mdhtml-lite](lite/README.md) provides a small JavaScript parser without WASM. Its [preview dialect](lite/dialect-mini.md) covers basic `md`; applications replace the preview with full mdhtml output when streaming finishes.
94
+
93
95
  Install via pip to get both the Python API and the `md2mdhtml` CLI:
94
96
 
95
97
  ```bash
@@ -58,6 +58,8 @@ Write attributes for raw HTML blocks in the HTML itself. `md` attribute lists do
58
58
 
59
59
  ## Usage
60
60
 
61
+ For client-side previews of streaming LLM output, [mdhtml-lite](lite/README.md) provides a small JavaScript parser without WASM. Its [preview dialect](lite/dialect-mini.md) covers basic `md`; applications replace the preview with full mdhtml output when streaming finishes.
62
+
61
63
  Install via pip to get both the Python API and the `md2mdhtml` CLI:
62
64
 
63
65
  ```bash
@@ -362,7 +362,7 @@ GitHub-specific Markdown is inserted only in GFM output.
362
362
  </code></pre>
363
363
  <p>A quick aside.<sup id="fnref-__note1"><a href="#fn-__note1" class="footnote-ref" role="doc-noteref">2</a></sup></p>
364
364
  <h2>Template tokens and filling</h2>
365
- <p>Mustache-spelled tokens are recognized when a <code>templates=</code> configuration is passed (<code>viewmd</code> and <code>md2html</code> pass one by default) and render as inert pills, so a template previews without running. <code>fillmd</code> fills them, gathering defaults from the document's own <code>formdata:</code> frontmatter — this page's frontmatter supplies every field below, so <code>fillmd examples/sample-clean.md</code> (the generated plain register, where the example is live rather than fenced) completes this section. A var substitutes text in place; a range's behavior is decided by its value's <em>type</em>: falsy drops it, a dict keeps it once as a scope, a list repeats it per item, and <code>{{^</code> keeps only on falsy:</p>
365
+ <p>Mustache-spelled tokens are recognized when a <code>templates=</code> configuration is passed (<code>viewmd</code> and <code>md2html</code> pass one by default) and render as inert pills without filling. <code>fillmd</code> fills them from the document's <code>formdata:</code>. Sample generation fills the live examples below and leaves their source fences unchanged. A variable substitutes text in place; a range's behavior is decided by its value's type: falsy drops it, a dict keeps it once as a scope, a list repeats it per item, and <code>{{^</code> keeps only on falsy:</p>
366
366
  <pre><code class="language-markdown">Prepared for {{client}}.
367
367
 
368
368
  {{#office}}
@@ -379,19 +379,47 @@ The {{name}} office ({{city}}) handles this matter.
379
379
  Standard processing applies.
380
380
  {{/rush}}
381
381
  </code></pre>
382
- <p>Prepared for {{client}}.</p>
383
- <p>{{#office}} The {{name}} office ({{city}}) handles this matter. {{/office}}</p>
382
+ <p>Prepared for Riverbank Ltd.</p>
383
+ <p>The North office (Leeds) handles this matter.</p>
384
384
  <table>
385
385
  <thead>
386
386
  <tr><th>Item</th><th>Qty</th></tr>
387
387
  </thead>
388
388
  <tbody>
389
- <tr><td>{{#items}}</td><td></td></tr>
390
- <tr><td>{{name}}</td><td>{{qty}}</td></tr>
391
- <tr><td>{{/items}}</td><td></td></tr>
389
+ <tr><td>Widget</td><td>12</td></tr>
390
+ <tr><td>Sprocket</td><td>3</td></tr>
392
391
  </tbody>
393
392
  </table>
394
- <p>{{^rush}} Standard processing applies. {{/rush}}</p>
393
+ <p>Standard processing applies.</p>
394
+ <p>Nested sections scope each person's name within their department. The skills are a list of strings, addressed with <code>{{.}}</code>:</p>
395
+ <pre><code class="language-markdown">{{#departments}}
396
+ ### {{name}}
397
+
398
+ {{#people}}
399
+ **{{name}}**
400
+
401
+ {{#skills}}
402
+ - {{.}}
403
+ {{/skills}}
404
+
405
+ {{/people}}
406
+ {{/departments}}
407
+ </code></pre>
408
+ <h3>Research</h3>
409
+ <p><strong>Ada</strong></p>
410
+ <ul>
411
+ <li>Rust</li>
412
+ <li>Python</li>
413
+ </ul>
414
+ <p><strong>Lin</strong></p>
415
+ <ul>
416
+ <li>Typst</li>
417
+ </ul>
418
+ <h3>Operations</h3>
419
+ <p><strong>Sam</strong></p>
420
+ <ul>
421
+ <li>SQL</li>
422
+ </ul>
395
423
  <section class="footnotes" role="doc-endnotes">
396
424
  <ol>
397
425
  <li id="fn-sample-note">
@@ -50,7 +50,7 @@ space, and ordinary text keeps flowing after the table.
50
50
  ## The other files
51
51
 
52
52
  - `sample.md` - the feature sample: one section per dialect feature, each giving its Markdown
53
- source once, fenced. `mdhtml.tools.sample_md()` expands each fence with a copy of its body
53
+ source once, fenced. `mdhtml.tools.sample_md()` expands each fence with a filled copy of its body
54
54
  unfenced, so the tour shows source and rendering without repeating either. `sample-render.md`
55
55
  is that expanded document, `sample-clean.md` the same with each fence *replaced* by its body
56
56
  (a plain demo document, `mdhtml.tools.sample_clean()`), `puppy.jpg` the image they use, and
@@ -11,6 +11,14 @@ formdata:
11
11
  - {name: Widget, qty: "12"}
12
12
  - {name: Sprocket, qty: "3"}
13
13
  rush: ""
14
+ departments:
15
+ - name: Research
16
+ people:
17
+ - {name: Ada, skills: [Rust, Python]}
18
+ - {name: Lin, skills: [Typst]}
19
+ - name: Operations
20
+ people:
21
+ - {name: Sam, skills: [SQL]}
14
22
  ---
15
23
 
16
24
  # mdhtml feature sample
@@ -290,27 +298,35 @@ A quick aside.^[Inline footnotes hold arbitrary *inline* Markdown.]
290
298
 
291
299
  ## Template tokens and filling
292
300
 
293
- Mustache-spelled tokens are recognized when a `templates=` configuration is passed
294
- (`viewmd` and `md2html` pass one by default) and render as inert pills, so a template
295
- previews without running. `fillmd` fills them, gathering defaults from the document's
296
- own `formdata:` frontmatter — this page's frontmatter supplies every field below, so
297
- `fillmd examples/sample-clean.md` (the generated plain register, where the example is
298
- live rather than fenced) completes this section. A var substitutes text in place;
299
- a range's behavior is decided by its value's *type*: falsy drops it, a dict keeps it
300
- once as a scope, a list repeats it per item, and `{{^` keeps only on falsy:
301
+ Mustache-spelled tokens are recognized when a `templates=` configuration is passed (`viewmd` and `md2html` pass one by default) and render as inert pills without filling. `fillmd` fills them from the document's `formdata:`. Sample generation fills the live examples below and leaves their source fences unchanged. A variable substitutes text in place; a range's behavior is decided by its value's type: falsy drops it, a dict keeps it once as a scope, a list repeats it per item, and `{{^` keeps only on falsy:
301
302
 
302
- Prepared for {{client}}.
303
+ Prepared for Riverbank Ltd.
303
304
 
304
- {{#office}}
305
- The {{name}} office ({{city}}) handles this matter.
306
- {{/office}}
305
+ The North office (Leeds) handles this matter.
307
306
 
308
307
  | Item | Qty |
309
308
  |------|------|
310
- {{#items}}
311
- | {{name}} | {{qty}} |
312
- {{/items}}
309
+ | Widget | 12 |
310
+ | Sprocket | 3 |
313
311
 
314
- {{^rush}}
315
312
  Standard processing applies.
316
- {{/rush}}
313
+
314
+ Nested sections scope each person's name within their department. The skills are a list of strings, addressed with `{{.}}`:
315
+
316
+ ### Research
317
+
318
+ **Ada**
319
+
320
+ - Rust
321
+ - Python
322
+
323
+ **Lin**
324
+
325
+ - Typst
326
+
327
+ ### Operations
328
+
329
+ **Sam**
330
+
331
+ - SQL
332
+
@@ -11,6 +11,14 @@ formdata:
11
11
  - {name: Widget, qty: "12"}
12
12
  - {name: Sprocket, qty: "3"}
13
13
  rush: ""
14
+ departments:
15
+ - name: Research
16
+ people:
17
+ - {name: Ada, skills: [Rust, Python]}
18
+ - {name: Lin, skills: [Typst]}
19
+ - name: Operations
20
+ people:
21
+ - {name: Sam, skills: [SQL]}
14
22
  ---
15
23
 
16
24
  # mdhtml feature sample
@@ -527,14 +535,7 @@ A quick aside.^[Inline footnotes hold arbitrary *inline* Markdown.]
527
535
 
528
536
  ## Template tokens and filling
529
537
 
530
- Mustache-spelled tokens are recognized when a `templates=` configuration is passed
531
- (`viewmd` and `md2html` pass one by default) and render as inert pills, so a template
532
- previews without running. `fillmd` fills them, gathering defaults from the document's
533
- own `formdata:` frontmatter — this page's frontmatter supplies every field below, so
534
- `fillmd examples/sample-clean.md` (the generated plain register, where the example is
535
- live rather than fenced) completes this section. A var substitutes text in place;
536
- a range's behavior is decided by its value's *type*: falsy drops it, a dict keeps it
537
- once as a scope, a list repeats it per item, and `{{^` keeps only on falsy:
538
+ Mustache-spelled tokens are recognized when a `templates=` configuration is passed (`viewmd` and `md2html` pass one by default) and render as inert pills without filling. `fillmd` fills them from the document's `formdata:`. Sample generation fills the live examples below and leaves their source fences unchanged. A variable substitutes text in place; a range's behavior is decided by its value's type: falsy drops it, a dict keeps it once as a scope, a list repeats it per item, and `{{^` keeps only on falsy:
538
539
 
539
540
  `````markdown
540
541
  Prepared for {{client}}.
@@ -554,18 +555,48 @@ Standard processing applies.
554
555
  {{/rush}}
555
556
  `````
556
557
 
557
- Prepared for {{client}}.
558
+ Prepared for Riverbank Ltd.
558
559
 
559
- {{#office}}
560
- The {{name}} office ({{city}}) handles this matter.
561
- {{/office}}
560
+ The North office (Leeds) handles this matter.
562
561
 
563
562
  | Item | Qty |
564
563
  |------|------|
565
- {{#items}}
566
- | {{name}} | {{qty}} |
567
- {{/items}}
564
+ | Widget | 12 |
565
+ | Sprocket | 3 |
568
566
 
569
- {{^rush}}
570
567
  Standard processing applies.
571
- {{/rush}}
568
+
569
+ Nested sections scope each person's name within their department. The skills are a list of strings, addressed with `{{.}}`:
570
+
571
+ `````markdown
572
+ {{#departments}}
573
+ ### {{name}}
574
+
575
+ {{#people}}
576
+ **{{name}}**
577
+
578
+ {{#skills}}
579
+ - {{.}}
580
+ {{/skills}}
581
+
582
+ {{/people}}
583
+ {{/departments}}
584
+ `````
585
+
586
+ ### Research
587
+
588
+ **Ada**
589
+
590
+ - Rust
591
+ - Python
592
+
593
+ **Lin**
594
+
595
+ - Typst
596
+
597
+ ### Operations
598
+
599
+ **Sam**
600
+
601
+ - SQL
602
+
@@ -11,6 +11,14 @@ formdata:
11
11
  - {name: Widget, qty: "12"}
12
12
  - {name: Sprocket, qty: "3"}
13
13
  rush: ""
14
+ departments:
15
+ - name: Research
16
+ people:
17
+ - {name: Ada, skills: [Rust, Python]}
18
+ - {name: Lin, skills: [Typst]}
19
+ - name: Operations
20
+ people:
21
+ - {name: Sam, skills: [SQL]}
14
22
  ---
15
23
 
16
24
  # mdhtml feature sample
@@ -338,14 +346,7 @@ A quick aside.^[Inline footnotes hold arbitrary *inline* Markdown.]
338
346
 
339
347
  ## Template tokens and filling
340
348
 
341
- Mustache-spelled tokens are recognized when a `templates=` configuration is passed
342
- (`viewmd` and `md2html` pass one by default) and render as inert pills, so a template
343
- previews without running. `fillmd` fills them, gathering defaults from the document's
344
- own `formdata:` frontmatter — this page's frontmatter supplies every field below, so
345
- `fillmd examples/sample-clean.md` (the generated plain register, where the example is
346
- live rather than fenced) completes this section. A var substitutes text in place;
347
- a range's behavior is decided by its value's *type*: falsy drops it, a dict keeps it
348
- once as a scope, a list repeats it per item, and `{{^` keeps only on falsy:
349
+ Mustache-spelled tokens are recognized when a `templates=` configuration is passed (`viewmd` and `md2html` pass one by default) and render as inert pills without filling. `fillmd` fills them from the document's `formdata:`. Sample generation fills the live examples below and leaves their source fences unchanged. A variable substitutes text in place; a range's behavior is decided by its value's type: falsy drops it, a dict keeps it once as a scope, a list repeats it per item, and `{{^` keeps only on falsy:
349
350
 
350
351
  `````markdown
351
352
  Prepared for {{client}}.
@@ -364,3 +365,20 @@ The {{name}} office ({{city}}) handles this matter.
364
365
  Standard processing applies.
365
366
  {{/rush}}
366
367
  `````
368
+
369
+ Nested sections scope each person's name within their department. The skills are a list of strings, addressed with `{{.}}`:
370
+
371
+ `````markdown
372
+ {{#departments}}
373
+ ### {{name}}
374
+
375
+ {{#people}}
376
+ **{{name}}**
377
+
378
+ {{#skills}}
379
+ - {{.}}
380
+ {{/skills}}
381
+
382
+ {{/people}}
383
+ {{/departments}}
384
+ `````