@docubook/create 1.15.0 → 1.15.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.
Files changed (44) hide show
  1. package/package.json +1 -1
  2. package/src/dist/app/layout.tsx +0 -1
  3. package/src/dist/app/page.tsx +1 -1
  4. package/src/dist/components/DocSearch.tsx +0 -1
  5. package/src/dist/contents/docs/api-reference/delete/index.mdx +63 -0
  6. package/src/dist/contents/docs/api-reference/fetch/index.mdx +63 -0
  7. package/src/dist/contents/docs/api-reference/get/index.mdx +63 -0
  8. package/src/dist/contents/docs/api-reference/post/index.mdx +63 -0
  9. package/src/dist/contents/docs/changelog/version-1/index.mdx +22 -654
  10. package/src/dist/contents/docs/changelog/version-2/index.mdx +49 -0
  11. package/src/dist/contents/docs/changelog/version-3/index.mdx +49 -0
  12. package/src/dist/contents/docs/getting-started/development/index.mdx +63 -0
  13. package/src/dist/contents/docs/getting-started/introduction/index.mdx +49 -36
  14. package/src/dist/contents/docs/getting-started/quick-start-guide/index.mdx +44 -126
  15. package/src/dist/docu.json +90 -104
  16. package/src/dist/package.json +1 -1
  17. package/src/dist/styles/algolia.css +97 -91
  18. package/src/dist/styles/globals.css +5 -3
  19. package/src/dist/contents/docs/components/accordion/index.mdx +0 -86
  20. package/src/dist/contents/docs/components/button/index.mdx +0 -40
  21. package/src/dist/contents/docs/components/card/index.mdx +0 -68
  22. package/src/dist/contents/docs/components/card-group/index.mdx +0 -47
  23. package/src/dist/contents/docs/components/code-block/index.mdx +0 -39
  24. package/src/dist/contents/docs/components/custom/index.mdx +0 -38
  25. package/src/dist/contents/docs/components/file-tree/index.mdx +0 -109
  26. package/src/dist/contents/docs/components/image/index.mdx +0 -37
  27. package/src/dist/contents/docs/components/index.mdx +0 -9
  28. package/src/dist/contents/docs/components/keyboard/index.mdx +0 -117
  29. package/src/dist/contents/docs/components/link/index.mdx +0 -34
  30. package/src/dist/contents/docs/components/note/index.mdx +0 -44
  31. package/src/dist/contents/docs/components/release-note/index.mdx +0 -130
  32. package/src/dist/contents/docs/components/stepper/index.mdx +0 -45
  33. package/src/dist/contents/docs/components/tabs/index.mdx +0 -70
  34. package/src/dist/contents/docs/components/tooltips/index.mdx +0 -22
  35. package/src/dist/contents/docs/components/youtube/index.mdx +0 -23
  36. package/src/dist/contents/docs/getting-started/customize/index.mdx +0 -92
  37. package/src/dist/contents/docs/getting-started/index.mdx +0 -9
  38. package/src/dist/contents/docs/getting-started/installation/index.mdx +0 -84
  39. package/src/dist/contents/docs/getting-started/project-structure/index.mdx +0 -87
  40. package/src/dist/contents/docs/getting-started/theme-colors/coffee/index.mdx +0 -165
  41. package/src/dist/contents/docs/getting-started/theme-colors/default/index.mdx +0 -160
  42. package/src/dist/contents/docs/getting-started/theme-colors/freshlime/index.mdx +0 -161
  43. package/src/dist/contents/docs/getting-started/theme-colors/index.mdx +0 -9
  44. package/src/dist/contents/docs/getting-started/theme-colors/llms/index.mdx +0 -77
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docubook",
3
- "version": "1.15.0",
3
+ "version": "1.15.2",
4
4
  "private": true,
5
5
  "scripts": {
6
6
  "dev": "next dev",
@@ -1,44 +1,67 @@
1
1
  /*
2
2
  ================================================================================
3
- DocSearch Component Styling (Themed Version)
4
- - This version uses the CSS variables defined in :root and .dark
5
- to automatically adapt to your site's light and dark themes.
3
+ DocSearch Component Styling (Refactored Version)
6
4
  ================================================================================
7
5
  */
8
- .docsearch {
9
- /* Map theme variables to DocSearch's internal variables */
6
+
7
+ /* -- LANGKAH 1: Definisi Variabel Global --
8
+ Variabel tema DocSearch sekarang didefinisikan secara global di :root.
9
+ Ini menyederhanakan pewarisan tema dan memastikan konsistensi.
10
+ Mode gelap secara otomatis menimpa variabel ini karena .dark di globals.css.
11
+ */
12
+ :root {
10
13
  --docsearch-primary-color: hsl(var(--primary));
11
- --docsearch-text-color: hsl(var(--foreground));
12
- --docsearch-container-background: hsla(var(--background) / 0.8); /* Use theme background with transparency */
13
- --docsearch-modal-background: hsl(var(--card)); /* Modals should use card color */
14
- --docsearch-modal-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
15
- --docsearch-searchbox-background: hsl(var(--secondary));
16
- --docsearch-searchbox-focus-background: hsl(var(--secondary));
14
+ --docsearch-text-color: hsl(var(--muted-foreground));
15
+ --docsearch-spacing: 12px;
16
+ --docsearch-icon-stroke-width: 1.4;
17
+ --docsearch-highlight-color: var(--docsearch-primary-color);
18
+ --docsearch-muted-color: hsl(var(--muted-foreground));
19
+ --docsearch-container-background: rgba(0, 0, 0, 0.7);
20
+ --docsearch-logo-color: hsl(var(--primary-foreground));
21
+
22
+ /* Modal */
23
+ --docsearch-modal-width: 560px;
24
+ --docsearch-modal-height: 600px;
25
+ --docsearch-modal-background: hsl(var(--background));
26
+ --docsearch-modal-shadow: 0 0 0 1px hsl(var(--border)), 0 8px 20px rgba(0, 0, 0, 0.2);
27
+
28
+ /* SearchBox */
29
+ --docsearch-searchbox-height: 56px;
30
+ --docsearch-searchbox-background: hsl(var(--input));
31
+ --docsearch-searchbox-focus-background: hsl(var(--card));
32
+ --docsearch-searchbox-shadow: none;
33
+
34
+ /* Hit (Hasil Pencarian) */
35
+ --docsearch-hit-height: 56px;
17
36
  --docsearch-hit-color: hsl(var(--foreground));
37
+ --docsearch-hit-active-color: hsl(var(--primary-foreground));
18
38
  --docsearch-hit-background: hsl(var(--card));
19
39
  --docsearch-hit-shadow: none;
20
- --docsearch-hit-active-color: hsl(var(--primary-foreground));
21
- --docsearch-selected-background: hsl(var(--secondary)); /* Use secondary for selection */
22
- --docsearch-footer-background: hsl(var(--card));
23
- --docsearch-footer-shadow: inset 0 1px 0 0 hsl(var(--border));
24
- --docsearch-key-gradient: transparent;
40
+
41
+ /* Keys */
42
+ --docsearch-key-gradient: none;
25
43
  --docsearch-key-shadow: none;
26
- --docsearch-muted-color: hsl(var(--muted-foreground)); /* Use muted for less important text */
44
+ --docsearch-key-pressed-shadow: none;
45
+
46
+ /* Footer */
47
+ --docsearch-footer-height: 44px;
48
+ --docsearch-footer-background: hsl(var(--background));
49
+ --docsearch-footer-shadow: none;
27
50
  }
28
51
 
29
- /*
30
- * =====================================
31
- * 1. Initial Search Button Styling
32
- * =====================================
33
- */
52
+ /* -- LANGKAH 2: Gaya untuk Tombol Awal --
53
+ Gaya ini spesifik untuk tombol yang ada di Navbar,
54
+ yang dibungkus oleh <div class="docsearch">.
55
+ */
34
56
  .docsearch .DocSearch-Button {
35
- background-color: hsl(var(--secondary)); /* Use secondary for the button background */
36
- border: 1px solid hsl(var(--border)); /* Use the standard border color */
37
- border-radius: 9999px; /* Pill shape */
38
- width: 160px; /* Lebar default untuk desktop */
57
+ background-color: hsl(var(--secondary));
58
+ border: 1px solid hsl(var(--border));
59
+ border-radius: 9999px;
60
+ width: 160px;
39
61
  height: 40px;
40
- color: hsl(var(--muted-foreground)); /* Use muted text color for the placeholder */
41
- transition: width 0.3s ease; /* Transisi untuk perubahan lebar */
62
+ color: hsl(var(--muted-foreground));
63
+ transition: width 0.3s ease;
64
+ margin: 0;
42
65
  }
43
66
 
44
67
  .docsearch .DocSearch-Button:hover {
@@ -46,21 +69,24 @@
46
69
  box-shadow: none;
47
70
  }
48
71
 
49
- /* Magnifying glass icon */
50
72
  .docsearch .DocSearch-Search-Icon {
51
- color: hsl(var(--muted-foreground));
73
+ color: var(--docsearch-muted-color);
74
+ width: 1rem;
75
+ height: 1rem;
52
76
  }
53
77
 
54
- /* The 'Search' placeholder text */
55
78
  .docsearch .DocSearch-Button-Placeholder {
56
79
  font-style: normal;
80
+ margin-left: 0.25rem;
81
+ font-size: 0.875rem;
82
+ line-height: 1.25rem;
83
+ color: var(--docsearch-muted-color);
57
84
  }
58
85
 
59
- /* Styling for the '⌘K' keys */
60
86
  .docsearch .DocSearch-Button-Key {
61
- background: hsl(var(--primary)); /* Use primary color for the key background */
87
+ background: var(--docsearch-primary-color);
88
+ color: var(--docsearch-logo-color); /* Menggunakan variabel yg relevan */
62
89
  border-radius: 6px;
63
- color: hsl(var(--primary-foreground)); /* Use primary-foreground for the key text */
64
90
  font-size: 14px;
65
91
  font-weight: 500;
66
92
  height: 24px;
@@ -70,85 +96,65 @@
70
96
  top: 0;
71
97
  }
72
98
 
73
-
74
- /*
75
- * =====================================
76
- * 2. Modal and Results Styling
77
- * =====================================
78
- */
79
-
80
- /* Main modal window */
81
- .docsearch .DocSearch-Modal {
99
+ /* -- LANGKAH 3: Gaya untuk Modal dan Isinya --
100
+ Gaya ini menargetkan elemen-elemen modal yang dirender terpisah.
101
+ Karena variabel sudah global, kita hanya perlu menata elemennya.
102
+ */
103
+ .DocSearch-Container .DocSearch-Modal {
82
104
  backdrop-filter: blur(8px);
83
105
  }
84
106
 
85
- .docsearch .DocSearch-Container {
86
- box-shadow: var(--docsearch-modal-shadow);
87
- }
88
-
89
- /* Search input form */
90
- .docsearch .DocSearch-Form {
107
+ .DocSearch-Form {
91
108
  border: 1px solid hsl(var(--border));
92
- box-shadow: none;
93
109
  background-color: transparent;
94
110
  }
95
111
 
96
- /* The 'Return' and 'Esc' hints */
97
- .docsearch .DocSearch-Reset-Icon,
98
- .docsearch .DocSearch-Cancel {
99
- color: hsl(var(--muted-foreground));
100
- }
101
-
102
- /* Style for each search result item */
103
- .docsearch .DocSearch-Hit a {
104
- border-radius: 4px;
112
+ .DocSearch-Input {
113
+ font-size: 15px !important;
105
114
  }
106
115
 
107
- /* Selected search result */
108
- .docsearch .DocSearch-Hit[aria-selected="true"] a {
109
- background: var(--docsearch-selected-background); /* Highlight color for selected item */
116
+ .DocSearch-Footer {
117
+ border-top: 1px solid hsl(var(--border));
110
118
  }
111
119
 
112
- /* Hide category headers if not needed */
113
- .docsearch .DocSearch-Hit-source {
114
- display: none;
120
+ /* Gaya untuk tombol keyboard di footer */
121
+ .DocSearch-Footer--commands kbd {
122
+ background-color: hsl(var(--secondary));
123
+ border: 1px solid hsl(var(--border));
124
+ border-bottom-width: 2px;
125
+ border-radius: 6px;
126
+ color: var(--docsearch-muted-color);
127
+ padding: 4px 8px;
128
+ display: flex;
129
+ align-items: center;
130
+ justify-content: center;
115
131
  }
116
132
 
117
- /* Icon next to each result title */
118
- .docsearch .DocSearch-Hit-icon {
133
+ /* Menghilangkan gaya default dari ikon di dalam tombol footer */
134
+ .DocSearch-Commands-Key {
135
+ background: none;
119
136
  color: hsl(var(--muted-foreground));
120
- }
121
-
122
- /* Footer instructions ('to navigate', 'to select', etc.) */
123
- .docsearch .DocSearch-Footer {
124
- border-top: 1px solid hsl(var(--border));
125
- }
126
-
127
- .docsearch .DocSearch-Footer--commands kbd {
128
- background: hsl(var(--muted)); /* Use muted for the background of keyboard hints */
129
137
  border: 1px solid hsl(var(--border));
130
- border-radius: 4px;
131
- color: hsl(var(--muted-foreground));
138
+ box-shadow: none;
139
+ padding: 2px 4px;
140
+ margin-right: 0.4em;
141
+ height: 20px;
142
+ width: 32px;
143
+ border-radius: 6px;
132
144
  }
133
145
 
134
- /*
135
- * =====================================
136
- * 3. Responsive Styling (Mobile)
137
- * =====================================
138
- */
146
+ /* -- LANGKAH 4: Gaya Responsif --
147
+ Tidak ada perubahan, hanya mempertahankan fungsionalitas mobile.
148
+ */
139
149
  @media (max-width: 768px) {
140
- /* Aturan ini akan aktif pada layar 768px ke bawah */
141
-
142
150
  .docsearch .DocSearch-Button {
143
- width: 40px; /* Mengubah lebar tombol menjadi seukuran ikon */
144
- height: 40px; /* Memastikan tinggi tetap sama */
145
- padding: 0; /* Menghapus padding agar ikon bisa di tengah */
146
- justify-content: center; /* Memusatkan ikon di dalam tombol */
151
+ width: 40px;
152
+ height: 40px;
153
+ padding: 0;
154
+ justify-content: center;
147
155
  background: none;
148
156
  border: none;
149
157
  }
150
-
151
- /* Menyembunyikan teks "Search..." dan shortcut keyboard */
152
158
  .docsearch .DocSearch-Button-Placeholder,
153
159
  .docsearch .DocSearch-Button-Key {
154
160
  display: none;
@@ -1,9 +1,11 @@
1
+ @import "@docsearch/css";
2
+ @import "./algolia.css";
3
+
1
4
  @tailwind base;
2
5
  @tailwind components;
3
6
  @tailwind utilities;
4
7
 
5
- @import url("../styles/syntax.css");
6
-
8
+ @import url("./syntax.css");
7
9
  /* Modern Blue Theme */
8
10
  @layer base {
9
11
  :root {
@@ -136,4 +138,4 @@ pre>code {
136
138
  background-position: 0% 0%;
137
139
  }
138
140
  }
139
- }
141
+ }
@@ -1,86 +0,0 @@
1
- ---
2
- title: Accordion
3
- description: A component used to create collapsible content that can be hidden and shown again.
4
- date: 22-12-2024
5
- ---
6
-
7
- ## Preview
8
-
9
- ### Basic Usage
10
-
11
- <Accordion title="Click to expand" defaultOpen={true}>
12
- This is a simple accordion component that can be toggled by clicking the header. The content can include any valid React nodes, including text, components, and markdown.
13
- </Accordion>
14
-
15
- ### With Code Block
16
-
17
- <Accordion title="Code Example" className="mt-4">
18
- ```javascript:utils.js showLineNumbers
19
- // Example of using the Accordion component
20
- import Accordion from '@/components/markdown/AccordionMdx';
21
-
22
- function Example() {
23
- return (
24
- <Accordion title="Click to see code">
25
- <pre>
26
- {`function greet() {\n console.log('Hello, world!');\n}`}
27
- </pre>
28
- </Accordion>
29
- );
30
- }
31
- ```
32
- </Accordion>
33
-
34
- ### With Markdown Content
35
-
36
- <Accordion title="Markdown Example" className="mt-4">
37
- ## This is a markdown heading
38
-
39
- - List item 1
40
- - List item 2
41
- - List item 3
42
-
43
- You can include **bold** and *italic* text, [links](#), and other markdown elements.
44
- </Accordion>
45
-
46
- ## Props
47
-
48
- | Prop | Type | Default | Description |
49
- |------|------|---------|-------------|
50
- | `title` | string | - | **Required**. The text displayed in the accordion header. |
51
- | `children` | ReactNode | null | The content to be displayed when the accordion is expanded. Can be plain text, markdown, or React components. |
52
- | `defaultOpen` | boolean | false | When true, the accordion will be expanded by default. |
53
- | `className` | string | undefined | Additional CSS classes to apply to the accordion container. |
54
-
55
- ## Output Markdown
56
-
57
- <Tabs defaultValue="markdown" className="pt-5 pb-1">
58
- <TabsList>
59
- <TabsTrigger value="markdown">Markdown</TabsTrigger>
60
- <TabsTrigger value="codeblock">Code Block</TabsTrigger>
61
- </TabsList>
62
- <TabsContent value="markdown">
63
- ```plaintext
64
- <Accordion title="Markdown">
65
- this is an example of plain text content from the accordion component and below is markdown ;
66
- 1. number one
67
- 2. number two
68
- 3. number three
69
- </Accordion>
70
- ```
71
- </TabsContent>
72
- <TabsContent value="codeblock">
73
- ````plaintext
74
- <Accordion title="Code Block" defaultOpen={true}>
75
- ```javascript:main.js showLineNumbers {3-4}
76
- function isRocketAboutToCrash() {
77
- // Check if the rocket is stable
78
- if (!isStable()) {
79
- NoCrash(); // Prevent the crash
80
- }
81
- }
82
- ```
83
- </Accordion>
84
- ````
85
- </TabsContent>
86
- </Tabs>
@@ -1,40 +0,0 @@
1
- ---
2
- title: Button
3
- description: A component used to create buttons that can be used to trigger actions or navigate to other pages.
4
- date: 14-12-2024
5
- ---
6
-
7
- ## Preview
8
-
9
- <Button
10
- text="Learn More"
11
- href="https://learn.example.com"
12
- icon="MoveUpRight"
13
- size="md"
14
- target="_blank"
15
- variation="primary"
16
- />
17
-
18
- ## Props
19
-
20
- | Prop | Type | Default | Description |
21
- | ----------- | -------- | ----------- | -------------------------------------------- |
22
- | `text` | string | undefined | The button text |
23
- | `href` | string | **required**| The URL to navigate to |
24
- | `icon` | string | undefined | Lucide icon name (e.g. "MoveUpRight") |
25
- | `size` | string | "md" | Button size: `"sm"`, `"md"`, or `"lg"` |
26
- | `target` | string | undefined | Link target (e.g. "_blank") |
27
- | `variation` | string | "primary" | Button style: `"primary"`, `"accent"`, or `"outline"` |
28
-
29
- ## Output Markdown
30
-
31
- ```markdown
32
- <Button
33
- text="Learn More"
34
- href="https://learn.example.com"
35
- icon="MoveUpRight"
36
- size="md"
37
- target="_blank"
38
- variation="primary"
39
- />
40
- ```
@@ -1,68 +0,0 @@
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>
@@ -1,47 +0,0 @@
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
- ## Preview
8
-
9
- <CardGroup cols={2}>
10
- <Card title="Heading 1" icon="Heading1">
11
- This is an example of card content with columns.
12
- </Card>
13
- <Card title="Heading 2" icon="Heading2">
14
- This is an example of card content with columns.
15
- </Card>
16
- <Card title="Grid Card" icon="Grid" horizontal>
17
- This is a horizontal card layout.
18
- </Card>
19
- <Card title="Horizontal Card" icon="Layout" horizontal>
20
- This is a horizontal card layout.
21
- </Card>
22
- </CardGroup>
23
-
24
- ## Props
25
-
26
- | Prop | Type | Default | Description |
27
- | ------------- | -------- | ------- | ------------------------------------------------------- |
28
- | `cols` | number | {2} | By default 2 The number of columns per row |
29
-
30
- ## Output Markdown
31
-
32
- ```markdown
33
- <CardGroup cols={2}>
34
- <Card title="Heading 1" icon="Heading1">
35
- This is an example of card content with columns.
36
- </Card>
37
- <Card title="Heading 2" icon="Heading2">
38
- This is an example of card content with columns.
39
- </Card>
40
- <Card title="Grid Card" icon="Grid" horizontal>
41
- This is a horizontal card layout.
42
- </Card>
43
- <Card title="Horizontal Card" icon="Layout" horizontal>
44
- This is a horizontal card layout.
45
- </Card>
46
- </CardGroup>
47
- ```
@@ -1,39 +0,0 @@
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 1 to 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
- - **Line Numbers**: Enable line numbers by adding `showLineNumbers` after the opening backticks.
38
- - **Highlight Lines**: Specify lines to highlight using curly braces (e.g., `{2,3-5}`).
39
- - **Syntax Highlighting**: Use the appropriate language for syntax highlighting.
@@ -1,38 +0,0 @@
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.