markopress 0.0.2 → 0.0.4

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 (288) hide show
  1. package/dist/build/index.d.ts +0 -1
  2. package/dist/build/index.js +1 -1627
  3. package/dist/build/types.d.ts +0 -1
  4. package/dist/build/types.js +1 -5
  5. package/dist/build/vite-markdown-plugin.d.ts +0 -1
  6. package/dist/build/vite-markdown-plugin.js +1 -147
  7. package/dist/cli/index.d.ts +0 -1
  8. package/dist/cli/index.js +1 -74
  9. package/dist/config/app-root.d.ts +0 -1
  10. package/dist/config/app-root.js +1 -24
  11. package/dist/config/index.d.ts +0 -1
  12. package/dist/config/index.js +1 -6
  13. package/dist/config/loader.d.ts +0 -1
  14. package/dist/config/loader.js +1 -188
  15. package/dist/config/types.d.ts +0 -1
  16. package/dist/config/types.js +1 -5
  17. package/dist/config/validation.d.ts +0 -1
  18. package/dist/config/validation.js +1 -139
  19. package/dist/content/index.d.ts +0 -1
  20. package/dist/content/index.js +1 -6
  21. package/dist/content/registry.d.ts +0 -1
  22. package/dist/content/registry.js +1 -45
  23. package/dist/content/types.d.ts +0 -1
  24. package/dist/content/types.js +1 -5
  25. package/dist/dev/index.d.ts +0 -1
  26. package/dist/dev/index.js +1 -93
  27. package/dist/index.d.ts +0 -1
  28. package/dist/index.js +1 -17
  29. package/dist/markdown/base-path-plugin.d.ts +16 -0
  30. package/dist/markdown/base-path-plugin.js +1 -0
  31. package/dist/markdown/code.d.ts +0 -1
  32. package/dist/markdown/code.js +1 -305
  33. package/dist/markdown/containers.d.ts +0 -1
  34. package/dist/markdown/containers.js +1 -143
  35. package/dist/markdown/includes.d.ts +0 -1
  36. package/dist/markdown/includes.js +1 -9
  37. package/dist/markdown/index.d.ts +0 -1
  38. package/dist/markdown/index.js +1 -8
  39. package/dist/markdown/loader.d.ts +0 -1
  40. package/dist/markdown/loader.js +1 -325
  41. package/dist/markdown/md-link-plugin.d.ts +14 -0
  42. package/dist/markdown/md-link-plugin.js +1 -0
  43. package/dist/markdown/preserve-tags.d.ts +0 -1
  44. package/dist/markdown/preserve-tags.js +1 -233
  45. package/dist/markdown/renderer.d.ts +0 -1
  46. package/dist/markdown/renderer.js +1 -146
  47. package/dist/markdown/tag-validator.d.ts +0 -1
  48. package/dist/markdown/tag-validator.js +1 -118
  49. package/dist/markdown/types.d.ts +2 -1
  50. package/dist/markdown/types.js +1 -5
  51. package/dist/plugin/compat.d.ts +0 -1
  52. package/dist/plugin/compat.js +1 -78
  53. package/dist/plugin/context.d.ts +0 -1
  54. package/dist/plugin/context.js +1 -103
  55. package/dist/plugin/index.d.ts +0 -1
  56. package/dist/plugin/index.js +1 -6
  57. package/dist/plugin/manager.d.ts +0 -1
  58. package/dist/plugin/manager.js +1 -385
  59. package/dist/plugin/types.d.ts +1 -1
  60. package/dist/plugin/types.js +1 -5
  61. package/dist/plugins/blog-index/index.d.ts +0 -1
  62. package/dist/plugins/blog-index/index.js +1 -158
  63. package/dist/plugins/sidenav/index.d.ts +0 -1
  64. package/dist/plugins/sidenav/index.js +1 -86
  65. package/dist/plugins/toc/index.d.ts +0 -1
  66. package/dist/plugins/toc/index.js +1 -79
  67. package/dist/preview/index.d.ts +0 -1
  68. package/dist/preview/index.js +1 -25
  69. package/dist/theme/default/design-systems/default.d.ts +0 -1
  70. package/dist/theme/default/design-systems/default.js +1 -289
  71. package/dist/theme/default/design-systems/docusaurus.d.ts +0 -1
  72. package/dist/theme/default/design-systems/docusaurus.js +1 -299
  73. package/dist/theme/default/design-systems/index.d.ts +0 -1
  74. package/dist/theme/default/design-systems/index.js +1 -54
  75. package/dist/theme/default/design-systems/rspress.d.ts +0 -1
  76. package/dist/theme/default/design-systems/rspress.js +1 -299
  77. package/dist/theme/default/design-systems/types.d.ts +0 -1
  78. package/dist/theme/default/design-systems/types.js +1 -6
  79. package/dist/theme/default/design-systems/vitepress.d.ts +0 -1
  80. package/dist/theme/default/design-systems/vitepress.js +1 -299
  81. package/dist/theme/default/index.d.ts +0 -1
  82. package/dist/theme/default/index.js +1 -44
  83. package/dist/theme/default/theme.d.ts +0 -1
  84. package/dist/theme/default/theme.js +1 -58
  85. package/dist/theme/index.d.ts +0 -1
  86. package/dist/theme/index.js +1 -6
  87. package/dist/theme/loader.d.ts +0 -1
  88. package/dist/theme/loader.js +1 -125
  89. package/dist/theme/types.d.ts +1 -1
  90. package/dist/theme/types.js +1 -5
  91. package/dist/vite/index.d.ts +0 -1
  92. package/dist/vite/index.js +1 -6
  93. package/dist/vite/markdownPlugin.d.ts +0 -1
  94. package/dist/vite/markdownPlugin.js +1 -111
  95. package/dist/vite/plugin.d.ts +0 -1
  96. package/dist/vite/plugin.js +1 -94
  97. package/package.json +3 -2
  98. package/src/theme/default/layouts/blog.marko +1 -1
  99. package/src/theme/default/layouts/default.marko +5 -5
  100. package/src/theme/default/layouts/docs.marko +6 -6
  101. package/src/theme/default/layouts/page.marko +1 -1
  102. package/templates/catch-all-handler.js.template +2 -17
  103. package/dist/build/index.d.ts.map +0 -1
  104. package/dist/build/index.js.map +0 -1
  105. package/dist/build/manifest-generator.d.ts +0 -34
  106. package/dist/build/manifest-generator.d.ts.map +0 -1
  107. package/dist/build/manifest-generator.js +0 -86
  108. package/dist/build/manifest-generator.js.map +0 -1
  109. package/dist/build/security.test.d.ts +0 -6
  110. package/dist/build/security.test.d.ts.map +0 -1
  111. package/dist/build/security.test.js +0 -88
  112. package/dist/build/security.test.js.map +0 -1
  113. package/dist/build/types.d.ts.map +0 -1
  114. package/dist/build/types.js.map +0 -1
  115. package/dist/build/vite-config.test.d.ts +0 -2
  116. package/dist/build/vite-config.test.d.ts.map +0 -1
  117. package/dist/build/vite-config.test.js +0 -53
  118. package/dist/build/vite-config.test.js.map +0 -1
  119. package/dist/build/vite-markdown-plugin.d.ts.map +0 -1
  120. package/dist/build/vite-markdown-plugin.js.map +0 -1
  121. package/dist/build/vite-markdown-plugin.test.d.ts +0 -2
  122. package/dist/build/vite-markdown-plugin.test.d.ts.map +0 -1
  123. package/dist/build/vite-markdown-plugin.test.js +0 -41
  124. package/dist/build/vite-markdown-plugin.test.js.map +0 -1
  125. package/dist/cli/index.d.ts.map +0 -1
  126. package/dist/cli/index.js.map +0 -1
  127. package/dist/config/app-root.d.ts.map +0 -1
  128. package/dist/config/app-root.js.map +0 -1
  129. package/dist/config/app-root.test.d.ts +0 -2
  130. package/dist/config/app-root.test.d.ts.map +0 -1
  131. package/dist/config/app-root.test.js +0 -71
  132. package/dist/config/app-root.test.js.map +0 -1
  133. package/dist/config/index.d.ts.map +0 -1
  134. package/dist/config/index.js.map +0 -1
  135. package/dist/config/loader.d.ts.map +0 -1
  136. package/dist/config/loader.js.map +0 -1
  137. package/dist/config/loader.test.d.ts +0 -2
  138. package/dist/config/loader.test.d.ts.map +0 -1
  139. package/dist/config/loader.test.js +0 -24
  140. package/dist/config/loader.test.js.map +0 -1
  141. package/dist/config/types.d.ts.map +0 -1
  142. package/dist/config/types.js.map +0 -1
  143. package/dist/config/validation.d.ts.map +0 -1
  144. package/dist/config/validation.js.map +0 -1
  145. package/dist/content/index.d.ts.map +0 -1
  146. package/dist/content/index.js.map +0 -1
  147. package/dist/content/registry.d.ts.map +0 -1
  148. package/dist/content/registry.js.map +0 -1
  149. package/dist/content/scanner.d.ts +0 -9
  150. package/dist/content/scanner.d.ts.map +0 -1
  151. package/dist/content/scanner.js +0 -115
  152. package/dist/content/scanner.js.map +0 -1
  153. package/dist/content/types.d.ts.map +0 -1
  154. package/dist/content/types.js.map +0 -1
  155. package/dist/dev/index.d.ts.map +0 -1
  156. package/dist/dev/index.js.map +0 -1
  157. package/dist/index.d.ts.map +0 -1
  158. package/dist/index.js.map +0 -1
  159. package/dist/markdown/code.d.ts.map +0 -1
  160. package/dist/markdown/code.js.map +0 -1
  161. package/dist/markdown/containers.d.ts.map +0 -1
  162. package/dist/markdown/containers.js.map +0 -1
  163. package/dist/markdown/includes.d.ts.map +0 -1
  164. package/dist/markdown/includes.js.map +0 -1
  165. package/dist/markdown/index.d.ts.map +0 -1
  166. package/dist/markdown/index.js.map +0 -1
  167. package/dist/markdown/loader.d.ts.map +0 -1
  168. package/dist/markdown/loader.js.map +0 -1
  169. package/dist/markdown/preserve-tags.d.ts.map +0 -1
  170. package/dist/markdown/preserve-tags.js.map +0 -1
  171. package/dist/markdown/renderer.d.ts.map +0 -1
  172. package/dist/markdown/renderer.js.map +0 -1
  173. package/dist/markdown/tag-validator.d.ts.map +0 -1
  174. package/dist/markdown/tag-validator.js.map +0 -1
  175. package/dist/markdown/types.d.ts.map +0 -1
  176. package/dist/markdown/types.js.map +0 -1
  177. package/dist/plugin/compat.d.ts.map +0 -1
  178. package/dist/plugin/compat.js.map +0 -1
  179. package/dist/plugin/context.d.ts.map +0 -1
  180. package/dist/plugin/context.js.map +0 -1
  181. package/dist/plugin/index.d.ts.map +0 -1
  182. package/dist/plugin/index.js.map +0 -1
  183. package/dist/plugin/manager.d.ts.map +0 -1
  184. package/dist/plugin/manager.js.map +0 -1
  185. package/dist/plugin/types.d.ts.map +0 -1
  186. package/dist/plugin/types.js.map +0 -1
  187. package/dist/plugins/blog-index/index.d.ts.map +0 -1
  188. package/dist/plugins/blog-index/index.js.map +0 -1
  189. package/dist/plugins/sidenav/index.d.ts.map +0 -1
  190. package/dist/plugins/sidenav/index.js.map +0 -1
  191. package/dist/plugins/toc/index.d.ts.map +0 -1
  192. package/dist/plugins/toc/index.js.map +0 -1
  193. package/dist/preview/index.d.ts.map +0 -1
  194. package/dist/preview/index.js.map +0 -1
  195. package/dist/theme/default/build/generate-all.d.ts +0 -9
  196. package/dist/theme/default/build/generate-all.d.ts.map +0 -1
  197. package/dist/theme/default/build/generate-all.js +0 -85
  198. package/dist/theme/default/build/generate-all.js.map +0 -1
  199. package/dist/theme/default/build/generate-css.d.ts +0 -19
  200. package/dist/theme/default/build/generate-css.d.ts.map +0 -1
  201. package/dist/theme/default/build/generate-css.js +0 -199
  202. package/dist/theme/default/build/generate-css.js.map +0 -1
  203. package/dist/theme/default/build/index.d.ts +0 -5
  204. package/dist/theme/default/build/index.d.ts.map +0 -1
  205. package/dist/theme/default/build/index.js +0 -5
  206. package/dist/theme/default/build/index.js.map +0 -1
  207. package/dist/theme/default/design-systems/default.d.ts.map +0 -1
  208. package/dist/theme/default/design-systems/default.js.map +0 -1
  209. package/dist/theme/default/design-systems/docusaurus.d.ts.map +0 -1
  210. package/dist/theme/default/design-systems/docusaurus.js.map +0 -1
  211. package/dist/theme/default/design-systems/index.d.ts.map +0 -1
  212. package/dist/theme/default/design-systems/index.js.map +0 -1
  213. package/dist/theme/default/design-systems/rspress.d.ts.map +0 -1
  214. package/dist/theme/default/design-systems/rspress.js.map +0 -1
  215. package/dist/theme/default/design-systems/types.d.ts.map +0 -1
  216. package/dist/theme/default/design-systems/types.js.map +0 -1
  217. package/dist/theme/default/design-systems/vitepress.d.ts.map +0 -1
  218. package/dist/theme/default/design-systems/vitepress.js.map +0 -1
  219. package/dist/theme/default/index.d.ts.map +0 -1
  220. package/dist/theme/default/index.js.map +0 -1
  221. package/dist/theme/default/theme.d.ts.map +0 -1
  222. package/dist/theme/default/theme.js.map +0 -1
  223. package/dist/theme/index.d.ts.map +0 -1
  224. package/dist/theme/index.js.map +0 -1
  225. package/dist/theme/loader.d.ts.map +0 -1
  226. package/dist/theme/loader.js.map +0 -1
  227. package/dist/theme/types.d.ts.map +0 -1
  228. package/dist/theme/types.js.map +0 -1
  229. package/dist/vite/index.d.ts.map +0 -1
  230. package/dist/vite/index.js.map +0 -1
  231. package/dist/vite/markdownPlugin.d.ts.map +0 -1
  232. package/dist/vite/markdownPlugin.js.map +0 -1
  233. package/dist/vite/plugin.d.ts.map +0 -1
  234. package/dist/vite/plugin.js.map +0 -1
  235. package/src/theme/default/build/generate-all.ts +0 -99
  236. package/src/theme/default/build/generate-css.ts +0 -234
  237. package/src/theme/default/build/index.ts +0 -5
  238. package/src/theme/default/components/doc-footer.marko +0 -180
  239. package/src/theme/default/components/footer.marko +0 -32
  240. package/src/theme/default/components/header.marko +0 -49
  241. package/src/theme/default/components/nav-bar.marko +0 -191
  242. package/src/theme/default/components/page-header.marko +0 -20
  243. package/src/theme/default/components/reading-progress.marko +0 -36
  244. package/src/theme/default/components/search.marko +0 -239
  245. package/src/theme/default/components/sidebar.marko +0 -211
  246. package/src/theme/default/components/site-footer.marko +0 -211
  247. package/src/theme/default/components/skip-link.marko +0 -49
  248. package/src/theme/default/components/theme/theme-aside-bottom.marko +0 -1
  249. package/src/theme/default/components/theme/theme-aside-top.marko +0 -1
  250. package/src/theme/default/components/theme/theme-body-bottom.marko +0 -1
  251. package/src/theme/default/components/theme/theme-body-top.marko +0 -1
  252. package/src/theme/default/components/theme/theme-doc-bottom.marko +0 -1
  253. package/src/theme/default/components/theme/theme-doc-footer-after.marko +0 -1
  254. package/src/theme/default/components/theme/theme-doc-footer-before.marko +0 -1
  255. package/src/theme/default/components/theme/theme-doc-top.marko +0 -1
  256. package/src/theme/default/components/theme/theme-head-bottom.marko +0 -1
  257. package/src/theme/default/components/theme/theme-head-top.marko +0 -1
  258. package/src/theme/default/components/theme/theme-home-features-after.marko +0 -1
  259. package/src/theme/default/components/theme/theme-home-hero-after.marko +0 -1
  260. package/src/theme/default/components/theme/theme-home-hero-before.marko +0 -1
  261. package/src/theme/default/components/theme/theme-navbar-center.marko +0 -5
  262. package/src/theme/default/components/theme/theme-navbar-end.marko +0 -30
  263. package/src/theme/default/components/theme/theme-navbar-start.marko +0 -1
  264. package/src/theme/default/components/theme/theme-page-bottom.marko +0 -1
  265. package/src/theme/default/components/theme/theme-page-top.marko +0 -1
  266. package/src/theme/default/components/theme/theme-sidebar-bottom.marko +0 -1
  267. package/src/theme/default/components/theme/theme-sidebar-top.marko +0 -1
  268. package/src/theme/default/components/theme/theme-toc-item.marko +0 -1
  269. package/src/theme/default/components/theme-toggle.marko +0 -122
  270. package/src/theme/default/components/toc.marko +0 -140
  271. package/src/theme/default/design-systems/default.ts +0 -331
  272. package/src/theme/default/design-systems/docusaurus.ts +0 -341
  273. package/src/theme/default/design-systems/index.ts +0 -67
  274. package/src/theme/default/design-systems/rspress.ts +0 -341
  275. package/src/theme/default/design-systems/types.ts +0 -296
  276. package/src/theme/default/design-systems/vitepress.ts +0 -341
  277. package/src/theme/default/index.ts +0 -107
  278. package/src/theme/default/theme.ts +0 -83
  279. package/templates/example-tags/README.md +0 -212
  280. package/templates/example-tags/alert-box.marko +0 -98
  281. package/templates/example-tags/button-primary.marko +0 -28
  282. package/templates/example-tags/button-secondary.marko +0 -28
  283. package/templates/example-tags/button.marko +0 -6
  284. package/templates/example-tags/card-body.marko +0 -8
  285. package/templates/example-tags/card-footer.marko +0 -7
  286. package/templates/example-tags/card-header.marko +0 -7
  287. package/templates/example-tags/card.marko +0 -20
  288. package/templates/example-tags/icon.marko +0 -149
@@ -1,212 +0,0 @@
1
- # Marko Tags Example Components
2
-
3
- This directory contains example Marko components demonstrating best practices for the Marko Tags in Markdown feature.
4
-
5
- ## Available Components
6
-
7
- ### Alert Boxes
8
-
9
- **File:** `alert-box.marko`
10
-
11
- A styled alert component with 6 variants: note, tip, warning, danger, info, caution
12
-
13
- **Usage:**
14
- ```markdown
15
- <alert-box kind="warning">
16
- This is a **warning** alert with `code` support!
17
- </alert-box>
18
- ```
19
-
20
- **Features:**
21
- - Emoji icons for each variant
22
- - Left icon bar
23
- - Gradient overlay
24
- - Proper markdown content rendering
25
- - Responsive styling
26
-
27
- ### Buttons
28
-
29
- **Files:** `button-primary.marko`, `button-secondary.marko`, `button.marko`
30
-
31
- Styled button components with icon support.
32
-
33
- **Usage:**
34
- ```markdown
35
- <button-primary href="/docs" icon="📚">
36
- Documentation
37
- </button-primary>
38
-
39
- <button-secondary href="/blog">
40
- Blog
41
- </button-secondary>
42
- ```
43
-
44
- **Features:**
45
- - Primary and secondary styles
46
- - Optional icon attribute (emoji)
47
- - Dynamic href binding
48
- - Proper body content rendering
49
-
50
- ### Cards
51
-
52
- **Files:** `card.marko`, `card-header.marko`, `card-body.marko`, `card-footer.marko`
53
-
54
- Card components with named slots for flexible content layout.
55
-
56
- **Usage:**
57
- ```markdown
58
- <card>
59
- <card-header>
60
- <h3>Card Title</h3>
61
- </card-header>
62
- <card-body>
63
- - List item 1
64
- - List item 2
65
- </card-body>
66
- <card-footer>
67
- <button-primary href="/learn">Learn More</button-primary>
68
- </card-footer>
69
- </card>
70
- ```
71
-
72
- **Features:**
73
- - Named slots (header, body, footer)
74
- - Nested component support
75
- - Flexible content layout
76
-
77
- ### Icons
78
-
79
- **File:** `icon.marko`
80
-
81
- SVG icon component with customizable size and color.
82
-
83
- **Usage:**
84
- ```markdown
85
- <icon name="check" size="24" color="success" />
86
- <icon name="warning" size="32" color="warning" />
87
- ```
88
-
89
- **Available Icons:**
90
- - **Actions:** check, x-circle, plus, minus
91
- - **Navigation:** arrow-right, arrow-left, arrow-up, arrow-down
92
- - **Status:** info, warning, danger, success, error
93
- - **Social:** star, heart, bookmark
94
- - **And more...** (18+ icons included)
95
-
96
- **Features:**
97
- - 18+ built-in SVG icons
98
- - Customizable size
99
- - Color variants (success, warning, danger, info, default)
100
- - Self-closing syntax
101
-
102
- ## Component Patterns
103
-
104
- These examples demonstrate key Marko Tags patterns:
105
-
106
- ### 1. Body Content Rendering
107
- ```marko
108
- <div class="my-component">
109
- <${input.content}/> <!-- Renders markdown content -->
110
- </div>
111
- ```
112
-
113
- ### 2. Dynamic Classes (Array Syntax)
114
- ```marko
115
- <div class=["base-class", input.variant && "base-" + input.variant]>
116
- ```
117
-
118
- ### 3. Conditional Attributes
119
- ```marko
120
- <div class=["alert", input.kind && "alert-" + input.kind, !input.kind && "alert-note"]>
121
- ```
122
-
123
- ### 4. Named Slots
124
- ```marko
125
- <!-- Parent component -->
126
- <div class="card">
127
- <${input@header}/> <!-- Renders header slot -->
128
- <${input@body/> <!-- Renders body slot -->
129
- <${input@footer}/> <!-- Renders footer slot -->
130
- </div>
131
- ```
132
-
133
- ### 5. Self-Closing Components
134
- ```marko
135
- <icon name="check" size="24" />
136
- ```
137
-
138
- ### 6. Inline Styles
139
- ```marko
140
- <style>
141
- .my-component {
142
- padding: 1rem;
143
- border-radius: 8px;
144
- }
145
- </style>
146
- ```
147
-
148
- ## Best Practices
149
-
150
- 1. **Use kebab-case tag names:** `<my-component>`, not `<MyComponent>`
151
- 2. **Avoid reserved HTML attributes:** Use `kind` instead of `type`, `uid` instead of `id`
152
- 3. **Use array syntax for dynamic classes:** `class=["base", modifier]`
153
- 4. **Use `<${input.content}/>` for body content:** Not `<input.text/>`
154
- 5. **Use unquoted attributes for dynamic values:** `href=input.link`, not `href="input.link"`
155
- 6. **Include inline styles:** Components should be self-contained with styling
156
-
157
- ## Copying to Your Project
158
-
159
- To use these components in your project:
160
-
161
- 1. **Create a `tags/` directory** in your project root
162
- 2. **Copy components** from this directory to `tags/`
163
- 3. **Enable Marko Tags** in your config:
164
-
165
- ```typescript
166
- // markopress.config.ts
167
- export default defineConfig({
168
- markdown: {
169
- markoTags: {
170
- enabled: true,
171
- tagsDir: 'tags/',
172
- },
173
- },
174
- });
175
- ```
176
-
177
- 4. **Use in Markdown:**
178
-
179
- ```markdown
180
- <alert-box kind="tip">
181
- Check out the **documentation** for more info!
182
- </alert-box>
183
- ```
184
-
185
- ## Customization
186
-
187
- These are examples - feel free to:
188
-
189
- - Modify styles to match your design system
190
- - Add new variants (e.g., `<alert-box kind="custom">`)
191
- - Create new components based on these patterns
192
- - Extend icon component with more SVG icons
193
-
194
- ## Technical Notes
195
-
196
- - **Marko Version:** v6 syntax
197
- - **Markdown Support:** Full markdown rendering inside components
198
- - **CSS:** Inline styles per component (scoped)
199
- - **Build-time Validation:** Missing components trigger build errors
200
- - **Performance:** Components compiled at build time
201
-
202
- ## See Also
203
-
204
- - [Marko Tags Guide](../../../docs/guides/marko-tags.md) - Feature overview
205
- - [Component API Reference](../../../docs/guides/marko-components.md) - Detailed API docs
206
- - [Marko.js v6 Syntax](../../../docs/guides/marko-v6-syntax.md) - Syntax reference
207
- - [Lessons Learned](../../../docs/development/marko-tags-lessons.md) - Common mistakes to avoid
208
-
209
- ---
210
-
211
- **Last Updated:** 2025-01-17
212
- **Status:** ✅ Production Ready
@@ -1,98 +0,0 @@
1
- <!-- Alert Box Component -->
2
- <!-- Types: note, tip, warning, danger, info, caution -->
3
- <!-- Example: <alert-box kind="warning">This is important!</alert-box> -->
4
-
5
- <div class=["alert", input.kind && "alert-" + input.kind, !input.kind && "alert-note"]>
6
- <div class="alert-content">
7
- <${input.content}/>
8
- </div>
9
- </div>
10
-
11
- <style>
12
- .alert {
13
- --alert-icon-size: 1.5rem;
14
- }
15
-
16
- .alert-content {
17
- position: relative;
18
- z-index: 1;
19
- }
20
-
21
- /* Ensure markdown content renders properly */
22
- .alert-content p:first-child {
23
- margin-top: 0;
24
- }
25
-
26
- .alert-content p:last-child {
27
- margin-bottom: 0;
28
- }
29
-
30
- .alert-content ul,
31
- .alert-content ol {
32
- margin: 0.5rem 0;
33
- padding-left: 1.5rem;
34
- }
35
-
36
- .alert-content li {
37
- margin-bottom: 0.25rem;
38
- }
39
-
40
- .alert-content li:last-child {
41
- margin-bottom: 0;
42
- }
43
-
44
- .alert-content code {
45
- font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
46
- font-weight: 600;
47
- }
48
-
49
- /* Add icon bar on the left */
50
- .alert::before {
51
- content: "";
52
- position: absolute;
53
- left: 0;
54
- top: 0;
55
- bottom: 0;
56
- width: 4px;
57
- background: currentColor;
58
- opacity: 0.3;
59
- border-radius: 0.5rem 0 0 0.5rem;
60
- }
61
-
62
- /* Enhance emoji icon */
63
- .alert::after {
64
- font-size: var(--alert-icon-size);
65
- line-height: 1;
66
- }
67
-
68
- .alert-note::after {
69
- content: "💡";
70
- }
71
-
72
- .alert-tip::after {
73
- content: "✨";
74
- }
75
-
76
- .alert-warning::after {
77
- content: "⚠️";
78
- }
79
-
80
- .alert-danger::after {
81
- content: "🚫";
82
- }
83
-
84
- .alert-info::after {
85
- content: "ℹ️";
86
- }
87
-
88
- .alert-caution::after {
89
- content: "⚡";
90
- }
91
-
92
- /* Add subtle pattern overlay */
93
- .alert {
94
- background-image:
95
- radial-gradient(circle at 20% 50%, rgba(255,255,255,0.1) 0%, transparent 50%),
96
- radial-gradient(circle at 80% 80%, rgba(255,255,255,0.1) 0%, transparent 50%);
97
- }
98
- </style>
@@ -1,28 +0,0 @@
1
- <!-- Primary Button Component -->
2
- <!-- Creates a prominent call-to-action button -->
3
- <!-- Example: <button-primary href="/docs" icon="arrow">Get Started</button-primary> -->
4
-
5
- <a href=input.href||"#" class=["btn", "btn-primary", input.disabled && "btn-disabled"] aria-disabled=input.disabled>
6
- <if=input.icon>
7
- <span class="btn-icon">${input.icon}</span>
8
- </if>
9
- <${input.content}/>
10
- <if=input.arrow>
11
- <span class="btn-arrow">→</span>
12
- </if>
13
- </a>
14
-
15
- <style>
16
- .btn-icon {
17
- font-size: 1.125em;
18
- }
19
-
20
- .btn-arrow {
21
- margin-left: 0.5rem;
22
- transition: transform 0.2s;
23
- }
24
-
25
- a:hover .btn-arrow {
26
- transform: translateX(4px);
27
- }
28
- </style>
@@ -1,28 +0,0 @@
1
- <!-- Secondary Button Component -->
2
- <!-- Creates a subtle secondary action button -->
3
- <!-- Example: <button-secondary href="/about">Learn More</button-secondary> -->
4
-
5
- <a href=input.href||"#" class=["btn", "btn-secondary", input.disabled && "btn-disabled"] aria-disabled=input.disabled>
6
- <if=input.icon>
7
- <span class="btn-icon">${input.icon}</span>
8
- </if>
9
- <${input.content}/>
10
- <if=input.arrow>
11
- <span class="btn-arrow">→</span>
12
- </if>
13
- </a>
14
-
15
- <style>
16
- .btn-icon {
17
- font-size: 1.125em;
18
- }
19
-
20
- .btn-arrow {
21
- margin-left: 0.5rem;
22
- transition: transform 0.2s;
23
- }
24
-
25
- a:hover .btn-arrow {
26
- transform: translateX(4px);
27
- }
28
- </style>
@@ -1,6 +0,0 @@
1
- <!-- Button component -->
2
- <!-- Supports: href, style, disabled attributes -->
3
-
4
- <a href=input.href class=["btn", "btn-" + (input.style || 'primary'), input.disabled && "btn-disabled"] aria-disabled=input.disabled>
5
- <input.text/>
6
- </a>
@@ -1,8 +0,0 @@
1
- <!-- Card Body Component -->
2
- <!-- Creates the main content area of a card -->
3
- <!-- Supports full markdown formatting -->
4
- <!-- Example: <card-body>This is **bold** and *italic* text.</card-body> -->
5
-
6
- <div class="card-body">
7
- <input/>
8
- </div>
@@ -1,7 +0,0 @@
1
- <!-- Card Footer Component -->
2
- <!-- Creates a styled card footer section -->
3
- <!-- Example: <card-footer>Additional info</card-footer> -->
4
-
5
- <div class="card-footer">
6
- <input/>
7
- </div>
@@ -1,7 +0,0 @@
1
- <!-- Card Header Component -->
2
- <!-- Creates a styled card header section -->
3
- <!-- Example: <card-header><h3>Card Title</h3></card-header> -->
4
-
5
- <div class="card-header">
6
- <input/>
7
- </div>
@@ -1,20 +0,0 @@
1
- <!-- Card component -->
2
- <!-- Supports header, body, footer content slots -->
3
-
4
- <div class="card">
5
- <if=input.header>
6
- <div class="card-header">
7
- <input.header/>
8
- </div>
9
- </if>
10
- <if=input.body>
11
- <div class="card-body">
12
- <input.body/>
13
- </div>
14
- </if>
15
- <if=input.footer>
16
- <div class="card-footer">
17
- <input.footer/>
18
- </div>
19
- </if>
20
- </div>
@@ -1,149 +0,0 @@
1
- <!-- Icon Component -->
2
- <!-- Displays SVG icons with customizable size and color -->
3
- <!-- Supported icons: user, settings, check, home, menu, close, search, arrow, star, heart -->
4
- <!-- Example: <icon name="check" size="24" color="success" /> -->
5
- <!-- Example: <icon name="arrow" size="20" spin /> -->
6
-
7
- <svg
8
- xmlns="http://www.w3.org/2000/svg"
9
- width=(input.size || 20)
10
- height=(input.size || 20)
11
- class=["icon", input.spin && "icon-spin"]
12
- fill=input.fill || "none"
13
- stroke=input.color === "primary" ? "var(--accent-primary)" :
14
- input.color === "success" ? "var(--c-success)" :
15
- input.color === "warning" ? "var(--c-warning)" :
16
- input.color === "danger" ? "var(--c-danger)" :
17
- input.color === "light" ? "var(--c-gray-300)" :
18
- "currentColor"
19
- stroke-width=input.strokeWidth || 2
20
- stroke-linecap="round"
21
- stroke-linejoin="round">
22
-
23
- <if=input.name === 'user'>
24
- <!-- User/Person Icon -->
25
- <path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path>
26
- <circle cx="12" cy="7" r="4"></circle>
27
- </if>
28
-
29
- <if=input.name === 'settings'>
30
- <!-- Settings/Gear Icon -->
31
- <circle cx="12" cy="12" r="3"></circle>
32
- <path d="M12 1v6m0 6v6m9-9h-6m-6 0H3m15.364 6.364l-4.243 4.243M9.879 9.879L5.636 5.636m12.728 12.728l-4.243 4.243M9.879 14.121l-4.243 4.243"></path>
33
- </if>
34
-
35
- <if=input.name === 'check'>
36
- <!-- Check/Tick Icon -->
37
- <polyline points="20 6 9 17 4 12"></polyline>
38
- </if>
39
-
40
- <if=input.name === 'check-circle'>
41
- <!-- Check in Circle Icon -->
42
- <path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path>
43
- <polyline points="22 4 12 14.01 9 11.01"></polyline>
44
- </if>
45
-
46
- <if=input.name === 'home'>
47
- <!-- Home Icon -->
48
- <path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path>
49
- <polyline points="9 22 9 12 15 12 15 22"></polyline>
50
- </if>
51
-
52
- <if=input.name === 'menu'>
53
- <!-- Menu/Hamburger Icon -->
54
- <line x1="3" y1="12" x2="21" y2="12"></line>
55
- <line x1="3" y1="6" x2="21" y2="6"></line>
56
- <line x1="3" y1="18" x2="21" y2="18"></line>
57
- </if>
58
-
59
- <if=input.name === 'close'>
60
- <!-- Close/X Icon -->
61
- <line x1="18" y1="6" x2="6" y2="18"></line>
62
- <line x1="6" y1="6" x2="18" y2="18"></line>
63
- </if>
64
-
65
- <if=input.name === 'search'>
66
- <!-- Search/Magnifying Glass Icon -->
67
- <circle cx="11" cy="11" r="8"></circle>
68
- <path d="m21 21-4.35-4.35"></path>
69
- </if>
70
-
71
- <if=input.name === 'arrow'>
72
- <!-- Arrow Right Icon -->
73
- <line x1="5" y1="12" x2="19" y2="12"></line>
74
- <polyline points="12 5 19 12 12 19"></polyline>
75
- </if>
76
-
77
- <if=input.name === 'arrow-left'>
78
- <!-- Arrow Left Icon -->
79
- <line x1="19" y1="12" x2="5" y2="12"></line>
80
- <polyline points="12 19 5 12 12 5"></polyline>
81
- </if>
82
-
83
- <if=input.name === 'star'>
84
- <!-- Star Icon -->
85
- <polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"></polygon>
86
- </if>
87
-
88
- <if=input.name === 'heart'>
89
- <!-- Heart Icon -->
90
- <path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"></path>
91
- </if>
92
-
93
- <if=input.name === 'info'>
94
- <!-- Info Icon -->
95
- <circle cx="12" cy="12" r="10"></circle>
96
- <line x1="12" y1="16" x2="12" y2="12"></line>
97
- <line x1="12" y1="8" x2="12.01" y2="8"></line>
98
- </if>
99
-
100
- <if=input.name === 'warning'>
101
- <!-- Warning/Alert Icon -->
102
- <path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path>
103
- <line x1="12" y1="9" x2="12" y2="13"></line>
104
- <line x1="12" y1="17" x2="12.01" y2="17"></line>
105
- </if>
106
-
107
- <if=input.name === 'download'>
108
- <!-- Download Icon -->
109
- <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
110
- <polyline points="7 10 12 15 17 10"></polyline>
111
- <line x1="12" y1="15" x2="12" y2="3"></line>
112
- </if>
113
-
114
- <if=input.name === 'upload'>
115
- <!-- Upload Icon -->
116
- <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
117
- <polyline points="17 8 12 3 7 8"></polyline>
118
- <line x1="12" y1="3" x2="12" y2="15"></line>
119
- </if>
120
-
121
- <if=input.name === 'external-link'>
122
- <!-- External Link Icon -->
123
- <path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path>
124
- <polyline points="15 3 21 3 21 9"></polyline>
125
- <line x1="10" y1="14" x2="21" y2="3"></line>
126
- </if>
127
-
128
- <else>
129
- <!-- Default Circle Icon for unknown names -->
130
- <circle cx="12" cy="12" r="10"></circle>
131
- <line x1="12" y1="8" x2="12" y2="12"></line>
132
- <line x1="12" y1="16" x2="12.01" y2="16"></line>
133
- </else>
134
- </svg>
135
-
136
- <style>
137
- .icon-spin {
138
- animation: spin 1s linear infinite;
139
- }
140
-
141
- @keyframes spin {
142
- from {
143
- transform: rotate(0deg);
144
- }
145
- to {
146
- transform: rotate(360deg);
147
- }
148
- }
149
- </style>