@docubook/create 1.9.1 → 1.11.2
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/README.md +1 -3
- package/package.json +4 -5
- package/src/cli/program.js +32 -0
- package/src/cli/promptHandler.js +73 -0
- package/src/dist/LICENSE +21 -0
- package/src/dist/README.md +37 -0
- package/src/dist/app/docs/[[...slug]]/page.tsx +105 -0
- package/src/dist/app/docs/layout.tsx +16 -0
- package/src/dist/app/error.tsx +44 -0
- package/src/dist/app/layout.tsx +96 -0
- package/src/dist/app/not-found.tsx +19 -0
- package/src/dist/app/page.tsx +96 -0
- package/src/dist/components/GithubStart.tsx +44 -0
- package/src/dist/components/Sponsor.tsx +69 -0
- package/src/dist/components/anchor.tsx +84 -0
- package/src/dist/components/contexts/theme-provider.tsx +9 -0
- package/src/dist/components/docs-breadcrumb.tsx +47 -0
- package/src/dist/components/docs-menu.tsx +45 -0
- package/src/dist/components/edit-on-github.tsx +33 -0
- package/src/dist/components/footer.tsx +85 -0
- package/src/dist/components/leftbar.tsx +95 -0
- package/src/dist/components/markdown/AccordionMdx.tsx +47 -0
- package/src/dist/components/markdown/ButtonMdx.tsx +52 -0
- package/src/dist/components/markdown/CardGroupMdx.tsx +28 -0
- package/src/dist/components/markdown/CardMdx.tsx +41 -0
- package/src/dist/components/markdown/CopyMdx.tsx +33 -0
- package/src/dist/components/markdown/ImageMdx.tsx +25 -0
- package/src/dist/components/markdown/KeyboardMdx.tsx +102 -0
- package/src/dist/components/markdown/LinkMdx.tsx +14 -0
- package/src/dist/components/markdown/NoteMdx.tsx +52 -0
- package/src/dist/components/markdown/OutletMdx.tsx +29 -0
- package/src/dist/components/markdown/PreMdx.tsx +19 -0
- package/src/dist/components/markdown/ReleaseMdx.tsx +109 -0
- package/src/dist/components/markdown/StepperMdx.tsx +41 -0
- package/src/dist/components/markdown/TooltipsMdx.tsx +28 -0
- package/src/dist/components/markdown/YoutubeMdx.tsx +22 -0
- package/src/dist/components/markdown/mdx-provider.tsx +29 -0
- package/src/dist/components/mob-toc.tsx +128 -0
- package/src/dist/components/navbar.tsx +87 -0
- package/src/dist/components/pagination.tsx +49 -0
- package/src/dist/components/scroll-to-top.tsx +86 -0
- package/src/dist/components/search.tsx +214 -0
- package/src/dist/components/sublink.tsx +133 -0
- package/src/dist/components/theme-toggle.tsx +71 -0
- package/src/dist/components/toc-observer.tsx +264 -0
- package/src/dist/components/toc.tsx +27 -0
- package/src/dist/components/typography.tsx +9 -0
- package/src/dist/components/ui/accordion.tsx +58 -0
- package/src/dist/components/ui/animated-shiny-text.tsx +40 -0
- package/src/dist/components/ui/aurora.tsx +45 -0
- package/src/dist/components/ui/avatar.tsx +50 -0
- package/src/dist/components/ui/badge.tsx +37 -0
- package/src/dist/components/ui/breadcrumb.tsx +115 -0
- package/src/dist/components/ui/button.tsx +57 -0
- package/src/dist/components/ui/card.tsx +76 -0
- package/src/dist/components/ui/collapsible.tsx +11 -0
- package/src/dist/components/ui/command.tsx +153 -0
- package/src/dist/components/ui/dialog.tsx +124 -0
- package/src/dist/components/ui/dropdown-menu.tsx +200 -0
- package/src/dist/components/ui/icon-cloud.tsx +324 -0
- package/src/dist/components/ui/input.tsx +25 -0
- package/src/dist/components/ui/interactive-hover-button.tsx +35 -0
- package/src/dist/components/ui/popover.tsx +33 -0
- package/src/dist/components/ui/scroll-area.tsx +48 -0
- package/src/dist/components/ui/separator.tsx +30 -0
- package/src/dist/components/ui/sheet.tsx +140 -0
- package/src/dist/components/ui/shine-border.tsx +64 -0
- package/src/dist/components/ui/skeleton.tsx +15 -0
- package/src/dist/components/ui/sonner.tsx +31 -0
- package/src/dist/components/ui/table.tsx +117 -0
- package/src/dist/components/ui/tabs.tsx +55 -0
- package/src/dist/components/ui/toggle-group.tsx +61 -0
- package/src/dist/components/ui/toggle.tsx +46 -0
- package/src/dist/components.json +17 -0
- package/src/dist/contents/docs/getting-started/changelog/index.mdx +512 -0
- package/src/dist/contents/docs/getting-started/components/accordion/index.mdx +72 -0
- package/src/dist/contents/docs/getting-started/components/button/index.mdx +42 -0
- package/src/dist/contents/docs/getting-started/components/card/index.mdx +70 -0
- package/src/dist/contents/docs/getting-started/components/card-group/index.mdx +49 -0
- package/src/dist/contents/docs/getting-started/components/code-block/index.mdx +41 -0
- package/src/dist/contents/docs/getting-started/components/custom/index.mdx +38 -0
- package/src/dist/contents/docs/getting-started/components/image/index.mdx +37 -0
- package/src/dist/contents/docs/getting-started/components/index.mdx +9 -0
- package/src/dist/contents/docs/getting-started/components/keyboard/index.mdx +117 -0
- package/src/dist/contents/docs/getting-started/components/link/index.mdx +34 -0
- package/src/dist/contents/docs/getting-started/components/note/index.mdx +46 -0
- package/src/dist/contents/docs/getting-started/components/release-note/index.mdx +130 -0
- package/src/dist/contents/docs/getting-started/components/stepper/index.mdx +47 -0
- package/src/dist/contents/docs/getting-started/components/tabs/index.mdx +70 -0
- package/src/dist/contents/docs/getting-started/components/tooltips/index.mdx +22 -0
- package/src/dist/contents/docs/getting-started/components/youtube/index.mdx +21 -0
- package/src/dist/contents/docs/getting-started/customize/index.mdx +94 -0
- package/src/dist/contents/docs/getting-started/installation/index.mdx +84 -0
- package/src/dist/contents/docs/getting-started/introduction/index.mdx +50 -0
- package/src/dist/contents/docs/getting-started/project-structure/index.mdx +87 -0
- package/src/dist/contents/docs/getting-started/quick-start-guide/index.mdx +127 -0
- package/src/dist/docu.json +100 -0
- package/src/dist/hooks/index.ts +2 -0
- package/src/dist/hooks/useActiveSection.ts +68 -0
- package/src/dist/hooks/useScrollPosition.ts +28 -0
- package/src/dist/lib/markdown.ts +244 -0
- package/src/dist/lib/routes-config.ts +28 -0
- package/src/dist/lib/toc.ts +9 -0
- package/src/dist/lib/utils.ts +80 -0
- package/src/dist/next-env.d.ts +5 -0
- package/src/dist/next.config.mjs +14 -0
- package/src/dist/package.json +58 -0
- package/src/dist/postcss.config.js +6 -0
- package/src/dist/public/favicon.ico +0 -0
- package/src/dist/public/images/docu.svg +6 -0
- package/src/dist/public/images/example-img.png +0 -0
- package/src/dist/public/images/img-playground.png +0 -0
- package/src/dist/public/images/new-editor.png +0 -0
- package/src/dist/public/images/og-image.png +0 -0
- package/src/dist/public/images/release-note.png +0 -0
- package/src/dist/public/images/snippet.png +0 -0
- package/src/dist/public/images/vercel.png +0 -0
- package/src/dist/public/images/view-changelog.png +0 -0
- package/src/dist/styles/editor.css +57 -0
- package/src/dist/styles/globals.css +156 -0
- package/src/dist/styles/syntax.css +100 -0
- package/src/dist/tailwind.config.ts +112 -0
- package/src/dist/tsconfig.json +26 -0
- package/src/index.js +19 -0
- package/src/installer/projectInstaller.js +125 -0
- package/src/utils/display.js +83 -0
- package/src/utils/logger.js +11 -0
- package/src/utils/packageManager.js +54 -0
- package/create.js +0 -211
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Card Group
|
|
3
|
+
description: A component used to create card groups that can be used to display multiple cards in a compact and organized way.
|
|
4
|
+
date: 20-02-2025
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
The CardGroup component is a component used to create card groups that can be used to display multiple cards in a compact and organized way.
|
|
8
|
+
|
|
9
|
+
## Preview
|
|
10
|
+
|
|
11
|
+
<CardGroup cols={2}>
|
|
12
|
+
<Card title="Heading 1" icon="Heading1">
|
|
13
|
+
This is an example of card content with columns.
|
|
14
|
+
</Card>
|
|
15
|
+
<Card title="Heading 2" icon="Heading2">
|
|
16
|
+
This is an example of card content with columns.
|
|
17
|
+
</Card>
|
|
18
|
+
<Card title="Grid Card" icon="Grid" horizontal>
|
|
19
|
+
This is a horizontal card layout.
|
|
20
|
+
</Card>
|
|
21
|
+
<Card title="Horizontal Card" icon="Layout" horizontal>
|
|
22
|
+
This is a horizontal card layout.
|
|
23
|
+
</Card>
|
|
24
|
+
</CardGroup>
|
|
25
|
+
|
|
26
|
+
## Props
|
|
27
|
+
|
|
28
|
+
| Prop | Type | Default | Description |
|
|
29
|
+
| ------------- | -------- | ------- | ------------------------------------------------------- |
|
|
30
|
+
| `cols` | `number` | `{2}` | By default 2 The number of columns per row |
|
|
31
|
+
|
|
32
|
+
## Code
|
|
33
|
+
|
|
34
|
+
```markdown
|
|
35
|
+
<CardGroup cols={2}>
|
|
36
|
+
<Card title="Heading 1" icon="Heading1">
|
|
37
|
+
This is an example of card content with columns.
|
|
38
|
+
</Card>
|
|
39
|
+
<Card title="Heading 2" icon="Heading2">
|
|
40
|
+
This is an example of card content with columns.
|
|
41
|
+
</Card>
|
|
42
|
+
<Card title="Grid Card" icon="Grid" horizontal>
|
|
43
|
+
This is a horizontal card layout.
|
|
44
|
+
</Card>
|
|
45
|
+
<Card title="Horizontal Card" icon="Layout" horizontal>
|
|
46
|
+
This is a horizontal card layout.
|
|
47
|
+
</Card>
|
|
48
|
+
</CardGroup>
|
|
49
|
+
```
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Code Block
|
|
3
|
+
description: A component used to display code snippets with optional line numbering and line highlighting.
|
|
4
|
+
date: 14-12-2024
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
The Code Block component is a component used to display code snippets with optional line numbering and line highlighting.
|
|
8
|
+
|
|
9
|
+
## Preview
|
|
10
|
+
|
|
11
|
+
```javascript:main.js showLineNumbers {3-4}
|
|
12
|
+
function isRocketAboutToCrash() {
|
|
13
|
+
// Check if the rocket is stable
|
|
14
|
+
if (!isStable()) {
|
|
15
|
+
NoCrash(); // Prevent the crash
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
In this example, line numbers are displayed for lines 1 to 4. You can specify which lines to highlight using the format `{2,3-5}`.
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
You can directly use the following syntax to create a code block with line numbers and highlight specific lines:
|
|
25
|
+
|
|
26
|
+
````plaintext
|
|
27
|
+
```javascript:main.js showLineNumbers {3-4}
|
|
28
|
+
function isRocketAboutToCrash() {
|
|
29
|
+
// Check if the rocket is stable
|
|
30
|
+
if (!isStable()) {
|
|
31
|
+
NoCrash(); // Prevent the crash
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
````
|
|
36
|
+
|
|
37
|
+
### Features
|
|
38
|
+
|
|
39
|
+
- **Line Numbers**: Enable line numbers by adding `showLineNumbers` after the opening backticks.
|
|
40
|
+
- **Highlight Lines**: Specify lines to highlight using curly braces (e.g., `{2,3-5}`).
|
|
41
|
+
- **Syntax Highlighting**: Use the appropriate language for syntax highlighting.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Custom Components
|
|
3
|
+
description: How to create custom components for Markdown.
|
|
4
|
+
date: 14-12-2024
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
To add custom components in DocuBook, follow these steps:
|
|
8
|
+
|
|
9
|
+
1. **Create Your Component**: First, create your custom component in the `@components/markdown` folder. For example, you might create a file named `Outlet.tsx`.
|
|
10
|
+
|
|
11
|
+
2. **Import Your Component**: Next, open the `@lib/markdown.ts` file. This is where you'll register your custom component for use in Markdown.
|
|
12
|
+
|
|
13
|
+
3. **Add Your Component to the Components Object**: In the `@lib/markdown.ts` file, import your custom component and add it to the `components` object. Here’s how to do it:
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import Outlet from "@/components/markdown/outlet";
|
|
17
|
+
|
|
18
|
+
// Add custom components
|
|
19
|
+
const components = {
|
|
20
|
+
Outlet,
|
|
21
|
+
};
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
4. **Using Your Custom Component in Markdown**: After registering your component, you can now use it anywhere in your Markdown content. For instance, if your `Outlet` component is designed to display additional information, you can use it as follows:
|
|
25
|
+
|
|
26
|
+
### Markdown Example
|
|
27
|
+
|
|
28
|
+
```markdown
|
|
29
|
+
<Outlet>
|
|
30
|
+
This is some custom content rendered by the Outlet component!
|
|
31
|
+
</Outlet>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Rendered Output
|
|
35
|
+
|
|
36
|
+
This will render the content inside the `Outlet` component, allowing you to create reusable and dynamic Markdown content.
|
|
37
|
+
|
|
38
|
+
By following these steps, you can extend the capabilities of your Markdown documentation and create a more engaging user experience.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Image
|
|
3
|
+
description: A component used to display images in Markdown.
|
|
4
|
+
date: 14-12-2024
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
In DocuBook, all images written in Markdown are automatically converted to their respective Next.js components. This allows for better optimization and performance in your application.
|
|
8
|
+
|
|
9
|
+
## Images
|
|
10
|
+
|
|
11
|
+
Similarly, images in Markdown are transformed into the Next.js `Image` component. This allows for automatic image optimization, such as lazy loading and resizing, which enhances performance and user experience. Here’s an example:
|
|
12
|
+
|
|
13
|
+
### Markdown
|
|
14
|
+
|
|
15
|
+
```markdown
|
|
16
|
+

|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Rendered Output
|
|
20
|
+
|
|
21
|
+
The above Markdown is converted to:
|
|
22
|
+
|
|
23
|
+
```jsx
|
|
24
|
+
<Image
|
|
25
|
+
src="https://via.placeholder.com/150"
|
|
26
|
+
alt="Alt text for the image"
|
|
27
|
+
width={800}
|
|
28
|
+
height={350}
|
|
29
|
+
/>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Benefits
|
|
33
|
+
|
|
34
|
+
- **Performance Optimization**: Automatic conversion to Next.js components ensures optimized loading of images.
|
|
35
|
+
- **Responsive Images**: Next.js `Image` component handles responsive images, providing the best quality for various device sizes.
|
|
36
|
+
|
|
37
|
+
By utilizing these features, you can ensure that your documentation is not only visually appealing but also performs efficiently.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Components
|
|
3
|
+
description: This section provides an overview of the custom components available in DocuBook.
|
|
4
|
+
date: 29-11-2024
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Explore the custom components we've defined for easy integration and development within your projects. Each component is designed to enhance your workflow and streamline your development process.
|
|
8
|
+
|
|
9
|
+
<Outlet path="getting-started/components" />
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Keyboard
|
|
3
|
+
description: Display keyboard keys with platform-specific styling for Windows and macOS.
|
|
4
|
+
date : 19-05-2025
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
The `Keyboard` component automatically renders platform-appropriate key symbols for macOS and Windows. It's perfect for documenting keyboard shortcuts in your application.
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
### Basic Usage
|
|
12
|
+
|
|
13
|
+
Simply use the `Kbd` component with a `show` prop:
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
<Kbd show="cmd" type="mac" /> + <Kbd show="c" />
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Renders as:
|
|
20
|
+
<Kbd show="cmd" type="mac" /> + <Kbd show="c" />
|
|
21
|
+
|
|
22
|
+
### Automatic Symbol Rendering
|
|
23
|
+
|
|
24
|
+
The component automatically renders appropriate symbols based on the platform:
|
|
25
|
+
|
|
26
|
+
```tsx
|
|
27
|
+
{/* Windows style (default) */}
|
|
28
|
+
<Kbd show="ctrl" /> + <Kbd show="v" />
|
|
29
|
+
|
|
30
|
+
{/* Mac style */}
|
|
31
|
+
<Kbd show="cmd" type="mac" /> + <Kbd show="v" type="mac" />
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Renders as:
|
|
35
|
+
- Windows: <Kbd show="ctrl" type="window" /> + <Kbd show="v" type="window" />
|
|
36
|
+
- Mac: <Kbd show="cmd" type="mac" /> + <Kbd show="v" type="mac" />
|
|
37
|
+
|
|
38
|
+
### Custom Content
|
|
39
|
+
|
|
40
|
+
For custom key labels, provide children:
|
|
41
|
+
|
|
42
|
+
```tsx
|
|
43
|
+
<Kbd show="custom">Custom</Kbd>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Renders as: <Kbd show="custom">Custom</Kbd>
|
|
47
|
+
|
|
48
|
+
## Props
|
|
49
|
+
|
|
50
|
+
| Prop | Type | Default | Description |
|
|
51
|
+
|-----------|---------------------|------------|-------------|
|
|
52
|
+
| `show` | `string` | (required) | The key identifier (e.g., 'cmd', 'ctrl', 'a') |
|
|
53
|
+
| `type` | `string` | `window` | for device type `mac` or `window` | Platform style or custom content |
|
|
54
|
+
| `children`| `ReactNode` | - | Custom content to display (overrides automatic rendering) |
|
|
55
|
+
|
|
56
|
+
## Supported Keys
|
|
57
|
+
|
|
58
|
+
The component includes special handling for common keys:
|
|
59
|
+
|
|
60
|
+
| Key Name | Windows | macOS |
|
|
61
|
+
|-------------|---------|-------|
|
|
62
|
+
| command/cmd | `Win` | `⌘` |
|
|
63
|
+
| option/alt | `Alt` | `⌥` |
|
|
64
|
+
| shift | `Shift` | `⇧` |
|
|
65
|
+
| ctrl/control| `Ctrl` | `⌃` |
|
|
66
|
+
| tab | `Tab` | `⇥` |
|
|
67
|
+
| enter/return| `Enter` | `⏎` |
|
|
68
|
+
| delete | `Del` | `⌫` |
|
|
69
|
+
| escape/esc | `Esc` | `⎋` |
|
|
70
|
+
| up/down/left/right | `↑` `↓` `←` `→` | `↑` `↓` `←` `→` |
|
|
71
|
+
| space | `Space` | `␣` |
|
|
72
|
+
|
|
73
|
+
## Examples
|
|
74
|
+
|
|
75
|
+
### Common Shortcuts
|
|
76
|
+
|
|
77
|
+
```tsx
|
|
78
|
+
{/* Copy shortcut */}
|
|
79
|
+
<Kbd show="ctrl" /> + <Kbd show="c" />
|
|
80
|
+
|
|
81
|
+
{/* Paste shortcut */}
|
|
82
|
+
<Kbd show="cmd" type="mac" /> + <Kbd show="v" type="mac" />
|
|
83
|
+
|
|
84
|
+
{/* Save shortcut */}
|
|
85
|
+
<Kbd show="ctrl" /> + <Kbd show="s" />
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Custom Key Combinations
|
|
89
|
+
|
|
90
|
+
```tsx
|
|
91
|
+
{/* Custom application shortcut */}
|
|
92
|
+
<Kbd show="cmd" type="mac" /> + <Kbd show="option" type="mac" /> + <Kbd show="a" type="mac"/>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Render as: <Kbd show="cmd" type="mac" /> + <Kbd show="option" type="mac" /> + <Kbd show="a" type="mac"/>
|
|
96
|
+
|
|
97
|
+
### Arrow Key
|
|
98
|
+
|
|
99
|
+
```tsx
|
|
100
|
+
<Kbd show="up" /> <Kbd show="down" /> <Kbd show="left" /> <Kbd show="right" />
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Render as: <Kbd show="up" /> <Kbd show="down" /> <Kbd show="left" /> <Kbd show="right" />
|
|
104
|
+
|
|
105
|
+
## Best Practices
|
|
106
|
+
|
|
107
|
+
1. **Be Consistent**: Stick to one platform style within the same context
|
|
108
|
+
2. **Use Type Wisely**:
|
|
109
|
+
- Use `type="mac"` for Mac-specific documentation
|
|
110
|
+
- Use `type="window"` (default) for Windows/Linux
|
|
111
|
+
3. **Accessibility**: The component uses semantic `<kbd>` HTML for better accessibility
|
|
112
|
+
|
|
113
|
+
## Notes
|
|
114
|
+
|
|
115
|
+
- The component automatically capitalizes single letters (e.g., 'a' becomes 'A')
|
|
116
|
+
- Unrecognized keys are displayed as-is
|
|
117
|
+
- Dark mode is automatically supported through Tailwind's dark mode classes
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Link
|
|
3
|
+
description: A component used to create links that can be used to navigate to other pages.
|
|
4
|
+
date: 14-12-2024
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
In DocuBook, all links written in Markdown are automatically converted to their respective Next.js components. This allows for better optimization and performance in your application.
|
|
8
|
+
|
|
9
|
+
## Links
|
|
10
|
+
|
|
11
|
+
When you create a link in your Markdown, it is converted to the Next.js `Link` component. This enables client-side navigation and improves loading times. Here’s an example of how a Markdown link is transformed:
|
|
12
|
+
|
|
13
|
+
### Markdown
|
|
14
|
+
|
|
15
|
+
```markdown
|
|
16
|
+
[Visit OpenAI](https://www.openai.com)
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Rendered Output
|
|
20
|
+
|
|
21
|
+
The above Markdown is converted to:
|
|
22
|
+
|
|
23
|
+
```jsx
|
|
24
|
+
<Link href="https://www.openai.com" target="_blank" rel="noopener noreferrer">
|
|
25
|
+
Visit OpenAI
|
|
26
|
+
</Link>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Benefits
|
|
30
|
+
|
|
31
|
+
- **Performance Optimization**: Automatic conversion to Next.js components ensures optimized loading of links.
|
|
32
|
+
- **Improved User Experience**: Client-side navigation with Next.js `Link` improves the browsing experience.
|
|
33
|
+
|
|
34
|
+
By utilizing these features, you can ensure that your documentation is not only visually appealing but also performs efficiently.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Note
|
|
3
|
+
description: A component used to display different types of messages such as general notes, warnings, or success notifications.
|
|
4
|
+
date: 14-12-2024
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
The `Note` component allows you to display different types of messages such as general notes, warnings, or success notifications. Each type is styled accordingly, providing a clear visual cue to the user.
|
|
8
|
+
|
|
9
|
+
## Preview
|
|
10
|
+
|
|
11
|
+
<Note type="note" title="Note">
|
|
12
|
+
This is a general note to convey information to the user.
|
|
13
|
+
</Note>
|
|
14
|
+
<Note type="danger" title="Danger">
|
|
15
|
+
This is a danger alert to notify the user of a critical issue.
|
|
16
|
+
</Note>
|
|
17
|
+
<Note type="warning" title="Warning">
|
|
18
|
+
This is a warning alert for issues that require attention.
|
|
19
|
+
</Note>
|
|
20
|
+
<Note type="success" title="Success">
|
|
21
|
+
This is a success message to inform the user of successful actions.
|
|
22
|
+
</Note>
|
|
23
|
+
|
|
24
|
+
## Props
|
|
25
|
+
|
|
26
|
+
| Prop | Type | Default | Description |
|
|
27
|
+
| ------- | ---------------------------------------------- | ------- | ---------------------------------------- |
|
|
28
|
+
| `title` | `string` | "Note" | Sets the title of the note. |
|
|
29
|
+
| `type` | `"note"`, `"danger"`, `"warning"`, `"success"` | "note" | Determines the visual style of the note. |
|
|
30
|
+
|
|
31
|
+
## Code
|
|
32
|
+
|
|
33
|
+
```jsx
|
|
34
|
+
<Note type="note" title="Note">
|
|
35
|
+
This is a general note to convey information to the user.
|
|
36
|
+
</Note>
|
|
37
|
+
<Note type="danger" title="Danger">
|
|
38
|
+
This is a danger alert to notify the user of a critical issue.
|
|
39
|
+
</Note>
|
|
40
|
+
<Note type="warning" title="Warning">
|
|
41
|
+
This is a warning alert for issues that require attention.
|
|
42
|
+
</Note>
|
|
43
|
+
<Note type="success" title="Success">
|
|
44
|
+
This is a success message to inform the user of successful actions.
|
|
45
|
+
</Note>
|
|
46
|
+
```
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Release Note
|
|
3
|
+
description: The Release Note component makes it easy for you to write updates for each version of your application.
|
|
4
|
+
date: 31-12-2024
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
The Release Note component makes it easy for you to write and display changelogs in a structured and organized way. This component consists of two main parts: `Release` and `Changes` which can be used to display version, date, release title, and a list of changes categorized by type.
|
|
8
|
+
|
|
9
|
+
## Basic Usage
|
|
10
|
+
|
|
11
|
+
Here is a basic example of using the Release Note component:
|
|
12
|
+
|
|
13
|
+
```jsx
|
|
14
|
+
<Release version="1.10.1" date="2025-05-24" title="Accessibility Improvements and Bug Fixes">
|
|
15
|
+
<Changes type="added">
|
|
16
|
+
- New feature to improve accessibility
|
|
17
|
+
- Keyboard navigation support for dialog components
|
|
18
|
+
</Changes>
|
|
19
|
+
<Changes type="fixed">
|
|
20
|
+
- Bug fix for mobile menu
|
|
21
|
+
- Fixed loading issues on documentation pages
|
|
22
|
+
</Changes>
|
|
23
|
+
</Release>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
<Accordion title="Render As" defaultOpen={true}>
|
|
27
|
+
<Release version="1.10.1" date="2025-05-24" title="Accessibility Improvements and Bug Fixes">
|
|
28
|
+
<Changes type="added">
|
|
29
|
+
- New feature to improve accessibility
|
|
30
|
+
- Keyboard navigation support for dialog components
|
|
31
|
+
</Changes>
|
|
32
|
+
<Changes type="fixed">
|
|
33
|
+
- Bug fix for mobile menu
|
|
34
|
+
- Fixed loading issues on documentation pages
|
|
35
|
+
</Changes>
|
|
36
|
+
</Release>
|
|
37
|
+
</Accordion>
|
|
38
|
+
|
|
39
|
+
## Release Component
|
|
40
|
+
|
|
41
|
+
The `Release` component is used to display key information about a release version, such as version number, release date, and title.
|
|
42
|
+
|
|
43
|
+
### Release Props
|
|
44
|
+
|
|
45
|
+
| Prop | Type | Required | Description |
|
|
46
|
+
|------|------|----------|-------------|
|
|
47
|
+
| `version` | string | ✅ | Version number to display (without "v" prefix) |
|
|
48
|
+
| `title` | string | ✅ | Title or name of the release |
|
|
49
|
+
| `date` | string | ❌ | Release date in a valid format (example: "2025-05-24") |
|
|
50
|
+
| `children` | ReactNode | ✅ | Child content, typically `Changes` components |
|
|
51
|
+
|
|
52
|
+
```jsx
|
|
53
|
+
<Release
|
|
54
|
+
version="1.10.1"
|
|
55
|
+
date="2025-05-24"
|
|
56
|
+
title="Accessibility Improvements and Bug Fixes"
|
|
57
|
+
>
|
|
58
|
+
{/* Changes content here */}
|
|
59
|
+
</Release>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Changes Component
|
|
63
|
+
|
|
64
|
+
The `Changes` component is used to group changes by category with appropriate icons and colors.
|
|
65
|
+
|
|
66
|
+
### Changes Props
|
|
67
|
+
|
|
68
|
+
| Prop | Type | Required | Description |
|
|
69
|
+
|------|------|----------|-------------|
|
|
70
|
+
| `type` | string | ✅ | Type of change: 'added', 'fixed', 'improved', 'deprecated', or 'removed' |
|
|
71
|
+
| `children` | ReactNode | ✅ | List of changes, can be text with Markdown formatting |
|
|
72
|
+
|
|
73
|
+
### Changes Note
|
|
74
|
+
|
|
75
|
+
| Category | Description |
|
|
76
|
+
|----------|-------------|
|
|
77
|
+
| `added` | New features or functionality added |
|
|
78
|
+
| `fixed` | Bugs or issues that have been fixed |
|
|
79
|
+
| `improved` | Enhancements or optimizations to existing features |
|
|
80
|
+
| `deprecated` | Features that are not recommended and may be removed in future |
|
|
81
|
+
| `removed` | Features that have been completely removed |
|
|
82
|
+
|
|
83
|
+
### Changes Example
|
|
84
|
+
|
|
85
|
+
```jsx
|
|
86
|
+
<Changes type="added">
|
|
87
|
+
- New feature to improve accessibility
|
|
88
|
+
- Keyboard navigation support for dialog components
|
|
89
|
+
</Changes>
|
|
90
|
+
|
|
91
|
+
<Changes type="fixed">
|
|
92
|
+
- Bug fix for mobile menu
|
|
93
|
+
- Fixed loading issues on documentation pages
|
|
94
|
+
</Changes>
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Complete Implementation
|
|
98
|
+
|
|
99
|
+
Here is a complete example of using the Release Note component in an MDX file:
|
|
100
|
+
|
|
101
|
+
````plaintext
|
|
102
|
+
<!-- hidden heading for TOC -->
|
|
103
|
+
|
|
104
|
+
<Release version="1.10.1" date="2025-05-24" title="Accessibility Improvements and Bug Fixes">
|
|
105
|
+
<Changes type="added">
|
|
106
|
+
- Keyboard navigation for all interactive components
|
|
107
|
+
- Screen reader support for table components
|
|
108
|
+
- Dark mode feature with system preference detection
|
|
109
|
+
</Changes>
|
|
110
|
+
|
|
111
|
+
<Changes type="fixed">
|
|
112
|
+
- Fixed mobile menu bug that wouldn't close when navigating to another page
|
|
113
|
+
- Fixed loading issues on documentation pages
|
|
114
|
+
- Fixed display issues in Safari browser
|
|
115
|
+
</Changes>
|
|
116
|
+
|
|
117
|
+
<Changes type="improved">
|
|
118
|
+
- Improved page loading performance
|
|
119
|
+
- Optimized JavaScript bundle size
|
|
120
|
+
- Enhanced responsive design across all viewports
|
|
121
|
+
</Changes>
|
|
122
|
+
</Release>
|
|
123
|
+
````
|
|
124
|
+
|
|
125
|
+
## Usage Tips
|
|
126
|
+
|
|
127
|
+
1. **Date Format**: Use a consistent date format for all releases.
|
|
128
|
+
2. **Version Ordering**: Arrange versions in reverse chronological order (newest version at the top).
|
|
129
|
+
3. **List Items**: You can use standard Markdown list format (`-` or `*`) or write text directly, the component will handle the formatting.
|
|
130
|
+
4. **TOC**: Use hidden headings to ensure each version is detected in the Table of Contents. Use `<div className="sr-only">### v 1.10.1</div>`
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Stepper
|
|
3
|
+
description: A component used to display step-by-step instructions directly within the markdown render.
|
|
4
|
+
date: 14-12-2024
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
In this guide, we utilize a custom `Stepper` component, specifically designed for DocuBook, which enables users to display step-by-step instructions directly within the markdown render.
|
|
8
|
+
|
|
9
|
+
## Preview
|
|
10
|
+
|
|
11
|
+
##
|
|
12
|
+
|
|
13
|
+
<Stepper>
|
|
14
|
+
<StepperItem title="Step 1: Clone the DocuBook Repository">
|
|
15
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec interdum,
|
|
16
|
+
felis sed efficitur tincidunt, justo nulla viverra enim, et maximus nunc
|
|
17
|
+
dolor in lorem.
|
|
18
|
+
</StepperItem>
|
|
19
|
+
<StepperItem title="Step 2: Access the Project Directory">
|
|
20
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin non neque ut
|
|
21
|
+
eros auctor accumsan. Mauris a nisl vitae magna ultricies aliquam.
|
|
22
|
+
</StepperItem>
|
|
23
|
+
<StepperItem title="Step 3: Install Required Dependencies">
|
|
24
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque ut
|
|
25
|
+
ipsum nec nulla ultricies porttitor et non justo.
|
|
26
|
+
</StepperItem>
|
|
27
|
+
</Stepper>
|
|
28
|
+
|
|
29
|
+
## Code
|
|
30
|
+
|
|
31
|
+
```jsx
|
|
32
|
+
<Stepper>
|
|
33
|
+
<StepperItem title="Step 1: Clone the DocuBook Repository">
|
|
34
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec interdum,
|
|
35
|
+
felis sed efficitur tincidunt, justo nulla viverra enim, et maximus nunc
|
|
36
|
+
dolor in lorem.
|
|
37
|
+
</StepperItem>
|
|
38
|
+
<StepperItem title="Step 2: Access the Project Directory">
|
|
39
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin non neque ut
|
|
40
|
+
eros auctor accumsan. Mauris a nisl vitae magna ultricies aliquam.
|
|
41
|
+
</StepperItem>
|
|
42
|
+
<StepperItem title="Step 3: Install Required Dependencies">
|
|
43
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque ut
|
|
44
|
+
ipsum nec nulla ultricies porttitor et non justo.
|
|
45
|
+
</StepperItem>
|
|
46
|
+
</Stepper>
|
|
47
|
+
```
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Tabs
|
|
3
|
+
description: Organize content into multiple sections with switchable tabs.
|
|
4
|
+
date: 14-12-2024
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
The `Tabs` component allows you to organize content into multiple sections, enabling users to switch between them easily. This is particularly useful for displaying related content in a compact manner.
|
|
8
|
+
|
|
9
|
+
## Preview
|
|
10
|
+
|
|
11
|
+
<Tabs defaultValue="java" className="pt-5 pb-1">
|
|
12
|
+
<TabsList>
|
|
13
|
+
<TabsTrigger value="java">Java</TabsTrigger>
|
|
14
|
+
<TabsTrigger value="typescript">TypeScript</TabsTrigger>
|
|
15
|
+
</TabsList>
|
|
16
|
+
<TabsContent value="java">
|
|
17
|
+
```java
|
|
18
|
+
// HelloWorld.java
|
|
19
|
+
public class HelloWorld {
|
|
20
|
+
public static void main(String[] args) {
|
|
21
|
+
System.out.println("Hello, World!");
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
</TabsContent>
|
|
26
|
+
<TabsContent value="typescript">
|
|
27
|
+
```typescript
|
|
28
|
+
// helloWorld.ts
|
|
29
|
+
function helloWorld(): void {
|
|
30
|
+
console.log("Hello, World!");
|
|
31
|
+
}
|
|
32
|
+
helloWorld();
|
|
33
|
+
```
|
|
34
|
+
</TabsContent>
|
|
35
|
+
</Tabs>
|
|
36
|
+
|
|
37
|
+
## Props
|
|
38
|
+
|
|
39
|
+
| Prop | Type | Default | Description |
|
|
40
|
+
| -------------- | -------- | ------- | ------------------------------------------------------ |
|
|
41
|
+
| `defaultValue` | `string` | `null` | The value of the tab that is selected by default. |
|
|
42
|
+
| `className` | `string` | `""` | Additional CSS classes for styling the Tabs component. |
|
|
43
|
+
|
|
44
|
+
## Code
|
|
45
|
+
|
|
46
|
+
````jsx
|
|
47
|
+
<Tabs defaultValue="java" className="pt-5 pb-1">
|
|
48
|
+
<TabsList>
|
|
49
|
+
<TabsTrigger value="java">Java</TabsTrigger>
|
|
50
|
+
<TabsTrigger value="typescript">TypeScript</TabsTrigger>
|
|
51
|
+
</TabsList>
|
|
52
|
+
<TabsContent value="java">
|
|
53
|
+
```java
|
|
54
|
+
// HelloWorld.java
|
|
55
|
+
public class HelloWorld {
|
|
56
|
+
public static void main(String[] args) {
|
|
57
|
+
System.out.println("Hello, World!");
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
```</TabsContent>
|
|
61
|
+
<TabsContent value="typescript">
|
|
62
|
+
```typescript
|
|
63
|
+
// helloWorld.ts
|
|
64
|
+
function helloWorld(): void {
|
|
65
|
+
console.log("Hello, World!");
|
|
66
|
+
}
|
|
67
|
+
helloWorld();
|
|
68
|
+
```</TabsContent>
|
|
69
|
+
</Tabs>
|
|
70
|
+
````
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Tooltips
|
|
3
|
+
description: A component used to display additional information when hovering over a word or phrase.
|
|
4
|
+
date: 19-02-2025
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
I have implemented the `tooltips` component into markdown which allows you to add additional information to a word or phrase when hovering. This feature is useful for providing definitions, explanations, or any other additional information that can enhance the user experience.
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
You can use tooltips in your Markdown content to provide additional information when hovering over a word or phrase.
|
|
11
|
+
|
|
12
|
+
### Preview
|
|
13
|
+
|
|
14
|
+
What do you know about <Tooltip text="DocuBook" tip="npx @docubook/create@latest" /> ? Create interactive nested documentations using MDX.
|
|
15
|
+
|
|
16
|
+
### Code
|
|
17
|
+
|
|
18
|
+
The above Markdown is converted to:
|
|
19
|
+
|
|
20
|
+
```markdown:index.mdx
|
|
21
|
+
What do you know about <Tooltip text="DocuBook" tip="npx @docubook/create@latest" /> ? Create interactive nested documentations using MDX.
|
|
22
|
+
```
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Youtube
|
|
3
|
+
description: A component used to embed YouTube videos directly into your documentation.
|
|
4
|
+
date: 14-12-2024
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
I have implemented a `YouTube` component for your documentation. This component allows you to easily embed YouTube videos directly into your documentation by simply inputting the video's ID.
|
|
8
|
+
|
|
9
|
+
## Preview
|
|
10
|
+
|
|
11
|
+
<Youtube videoId="cpraXaw7dyc" />
|
|
12
|
+
|
|
13
|
+
## Code
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
<Youtube videoId="cpraXaw7dyc" />
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
for example the youtube URL show this https://www.youtube.com/watch?v=cpraXaw7dyc the ID `cpraXaw7dyc`
|