diff --git a/README.md b/README.md
index 8d684d2..fbec515 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,8 @@
> **Note**: This application is a fork of [AriaDocs](https://github.com/nisabmohd/Aria-Docs), created by [Nisab Mohd](https://github.com/nisabmohd). DocuBook provides an alternative to the documentation solution found on [Mintlify](https://mintlify.com/), utilizing `.mdx` (Markdown + JSX) for content creation and management.
-[](https://vercel.com/import/project?template=https://github.com/mywildancloud/docubook)
+[](https://vercel.com/import/project?template=https://github.com/gitfromwildan/docubook)
## Features
diff --git a/app/blog/page.tsx b/app/blog/page.tsx
index dd5eaec..780cd39 100644
--- a/app/blog/page.tsx
+++ b/app/blog/page.tsx
@@ -16,7 +16,7 @@ export default async function BlogIndexPage() {
(a, b) => stringToDate(b.date).getTime() - stringToDate(a.date).getTime()
);
return (
-
+
Blog Posts
diff --git a/app/hire-me/page.tsx b/app/hire-me/page.tsx
deleted file mode 100644
index 327d889..0000000
--- a/app/hire-me/page.tsx
+++ /dev/null
@@ -1,18 +0,0 @@
-import { getMetadata } from "@/app/layout";
-
-export const metadata = getMetadata({
- title: "Hire Me",
- description: "Hire me to start a documentation project with DocuBook",
-});
-
-export default function EmbeddedHTML() {
- return (
-
-
-
- );
-}
diff --git a/app/playground/page.tsx b/app/playground/page.tsx
index 1c251f8..f2f7a7a 100644
--- a/app/playground/page.tsx
+++ b/app/playground/page.tsx
@@ -29,7 +29,8 @@ import {
Laptop2,
Copy,
Download,
- RotateCcw
+ RotateCcw,
+ Calendar
} from "lucide-react";
import { Button as UIButton } from "@/components/ui/button";
import { cn } from "@/lib/utils";
@@ -38,8 +39,23 @@ import {
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
- DropdownMenuSeparator,
} from "@/components/ui/dropdown-menu";
+import {
+ handleParagraphClick,
+ handleHeading2Click,
+ handleHeading3Click,
+ handleBulletListClick,
+ handleNumberedListClick,
+ handleLinkClick,
+ handleImageClick,
+ handleBlockquoteClick,
+ handleCodeBlockClick,
+ handleTableClick,
+ handleNoteClick,
+ handleComponentClick,
+ handleMetadataClick,
+ } from "@/components/playground/MarkComponent";
+
import "@/styles/editor.css";
const ToolbarButton = ({ icon: Icon, label, onClick }: { icon: any, label: string, onClick?: () => void }) => (
@@ -167,9 +183,7 @@ export default function PlaygroundPage() {
- ), {
- duration: 10000,
- });
+ ), { duration: 10000 });
}
};
@@ -179,149 +193,17 @@ export default function PlaygroundPage() {
const before = markdown.substring(0, start);
const after = markdown.substring(end);
- const newText = before + text + after;
+ // Menambahkan satu baris kosong sebelum dan sesudah komponen
+ const newText = `${before}${text}\n${after}`;
setMarkdown(newText);
requestAnimationFrame(() => {
textArea.focus();
- const newPosition = start + text.length;
+ const newPosition = start + text.length + 1;
textArea.setSelectionRange(newPosition, newPosition);
});
};
- const handleParagraphClick = () => {
- const textArea = document.querySelector('textarea');
- if (textArea) {
- insertAtCursor(textArea, 'this is regular text, **bold text**, *italic text*\n');
- }
- };
-
- const handleHeading2Click = () => {
- const textArea = document.querySelector('textarea');
- if (textArea) {
- insertAtCursor(textArea, '## Heading 2\n');
- }
- };
-
- const handleHeading3Click = () => {
- const textArea = document.querySelector('textarea');
- if (textArea) {
- insertAtCursor(textArea, '### Heading 3\n');
- }
- };
-
- const handleBulletListClick = () => {
- const textArea = document.querySelector('textarea');
- if (textArea) {
- insertAtCursor(textArea, '- List One\n- List Two\n- Other List\n');
- }
- };
-
- const handleNumberedListClick = () => {
- const textArea = document.querySelector('textarea');
- if (textArea) {
- insertAtCursor(textArea, '1. Number One\n2. Number Two\n3. Number Three\n');
- }
- };
-
- const handleLinkClick = () => {
- const textArea = document.querySelector('textarea');
- if (textArea) {
- insertAtCursor(textArea, '[Visit OpenAI](https://www.openai.com)\n');
- }
- };
-
- const handleImageClick = () => {
- const textArea = document.querySelector('textarea');
- if (textArea) {
- insertAtCursor(textArea, '\n');
- }
- };
-
- const handleBlockquoteClick = () => {
- const textArea = document.querySelector('textarea');
- if (textArea) {
- insertAtCursor(textArea, '> The overriding design goal for Markdown\'s formatting syntax is to make it as readable as possible.\n');
- }
- };
-
- const handleCodeBlockClick = () => {
- const textArea = document.querySelector('textarea');
- if (textArea) {
- insertAtCursor(textArea, '```javascript:main.js showLineNumbers {3-4}\nfunction isRocketAboutToCrash() {\n // Check if the rocket is stable\n if (!isStable()) {\n NoCrash(); // Prevent the crash\n }\n}\n```\n');
- }
- };
-
- const handleTableClick = () => {
- const textArea = document.querySelector('textarea');
- if (textArea) {
- insertAtCursor(textArea, `| **Feature** | **Description** |
-| ------------------------------- | ----------------------------------------------------- |
-| MDX Support | Write interactive documentation with MDX. |
-| Nested Pages | Organize content in a nested, hierarchical structure. |
-| Blog Section | Include a dedicated blog section. |
-| Pagination | Split content across multiple pages. |
-
-`);
- }
- };
-
- const handleNoteClick = (type: string) => {
- const textArea = document.querySelector('textarea');
- if (textArea) {
- const noteTemplate = `
\n This is a ${type} message.\n \n`;
- insertAtCursor(textArea, noteTemplate);
- }
- };
-
- const handleComponentClick = (component: string) => {
- const textArea = document.querySelector('textarea');
- if (!textArea) return;
-
- const templates: { [key: string]: string } = {
- stepper: `
-
- Content for step 1
-
-
- Content for step 2
-
- \n`,
- card: `
- This is how you use a card with an icon and a link. Clicking on this card
- brings you to the Card Group page.
- \n`,
- button: `
\n`,
- accordion: `
- this is an example of plain text content from the accordion component and below is markdown ;
- 1. number one
- 2. number two
- 3. number three
- \n`,
- youtube: `
\n`,
- tooltip: `What do you know about
? Create interactive nested documentations using MDX.\n`,
- tabs: `
-
- Tab 1
- Tab 2
-
-
- Content for tab 1
-
-
- Content for tab 2
-
- \n`
- };
-
- insertAtCursor(textArea, templates[component]);
- };
if (isMobile) {
return
;
@@ -402,86 +284,88 @@ export default function PlaygroundPage() {