mdhtml 0.1.45__tar.gz → 0.1.47__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 (151) hide show
  1. {mdhtml-0.1.45 → mdhtml-0.1.47}/.github/workflows/ci.yml +30 -5
  2. {mdhtml-0.1.45 → mdhtml-0.1.47}/.gitignore +2 -0
  3. {mdhtml-0.1.45 → mdhtml-0.1.47}/Cargo.lock +12 -12
  4. {mdhtml-0.1.45 → mdhtml-0.1.47}/Cargo.toml +1 -1
  5. {mdhtml-0.1.45 → mdhtml-0.1.47}/DEV.md +2 -0
  6. {mdhtml-0.1.45 → mdhtml-0.1.47}/PKG-INFO +3 -1
  7. {mdhtml-0.1.45 → mdhtml-0.1.47}/README.md +2 -0
  8. {mdhtml-0.1.45 → mdhtml-0.1.47}/docs/sample.html +35 -7
  9. {mdhtml-0.1.45 → mdhtml-0.1.47}/examples/README.md +1 -1
  10. {mdhtml-0.1.45 → mdhtml-0.1.47}/examples/sample-clean.md +33 -17
  11. {mdhtml-0.1.45 → mdhtml-0.1.47}/examples/sample-render.md +48 -17
  12. {mdhtml-0.1.45 → mdhtml-0.1.47}/examples/sample.md +26 -8
  13. mdhtml-0.1.47/lite/LICENSE +201 -0
  14. mdhtml-0.1.47/lite/README.md +53 -0
  15. mdhtml-0.1.47/lite/demo/activity.js +30 -0
  16. mdhtml-0.1.47/lite/demo.html +78 -0
  17. mdhtml-0.1.47/lite/dialect-mini.md +63 -0
  18. mdhtml-0.1.47/lite/index.d.ts +30 -0
  19. mdhtml-0.1.47/lite/index.js +81 -0
  20. mdhtml-0.1.47/lite/inline.js +191 -0
  21. mdhtml-0.1.47/lite/package-lock.json +323 -0
  22. mdhtml-0.1.47/lite/package.json +43 -0
  23. mdhtml-0.1.47/lite/parse.js +213 -0
  24. mdhtml-0.1.47/lite/scripts/dev.js +13 -0
  25. mdhtml-0.1.47/lite/test/fixtures.js +26 -0
  26. mdhtml-0.1.47/lite/test/parser.test.js +171 -0
  27. {mdhtml-0.1.45 → mdhtml-0.1.47}/python/mdhtml/tools.py +5 -5
  28. {mdhtml-0.1.45 → mdhtml-0.1.47}/.cargo/config.toml +0 -0
  29. {mdhtml-0.1.45 → mdhtml-0.1.47}/.nojekyll +0 -0
  30. {mdhtml-0.1.45 → mdhtml-0.1.47}/CHANGELOG.md +0 -0
  31. {mdhtml-0.1.45 → mdhtml-0.1.47}/LICENSE +0 -0
  32. {mdhtml-0.1.45 → mdhtml-0.1.47}/_config.yml +0 -0
  33. {mdhtml-0.1.45 → mdhtml-0.1.47}/_layouts/default.html +0 -0
  34. {mdhtml-0.1.45 → mdhtml-0.1.47}/docs/DIALECT.md +0 -0
  35. {mdhtml-0.1.45 → mdhtml-0.1.47}/docs/puppy.jpg +0 -0
  36. {mdhtml-0.1.45 → mdhtml-0.1.47}/examples/demo.md +0 -0
  37. {mdhtml-0.1.45 → mdhtml-0.1.47}/examples/examples.ipynb +0 -0
  38. {mdhtml-0.1.45 → mdhtml-0.1.47}/examples/filldemo.py +0 -0
  39. {mdhtml-0.1.45 → mdhtml-0.1.47}/examples/legal_demo-bound.docx +0 -0
  40. {mdhtml-0.1.45 → mdhtml-0.1.47}/examples/legal_demo-filled.md +0 -0
  41. {mdhtml-0.1.45 → mdhtml-0.1.47}/examples/legal_demo-filled.pdf +0 -0
  42. {mdhtml-0.1.45 → mdhtml-0.1.47}/examples/legal_demo-form.docx +0 -0
  43. {mdhtml-0.1.45 → mdhtml-0.1.47}/examples/legal_demo-render.md +0 -0
  44. {mdhtml-0.1.45 → mdhtml-0.1.47}/examples/legal_demo.docx +0 -0
  45. {mdhtml-0.1.45 → mdhtml-0.1.47}/examples/legal_demo.html +0 -0
  46. {mdhtml-0.1.45 → mdhtml-0.1.47}/examples/legal_demo.ipynb +0 -0
  47. {mdhtml-0.1.45 → mdhtml-0.1.47}/examples/legal_demo.md +0 -0
  48. {mdhtml-0.1.45 → mdhtml-0.1.47}/examples/legal_demo.pdf +0 -0
  49. {mdhtml-0.1.45 → mdhtml-0.1.47}/examples/legal_demo.typ +0 -0
  50. {mdhtml-0.1.45 → mdhtml-0.1.47}/examples/nbsample.ipynb +0 -0
  51. {mdhtml-0.1.45 → mdhtml-0.1.47}/examples/puppy.jpg +0 -0
  52. {mdhtml-0.1.45 → mdhtml-0.1.47}/examples/render_demo.py +0 -0
  53. {mdhtml-0.1.45 → mdhtml-0.1.47}/examples/sample.css +0 -0
  54. {mdhtml-0.1.45 → mdhtml-0.1.47}/examples/sample.js +0 -0
  55. {mdhtml-0.1.45 → mdhtml-0.1.47}/py/Cargo.toml +0 -0
  56. {mdhtml-0.1.45 → mdhtml-0.1.47}/py/build.rs +0 -0
  57. {mdhtml-0.1.45 → mdhtml-0.1.47}/py/src/lib.rs +0 -0
  58. {mdhtml-0.1.45 → mdhtml-0.1.47}/pyproject.toml +0 -0
  59. {mdhtml-0.1.45 → mdhtml-0.1.47}/python/mdhtml/__init__.py +0 -0
  60. {mdhtml-0.1.45 → mdhtml-0.1.47}/python/mdhtml/__main__.py +0 -0
  61. {mdhtml-0.1.45 → mdhtml-0.1.47}/python/mdhtml/_cli.py +0 -0
  62. {mdhtml-0.1.45 → mdhtml-0.1.47}/python/mdhtml/chunk.py +0 -0
  63. {mdhtml-0.1.45 → mdhtml-0.1.47}/python/mdhtml/controls.html +0 -0
  64. {mdhtml-0.1.45 → mdhtml-0.1.47}/python/mdhtml/export.py +0 -0
  65. {mdhtml-0.1.45 → mdhtml-0.1.47}/python/mdhtml/fill.py +0 -0
  66. {mdhtml-0.1.45 → mdhtml-0.1.47}/python/mdhtml/md.py +0 -0
  67. {mdhtml-0.1.45 → mdhtml-0.1.47}/python/mdhtml/md2html.py +0 -0
  68. {mdhtml-0.1.45 → mdhtml-0.1.47}/python/mdhtml/mustache.py +0 -0
  69. {mdhtml-0.1.45 → mdhtml-0.1.47}/python/mdhtml/page.css +0 -0
  70. {mdhtml-0.1.45 → mdhtml-0.1.47}/python/mdhtml/readme.py +0 -0
  71. {mdhtml-0.1.45 → mdhtml-0.1.47}/python/mdhtml/typst.py +0 -0
  72. {mdhtml-0.1.45 → mdhtml-0.1.47}/python/mdhtml/view.css +0 -0
  73. {mdhtml-0.1.45 → mdhtml-0.1.47}/python/mdhtml/view.js +0 -0
  74. {mdhtml-0.1.45 → mdhtml-0.1.47}/python/mdhtml/viewmd.py +0 -0
  75. {mdhtml-0.1.45 → mdhtml-0.1.47}/python/mdhtml/wrap.py +0 -0
  76. {mdhtml-0.1.45 → mdhtml-0.1.47}/rustfmt.toml +0 -0
  77. {mdhtml-0.1.45 → mdhtml-0.1.47}/src/ast.rs +0 -0
  78. {mdhtml-0.1.45 → mdhtml-0.1.47}/src/attrs.rs +0 -0
  79. {mdhtml-0.1.45 → mdhtml-0.1.47}/src/block.rs +0 -0
  80. {mdhtml-0.1.45 → mdhtml-0.1.47}/src/chunk.rs +0 -0
  81. {mdhtml-0.1.45 → mdhtml-0.1.47}/src/diagnostic.rs +0 -0
  82. {mdhtml-0.1.45 → mdhtml-0.1.47}/src/entity.rs +0 -0
  83. {mdhtml-0.1.45 → mdhtml-0.1.47}/src/export_html.rs +0 -0
  84. {mdhtml-0.1.45 → mdhtml-0.1.47}/src/frontmatter.rs +0 -0
  85. {mdhtml-0.1.45 → mdhtml-0.1.47}/src/highlight.rs +0 -0
  86. {mdhtml-0.1.45 → mdhtml-0.1.47}/src/html.rs +0 -0
  87. {mdhtml-0.1.45 → mdhtml-0.1.47}/src/import.rs +0 -0
  88. {mdhtml-0.1.45 → mdhtml-0.1.47}/src/inline.rs +0 -0
  89. {mdhtml-0.1.45 → mdhtml-0.1.47}/src/inline_spans.rs +0 -0
  90. {mdhtml-0.1.45 → mdhtml-0.1.47}/src/lib.rs +0 -0
  91. {mdhtml-0.1.45 → mdhtml-0.1.47}/src/line.rs +0 -0
  92. {mdhtml-0.1.45 → mdhtml-0.1.47}/src/markdown.rs +0 -0
  93. {mdhtml-0.1.45 → mdhtml-0.1.47}/src/preview.css +0 -0
  94. {mdhtml-0.1.45 → mdhtml-0.1.47}/src/render.rs +0 -0
  95. {mdhtml-0.1.45 → mdhtml-0.1.47}/src/resolve.rs +0 -0
  96. {mdhtml-0.1.45 → mdhtml-0.1.47}/src/scan.rs +0 -0
  97. {mdhtml-0.1.45 → mdhtml-0.1.47}/src/template.rs +0 -0
  98. {mdhtml-0.1.45 → mdhtml-0.1.47}/src/tmpl.css +0 -0
  99. {mdhtml-0.1.45 → mdhtml-0.1.47}/src/wikitext.rs +0 -0
  100. {mdhtml-0.1.45 → mdhtml-0.1.47}/src/wrap.rs +0 -0
  101. {mdhtml-0.1.45 → mdhtml-0.1.47}/src/write_md.rs +0 -0
  102. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/canonical.rs +0 -0
  103. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/fixtures/dialect.html +0 -0
  104. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/fixtures/dialect.md +0 -0
  105. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/helpers.py +0 -0
  106. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/resolve.rs +0 -0
  107. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/source/cmark-gfm/README.md +0 -0
  108. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/source/cmark-gfm/extensions.txt +0 -0
  109. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/source/cmark-gfm/spec.txt +0 -0
  110. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/source/kramdown.txt +0 -0
  111. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/source/markdowntests.md +0 -0
  112. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/source/mf.txt +0 -0
  113. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/source/pandoc-grid-tables.txt +0 -0
  114. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/source/php-markdown-extra.mdtest/Abbr.text +0 -0
  115. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/source/php-markdown-extra.mdtest/Abbr.xhtml +0 -0
  116. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/source/php-markdown-extra.mdtest/Backtick Fenced Code Blocks Special Cases.text +0 -0
  117. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/source/php-markdown-extra.mdtest/Backtick Fenced Code Blocks Special Cases.xhtml +0 -0
  118. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/source/php-markdown-extra.mdtest/Backtick Fenced Code Blocks.text +0 -0
  119. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/source/php-markdown-extra.mdtest/Backtick Fenced Code Blocks.xhtml +0 -0
  120. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/source/php-markdown-extra.mdtest/Definition Lists.text +0 -0
  121. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/source/php-markdown-extra.mdtest/Definition Lists.xhtml +0 -0
  122. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/source/php-markdown-extra.mdtest/Emphasis.text +0 -0
  123. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/source/php-markdown-extra.mdtest/Emphasis.xhtml +0 -0
  124. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/source/php-markdown-extra.mdtest/Footnotes.text +0 -0
  125. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/source/php-markdown-extra.mdtest/Footnotes.xhtml +0 -0
  126. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/source/php-markdown-extra.mdtest/Headers with attributes.text +0 -0
  127. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/source/php-markdown-extra.mdtest/Headers with attributes.xhtml +0 -0
  128. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/source/php-markdown-extra.mdtest/Inline HTML with Markdown content.text +0 -0
  129. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/source/php-markdown-extra.mdtest/Inline HTML with Markdown content.xhtml +0 -0
  130. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/source/php-markdown-extra.mdtest/Link & Image Attributes.text +0 -0
  131. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/source/php-markdown-extra.mdtest/Link & Image Attributes.xhtml +0 -0
  132. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/source/php-markdown-extra.mdtest/Tables.text +0 -0
  133. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/source/php-markdown-extra.mdtest/Tables.xhtml +0 -0
  134. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/source/php-markdown-extra.mdtest/Tilde Fenced Code Blocks Special Cases.text +0 -0
  135. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/source/php-markdown-extra.mdtest/Tilde Fenced Code Blocks Special Cases.xhtml +0 -0
  136. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/source/php-markdown-extra.mdtest/Tilde Fenced Code Blocks.text +0 -0
  137. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/source/php-markdown-extra.mdtest/Tilde Fenced Code Blocks.xhtml +0 -0
  138. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/test_bibliography.py +0 -0
  139. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/test_chunk.py +0 -0
  140. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/test_conformance.py +0 -0
  141. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/test_export.py +0 -0
  142. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/test_fill.py +0 -0
  143. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/test_focused.py +0 -0
  144. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/test_pathological.py +0 -0
  145. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/test_python.py +0 -0
  146. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/test_readme.py +0 -0
  147. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/test_typst.py +0 -0
  148. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/test_wrap.py +0 -0
  149. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/wasm.mjs +0 -0
  150. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/wikitext.rs +0 -0
  151. {mdhtml-0.1.45 → mdhtml-0.1.47}/tests/wrap.rs +0 -0
@@ -7,6 +7,22 @@ on:
7
7
  pull_request:
8
8
 
9
9
  jobs:
10
+ lite:
11
+ runs-on: ubuntu-latest
12
+ defaults:
13
+ run:
14
+ working-directory: lite
15
+ steps:
16
+ - uses: actions/checkout@v7
17
+ - uses: actions/setup-node@v7
18
+ with:
19
+ node-version: lts/*
20
+ cache: npm
21
+ cache-dependency-path: lite/package-lock.json
22
+ - run: npm ci
23
+ - run: npm test
24
+ - run: npm pack --dry-run
25
+
10
26
  test:
11
27
  runs-on: ubuntu-latest
12
28
  steps:
@@ -108,13 +124,20 @@ jobs:
108
124
 
109
125
  npm:
110
126
  if: startsWith(github.ref, 'refs/tags/v')
111
- needs: [test, wasm]
127
+ needs: [test, wasm, lite]
112
128
  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.
129
+ strategy:
130
+ fail-fast: false
131
+ matrix:
132
+ directory: [wasm/pkg, lite]
133
+ # Both npm packages trust this workflow and share the Cargo release version.
114
134
  permissions:
135
+ contents: read
115
136
  id-token: write
116
137
  steps:
117
- - uses: actions/download-artifact@v8
138
+ - uses: actions/checkout@v7
139
+ - if: matrix.directory == 'wasm/pkg'
140
+ uses: actions/download-artifact@v8
118
141
  with:
119
142
  name: wasm-pkg
120
143
  path: wasm/pkg
@@ -122,5 +145,7 @@ jobs:
122
145
  with:
123
146
  node-version: lts/*
124
147
  registry-url: https://registry.npmjs.org
125
- - run: npm publish
126
- working-directory: wasm/pkg
148
+ - run: |
149
+ npm pkg set version="${GITHUB_REF_NAME#v}"
150
+ npm publish --access public --ignore-scripts
151
+ 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
+ lite/node_modules/
96
+ lite/*.tgz
95
97
 
96
98
  # Jupyter Notebook
97
99
  .ipynb_checkpoints
@@ -67,9 +67,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
67
67
 
68
68
  [[package]]
69
69
  name = "html-escape"
70
- version = "0.3.0"
70
+ version = "0.3.1"
71
71
  source = "registry+https://github.com/rust-lang/crates.io-index"
72
- checksum = "491194d601b4fa9fac3c9571e014070a0ad1bc3392d1bc10419695196a8b3cc3"
72
+ checksum = "d45ed4d99334da2a2f221504e8ffc8ad09baf2a452b154465a976bfde697b004"
73
73
 
74
74
  [[package]]
75
75
  name = "html5ever"
@@ -93,9 +93,9 @@ dependencies = [
93
93
 
94
94
  [[package]]
95
95
  name = "itoa"
96
- version = "1.0.18"
96
+ version = "1.0.19"
97
97
  source = "registry+https://github.com/rust-lang/crates.io-index"
98
- checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
98
+ checksum = "3bd1574e617a9a6c1f8f8181bd7e841e1f20e4277607ef28945765188d6284d4"
99
99
 
100
100
  [[package]]
101
101
  name = "libc"
@@ -131,7 +131,7 @@ dependencies = [
131
131
 
132
132
  [[package]]
133
133
  name = "mdhtml-crate"
134
- version = "0.1.45"
134
+ version = "0.1.47"
135
135
  dependencies = [
136
136
  "base64",
137
137
  "fast5ever",
@@ -141,7 +141,7 @@ dependencies = [
141
141
 
142
142
  [[package]]
143
143
  name = "mdhtml-py"
144
- version = "0.1.45"
144
+ version = "0.1.47"
145
145
  dependencies = [
146
146
  "mdhtml-crate",
147
147
  "pyo3",
@@ -150,7 +150,7 @@ dependencies = [
150
150
 
151
151
  [[package]]
152
152
  name = "mdhtml-wasm"
153
- version = "0.1.45"
153
+ version = "0.1.47"
154
154
  dependencies = [
155
155
  "mdhtml-crate",
156
156
  ]
@@ -428,9 +428,9 @@ dependencies = [
428
428
 
429
429
  [[package]]
430
430
  name = "syn"
431
- version = "3.0.9"
431
+ version = "3.0.10"
432
432
  source = "registry+https://github.com/rust-lang/crates.io-index"
433
- checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b"
433
+ checksum = "4ae9ccbea3a7b0b09443036490c8f34a8b1b760fd345e5c0dae0aac718faea79"
434
434
  dependencies = [
435
435
  "proc-macro2",
436
436
  "quote",
@@ -439,9 +439,9 @@ dependencies = [
439
439
 
440
440
  [[package]]
441
441
  name = "target-lexicon"
442
- version = "0.13.5"
442
+ version = "0.13.6"
443
443
  source = "registry+https://github.com/rust-lang/crates.io-index"
444
- checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca"
444
+ checksum = "8c447be3a2abfa84b2d91680c56600bd6b2873866de27b36ec911be705e291da"
445
445
 
446
446
  [[package]]
447
447
  name = "tendril"
@@ -529,7 +529,7 @@ checksum = "8c3b93199df0ab874cdf0c6a94f0a0dc3423fe41f1cafb62b8bd7b1deb277aef"
529
529
 
530
530
  [[package]]
531
531
  name = "xtask"
532
- version = "0.1.45"
532
+ version = "0.1.47"
533
533
  dependencies = [
534
534
  "anyhow",
535
535
  "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.47"
6
6
  edition = "2024"
7
7
  rust-version = "1.91"
8
8
  license = "Apache-2.0"
@@ -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.47
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
+ `````