@docubook/create 2.3.0 → 2.5.0
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/package.json +1 -1
- package/src/dist/app/docs/[[...slug]]/page.tsx +56 -63
- package/src/dist/app/docs/layout.tsx +11 -4
- package/src/dist/app/layout.tsx +10 -9
- package/src/dist/app/page.tsx +3 -22
- package/src/dist/components/{context-popover.tsx → ContextPopover.tsx} +4 -3
- package/src/dist/components/{docs-breadcrumb.tsx → DocsBreadcrumb.tsx} +1 -1
- package/src/dist/components/{docs-menu.tsx → DocsMenu.tsx} +2 -2
- package/src/dist/components/DocsNavbar.tsx +46 -0
- package/src/dist/components/DocsSidebar.tsx +196 -0
- package/src/dist/components/Github.tsx +26 -0
- package/src/dist/components/{scroll-to-top.tsx → ScrollToTop.tsx} +16 -9
- package/src/dist/components/SearchBox.tsx +37 -0
- package/src/dist/components/SearchContext.tsx +47 -0
- package/src/dist/components/SearchModal.tsx +2 -2
- package/src/dist/components/SearchTrigger.tsx +5 -5
- package/src/dist/components/Sponsor.tsx +2 -2
- package/src/dist/components/{theme-toggle.tsx → ThemeToggle.tsx} +10 -10
- package/src/dist/components/TocObserver.tsx +197 -0
- package/src/dist/components/footer.tsx +16 -12
- package/src/dist/components/leftbar.tsx +45 -73
- package/src/dist/components/markdown/AccordionGroupMdx.tsx +1 -1
- package/src/dist/components/markdown/AccordionMdx.tsx +4 -4
- package/src/dist/components/markdown/CardMdx.tsx +4 -4
- package/src/dist/components/markdown/FileTreeMdx.tsx +4 -4
- package/src/dist/components/markdown/ImageMdx.tsx +1 -1
- package/src/dist/components/markdown/ReleaseMdx.tsx +1 -1
- package/src/dist/components/markdown/TooltipsMdx.tsx +1 -1
- package/src/dist/components/navbar.tsx +130 -53
- package/src/dist/components/sublink.tsx +1 -1
- package/src/dist/components/toc.tsx +16 -14
- package/src/dist/components/typography.tsx +1 -1
- package/src/dist/components/ui/icon-cloud.tsx +353 -0
- package/src/dist/components/ui/scroll-area.tsx +2 -2
- package/src/dist/components/ui/sheet.tsx +4 -4
- package/src/dist/components/ui/toggle.tsx +3 -3
- package/src/dist/docs/components/accordion-group.mdx +68 -0
- package/src/dist/docs/components/accordion.mdx +59 -0
- package/src/dist/docs/components/button.mdx +40 -0
- package/src/dist/docs/components/card-group.mdx +47 -0
- package/src/dist/docs/components/card.mdx +68 -0
- package/src/dist/docs/components/code-block.mdx +67 -0
- package/src/dist/docs/components/custom.mdx +38 -0
- package/src/dist/docs/components/file-tree.mdx +109 -0
- package/src/dist/docs/components/image.mdx +37 -0
- package/src/dist/docs/components/index.mdx +9 -0
- package/src/dist/docs/components/keyboard.mdx +117 -0
- package/src/dist/docs/components/link.mdx +34 -0
- package/src/dist/docs/components/note.mdx +44 -0
- package/src/dist/docs/components/release-note.mdx +114 -0
- package/src/dist/docs/components/stepper.mdx +45 -0
- package/src/dist/docs/components/tables.mdx +35 -0
- package/src/dist/docs/components/tabs.mdx +72 -0
- package/src/dist/docs/components/tooltips.mdx +22 -0
- package/src/dist/docs/components/youtube.mdx +23 -0
- package/src/dist/docs/getting-started/introduction.mdx +18 -0
- package/src/dist/docs/getting-started/quick-start-guide.mdx +60 -0
- package/src/dist/docu.json +36 -33
- package/src/dist/eslint.config.mjs +17 -30
- package/src/dist/hooks/useActiveSection.ts +34 -32
- package/src/dist/hooks/useScrollPosition.ts +16 -14
- package/src/dist/lib/markdown.ts +32 -17
- package/src/dist/lib/utils.ts +1 -1
- package/src/dist/next.config.mjs +10 -11
- package/src/dist/package.json +1 -1
- package/src/dist/styles/algolia.css +11 -9
- package/src/dist/styles/{syntax.css → override.css} +82 -39
- package/src/dist/tailwind.config.ts +11 -110
- package/src/dist/components/GithubStart.tsx +0 -44
- package/src/dist/components/mob-toc.tsx +0 -134
- package/src/dist/components/search.tsx +0 -55
- package/src/dist/components/toc-observer.tsx +0 -254
- package/src/dist/docs/api-reference/delete/index.mdx +0 -63
- package/src/dist/docs/api-reference/fetch/index.mdx +0 -63
- package/src/dist/docs/api-reference/get/index.mdx +0 -63
- package/src/dist/docs/api-reference/post/index.mdx +0 -63
- package/src/dist/docs/changelog/index.mdx +0 -49
- package/src/dist/docs/getting-started/development/index.mdx +0 -92
- package/src/dist/docs/getting-started/introduction/index.mdx +0 -92
- package/src/dist/docs/getting-started/quick-start-guide/index.mdx +0 -92
- /package/src/dist/components/{edit-on-github.tsx → EditWithGithub.tsx} +0 -0
- /package/src/dist/components/{contexts/theme-provider.tsx → ThemeProvider.tsx} +0 -0
- /package/src/dist/{components/contexts/AccordionContext.ts → lib/accordion-context.ts} +0 -0
- /package/src/dist/lib/{routes-config.ts → routes.ts} +0 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Cards
|
|
3
|
+
description: A component used to create cards that can be used to display content in a compact and organized way.
|
|
4
|
+
date: 20-02-2025
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Example
|
|
8
|
+
|
|
9
|
+
### Card with Link and icon
|
|
10
|
+
|
|
11
|
+
<Card title="Click on me" icon="Link" href="/docs/components/card-group">
|
|
12
|
+
This is how you use a card with an icon and a link. Clicking on this card
|
|
13
|
+
brings you to the Card Group page.
|
|
14
|
+
</Card>
|
|
15
|
+
|
|
16
|
+
### Card Horizontal
|
|
17
|
+
|
|
18
|
+
<Card title="Horizontal Card" icon="Layout" horizontal>
|
|
19
|
+
This is a horizontal card layout.
|
|
20
|
+
</Card>
|
|
21
|
+
|
|
22
|
+
### Card Simple
|
|
23
|
+
|
|
24
|
+
<Card title="Simple Card">
|
|
25
|
+
This is a simple card without an icon or link.
|
|
26
|
+
</Card>
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
## Props
|
|
30
|
+
|
|
31
|
+
| Prop | Type | Default | Description |
|
|
32
|
+
| ------------- | -------- | ------- | ------------------------------------------------------- |
|
|
33
|
+
| `title` | string | null | The value of card title. |
|
|
34
|
+
| `icon` | string | null | The value of card icon render from lucide. |
|
|
35
|
+
| `href` | string | null | The value of card link url. |
|
|
36
|
+
| `horizontal` | boolean | undefined | horizontal layout for card. |
|
|
37
|
+
|
|
38
|
+
## Output Markdown
|
|
39
|
+
|
|
40
|
+
<Tabs defaultValue="link" className="pt-5 pb-1">
|
|
41
|
+
<TabsList>
|
|
42
|
+
<TabsTrigger value="link">Link & Icon</TabsTrigger>
|
|
43
|
+
<TabsTrigger value="horizontal">Horizontal</TabsTrigger>
|
|
44
|
+
<TabsTrigger value="simple">Simple</TabsTrigger>
|
|
45
|
+
</TabsList>
|
|
46
|
+
<TabsContent value="link">
|
|
47
|
+
```markdown
|
|
48
|
+
<Card title="Click on me" icon="Link" href="/docs/getting-started/components/button">
|
|
49
|
+
This is how you use a card with an icon and a link. Clicking on this card
|
|
50
|
+
brings you to the Card Group page.
|
|
51
|
+
</Card>
|
|
52
|
+
```
|
|
53
|
+
</TabsContent>
|
|
54
|
+
<TabsContent value="horizontal">
|
|
55
|
+
```markdown
|
|
56
|
+
<Card title="Horizontal Card" icon="Layout" horizontal>
|
|
57
|
+
This is a horizontal card layout.
|
|
58
|
+
</Card>
|
|
59
|
+
```
|
|
60
|
+
</TabsContent>
|
|
61
|
+
<TabsContent value="simple">
|
|
62
|
+
```markdown
|
|
63
|
+
<Card title="Simple Card">
|
|
64
|
+
This is a simple card without an icon or link.
|
|
65
|
+
</Card>
|
|
66
|
+
```
|
|
67
|
+
</TabsContent>
|
|
68
|
+
</Tabs>
|
|
@@ -0,0 +1,67 @@
|
|
|
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
|
+
## Preview
|
|
8
|
+
|
|
9
|
+
```javascript:main.js showLineNumbers {3-4}
|
|
10
|
+
function isRocketAboutToCrash() {
|
|
11
|
+
// Check if the rocket is stable
|
|
12
|
+
if (!isStable()) {
|
|
13
|
+
NoCrash(); // Prevent the crash
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
In this example, line numbers are displayed for lines 3 and 4. You can specify which lines to highlight using the format `{2,3-5}`.
|
|
19
|
+
|
|
20
|
+
## Output Markdown
|
|
21
|
+
|
|
22
|
+
You can directly use the following syntax to create a code block with line numbers and highlight specific lines:
|
|
23
|
+
|
|
24
|
+
````plaintext
|
|
25
|
+
```javascript:main.js showLineNumbers {3-4}
|
|
26
|
+
function isRocketAboutToCrash() {
|
|
27
|
+
// Check if the rocket is stable
|
|
28
|
+
if (!isStable()) {
|
|
29
|
+
NoCrash(); // Prevent the crash
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
````
|
|
34
|
+
|
|
35
|
+
## Features
|
|
36
|
+
|
|
37
|
+
- **Language Title**: You can use a title for each programming language to render an icon and display a title bar. For example : `javascript:index.js`
|
|
38
|
+
- **Line Numbers**: Enable line numbers by adding `showLineNumbers` after the opening backticks.
|
|
39
|
+
- **Highlight Lines**: Specify lines to highlight using curly braces (e.g., `{2,3-5}`).
|
|
40
|
+
- **Syntax Highlighting**: Use the appropriate language for syntax highlighting.
|
|
41
|
+
|
|
42
|
+
## Language Support
|
|
43
|
+
|
|
44
|
+
| **Language** | **Title** |
|
|
45
|
+
| -------------------- | ------------------------ |
|
|
46
|
+
| **javascript** | `javascript:index.js` |
|
|
47
|
+
| **typescript** | `typescript:index.ts` |
|
|
48
|
+
| **jsx** or **tsx** | `jsx:index.jsx` |
|
|
49
|
+
| **python** | `python:main.py` |
|
|
50
|
+
| **go** | `go:main.go` |
|
|
51
|
+
| **php** | `php:index.php` |
|
|
52
|
+
| **ruby** | `ruby:main.rb` |
|
|
53
|
+
| **swift** | `swift:main.swift` |
|
|
54
|
+
| **kotlin** | `kotlin:main.kt` |
|
|
55
|
+
| **html** | `html:index.html` |
|
|
56
|
+
| **css** | `css:styles.css` |
|
|
57
|
+
| **sass** or **scss** | `sass:styles.sass` |
|
|
58
|
+
| **sql** | `sql:database.sql` |
|
|
59
|
+
| **graphql** | `graphql:database.gql` |
|
|
60
|
+
| **json** | `json:config.json` |
|
|
61
|
+
| **yaml** | `yaml:config.yml` |
|
|
62
|
+
| **toml** | `toml:config.toml` |
|
|
63
|
+
| **docker** | `docker:main.Dockerfile` |
|
|
64
|
+
| **nginx** | `nginx:config.nginx` |
|
|
65
|
+
| **gitignore** | `gitignore:.git` |
|
|
66
|
+
| **bash** | `bash:install.sh` |
|
|
67
|
+
| **markdown** | `markdown:readme.md` |
|
|
@@ -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,109 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: File Tree Component
|
|
3
|
+
description: A customizable file tree component for displaying hierarchical file structures in your documentation.
|
|
4
|
+
date: 28-05-2025
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
The File Tree component allows you to display hierarchical file structures in your documentation with collapsible folders and files.
|
|
8
|
+
|
|
9
|
+
## Basic Usage
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
<Files>
|
|
13
|
+
<Folder name="src">
|
|
14
|
+
<File name="App.tsx" />
|
|
15
|
+
<File name="index.tsx" />
|
|
16
|
+
<Folder name="components">
|
|
17
|
+
<File name="Button.tsx" />
|
|
18
|
+
<File name="Card.tsx" />
|
|
19
|
+
</Folder>
|
|
20
|
+
<Folder name="pages">
|
|
21
|
+
<File name="Home.tsx" />
|
|
22
|
+
<File name="About.tsx" />
|
|
23
|
+
</Folder>
|
|
24
|
+
</Folder>
|
|
25
|
+
</Files>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Render As:
|
|
29
|
+
<Files>
|
|
30
|
+
<Folder name="src">
|
|
31
|
+
<File name="App.tsx" />
|
|
32
|
+
<File name="index.tsx" />
|
|
33
|
+
<Folder name="components">
|
|
34
|
+
<File name="Button.tsx" />
|
|
35
|
+
<File name="Card.tsx" />
|
|
36
|
+
</Folder>
|
|
37
|
+
<Folder name="pages">
|
|
38
|
+
<File name="Home.tsx" />
|
|
39
|
+
<File name="About.tsx" />
|
|
40
|
+
</Folder>
|
|
41
|
+
</Folder>
|
|
42
|
+
</Files>
|
|
43
|
+
|
|
44
|
+
## Props
|
|
45
|
+
|
|
46
|
+
### Files
|
|
47
|
+
|
|
48
|
+
The root component that wraps the entire file tree.
|
|
49
|
+
|
|
50
|
+
### Folder
|
|
51
|
+
|
|
52
|
+
| Prop | Type | Required | Description |
|
|
53
|
+
|----------|----------|----------|---------------------------------------|
|
|
54
|
+
| `name` | string | Yes | The name of the folder |
|
|
55
|
+
| `children` | ReactNode | No | Child elements (File or Folder) |
|
|
56
|
+
|
|
57
|
+
### File
|
|
58
|
+
|
|
59
|
+
| Prop | Type | Required | Description |
|
|
60
|
+
|------|--------|----------|----------------------------|
|
|
61
|
+
| `name` | string | Yes | The name of the file |
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
## Examples
|
|
65
|
+
|
|
66
|
+
### Nested Folder Structure
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
<Files>
|
|
70
|
+
<Folder name="project-root">
|
|
71
|
+
<File name="package.json" />
|
|
72
|
+
<File name="tsconfig.json" />
|
|
73
|
+
<Folder name="src">
|
|
74
|
+
<File name="index.ts" />
|
|
75
|
+
<Folder name="components">
|
|
76
|
+
<File name="Button.tsx" />
|
|
77
|
+
<File name="Card.tsx" />
|
|
78
|
+
</Folder>
|
|
79
|
+
</Folder>
|
|
80
|
+
</Folder>
|
|
81
|
+
</Files>
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Minimal Example
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
<Files>
|
|
88
|
+
<Folder name="components">
|
|
89
|
+
<File name="Button.tsx" />
|
|
90
|
+
<File name="Input.tsx" />
|
|
91
|
+
</Folder>
|
|
92
|
+
</Files>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Best Practices
|
|
96
|
+
|
|
97
|
+
1. Keep the nesting level reasonable (recommended max 3-4 levels deep)
|
|
98
|
+
2. Use clear and descriptive names for files and folders
|
|
99
|
+
3. Consider the user experience when displaying large file structures
|
|
100
|
+
4. Use consistent naming conventions throughout your file tree
|
|
101
|
+
|
|
102
|
+
## Accessibility
|
|
103
|
+
|
|
104
|
+
The File Tree component includes built-in accessibility features:
|
|
105
|
+
|
|
106
|
+
- Keyboard navigation support
|
|
107
|
+
- ARIA attributes for screen readers
|
|
108
|
+
- Focus management for interactive elements
|
|
109
|
+
- High contrast mode support
|
|
@@ -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="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,44 @@
|
|
|
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
|
+
## Preview
|
|
8
|
+
|
|
9
|
+
<Note type="note" title="Note">
|
|
10
|
+
This is a general note to convey information to the user.
|
|
11
|
+
</Note>
|
|
12
|
+
<Note type="danger" title="Danger">
|
|
13
|
+
This is a danger alert to notify the user of a critical issue.
|
|
14
|
+
</Note>
|
|
15
|
+
<Note type="warning" title="Warning">
|
|
16
|
+
This is a warning alert for issues that require attention.
|
|
17
|
+
</Note>
|
|
18
|
+
<Note type="success" title="Success">
|
|
19
|
+
This is a success message to inform the user of successful actions.
|
|
20
|
+
</Note>
|
|
21
|
+
|
|
22
|
+
## Props
|
|
23
|
+
|
|
24
|
+
| Prop | Type | Default | Description |
|
|
25
|
+
| ------- | ---------------------------------------------- | ------- | ---------------------------------------- |
|
|
26
|
+
| `title` | string | "Note" | Sets the title of the note. |
|
|
27
|
+
| `type` | "note" "danger" "success" "warning" | undefined | Determines the visual style of the note. |
|
|
28
|
+
|
|
29
|
+
## Output Markdown
|
|
30
|
+
|
|
31
|
+
```markdown
|
|
32
|
+
<Note type="note" title="Note">
|
|
33
|
+
This is a general note to convey information to the user.
|
|
34
|
+
</Note>
|
|
35
|
+
<Note type="danger" title="Danger">
|
|
36
|
+
This is a danger alert to notify the user of a critical issue.
|
|
37
|
+
</Note>
|
|
38
|
+
<Note type="warning" title="Warning">
|
|
39
|
+
This is a warning alert for issues that require attention.
|
|
40
|
+
</Note>
|
|
41
|
+
<Note type="success" title="Success">
|
|
42
|
+
This is a success message to inform the user of successful actions.
|
|
43
|
+
</Note>
|
|
44
|
+
```
|
|
@@ -0,0 +1,114 @@
|
|
|
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
|
+
```markdown:.mdx
|
|
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
|
+
## Release Component
|
|
27
|
+
|
|
28
|
+
The `Release` component is used to display key information about a release version, such as version number, release date, and title.
|
|
29
|
+
|
|
30
|
+
### Release Props
|
|
31
|
+
|
|
32
|
+
| Prop | Type | Required | Description |
|
|
33
|
+
|------|------|----------|-------------|
|
|
34
|
+
| `version` | string | ✅ | Version number to display (without "v" prefix) |
|
|
35
|
+
| `title` | string | ✅ | Title or name of the release |
|
|
36
|
+
| `date` | string | ❌ | Release date in a valid format (example: "2025-05-24") |
|
|
37
|
+
| `children` | ReactNode | ✅ | Child content, typically `Changes` components |
|
|
38
|
+
|
|
39
|
+
```markdown:.mdx
|
|
40
|
+
<Release
|
|
41
|
+
version="1.10.1"
|
|
42
|
+
date="2025-05-24"
|
|
43
|
+
title="Accessibility Improvements and Bug Fixes"
|
|
44
|
+
>
|
|
45
|
+
{/* Changes content here */}
|
|
46
|
+
</Release>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Changes Component
|
|
50
|
+
|
|
51
|
+
The `Changes` component is used to group changes by category with appropriate icons and colors.
|
|
52
|
+
|
|
53
|
+
### Changes Props
|
|
54
|
+
|
|
55
|
+
| Prop | Type | Required | Description |
|
|
56
|
+
|------|------|----------|-------------|
|
|
57
|
+
| `type` | string | ✅ | Type of change: 'added', 'fixed', 'improved', 'deprecated', or 'removed' |
|
|
58
|
+
| `children` | ReactNode | ✅ | List of changes, can be text with Markdown formatting |
|
|
59
|
+
|
|
60
|
+
### Changes Note
|
|
61
|
+
|
|
62
|
+
| Category | Description |
|
|
63
|
+
|----------|-------------|
|
|
64
|
+
| `added` | New features or functionality added |
|
|
65
|
+
| `fixed` | Bugs or issues that have been fixed |
|
|
66
|
+
| `improved` | Enhancements or optimizations to existing features |
|
|
67
|
+
| `deprecated` | Features that are not recommended and may be removed in future |
|
|
68
|
+
| `removed` | Features that have been completely removed |
|
|
69
|
+
|
|
70
|
+
### Changes Example
|
|
71
|
+
|
|
72
|
+
```markdown:.mdx
|
|
73
|
+
<Changes type="added">
|
|
74
|
+
- New feature to improve accessibility
|
|
75
|
+
- Keyboard navigation support for dialog components
|
|
76
|
+
</Changes>
|
|
77
|
+
|
|
78
|
+
<Changes type="fixed">
|
|
79
|
+
- Bug fix for mobile menu
|
|
80
|
+
- Fixed loading issues on documentation pages
|
|
81
|
+
</Changes>
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Complete Implementation
|
|
85
|
+
|
|
86
|
+
Here is a complete example of using the Release Note component in an MDX file:
|
|
87
|
+
|
|
88
|
+
```markdown:.mdx
|
|
89
|
+
<Release version="1.10.1" date="2025-05-24" title="Accessibility Improvements and Bug Fixes">
|
|
90
|
+
<Changes type="added">
|
|
91
|
+
- Keyboard navigation for all interactive components
|
|
92
|
+
- Screen reader support for table components
|
|
93
|
+
- Dark mode feature with system preference detection
|
|
94
|
+
</Changes>
|
|
95
|
+
|
|
96
|
+
<Changes type="fixed">
|
|
97
|
+
- Fixed mobile menu bug that wouldn't close when navigating to another page
|
|
98
|
+
- Fixed loading issues on documentation pages
|
|
99
|
+
- Fixed display issues in Safari browser
|
|
100
|
+
</Changes>
|
|
101
|
+
|
|
102
|
+
<Changes type="improved">
|
|
103
|
+
- Improved page loading performance
|
|
104
|
+
- Optimized JavaScript bundle size
|
|
105
|
+
- Enhanced responsive design across all viewports
|
|
106
|
+
</Changes>
|
|
107
|
+
</Release>
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Usage Tips
|
|
111
|
+
|
|
112
|
+
1. **Date Format**: Use a consistent date format for all releases.
|
|
113
|
+
2. **Version Ordering**: Arrange versions in reverse chronological order (newest version at the top).
|
|
114
|
+
3. **List Items**: You can use standard Markdown list format (`-` or `*`) or write text directly, the component will handle the formatting.
|
|
@@ -0,0 +1,45 @@
|
|
|
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
|
+
<Stepper>
|
|
12
|
+
<StepperItem title="Step 1: Clone the DocuBook Repository">
|
|
13
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec interdum,
|
|
14
|
+
felis sed efficitur tincidunt, justo nulla viverra enim, et maximus nunc
|
|
15
|
+
dolor in lorem.
|
|
16
|
+
</StepperItem>
|
|
17
|
+
<StepperItem title="Step 2: Access the Project Directory">
|
|
18
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin non neque ut
|
|
19
|
+
eros auctor accumsan. Mauris a nisl vitae magna ultricies aliquam.
|
|
20
|
+
</StepperItem>
|
|
21
|
+
<StepperItem title="Step 3: Install Required Dependencies">
|
|
22
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque ut
|
|
23
|
+
ipsum nec nulla ultricies porttitor et non justo.
|
|
24
|
+
</StepperItem>
|
|
25
|
+
</Stepper>
|
|
26
|
+
|
|
27
|
+
## Output Markdown
|
|
28
|
+
|
|
29
|
+
```markdown
|
|
30
|
+
<Stepper>
|
|
31
|
+
<StepperItem title="Step 1: Clone the DocuBook Repository">
|
|
32
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec interdum,
|
|
33
|
+
felis sed efficitur tincidunt, justo nulla viverra enim, et maximus nunc
|
|
34
|
+
dolor in lorem.
|
|
35
|
+
</StepperItem>
|
|
36
|
+
<StepperItem title="Step 2: Access the Project Directory">
|
|
37
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin non neque ut
|
|
38
|
+
eros auctor accumsan. Mauris a nisl vitae magna ultricies aliquam.
|
|
39
|
+
</StepperItem>
|
|
40
|
+
<StepperItem title="Step 3: Install Required Dependencies">
|
|
41
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque ut
|
|
42
|
+
ipsum nec nulla ultricies porttitor et non justo.
|
|
43
|
+
</StepperItem>
|
|
44
|
+
</Stepper>
|
|
45
|
+
```
|