@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.
- package/.docu/components/Context.tsx +1 -1
- package/.docu/components/Pagination.tsx +9 -1
- package/.docu/components/Search.tsx +6 -6
- package/.docu/components/Sidebar.tsx +37 -8
- package/.docu/components/Theme.tsx +2 -2
- package/.docu/components/Toc.tsx +52 -6
- package/.docu/components/Typography.tsx +1 -1
- package/.docu/components/home/Hero.tsx +4 -4
- package/.docu/components/registry.ts +1 -1
- package/.docu/lib/build.deno.js +3 -3
- package/.docu/lib/{build.impl-TSIF3F7O.js → build.impl-VXB4KL4D.js} +3 -3
- package/.docu/lib/build.node.js +3 -3
- package/.docu/lib/{chunk-SPHVBXRR.js → chunk-7PRQ3RQB.js} +6 -6
- package/.docu/lib/{chunk-DITXUPUV.js → chunk-A6FIEG3H.js} +61 -10
- package/.docu/lib/{chunk-PJIJEPNR.js → chunk-JRERMREW.js} +5 -4
- package/.docu/lib/{chunk-KMDGSD57.js → chunk-LZDEWK25.js} +3 -3
- package/.docu/lib/{chunk-HRO7ONJQ.js → chunk-MQWWCO6O.js} +70 -27
- package/.docu/lib/{chunk-B6LGUADD.js → chunk-TRT6WQZG.js} +346 -183
- package/.docu/lib/chunk-UISOJ4RW.js +114 -0
- package/.docu/lib/clean.js +1 -1
- package/.docu/lib/deploy.deno.js +1 -1
- package/.docu/lib/deploy.node.js +1 -1
- package/.docu/lib/preview.deno.js +5 -3
- package/.docu/lib/preview.node.js +5 -3
- package/.docu/lib/server.deno.js +6 -4
- package/.docu/lib/server.node.js +6 -4
- package/.docu/node/build.impl.ts +75 -26
- package/.docu/node/build.ts +70 -17
- package/.docu/node/client.ts +64 -27
- package/.docu/node/deploy.shared.ts +5 -5
- package/.docu/node/deploy.ts +1 -1
- package/.docu/node/html.shared.ts +7 -2
- package/.docu/node/html.ts +4 -2
- package/.docu/node/hydrate.node.ts +69 -4
- package/.docu/node/hydrate.ts +50 -1
- package/.docu/node/mdx-manifest.d.ts +5 -0
- package/.docu/node/mdx.ts +103 -17
- package/.docu/node/preview.deno.ts +1 -1
- package/.docu/node/preview.impl.ts +3 -3
- package/.docu/node/preview.node.ts +1 -1
- package/.docu/node/preview.ts +2 -2
- package/.docu/node/route.ts +57 -1
- package/.docu/node/runtime/bun.ts +28 -0
- package/.docu/node/runtime/deno.ts +34 -0
- package/.docu/node/runtime/index.ts +4 -0
- package/.docu/node/runtime/node.ts +107 -0
- package/.docu/node/runtime/types.ts +19 -0
- package/.docu/node/search-indexer.ts +3 -2
- package/.docu/node/seo.ts +2 -2
- package/.docu/node/server-routes.ts +32 -13
- package/.docu/node/server.deno.ts +1 -1
- package/.docu/node/server.impl.ts +49 -3
- package/.docu/node/server.node.ts +1 -1
- package/.docu/node/server.ts +45 -1
- package/.docu/pages/docs/[[...slug]].tsx +13 -4
- package/.docu/pages/index.tsx +1 -1
- package/.docu/styles/globals.css +38 -20
- package/README.md +7 -48
- package/bin/cli.js +25 -7
- package/package.json +7 -6
- package/template/README.md +7 -48
- package/template/docs/getting-started/configuration.mdx +16 -4
- package/template/docs/getting-started/overview.mdx +34 -42
- package/template/docs/guide/components.mdx +46 -228
- package/template/docs/guide/routing.mdx +8 -6
- package/template/docs/index.mdx +9 -8
- package/template/docu.json +4 -4
|
@@ -1,256 +1,74 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Components
|
|
3
|
-
description:
|
|
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
|
-
|
|
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
|
-
|
|
8
|
+
## Callout
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
16
|
+
Variants: `tip`, `info`, `warning`, `danger`, `success`.
|
|
73
17
|
|
|
74
|
-
|
|
18
|
+
## Code block with title
|
|
75
19
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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
|
-
|
|
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
|
-
|
|
179
|
-
```ts:server.ts {3-5}
|
|
180
|
-
import { serve } from "bun";
|
|
29
|
+
## Tabs
|
|
181
30
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
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
|
-
##
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
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
|
-
##
|
|
198
|
-
|
|
199
|
-
Styled links with external indicator.
|
|
55
|
+
## Mermaid
|
|
200
56
|
|
|
201
|
-
```
|
|
202
|
-
|
|
57
|
+
```mermaid
|
|
58
|
+
flowchart LR
|
|
59
|
+
A --> B
|
|
203
60
|
```
|
|
204
61
|
|
|
205
|
-
##
|
|
206
|
-
|
|
207
|
-
Display keyboard shortcuts.
|
|
62
|
+
## Tooltip
|
|
208
63
|
|
|
209
|
-
```
|
|
210
|
-
|
|
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
|
-
|
|
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
|
-
```
|
|
226
|
-
|
|
70
|
+
```md
|
|
71
|
+
::youtube{videoId="OPM2t54T-Vo"}
|
|
227
72
|
```
|
|
228
73
|
|
|
229
|
-
|
|
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
|
|
3
|
+
description: How Flame maps markdown files to static pages.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
Flame uses **filesystem-based routing** — every
|
|
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
|
-
##
|
|
19
|
+
## Add a page
|
|
20
20
|
|
|
21
|
-
|
|
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
|
-
##
|
|
25
|
+
## Sidebar order
|
|
24
26
|
|
|
25
|
-
Define `routes` in `docu.json` for a custom
|
|
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.
|
package/template/docs/index.mdx
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
---
|
|
2
|
-
title:
|
|
3
|
-
description:
|
|
2
|
+
title: My Docs
|
|
3
|
+
description: Documentation powered by DocuBook Flame.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
|
|
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
|
|
10
|
-
A[
|
|
11
|
-
B --> C[Static HTML + assets]
|
|
12
|
-
C --> D[Vercel
|
|
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.
|
package/template/docu.json
CHANGED
|
@@ -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",
|