@zvndev/darkmown 1.5.0 → 2.0.1

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 (95) hide show
  1. package/AGENTS.md +18 -4
  2. package/CHANGELOG.md +40 -0
  3. package/README.md +49 -19
  4. package/SECURITY.md +21 -18
  5. package/docs/cli.md +5 -1
  6. package/docs/spec-alignment.md +21 -7
  7. package/package.json +3 -2
  8. package/site/_/base.skin +8 -0
  9. package/site/_/base.wd +4 -0
  10. package/site/_/feature-card.wd +4 -0
  11. package/site/_/footer.wd +5 -1
  12. package/site/_/nav.wd +4 -0
  13. package/site/_/scoped-promo.wd +4 -0
  14. package/site/_/scoped-stat.wd +4 -0
  15. package/site/pages/404.wd +1 -0
  16. package/site/pages/app.wd +2 -1
  17. package/site/pages/blog/collections-and-pagination.skin +127 -0
  18. package/site/pages/blog/drafts-that-never-leak.skin +127 -0
  19. package/site/pages/blog/index.wd +1 -0
  20. package/site/pages/blog/shipping-feeds.skin +127 -0
  21. package/site/pages/blog/typed-frontmatter.skin +127 -0
  22. package/site/pages/blog/unfinished-thoughts.skin +127 -0
  23. package/site/pages/blog/zero-js-by-default.md +1 -1
  24. package/site/pages/blog/zero-js-by-default.skin +127 -0
  25. package/site/pages/carousel/index.wd +1 -0
  26. package/site/pages/compass/index.wd +1 -0
  27. package/site/pages/data.wd +3 -0
  28. package/site/pages/docs/-relative-note.wd +4 -0
  29. package/site/pages/docs/index.skin +27 -0
  30. package/site/pages/docs/index.wd +85 -14
  31. package/site/pages/folio/-style.wd +4 -0
  32. package/site/pages/folio/cart.wd +1 -0
  33. package/site/pages/folio/index.wd +1 -0
  34. package/site/pages/forge/index.wd +1 -0
  35. package/site/pages/highlight/index.wd +1 -0
  36. package/site/pages/index.js +19 -0
  37. package/site/pages/index.skin +46 -1
  38. package/site/pages/index.wd +6 -3
  39. package/site/pages/interactions/index.wd +1 -0
  40. package/site/pages/ledger/index.wd +1 -0
  41. package/site/pages/loops.wd +1 -0
  42. package/site/pages/media/index.wd +1 -0
  43. package/site/pages/pulse/index.wd +1 -0
  44. package/site/pages/reactive.wd +1 -0
  45. package/site/pages/scoped/index.wd +1 -0
  46. package/site/pages/showcase/index.wd +2 -1
  47. package/site/pages/store.wd +1 -0
  48. package/site/pages/theme.wd +1 -0
  49. package/src/builder.js +444 -65
  50. package/src/cli.js +96 -18
  51. package/src/compiler/actions.js +303 -0
  52. package/src/compiler/body.js +36 -24
  53. package/src/compiler/context.js +65 -6
  54. package/src/compiler/directives.js +31 -1470
  55. package/src/compiler/fetch.js +159 -0
  56. package/src/compiler/format.js +17 -4
  57. package/src/compiler/forms.js +456 -0
  58. package/src/compiler/frontmatter.js +10 -5
  59. package/src/compiler/includes.js +75 -4
  60. package/src/compiler/index.js +15 -3
  61. package/src/compiler/loops.js +85 -23
  62. package/src/compiler/markdown.js +65 -15
  63. package/src/compiler/media.js +133 -0
  64. package/src/compiler/page.js +88 -77
  65. package/src/compiler/state.js +168 -0
  66. package/src/compiler/structure.js +399 -0
  67. package/src/dev.js +76 -0
  68. package/src/headers.js +56 -17
  69. package/src/router.js +12 -1
  70. package/src/runtime.js +5 -3
  71. package/src/statics.js +63 -12
  72. package/src/templates/blog/README.md +13 -4
  73. package/src/templates/blog/site/_/nav.wd +7 -6
  74. package/src/templates/blog/site/pages/index.skin +10 -4
  75. package/src/templates/blog/site/pages/index.wd +11 -6
  76. package/src/templates/blog/site/pages/posts/_schema.wd +16 -0
  77. package/src/templates/blog/site/pages/posts/hello-darkmown.md +2 -0
  78. package/src/templates/blog/site/pages/posts/hello-darkmown.skin +59 -0
  79. package/src/templates/blog/site/pages/posts/markdown-native.md +9 -4
  80. package/src/templates/blog/site/pages/posts/markdown-native.skin +59 -0
  81. package/src/templates/dashboard/site/_/nav.wd +7 -6
  82. package/src/templates/dashboard/site/pages/index.skin +7 -4
  83. package/src/templates/dashboard/site/pages/index.wd +2 -2
  84. package/src/templates/landing/site/_/nav.wd +7 -6
  85. package/src/templates/landing/site/pages/index.skin +13 -4
  86. package/src/templates/landing/site/pages/index.wd +22 -8
  87. package/src/templates/starter/site/_/nav.wd +8 -7
  88. package/src/templates/starter/site/pages/about.md +8 -2
  89. package/src/templates/starter/site/pages/about.skin +44 -0
  90. package/src/templates/starter/site/pages/index.skin +10 -6
  91. package/src/templates/starter/site/pages/index.wd +2 -2
  92. package/src/templates/store/site/_/nav.wd +7 -6
  93. package/src/templates/store/site/pages/index.skin +7 -4
  94. package/src/templates/store/site/pages/index.wd +2 -2
  95. package/src/templates/blog/site/_/posts.json +0 -16
@@ -29,7 +29,52 @@
29
29
  .hero-cta
30
30
  display flex
31
31
  flex-wrap wrap
32
- margin-bottom 2rem
32
+ margin-bottom 1.5rem
33
+
34
+ .hero-install
35
+ display inline-flex
36
+ align-items center
37
+ gap .55rem
38
+ max-width 100%
39
+ margin 0 0 2rem
40
+ padding .7rem 1rem
41
+ border 1px solid $line
42
+ radius 10px
43
+ bg $sunk
44
+ font-family ui-monospace, SFMono-Regular, Menlo, monospace
45
+ overflow-x auto
46
+
47
+ .hero-install::before
48
+ content "$"
49
+ color $accent
50
+ font-weight 700
51
+ flex-shrink 0
52
+
53
+ .hero-install code
54
+ font-family inherit
55
+ font-size .95rem
56
+ color $ink
57
+ white-space nowrap
58
+
59
+ .hero-install .copy-cmd
60
+ flex-shrink 0
61
+ margin-left .35rem
62
+ padding .25rem .65rem
63
+ border 1px solid $line
64
+ radius 7px
65
+ bg transparent
66
+ color $ink-soft
67
+ font-family inherit
68
+ font-size .8rem
69
+ cursor pointer
70
+
71
+ .hero-install .copy-cmd:hover
72
+ color $ink
73
+ border-color $accent
74
+
75
+ .hero-install .copy-cmd.is-copied
76
+ color $accent
77
+ border-color $accent
33
78
 
34
79
  .hero-stats
35
80
  display grid
@@ -1,4 +1,5 @@
1
1
  ---
2
+ html: true
2
3
  title: Darkmown — Markdown that runs, not Markdown that needs React
3
4
  description: A live store widget — search filter, add-to-cart, running total — written as one Markdown file that runs. The same outcome in Markdoc needs a React component, hydration, and a build step. Compare them side by side.
4
5
  image: https://darkmown.com/__wd/media/og.png
@@ -23,9 +24,11 @@ The left file is Markdown. It is also a running app — a live search filter, ad
23
24
  <a class="btn" href="/docs/">Read the docs</a>
24
25
  </div>
25
26
 
27
+ <div class="hero-install"><code>npx @zvndev/darkmown init my-site</code><button type="button" class="copy-cmd" data-copy-cmd aria-label="Copy install command">Copy</button></div>
28
+
26
29
  <ul class="hero-stats">
27
30
  <li><strong>0 KB</strong><span>framework JS on static pages</span></li>
28
- <li><strong>~7.4 KB</strong><span>one runtime, CI-enforced &lt; 8 KB</span></li>
31
+ <li><strong>~7.5 KB</strong><span>one runtime, CI-enforced &lt; 8 KB</span></li>
29
32
  <li><strong>1</strong><span>loop and one binding to learn</span></li>
30
33
  <li><strong>MIT</strong><span>zero runtime dependencies</span></li>
31
34
  </ul>
@@ -109,14 +112,14 @@ Markdoc.renderers.react(content, React, {
109
112
 
110
113
  </section>
111
114
 
112
- :note "Static pages ship zero JavaScript. The moment a page asks for reactivity — like this very homepage — one ~7.4 KB gzipped runtime loads (CI-enforced under 8 KB), never before. JS optional, CSS optional, always."
115
+ :note "Static pages ship zero JavaScript. The moment a page asks for reactivity — like this very homepage — one ~7.5 KB gzipped runtime loads (CI-enforced under 8 KB), never before. JS optional, CSS optional, always."
113
116
 
114
117
  <section class="props">
115
118
 
116
119
  ## Three rules, no escape hatch
117
120
 
118
121
  - **Zero-JS static.** A page with no state ships no framework JavaScript. `/markdown/` and `/docs/` prove it — open them and check the network tab.
119
- - **One runtime.** Every reactive page shares the same ~7.4 KB gzipped runtime, CI-enforced under 8 KB. No per-component bundles, no hydration tax that scales with your UI.
122
+ - **One runtime.** Every reactive page shares the same ~7.5 KB gzipped runtime, CI-enforced under 8 KB. No per-component bundles, no hydration tax that scales with your UI.
120
123
  - **One loop, one binding.** `@loop … into …` is the only loop; `{ name }` is the only interpolation. Nothing else to learn, nothing else to misuse.
121
124
 
122
125
  </section>
@@ -1,4 +1,5 @@
1
1
  ---
2
+ html: true
2
3
  title: Interactions — sliders, drag & carousels in Markdown
3
4
  description: :slider, :sortable, and :carousel — rich interactions that compile to tiny pay-for-what-you-use modules, declared in plain Markdown. Sliders ship zero JS; sortable and carousel each load one small module, only on the pages that use them.
4
5
  image: https://darkmown.com/__wd/media/og-showcase.png
@@ -1,4 +1,5 @@
1
1
  ---
2
+ html: true
2
3
  title: Ledger — a sortable expense table in Markdown
3
4
  description: A real data table written as one Markdown file — clickable-header sorting, a live filter, running totals, and a light/dark toggle. Format pipes (| money, | date), aggregates (sum, avg, max), reactive sort, and :theme — all declarative, no hand-written JavaScript.
4
5
  image: https://darkmown.com/__wd/media/og-showcase.png
@@ -1,4 +1,5 @@
1
1
  ---
2
+ html: true
2
3
  title: Loop ergonomics
3
4
  transitions: true
4
5
  ---
@@ -1,4 +1,5 @@
1
1
  ---
2
+ html: true
2
3
  title: Media — video, audio, and embeds in Markdown
3
4
  description: Three one-line directives — :video, :audio, :embed — compile to hardened, accessible, privacy-friendly players. No framework JavaScript ships: a media page stays zero-JS, just like static Markdown.
4
5
  image: https://darkmown.com/__wd/media/og-showcase.png
@@ -1,4 +1,5 @@
1
1
  ---
2
+ html: true
2
3
  title: Pulse — service status
3
4
  description: A calm, dark observability panel built in one Markdown file — a live :fetch board, build-time rollups, and a keyed services table, all with zero hand-written JavaScript.
4
5
  image: https://darkmown.com/__wd/media/og-pulse.png
@@ -1,4 +1,5 @@
1
1
  ---
2
+ html: true
2
3
  title: Reactive Markdown
3
4
  transitions: true
4
5
  ---
@@ -1,4 +1,5 @@
1
1
  ---
2
+ html: true
2
3
  title: Scoped styles — same class name, zero collision
3
4
  description: Two components reuse the class name .card and never clash. Compile-time scoped styles stamp each component's subtree with a path-derived id and rewrite its skin's selectors to match only there. Zero runtime JS — a static page stays static.
4
5
  transitions: true
@@ -1,4 +1,5 @@
1
1
  ---
2
+ html: true
2
3
  title: Showcase — real apps built in Markdown
3
4
  description: Five complete, beautiful apps — a storefront, a live dashboard, a pricing configurator, a product-finder quiz, and a sortable expense ledger — each one a readable Markdown file. See the app, then view its source.
4
5
  image: https://darkmown.com/__wd/media/og-showcase.png
@@ -95,7 +96,7 @@ Darkmown's whole pitch is weight. A static page ships **zero** framework JavaScr
95
96
 
96
97
  ::: card .sc-scale
97
98
  - **Static Darkmown page** — `0 KB` framework JS. Forever.
98
- - **Reactive Darkmown page** — one shared `~7.4 KB` gzipped runtime, no per-component bundles.
99
+ - **Reactive Darkmown page** — one shared `~7.5 KB` gzipped runtime, no per-component bundles.
99
100
  - **A typical SPA** — ships a framework runtime in the **~15–60 KB** gzipped range *before* your app code, on every page (Alpine ~15 KB, Vue ~18 KB runtime, React 19 ~59 KB).
100
101
  :::
101
102
 
@@ -1,4 +1,5 @@
1
1
  ---
2
+ html: true
2
3
  title: Global store
3
4
  transitions: true
4
5
  ---
@@ -1,4 +1,5 @@
1
1
  ---
2
+ html: true
2
3
  title: Dark-mode tokens
3
4
  transitions: true
4
5
  ---