@docubook/create 1.12.0 → 1.13.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.
Files changed (37) hide show
  1. package/package.json +1 -1
  2. package/src/dist/.vscode/card.code-snippets +52 -14
  3. package/src/dist/.vscode/table.code-snippets +10 -18
  4. package/src/dist/app/page.tsx +2 -2
  5. package/src/dist/components/context-popover.tsx +133 -0
  6. package/src/dist/components/docs-menu.tsx +39 -21
  7. package/src/dist/components/leftbar.tsx +10 -4
  8. package/src/dist/components/search.tsx +36 -4
  9. package/src/dist/contents/docs/{getting-started/changelog → changelog/version-1}/index.mdx +19 -0
  10. package/src/dist/contents/docs/{getting-started/components → components}/card/index.mdx +3 -3
  11. package/src/dist/contents/docs/getting-started/customize/index.mdx +0 -2
  12. package/src/dist/contents/docs/getting-started/installation/index.mdx +1 -1
  13. package/src/dist/contents/docs/getting-started/introduction/index.mdx +1 -1
  14. package/src/dist/contents/docs/getting-started/quick-start-guide/index.mdx +78 -60
  15. package/src/dist/docu.json +47 -24
  16. package/src/dist/lib/routes-config.ts +8 -1
  17. package/src/dist/package.json +1 -1
  18. package/src/dist/styles/globals.css +0 -17
  19. package/src/dist/tailwind.config.ts +0 -1
  20. package/src/dist/.vscode/extensions.json +0 -3
  21. package/src/dist/contents/docs/getting-started/components/index.mdx +0 -9
  22. package/src/dist/styles/editor.css +0 -57
  23. /package/src/dist/contents/docs/{getting-started/components → components}/accordion/index.mdx +0 -0
  24. /package/src/dist/contents/docs/{getting-started/components → components}/button/index.mdx +0 -0
  25. /package/src/dist/contents/docs/{getting-started/components → components}/card-group/index.mdx +0 -0
  26. /package/src/dist/contents/docs/{getting-started/components → components}/code-block/index.mdx +0 -0
  27. /package/src/dist/contents/docs/{getting-started/components → components}/custom/index.mdx +0 -0
  28. /package/src/dist/contents/docs/{getting-started/components → components}/file-tree/index.mdx +0 -0
  29. /package/src/dist/contents/docs/{getting-started/components → components}/image/index.mdx +0 -0
  30. /package/src/dist/contents/docs/{getting-started/components → components}/keyboard/index.mdx +0 -0
  31. /package/src/dist/contents/docs/{getting-started/components → components}/link/index.mdx +0 -0
  32. /package/src/dist/contents/docs/{getting-started/components → components}/note/index.mdx +0 -0
  33. /package/src/dist/contents/docs/{getting-started/components → components}/release-note/index.mdx +0 -0
  34. /package/src/dist/contents/docs/{getting-started/components → components}/stepper/index.mdx +0 -0
  35. /package/src/dist/contents/docs/{getting-started/components → components}/tabs/index.mdx +0 -0
  36. /package/src/dist/contents/docs/{getting-started/components → components}/tooltips/index.mdx +0 -0
  37. /package/src/dist/contents/docs/{getting-started/components → components}/youtube/index.mdx +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docubook/create",
3
- "version": "1.12.0",
3
+ "version": "1.13.0",
4
4
  "main": "src/index.js",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,16 +1,54 @@
1
1
  {
2
- "DocuCards": {
3
- "prefix": "card",
4
- "body": [
5
- "<CardGroup cols={2}>",
6
- "<Card title=\"${1:Heading2}\" icon=\"${2:Heading2}\">",
7
- " This is an example of card content with columns.",
8
- "</Card>",
9
- "<Card title=\"${3:Heading3}\" icon=\"${4:Heading3}\">",
10
- " This is an example of card content with columns.",
11
- "</Card>",
12
- "</CardGroup>"
13
- ],
14
- "description": "Create a DocuCards component on markdown."
15
- }
2
+ "Docu Card Group": {
3
+ "prefix": "card-group",
4
+ "body": [
5
+ "<CardGroup cols={${1:2}}>",
6
+ " <Card title=\"${2:Card Title}\" icon=\"${3:Home}\">",
7
+ " ${4:Card content goes here. You can add **markdown** content.}",
8
+ " </Card>",
9
+ " <Card title=\"${5:Another Card}\" icon=\"${6:Settings}\">",
10
+ " ${7:More content here.}",
11
+ " </Card>",
12
+ "</CardGroup>"
13
+ ],
14
+ "description": "Create a group of cards in a responsive grid"
15
+ },
16
+ "Docu Card": {
17
+ "prefix": "card",
18
+ "body": [
19
+ "<Card ",
20
+ " title=\"${1:Card Title}\"",
21
+ " icon=\"${2:Home}\"",
22
+ " href=\"${3:/optional-link}\"",
23
+ " ${4:horizontal}>",
24
+ " ${5:Card content goes here. You can add **markdown** content.}",
25
+ "</Card>"
26
+ ],
27
+ "description": "Create a single card component"
28
+ },
29
+ "Docu Horizontal Card": {
30
+ "prefix": "card-horizontal",
31
+ "body": [
32
+ "<Card ",
33
+ " title=\"${1:Card Title}\"",
34
+ " icon=\"${2:Home}\"",
35
+ " href=\"${3:/optional-link}\"",
36
+ " horizontal>",
37
+ " ${4:Content appears next to the icon in a horizontal layout.}",
38
+ "</Card>"
39
+ ],
40
+ "description": "Create a horizontal card layout"
41
+ },
42
+ "Docu Card With Link": {
43
+ "prefix": "card-link",
44
+ "body": [
45
+ "<Card ",
46
+ " title=\"${1:Card Title}\"",
47
+ " icon=\"${2:ExternalLink}\"",
48
+ " href=\"${3:https://example.com}\">",
49
+ " ${4:This card is clickable and links to an external URL.}",
50
+ "</Card>"
51
+ ],
52
+ "description": "Create a clickable card that links to a URL"
16
53
  }
54
+ }
@@ -1,20 +1,12 @@
1
1
  {
2
- "DocuTable": {
3
- "prefix": "table",
4
- "body": [
5
- "| **${1:Feature}** | **${2:Description}** |",
6
- "| ------------------------------- | ----------------------------------------------------- |",
7
- "| ${3:MDX Support} | ${4:Write interactive documentation with MDX.} |",
8
- "| Nested Pages | Organize content in a nested, hierarchical structure. |",
9
- "| Blog Section | Include a dedicated blog section. |",
10
- "| Pagination | Split content across multiple pages. |",
11
- "| Syntax Highlighting | Highlight code for better readability. |",
12
- "| Code Line Highlighting & Titles | Highlight specific lines with descriptive titles. |",
13
- "| Interactive Code Blocks | Language-specific and interactive code display. |",
14
- "| Custom Markdown Components | Embed custom, reusable components in your docs. |",
15
- "| Static Site Generation | Generate a static, high-performance site. |",
16
- "| SEO-Optimized | Structured for optimal search engine indexing. |"
17
- ],
18
- "description": "Create a DocuTable component on markdown."
19
- }
2
+ "DocuTable": {
3
+ "prefix": "table",
4
+ "body": [
5
+ "| **${1:Header 1}** | **${2:Header 2}** |",
6
+ "| ---------------- | ---------------- |",
7
+ "| ${3:Row 1, Col 1} | ${4:Row 1, Col 2} |",
8
+ "| ${5:Row 2, Col 1} | ${6:Row 2, Col 2} |"
9
+ ],
10
+ "description": "Create a simple 2x2 markdown table"
20
11
  }
12
+ }
@@ -15,7 +15,7 @@ export default function Home() {
15
15
  return (
16
16
  <div className="flex flex-col items-center justify-center px-2 py-8 text-center sm:py-36">
17
17
  <Link
18
- href="/docs/getting-started/changelog"
18
+ href="/docs/changelog/version-1"
19
19
  className="mb-5 sm:text-lg flex items-center gap-2 underline underline-offset-4 sm:-mt-12"
20
20
  >
21
21
  <div className="z-10 flex min-h-10 items-center justify-center max-[800px]:mt-10">
@@ -25,7 +25,7 @@ export default function Home() {
25
25
  )}
26
26
  >
27
27
  <AnimatedShinyText className="inline-flex items-center justify-center px-4 py-1 transition ease-out hover:text-neutral-100 hover:duration-300 hover:dark:text-neutral-200">
28
- <span>🚀 New Version - Release v1.12.0</span>
28
+ <span>🚀 New Version - Release v1.13.0</span>
29
29
  <ArrowRightIcon className="ml-1 size-3 transition-transform duration-300 ease-in-out group-hover:translate-x-0.5" />
30
30
  </AnimatedShinyText>
31
31
  </div>
@@ -0,0 +1,133 @@
1
+ "use client";
2
+
3
+ import { usePathname, useRouter } from "next/navigation";
4
+ import { useState, useEffect } from "react";
5
+ import { ROUTES, EachRoute } from "@/lib/routes-config";
6
+ import { cn } from "@/lib/utils";
7
+ import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
8
+ import { Button } from "@/components/ui/button";
9
+ import * as LucideIcons from "lucide-react";
10
+ import { ChevronsUpDown, Check, type LucideIcon } from "lucide-react";
11
+
12
+ interface ContextPopoverProps {
13
+ className?: string;
14
+ }
15
+
16
+ // Get all root-level routes with context
17
+ function getContextRoutes(): EachRoute[] {
18
+ return ROUTES.filter(route => route.context);
19
+ }
20
+
21
+ // Get the first item's href from a route
22
+ function getFirstItemHref(route: EachRoute): string {
23
+ return route.items?.[0]?.href ? `${route.href}${route.items[0].href}` : route.href;
24
+ }
25
+
26
+ // Get the active context route from the current path
27
+ function getActiveContextRoute(path: string): EachRoute | undefined {
28
+ if (!path.startsWith('/docs')) return undefined;
29
+ const docPath = path.replace(/^\/docs/, '');
30
+ return getContextRoutes().find(route => docPath.startsWith(route.href));
31
+ }
32
+
33
+ // Get icon component by name
34
+ function getIcon(name: string) {
35
+ const Icon = LucideIcons[name as keyof typeof LucideIcons] as LucideIcon | undefined;
36
+ if (!Icon) return <LucideIcons.FileQuestion className="h-4 w-4" />;
37
+ return <Icon className="h-4 w-4" />;
38
+ }
39
+
40
+ export default function ContextPopover({ className }: ContextPopoverProps) {
41
+ const pathname = usePathname();
42
+ const router = useRouter();
43
+ const [activeRoute, setActiveRoute] = useState<EachRoute>();
44
+ const contextRoutes = getContextRoutes();
45
+
46
+ useEffect(() => {
47
+ if (pathname.startsWith("/docs")) {
48
+ setActiveRoute(getActiveContextRoute(pathname));
49
+ } else {
50
+ setActiveRoute(undefined);
51
+ }
52
+ }, [pathname]);
53
+
54
+ if (!pathname.startsWith("/docs") || contextRoutes.length === 0) {
55
+ return null;
56
+ }
57
+
58
+ return (
59
+ <Popover>
60
+ <PopoverTrigger asChild>
61
+ <Button
62
+ variant="ghost"
63
+ className={cn(
64
+ "w-full max-w-[240px] flex items-center justify-between font-semibold text-foreground px-0 pt-8",
65
+ "hover:bg-transparent hover:text-foreground",
66
+ className
67
+ )}
68
+ >
69
+ <div className="flex items-center gap-2">
70
+ {activeRoute?.context?.icon && (
71
+ <span className="text-primary bg-primary/10 border border-primary rounded p-0.5">
72
+ {getIcon(activeRoute.context.icon)}
73
+ </span>
74
+ )}
75
+ <span className="truncate text-sm">
76
+ {activeRoute?.context?.title || activeRoute?.title || 'Select context'}
77
+ </span>
78
+ </div>
79
+ <ChevronsUpDown className="h-4 w-4 text-foreground/50" />
80
+ </Button>
81
+ </PopoverTrigger>
82
+ <PopoverContent
83
+ className="w-64 p-2"
84
+ align="start"
85
+ sideOffset={6}
86
+ >
87
+ <div className="space-y-1">
88
+ {contextRoutes.map((route) => {
89
+ const isActive = activeRoute?.href === route.href;
90
+ const firstItemPath = getFirstItemHref(route);
91
+ const contextPath = `/docs${firstItemPath}`;
92
+
93
+ return (
94
+ <button
95
+ key={route.href}
96
+ onClick={() => router.push(contextPath)}
97
+ className={cn(
98
+ "relative flex w-full items-center gap-2 rounded px-2 py-1.5 text-sm",
99
+ "text-left outline-none transition-colors",
100
+ isActive
101
+ ? "bg-primary/20 text-primary"
102
+ : "text-foreground/80 hover:bg-primary/20"
103
+ )}
104
+ >
105
+ {route.context?.icon && (
106
+ <span className={cn(
107
+ "flex h-4 w-4 items-center justify-center",
108
+ isActive ? "text-primary" : "text-foreground/60"
109
+ )}>
110
+ {getIcon(route.context.icon)}
111
+ </span>
112
+ )}
113
+ <div className="flex-1 min-w-0 overflow-hidden">
114
+ <div className="truncate font-medium">
115
+ {route.context?.title || route.title}
116
+ </div>
117
+ {route.context?.description && (
118
+ <div className="text-xs text-muted-foreground truncate text-ellipsis overflow-hidden max-w-full">
119
+ {route.context.description}
120
+ </div>
121
+ )}
122
+ </div>
123
+ {isActive && (
124
+ <Check className="h-3.5 w-3.5" />
125
+ )}
126
+ </button>
127
+ );
128
+ })}
129
+ </div>
130
+ </PopoverContent>
131
+ </Popover>
132
+ );
133
+ }
@@ -1,44 +1,62 @@
1
1
  "use client";
2
2
 
3
- import { ROUTES } from "@/lib/routes-config";
3
+ import { ROUTES, EachRoute } from "@/lib/routes-config";
4
4
  import SubLink from "./sublink";
5
5
  import { usePathname } from "next/navigation";
6
+ import { cn } from "@/lib/utils";
6
7
 
7
8
  interface DocsMenuProps {
8
9
  isSheet?: boolean;
9
10
  className?: string;
10
11
  }
11
12
 
13
+ // Get the current context from the path
14
+ function getCurrentContext(path: string): string | undefined {
15
+ if (!path.startsWith('/docs')) return undefined;
16
+
17
+ // Extract the first segment after /docs/
18
+ const match = path.match(/^\/docs\/([^\/]+)/);
19
+ return match ? match[1] : undefined;
20
+ }
21
+
22
+ // Get the route that matches the current context
23
+ function getContextRoute(contextPath: string): EachRoute | undefined {
24
+ return ROUTES.find(route => {
25
+ const normalizedHref = route.href.replace(/^\/+|\/+$/g, '');
26
+ return normalizedHref === contextPath;
27
+ });
28
+ }
29
+
12
30
  export default function DocsMenu({ isSheet = false, className = "" }: DocsMenuProps) {
13
31
  const pathname = usePathname();
14
32
 
15
33
  // Skip rendering if not on a docs page
16
34
  if (!pathname.startsWith("/docs")) return null;
17
35
 
36
+ // Get the current context
37
+ const currentContext = getCurrentContext(pathname);
38
+
39
+ // Get the route for the current context
40
+ const contextRoute = currentContext ? getContextRoute(currentContext) : undefined;
41
+
42
+ // If no context route is found, don't render anything
43
+ if (!contextRoute) return null;
44
+
18
45
  return (
19
46
  <nav
20
47
  aria-label="Documentation navigation"
21
- className={className}
48
+ className={cn("transition-all duration-200", className)}
22
49
  >
23
- <ul className="flex flex-col gap-3.5 mt-5 pr-2 pb-6">
24
- {ROUTES.map((item, index) => {
25
- // Normalize href - hapus leading/trailing slashes
26
- const normalizedHref = `/${item.href.replace(/^\/+|\/+$/g, '')}`;
27
- const itemHref = `/docs${normalizedHref}`;
28
-
29
- const modifiedItems = {
30
- ...item,
31
- href: itemHref,
32
- level: 0,
33
- isSheet,
34
- };
35
-
36
- return (
37
- <li key={`${item.title}-${index}`}>
38
- <SubLink {...modifiedItems} />
39
- </li>
40
- );
41
- })}
50
+ <ul className="flex flex-col gap-1.5 py-4">
51
+ {/* Display only the items from the current context */}
52
+ <li key={contextRoute.title}>
53
+ <SubLink
54
+ {...contextRoute}
55
+ href={`/docs${contextRoute.href}`}
56
+ level={0}
57
+ isSheet={isSheet}
58
+ />
59
+ </li>
42
60
  </ul>
43
61
  </nav>
44
62
  );
@@ -10,11 +10,11 @@ import {
10
10
  import { Logo, NavMenu } from "@/components/navbar";
11
11
  import { Button } from "@/components/ui/button";
12
12
  import { AlignLeftIcon, PanelLeftClose, PanelLeftOpen } from "lucide-react";
13
- import { FooterButtons } from "@/components/footer";
14
13
  import { DialogTitle, DialogDescription } from "@/components/ui/dialog";
15
14
  import { ScrollArea } from "@/components/ui/scroll-area";
16
15
  import DocsMenu from "@/components/docs-menu";
17
16
  import { ModeToggle } from "@/components/theme-toggle";
17
+ import ContextPopover from "@/components/context-popover";
18
18
 
19
19
  // Toggle Button Component
20
20
  export function ToggleButton({
@@ -52,9 +52,14 @@ export function Leftbar() {
52
52
  ${collapsed ? "w-[24px]" : "w-[280px]"} flex flex-col pr-2`}
53
53
  >
54
54
  <ToggleButton collapsed={collapsed} onToggle={toggleCollapse} />
55
- {/* Scrollable DocsMenu */}
55
+ {/* Scrollable Content */}
56
56
  <ScrollArea className="flex-1 px-0.5 pb-4">
57
- {!collapsed && <DocsMenu />}
57
+ {!collapsed && (
58
+ <div className="space-y-2">
59
+ <ContextPopover />
60
+ <DocsMenu />
61
+ </div>
62
+ )}
58
63
  </ScrollArea>
59
64
  </aside>
60
65
  );
@@ -82,7 +87,8 @@ export function SheetLeftbar() {
82
87
  <div className="flex flex-col gap-2.5 mt-3 mx-2 px-5">
83
88
  <NavMenu isSheet />
84
89
  </div>
85
- <div className="mx-2 px-5">
90
+ <div className="mx-2 px-5 space-y-2">
91
+ <ContextPopover />
86
92
  <DocsMenu isSheet />
87
93
  </div>
88
94
  <div className="flex w-2/4 px-5">
@@ -17,6 +17,23 @@ import {
17
17
  import Anchor from "./anchor";
18
18
  import { advanceSearch, cn } from "@/lib/utils";
19
19
  import { ScrollArea } from "@/components/ui/scroll-area";
20
+ import { page_routes } from "@/lib/routes-config";
21
+
22
+ // Define the ContextInfo type to match the one in routes-config
23
+ type ContextInfo = {
24
+ icon: string;
25
+ description: string;
26
+ title?: string;
27
+ };
28
+
29
+ type SearchResult = {
30
+ title: string;
31
+ href: string;
32
+ noLink?: boolean;
33
+ items?: undefined;
34
+ score?: number;
35
+ context?: ContextInfo;
36
+ };
20
37
 
21
38
  export default function Search() {
22
39
  const router = useRouter();
@@ -39,10 +56,25 @@ export default function Search() {
39
56
  };
40
57
  }, []);
41
58
 
42
- const filteredResults = useMemo(
43
- () => advanceSearch(searchedInput.trim()),
44
- [searchedInput]
45
- );
59
+ const filteredResults = useMemo<SearchResult[]>(() => {
60
+ const trimmedInput = searchedInput.trim();
61
+
62
+ // If search input is empty or less than 3 characters, show initial suggestions
63
+ if (trimmedInput.length < 3) {
64
+ return page_routes
65
+ .filter((route: { href: string }) => !route.href.endsWith('/')) // Filter out directory routes
66
+ .slice(0, 6) // Limit to 6 posts
67
+ .map((route: { title: string; href: string; noLink?: boolean; context?: ContextInfo }) => ({
68
+ title: route.title,
69
+ href: route.href,
70
+ noLink: route.noLink,
71
+ context: route.context
72
+ }));
73
+ }
74
+
75
+ // For search with 3 or more characters, use the advance search
76
+ return advanceSearch(trimmedInput) as unknown as SearchResult[];
77
+ }, [searchedInput]);
46
78
 
47
79
  useEffect(() => {
48
80
  setSelectedIndex(0);
@@ -8,6 +8,25 @@ date: 24-05-2025
8
8
 
9
9
  > This changelog contains a list of all the changes made to the DocuBook template. It will be updated with each new release and will include information about new features, bug fixes, and other improvements.
10
10
 
11
+ <div className="sr-only">
12
+ ### v 1.13.0
13
+ </div>
14
+
15
+ <Release version="1.13.0" date="2025-05-29" title="Context Menu for organize file and folder">
16
+ <Changes type="added">
17
+ - New ContextMenu component for organizing file and folder
18
+ - Nested docs folder and file support with context menu
19
+ </Changes>
20
+ <Changes type="improved">
21
+ - improve routes-config with context menu
22
+ - improve docu.json with context menu
23
+ - improve leftbar with context menu
24
+ - improve docs-menu with context menu
25
+ - improve search dialog limit result to 6 post per suggestion
26
+ - improve search result typing 3 characters to show suggestion
27
+ </Changes>
28
+ </Release>
29
+
11
30
  <div className="sr-only">
12
31
  ### v 1.12.0
13
32
  </div>
@@ -41,9 +41,9 @@ The Card component is a component used to create cards that can be used to displ
41
41
 
42
42
  <Tabs defaultValue="link" className="pt-5 pb-1">
43
43
  <TabsList>
44
- <TabsTrigger value="link">Card with Link & Icon</TabsTrigger>
45
- <TabsTrigger value="horizontal">Card Horizontal</TabsTrigger>
46
- <TabsTrigger value="simple">Card Simple</TabsTrigger>
44
+ <TabsTrigger value="link">Link & Icon</TabsTrigger>
45
+ <TabsTrigger value="horizontal">Horizontal</TabsTrigger>
46
+ <TabsTrigger value="simple">Simple</TabsTrigger>
47
47
  </TabsList>
48
48
  <TabsContent value="link">
49
49
  ```markdown
@@ -90,5 +90,3 @@ For both options, ensure that you add the variable to `tailwind.config.ts`:
90
90
  }
91
91
  }
92
92
  ```
93
-
94
- For theme and colors, refer to the [Theme section](/docs/getting-started/themes)
@@ -15,7 +15,7 @@ To get started, you can clone the DocuBook repository directly from GitHub.
15
15
  Begin by cloning the DocuBook repository from GitHub:
16
16
 
17
17
  ```bash
18
- git clone --branch starter https://gitlab.com/mywildancloud/docubook.git
18
+ git clone --branch main https://github.com/DocuBook/docubook.git
19
19
  ```
20
20
 
21
21
  </StepperItem>
@@ -13,7 +13,7 @@ DocuBook is proudly **open-source**! 🎉 We believe in creating an accessible,
13
13
 
14
14
  <Note title="Contribute">
15
15
  Interested in helping us improve? Check out our [GitHub
16
- repository](https://github.com/gitfromwildan/docubook) to get started! From
16
+ repository](https://github.com/DocuBook/docubook) to get started! From
17
17
  feature suggestions to bug fixes, all contributions are welcome.
18
18
  </Note>
19
19
 
@@ -4,11 +4,11 @@ description: Get up and running with DocuBook in minutes with this comprehensive
4
4
  date: 20-05-2025
5
5
  ---
6
6
 
7
- Welcome to DocuBook! This guide will help you set up your documentation site quickly and efficiently.
7
+ Welcome to DocuBook! This guide will help you set up and customize your documentation site efficiently.
8
8
 
9
9
  ## Prerequisites
10
10
 
11
- Before we begin, make sure you have the following installed:
11
+ Before we begin, ensure you have the following installed:
12
12
 
13
13
  - [Git](https://git-scm.com/)
14
14
  - [Node.js 18+](https://nodejs.org/) or [Bun 1.0+](https://bun.sh/)
@@ -16,112 +16,130 @@ Before we begin, make sure you have the following installed:
16
16
 
17
17
  ## Installation
18
18
 
19
- <Note type="note" title="Note">
20
- Follow the instructions on the [installation page](/docs/getting-started/installation) to install the required dependencies and set up your project.
19
+ <Note type="note" title="Initial Setup">
20
+ Follow the [installation guide](/docs/getting-started/installation) to set up your project dependencies and configuration.
21
21
  </Note>
22
22
 
23
23
  ## Project Setup
24
24
 
25
- ### Customize Branding
25
+ ### Configuration
26
26
 
27
27
  <Stepper>
28
- <StepperItem title="Step 1: Add Favicon">
29
- Place your favicon at `public/favicon.ico`
28
+ <StepperItem title="Add Favicon">
29
+ Place your favicon at `public/favicon.ico` for browser tab display.
30
30
  </StepperItem>
31
- <StepperItem title="Step 2: Add Logo">
32
- Place your logo at `public/images/docu.svg` (SVG format recommended)
31
+ <StepperItem title="Add Logo">
32
+ Add your logo at `public/images/docu.svg` (SVG format recommended for scalability).
33
33
  </StepperItem>
34
- <StepperItem title="Step 3: Update Site Info">
35
- Edit `docu.json` to update site name, description, and other settings
34
+ <StepperItem title="Update Site Information">
35
+ Customize your site's metadata in `docu.json`:
36
+ - Site title and description
37
+ - Navigation structure
38
+ - Default theme settings
36
39
  </StepperItem>
37
40
  </Stepper>
38
41
 
39
- ## Creating Content
42
+ ## Content Management
40
43
 
41
44
  ### File Structure
42
45
 
43
- DocuBook uses the following structure:
46
+ DocuBook organizes content in a hierarchical structure:
44
47
 
45
- ````plaintext
48
+ ```plaintext
46
49
  contents/
47
- docs/
48
- getting-started/
49
- quick-start-guide/ <-- You are here
50
+ docs/ # Main documentation directory
51
+ getting-started/ # Section for getting started guides
52
+ quick-start-guide/ # Current guide
53
+ index.mdx # Main content file
54
+ guides/ # Additional documentation sections
55
+ components/ # Component-specific documentation
50
56
  index.mdx
51
- guides/
52
- components/
53
- index.mdx
54
- ````
57
+ ```
55
58
 
56
- ### Adding New Pages
59
+ ### Creating New Content
57
60
 
58
61
  <Stepper>
59
- <StepperItem title="Step 1: Create a New Folder">
60
- Create a new folder in `contents/docs/getting-started/` for your content section
62
+ <StepperItem title="1. Create Content Directory">
63
+ Organize your documentation by creating a new directory:
64
+ ```bash
65
+ mkdir -p contents/docs/your-section/your-topic
66
+ ```
67
+
68
+ Example for an API reference:
61
69
  ```bash
62
- mkdir -p contents/docs/getting-started/your-page-title
70
+ mkdir -p contents/docs/api/authentication
63
71
  ```
64
72
  </StepperItem>
65
- <StepperItem title="Step 2: Add MDX File">
66
- Create an `index.mdx` file with frontmatter:
73
+
74
+ <StepperItem title="2. Create MDX Content">
75
+ Add an `index.mdx` file with frontmatter metadata:
67
76
  ````markdown
68
77
  ---
69
- title: Your Page Title
70
- description: Brief description of your page
71
- date: 20-05-2025
78
+ title: Authentication
79
+ description: Learn how to implement user authentication
80
+ date: 2025-05-29
72
81
  ---
73
82
 
74
- # Your Content Here
83
+ Your comprehensive guide to implementing authentication in your application.
84
+
85
+ ## Getting Started
75
86
 
76
- Start writing your documentation using Markdown or MDX components.
87
+ Start by setting up your authentication provider...
77
88
  ````
78
89
  </StepperItem>
79
- <StepperItem title="Step 3: Add to Navigation">
80
- Update the navigation in `docu.json`:
81
- ```json:docu.json showLineNumbers {8}
82
- {
90
+
91
+ <StepperItem title="3. Update Navigation">
92
+ Add your new section to the navigation in `docu.json`. Here's how to add the authentication section we created earlier:
93
+
94
+ ```json:docu.json showLineNumbers {4-16}
95
+ {
83
96
  "routes": [
97
+ // ... existing routes ...
84
98
  {
85
- "title": "Getting Started",
86
- "href": "/getting-started",
87
- "noLink": true,
88
- "items": [
89
- { "title": "Your Page Title", "href": "/your-page-title" } // Add your page here separated by comma `,`
90
- ]
99
+ "title": "API",
100
+ "href": "/api",
101
+ "noLink": true,
102
+ "context": {
103
+ "icon": "Code2",
104
+ "description": "API Reference and Integration",
105
+ "title": "API"
106
+ },
107
+ "items": [
108
+ { "title": "Authentication", "href": "/authentication" }
109
+ ]
91
110
  }
92
- ]
93
- }
111
+ ]
112
+ }
94
113
  ```
114
+
115
+ This will add a new "API" section with an "Authentication" page under it. The `context` object defines how this section appears in the navigation, including its icon and description.
95
116
  </StepperItem>
96
117
  </Stepper>
97
118
 
98
- ## Development
119
+ ## Development Workflow
120
+
121
+ ### Local Development
99
122
 
100
- Start the development server:
123
+ Start the development server with live reload:
101
124
 
102
125
  ```bash
126
+ # Using npm
103
127
  npm run dev
104
- # or
128
+
129
+ # Or using Bun
105
130
  bun dev
106
131
  ```
107
132
 
108
- Visit [http://localhost:3000](http://localhost:3000) to see your site.
133
+ Access your site at [http://localhost:3000](http://localhost:3000)
109
134
 
110
- ## Building for Production
135
+ ### Building for Production
111
136
 
112
- When you're ready to deploy:
137
+ When ready to deploy:
113
138
 
114
139
  ```bash
140
+ # Build the production version
115
141
  npm run build
142
+
143
+ # Start the production server
116
144
  npm start
117
145
  ```
118
-
119
- ## Need Help?
120
-
121
- <Note type="info">
122
- Check out the [Components Guide](/docs/getting-started/components) to learn about all available components.
123
- </Note>
124
-
125
- <Note type="warning">
126
- Make sure to commit your changes to version control before deploying.
127
- </Note>
@@ -61,35 +61,58 @@
61
61
  "title": "Getting Started",
62
62
  "href": "/getting-started",
63
63
  "noLink": true,
64
+ "context": {
65
+ "icon": "Book",
66
+ "description": "Set up your Documentation",
67
+ "title": "Guides"
68
+ },
64
69
  "items": [
65
70
  { "title": "Introduction", "href": "/introduction" },
66
71
  { "title": "Installation", "href": "/installation" },
67
72
  { "title": "Quick Start Guide", "href": "/quick-start-guide" },
68
73
  { "title": "Project Structure", "href": "/project-structure" },
69
- {
70
- "title": "Components",
71
- "href": "/components",
72
- "items": [
73
- { "title": "Accordion", "href": "/accordion" },
74
- { "title": "Button", "href": "/button" },
75
- { "title": "Card", "href": "/card" },
76
- { "title": "Card Group", "href": "/card-group" },
77
- { "title": "Code Block", "href": "/code-block" },
78
- { "title": "File Tree", "href": "/file-tree" },
79
- { "title": "Image", "href": "/image" },
80
- { "title": "Keyboard", "href": "/keyboard" },
81
- { "title": "Link", "href": "/link" },
82
- { "title": "Note", "href": "/note" },
83
- { "title": "Release Note", "href": "/release-note" },
84
- { "title": "Stepper", "href": "/stepper" },
85
- { "title": "Tabs", "href": "/tabs" },
86
- { "title": "Tooltips", "href": "/tooltips" },
87
- { "title": "Youtube", "href": "/youtube" },
88
- { "title": "Custom", "href": "/custom" }
89
- ]
90
- },
91
- { "title": "Customize", "href": "/customize" },
92
- { "title": "Changelog", "href": "/changelog" }
74
+ { "title": "Customize", "href": "/customize" }
75
+ ]
76
+ },
77
+ {
78
+ "title": "Components",
79
+ "href": "/components",
80
+ "noLink": true,
81
+ "context": {
82
+ "icon": "Layers",
83
+ "description": "Write with Markdown",
84
+ "title": "Markdown"
85
+ },
86
+ "items": [
87
+ { "title": "Accordion", "href": "/accordion" },
88
+ { "title": "Button", "href": "/button" },
89
+ { "title": "Card", "href": "/card" },
90
+ { "title": "Card Group", "href": "/card-group" },
91
+ { "title": "Code Block", "href": "/code-block" },
92
+ { "title": "File Tree", "href": "/file-tree" },
93
+ { "title": "Image", "href": "/image" },
94
+ { "title": "Keyboard", "href": "/keyboard" },
95
+ { "title": "Link", "href": "/link" },
96
+ { "title": "Note", "href": "/note" },
97
+ { "title": "Release Note", "href": "/release-note" },
98
+ { "title": "Stepper", "href": "/stepper" },
99
+ { "title": "Tabs", "href": "/tabs" },
100
+ { "title": "Tooltips", "href": "/tooltips" },
101
+ { "title": "Youtube", "href": "/youtube" },
102
+ { "title": "Custom", "href": "/custom" }
103
+ ]
104
+ },
105
+ {
106
+ "title": "Changelog",
107
+ "href": "/changelog",
108
+ "noLink": true,
109
+ "context": {
110
+ "icon": "History",
111
+ "description": "Updates and changes",
112
+ "title": "Changelog"
113
+ },
114
+ "items": [
115
+ { "title": "Version 1.0+", "href": "/version-1" }
93
116
  ]
94
117
  }
95
118
  ]
@@ -1,9 +1,16 @@
1
1
  import docuConfig from "@/docu.json"; // Import JSON file
2
2
 
3
+ export type ContextInfo = {
4
+ icon: string;
5
+ description: string;
6
+ title?: string;
7
+ };
8
+
3
9
  export type EachRoute = {
4
10
  title: string;
5
11
  href: string;
6
- noLink?: boolean; // Sekarang mendukung boolean
12
+ noLink?: boolean;
13
+ context?: ContextInfo;
7
14
  items?: EachRoute[];
8
15
  };
9
16
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docubook",
3
- "version": "1.12.0",
3
+ "version": "1.13.0",
4
4
  "private": true,
5
5
  "scripts": {
6
6
  "dev": "next dev",
@@ -3,7 +3,6 @@
3
3
  @tailwind utilities;
4
4
 
5
5
  @import url("../styles/syntax.css");
6
- @import url("../styles/editor.css");
7
6
 
8
7
  /* ocean */
9
8
  @layer base {
@@ -119,22 +118,6 @@ pre>code {
119
118
  background-color: transparent !important;
120
119
  }
121
120
 
122
- .line-clamp-3 {
123
- display: -webkit-box;
124
- -webkit-line-clamp: 3;
125
- -webkit-box-orient: vertical;
126
- overflow: hidden;
127
- text-overflow: ellipsis;
128
- }
129
-
130
- .line-clamp-2 {
131
- display: -webkit-box;
132
- -webkit-line-clamp: 2;
133
- -webkit-box-orient: vertical;
134
- overflow: hidden;
135
- text-overflow: ellipsis;
136
- }
137
-
138
121
  @layer utilities {
139
122
  .animate-shine {
140
123
  --animate-shine: shine var(--duration) infinite linear;
@@ -9,7 +9,6 @@ const config = {
9
9
  "./src/**/*.{ts,tsx}",
10
10
  ],
11
11
  prefix: "",
12
- safelist: ["line-clamp-3","line-clam-2"],
13
12
  theme: {
14
13
  container: {
15
14
  center: true,
@@ -1,3 +0,0 @@
1
- {
2
- "recommendations": []
3
- }
@@ -1,9 +0,0 @@
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" />
@@ -1,57 +0,0 @@
1
- /* GitHub-style editor customizations */
2
- .editor-container {
3
- @apply relative font-mono text-sm leading-relaxed;
4
- height: 100%;
5
- min-height: 600px;
6
- }
7
-
8
- .editor-textarea {
9
- @apply w-full h-full min-h-[600px] p-4 pl-14 bg-background resize-none focus:outline-none;
10
- line-height: 1.5rem;
11
- tab-size: 2;
12
- counter-reset: line;
13
- }
14
-
15
- /* Line numbers */
16
- .editor-line-numbers {
17
- @apply absolute left-0 top-0 bottom-0 w-10 bg-muted/30 border-r select-none;
18
- padding: 1rem 0;
19
- overflow: hidden;
20
- }
21
-
22
- .editor-line-numbers-content {
23
- @apply text-right pr-2 text-muted-foreground/70;
24
- font-size: 13px;
25
- line-height: 1.5rem;
26
- }
27
-
28
- .editor-line-numbers-content > div {
29
- height: 1.5rem;
30
- }
31
-
32
- .editor-line-numbers-content > div::before {
33
- content: attr(data-line-number);
34
- display: block;
35
- }
36
-
37
- /* Selection styling */
38
- .editor-textarea::selection {
39
- @apply bg-primary/20;
40
- }
41
-
42
- .dark .editor-textarea::selection {
43
- @apply bg-primary/30;
44
- }
45
-
46
- /* Scrollbar styling */
47
- .editor-textarea::-webkit-scrollbar {
48
- @apply w-2;
49
- }
50
-
51
- .editor-textarea::-webkit-scrollbar-track {
52
- @apply bg-transparent;
53
- }
54
-
55
- .editor-textarea::-webkit-scrollbar-thumb {
56
- @apply bg-muted-foreground/20 rounded-full hover:bg-muted-foreground/30;
57
- }