@docubook/flame 1.7.2 → 2.0.0-alpha.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 (67) hide show
  1. package/.docu/components/Context.tsx +1 -1
  2. package/.docu/components/Pagination.tsx +9 -1
  3. package/.docu/components/Search.tsx +6 -6
  4. package/.docu/components/Sidebar.tsx +37 -8
  5. package/.docu/components/Theme.tsx +2 -2
  6. package/.docu/components/Toc.tsx +52 -6
  7. package/.docu/components/Typography.tsx +1 -1
  8. package/.docu/components/home/Hero.tsx +4 -4
  9. package/.docu/components/registry.ts +1 -1
  10. package/.docu/lib/build.deno.js +3 -3
  11. package/.docu/lib/{build.impl-TSIF3F7O.js → build.impl-VXB4KL4D.js} +3 -3
  12. package/.docu/lib/build.node.js +3 -3
  13. package/.docu/lib/{chunk-SPHVBXRR.js → chunk-7PRQ3RQB.js} +6 -6
  14. package/.docu/lib/{chunk-DITXUPUV.js → chunk-A6FIEG3H.js} +61 -10
  15. package/.docu/lib/{chunk-PJIJEPNR.js → chunk-JRERMREW.js} +5 -4
  16. package/.docu/lib/{chunk-KMDGSD57.js → chunk-LZDEWK25.js} +3 -3
  17. package/.docu/lib/{chunk-HRO7ONJQ.js → chunk-MQWWCO6O.js} +70 -27
  18. package/.docu/lib/{chunk-B6LGUADD.js → chunk-TRT6WQZG.js} +346 -183
  19. package/.docu/lib/chunk-UISOJ4RW.js +114 -0
  20. package/.docu/lib/clean.js +1 -1
  21. package/.docu/lib/deploy.deno.js +1 -1
  22. package/.docu/lib/deploy.node.js +1 -1
  23. package/.docu/lib/preview.deno.js +5 -3
  24. package/.docu/lib/preview.node.js +5 -3
  25. package/.docu/lib/server.deno.js +6 -4
  26. package/.docu/lib/server.node.js +6 -4
  27. package/.docu/node/build.impl.ts +75 -26
  28. package/.docu/node/build.ts +70 -17
  29. package/.docu/node/client.ts +64 -27
  30. package/.docu/node/deploy.shared.ts +5 -5
  31. package/.docu/node/deploy.ts +1 -1
  32. package/.docu/node/html.shared.ts +7 -2
  33. package/.docu/node/html.ts +4 -2
  34. package/.docu/node/hydrate.node.ts +69 -4
  35. package/.docu/node/hydrate.ts +50 -1
  36. package/.docu/node/mdx-manifest.d.ts +5 -0
  37. package/.docu/node/mdx.ts +103 -17
  38. package/.docu/node/preview.deno.ts +1 -1
  39. package/.docu/node/preview.impl.ts +3 -3
  40. package/.docu/node/preview.node.ts +1 -1
  41. package/.docu/node/preview.ts +2 -2
  42. package/.docu/node/route.ts +57 -1
  43. package/.docu/node/runtime/bun.ts +28 -0
  44. package/.docu/node/runtime/deno.ts +34 -0
  45. package/.docu/node/runtime/index.ts +4 -0
  46. package/.docu/node/runtime/node.ts +107 -0
  47. package/.docu/node/runtime/types.ts +19 -0
  48. package/.docu/node/search-indexer.ts +3 -2
  49. package/.docu/node/seo.ts +2 -2
  50. package/.docu/node/server-routes.ts +32 -13
  51. package/.docu/node/server.deno.ts +1 -1
  52. package/.docu/node/server.impl.ts +49 -3
  53. package/.docu/node/server.node.ts +1 -1
  54. package/.docu/node/server.ts +45 -1
  55. package/.docu/pages/docs/[[...slug]].tsx +13 -4
  56. package/.docu/pages/index.tsx +1 -1
  57. package/.docu/styles/globals.css +38 -20
  58. package/README.md +7 -48
  59. package/bin/cli.js +25 -7
  60. package/package.json +7 -6
  61. package/template/README.md +7 -48
  62. package/template/docs/getting-started/configuration.mdx +16 -4
  63. package/template/docs/getting-started/overview.mdx +34 -42
  64. package/template/docs/guide/components.mdx +46 -228
  65. package/template/docs/guide/routing.mdx +8 -6
  66. package/template/docs/index.mdx +9 -8
  67. package/template/docu.json +4 -4
@@ -1,256 +1,74 @@
1
1
  ---
2
2
  title: Components
3
- description: Built-in MDX components available in DocuBook Flame.
4
- date: 2026-05-25
3
+ description: The directive syntax for built-in components — callouts, tabs, cards, code blocks, and more.
5
4
  ---
6
5
 
7
- DocuBook Flame includes pre-built MDX components you can use directly in your docs.
6
+ Components are **directives**, not JSX — content stays plain markdown. A few to get you started; the full reference lives at [docubook.pro/docs/components](https://www.docubook.pro/docs/components/accordion).
8
7
 
9
- > For full documentation and live examples, visit [docubook.pro/docs/components](https://www.docubook.pro/docs/components/accordion).
8
+ ## Callout
10
9
 
11
- ## Note
12
-
13
- Display messages with different severity levels.
14
-
15
- ```jsx:filename.mdx
16
- <Note type="tip" title="Tip">
17
- This is a tip to suggests a helpful.
18
- </Note>
19
- <Note type="info" title="Info">
20
- This is a general note to convey information to the user.
21
- </Note>
22
- <Note type="danger" title="Danger">
23
- This is a danger alert to notify the user of a critical issue.
24
- </Note>
25
- <Note type="warning">
26
- This note uses default title and default icon from its type.
27
- </Note>
28
- <Note type="success" title="Success">
29
- This is a success message to inform the user of successful actions.
30
- </Note>
31
- ```
32
-
33
- ## Tabs
34
-
35
- Organize content into switchable sections.
36
-
37
- ````jsx:filename.mdx
38
- <Tabs className="pt-5 pb-1">
39
- <Tab title="Java">
40
- ```java:HelloWorld.java
41
- // HelloWorld.java
42
- public class HelloWorld {
43
- public static void main(String[] args) {
44
- System.out.println("Hello, World!");
45
- }
46
- }
47
- ```
48
- </Tab>
49
- <Tab title="TypeScript">
50
- ```typescript:helloWorld.ts
51
- // helloWorld.ts
52
- function helloWorld(): void {
53
- console.log("Hello, World!");
54
- }
55
- helloWorld();
56
- ```
57
- </Tab>
58
- </Tabs>
59
- ````
60
-
61
- ## Card
62
-
63
- Display content in a compact card layout.
64
-
65
- ```jsx:filename.mdx
66
- <Card title="Card with Link and icon" icon="Link" href="/docs/components/card-group">
67
- This is how you use a card with an icon and a link. Clicking on this card
68
- brings you to the Card Group page.
69
- </Card>
10
+ ```md
11
+ :::tip{title="Optional title"}
12
+ Callout content.
13
+ :::
70
14
  ```
71
15
 
72
- ## Card Group
16
+ Variants: `tip`, `info`, `warning`, `danger`, `success`.
73
17
 
74
- Group multiple cards in a grid.
18
+ ## Code block with title
75
19
 
76
- ```jsx:filename.mdx
77
- <Cards cols={2}>
78
- <Card title="Heading 1" icon="Heading1">
79
- This is an example of card content with columns.
80
- </Card>
81
- <Card title="Heading 2" icon="Heading2">
82
- This is an example of card content with columns.
83
- </Card>
84
- <Card title="Grid Card" icon="Grid" horizontal>
85
- This is a horizontal card layout.
86
- </Card>
87
- <Card title="Horizontal Card" icon="Layout" horizontal>
88
- This is a horizontal card layout.
89
- </Card>
90
- </Cards>
20
+ ````md
21
+ ```javascript:app.js showLineNumbers {2-3}
22
+ const docs = "markdown";
23
+ console.log(docs);
91
24
  ```
92
-
93
- ## Accordion
94
-
95
- ````markdown:filename.mdx
96
- <Accordions>
97
- <Accordion title="Basic Usage">
98
- This accordion includes a [Lucide Icon](https://lucide.dev/icons/) because the `icon` prop is provided.
99
- </Accordion>
100
-
101
- <Accordion title="With icon props" icon="MousePointerClick">
102
- This accordion includes a Lucide icon because the `icon` prop is provided.
103
- </Accordion>
104
-
105
- <Accordion title="With Code Block">
106
- You can put other components inside Accordions.
107
- ```jsx:helloword.jsx
108
- class HelloWorld {
109
- public static void main(String[] args) {
110
- System.out.println("Hello, World!");
111
- }
112
- }
113
- ```
114
- </Accordion>
115
- </Accordions>
116
25
  ````
117
26
 
118
- ## Steps / Stepper
119
-
120
- Display step-by-step instructions.
121
-
122
- ````jsx:filename.mdx
123
- <Steps>
124
- <Step title="Step 1: Clone the DocuBook Repository">
125
- ```bash
126
- git clone https://github.com/DocuBook/docubook.git
127
- ```
128
- </Step>
129
- <Step title="Step 2: Access the Project Directory">
130
- ```bash
131
- cd docubook
132
- ```
133
- </Step>
134
- <Step title="Step 3: Install Required Dependencies">
135
- ```bash
136
- pnpm install
137
- ```
138
- </Step>
139
- </Steps>
140
- ````
141
-
142
- ## Button
143
-
144
- Styled buttons with icons.
145
-
146
- ```jsx
147
- <Button
148
- text="Learn More"
149
- href="https://example.com"
150
- icon="MoveUpRight"
151
- size="md"
152
- variant="secondary"
153
- target="_blank"
154
- />
155
- ```
156
-
157
- ## File Tree
158
-
159
- Display hierarchical file structures.
160
-
161
- ```jsx
162
- <Files>
163
- <Folder name="src">
164
- <File name="App.tsx" />
165
- <File name="index.tsx" />
166
- <Folder name="components">
167
- <File name="Button.tsx" />
168
- </Folder>
169
- </Folder>
170
- <File name="package.json" />
171
- </Files>
172
- ```
173
-
174
- ## Code Block
175
-
176
- Syntax-highlighted code with title and line highlighting.
27
+ The `:filename` suffix adds a title bar; `showLineNumbers` and `{2-3}` enable line numbers and highlighting.
177
28
 
178
- ````jsx
179
- ```ts:server.ts {3-5}
180
- import { serve } from "bun";
29
+ ## Tabs
181
30
 
182
- serve({
183
- port: 3000,
184
- fetch: () => new Response("Hello!"),
185
- });
186
- ```
31
+ ````md
32
+ ::::tabs
33
+ :::tab{title="Bun"}
34
+ bun run dev
35
+ :::
36
+ :::tab{title="Node"}
37
+ npm run dev
38
+ :::
39
+ ::::
187
40
  ````
188
41
 
189
- ## Image
190
-
191
- Responsive images with optional caption.
192
-
193
- ```markdown:filename.mdx
194
- ![Alt text for the image](https://via.placeholder.com/150)
42
+ ## Card group
43
+
44
+ ```md
45
+ ::::cards{cols="2"}
46
+ :::card{title="First" icon="Heading1"}
47
+ Card content.
48
+ :::
49
+ :::card{title="Second" icon="Heading2"}
50
+ Card content.
51
+ :::
52
+ ::::
195
53
  ```
196
54
 
197
- ## Link
198
-
199
- Styled links with external indicator.
55
+ ## Mermaid
200
56
 
201
- ```markdown:filename.mdx
202
- [Visit OpenAI](https://www.openai.com)
57
+ ```mermaid
58
+ flowchart LR
59
+ A --> B
203
60
  ```
204
61
 
205
- ## Keyboard
206
-
207
- Display keyboard shortcuts.
62
+ ## Tooltip
208
63
 
209
- ```tsx
210
- {/* Windows style (default) */}
211
- <Kbd show="ctrl" /> + <Kbd show="v" />
212
-
213
- {/* Mac style */}
214
- <Kbd show="cmd" type="mac" /> + <Kbd show="v" type="mac" />
64
+ ```md
65
+ Inline :tooltip[hover me]{tip="Extra details"}.
215
66
  ```
216
67
 
217
- Renders as:
218
- - Windows: <Kbd show="ctrl" type="window" /> + <Kbd show="v" type="window" />
219
- - Mac: <Kbd show="cmd" type="mac" /> + <Kbd show="v" type="mac" />
220
-
221
- ## Tooltips
222
-
223
- Hover tooltips for inline content.
68
+ ## Youtube
224
69
 
225
- ```markdown:filename.mdx
226
- This a tooltip <Tooltip text="Hover me show on top" tip="npx @docubook/cli@latest" side="top" /> and <Tooltip text="Hover me show on bottom" tip="npx @docubook/cli@latest" side="bottom" /> thanks you.
70
+ ```md
71
+ ::youtube{videoId="OPM2t54T-Vo"}
227
72
  ```
228
73
 
229
- ## YouTube
230
-
231
- Embed YouTube videos.
232
-
233
- ```markdown:filename.mdx
234
- <Youtube videoId="OPM2t54T-Vo" />
235
- ```
236
-
237
- > Usage
238
- > for example the youtube URL show this https://www.youtube.com/watch?v=OPM2t54T-Vo
239
- > the ID is `OPM2t54T-Vo`
240
-
241
- ## Release Note
242
-
243
- Display changelog entries.
244
-
245
- ```markdown:filename.mdx
246
- <Release version="1.10.1" date="2025-05-24" title="Accessibility Improvements and Bug Fixes">
247
- <Changes type="added">
248
- - New feature to improve accessibility
249
- - Keyboard navigation support for dialog components
250
- </Changes>
251
- <Changes type="fixed">
252
- - Bug fix for mobile menu
253
- - Fixed loading issues on documentation pages
254
- </Changes>
255
- </Release>
256
- ```
74
+ > All directives render server-side to static HTML — no runtime JavaScript unless the component needs it.
@@ -1,9 +1,9 @@
1
1
  ---
2
2
  title: Routing
3
- description: How Flame maps MDX files to static HTML pages.
3
+ description: How Flame maps markdown files to static pages.
4
4
  ---
5
5
 
6
- Flame uses **filesystem-based routing** — every `.mdx` file in `docs/` compiles to a matching `.html` path:
6
+ Flame uses **filesystem-based routing** — every markdown file in `docs/` compiles to a matching `.html` path:
7
7
 
8
8
  ```
9
9
  docs/
@@ -16,10 +16,12 @@ docs/
16
16
  └── routing.mdx → /docs/guide/routing.html
17
17
  ```
18
18
 
19
- ## Auto-routing
19
+ ## Add a page
20
20
 
21
- When `routes: []` in `docu.json`, Flame automatically scans `docs/` at build time and generates the sidebar from the directory structure.
21
+ 1. Create `docs/guide/faq.mdx`
22
+ 2. Add frontmatter: `title` and `description`
23
+ 3. Write markdown — the page appears in the sidebar and search automatically
22
24
 
23
- ## Manual routes
25
+ ## Sidebar order
24
26
 
25
- Define `routes` in `docu.json` for a custom sidebar. Add `context` groups with icons for multi-section documentation. See this project's `docu.json` for examples.
27
+ When `routes: []`, Flame scans `docs/` and builds the sidebar from the directory structure. Define `routes` in `docu.json` for a custom order and grouped sections — see this project's `docu.json` for a working example.
@@ -1,15 +1,16 @@
1
1
  ---
2
- title: DocuBook Flame 🔥
3
- description: An open-source alternative to Mintlify or GitBook — MDX-powered documentation, static HTML output.
2
+ title: My Docs
3
+ description: Documentation powered by DocuBook Flame.
4
4
  ---
5
5
 
6
- **@docubook/flame** is a static site generator for documentation. Write in MDX, compile to flat static HTML — no server required. Runs on **Bun**, **Node.js**, and **Deno**.
6
+ Welcome to **My Docs** — a static documentation site built with [DocuBook Flame](https://www.docubook.pro/).
7
+
8
+ Flame compiles the markdown in `docs/` into flat static HTML. No server, no database, no runtime — deploy anywhere.
7
9
 
8
10
  ```mermaid
9
- flowchart LR
10
- A[Your .mdx content] --> B[flame build]
11
- B --> C[Static HTML + assets]
12
- C --> D[Vercel / Netlify / GitHub Pages / S3]
11
+ flowchart TD
12
+ A["docs/*.md"] --> B["flame build"]
13
+ B --> C["Static HTML + assets"]
14
+ C --> D["Vercel · Netlify · GitHub Pages · S3"]
13
15
  ```
14
16
 
15
- Check the sidebar for guides on getting started, configuration, components, routing, and deployment.
@@ -7,6 +7,9 @@
7
7
  "favicon": "/docs/assets/images/favicon.ico",
8
8
  "ogImage": "/docs/assets/images/og.png"
9
9
  },
10
+ "sidebar": {
11
+ "context": "separator"
12
+ },
10
13
  "themes": {
11
14
  "colors": "default"
12
15
  },
@@ -71,13 +74,10 @@
71
74
  "social": []
72
75
  },
73
76
  "repo": {
74
- "url": "",
77
+ "url": "https://github.com/DocuBook/docubook",
75
78
  "path": "blob/main/{filePath}",
76
79
  "edit": false
77
80
  },
78
- "sidebar": {
79
- "context": "dropdown"
80
- },
81
81
  "routes": [
82
82
  {
83
83
  "title": "Getting Started",