doccupine 0.0.25 → 0.0.26
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/dist/index.js +1 -1
- package/dist/templates/components/MDXComponents.d.ts +1 -1
- package/dist/templates/components/MDXComponents.js +2 -0
- package/dist/templates/components/layout/GlobalStyles.d.ts +1 -1
- package/dist/templates/components/layout/GlobalStyles.js +4 -0
- package/dist/templates/mdx/index.mdx.d.ts +1 -1
- package/dist/templates/mdx/index.mdx.js +24 -8
- package/dist/templates/package.js +7 -7
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -837,7 +837,7 @@ export default function Home() {
|
|
|
837
837
|
program
|
|
838
838
|
.name("doccupine")
|
|
839
839
|
.description("Watch MDX files and generate Next.js documentation pages automatically")
|
|
840
|
-
.version("0.0.
|
|
840
|
+
.version("0.0.26");
|
|
841
841
|
program
|
|
842
842
|
.command("watch", { isDefault: true })
|
|
843
843
|
.description("Watch a directory for MDX changes and generate Next.js app")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const mdxComponentsTemplate = "import React from \"react\";\ntype MDXComponents = Record<string, React.ComponentType<any>>;\nimport { Code as CodeBlock } from \"@/components/layout/Code\";\nimport { Card } from \"@/components/layout/Card\";\nimport { Accordion } from \"@/components/layout/Accordion\";\nimport { Tabs, TabContent } from \"@/components/layout/Tabs\";\nimport { Callout } from \"@/components/layout/Callout\";\nimport { Icon } from \"@/components/layout/Icon\";\nimport { Columns } from \"@/components/layout/Columns\";\nimport { Field } from \"@/components/layout/Field\";\nimport { Update } from \"@/components/layout/Update\";\nimport { Steps, Step } from \"@/components/layout/Steps\";\nimport { Button } from \"@/components/layout/Button\";\nimport { DemoTheme } from \"@/components/layout/DemoTheme\";\n\nfunction extractAllTextFromChildren(children: React.ReactNode): string {\n if (children == null) return \"\";\n if (typeof children === \"string\") return children;\n if (typeof children === \"number\") return String(children);\n if (typeof children === \"boolean\") return \"\";\n if (Array.isArray(children))\n return children.map(extractAllTextFromChildren).join(\"\");\n if (React.isValidElement(children)) {\n const element = children as React.ReactElement<any>;\n return extractAllTextFromChildren(element.props.children);\n }\n return \"\";\n}\n\nfunction generateId(text: string): string {\n return text\n .toLowerCase()\n .replace(/[^\\w\\s-]/g, \"\")\n .replace(/\\s+/g, \"-\")\n .trim();\n}\n\n// Map <pre><code class=\"language-xyz\"> to our <Code /> component\nfunction Pre(props: any) {\n const child = React.Children.only(\n props.children,\n ) as React.ReactElement<any> | null;\n if (child && child.type === \"code\") {\n const className = child.props.className || \"\";\n const match = /language-(\\w+)/.exec(className);\n const language = match ? match[1] : undefined;\n const code =\n typeof child.props.children === \"string\"\n ? child.props.children.replace(/\\n$/, \"\")\n : String(child.props.children ?? \"\");\n if (language) {\n return (\n <CodeBlock className={className} code={code} language={language} />\n );\n }\n }\n return <pre {...props} />;\n}\n\nexport function useMDXComponents(components: MDXComponents): MDXComponents {\n return {\n // Headings with auto-generated ids for TOC and deep links\n h1: ({ children, ...props }: any) => {\n const id = generateId(extractAllTextFromChildren(children));\n return (\n <h1 id={id} {...props}>\n {children}\n </h1>\n );\n },\n h2: ({ children, ...props }: any) => {\n const id = generateId(extractAllTextFromChildren(children));\n return (\n <h2 id={id} {...props}>\n {children}\n </h2>\n );\n },\n h3: ({ children, ...props }: any) => {\n const id = generateId(extractAllTextFromChildren(children));\n return (\n <h3 id={id} {...props}>\n {children}\n </h3>\n );\n },\n h4: ({ children, ...props }: any) => {\n const id = generateId(extractAllTextFromChildren(children));\n return (\n <h4 id={id} {...props}>\n {children}\n </h4>\n );\n },\n h5: ({ children, ...props }: any) => {\n const id = generateId(extractAllTextFromChildren(children));\n return (\n <h5 id={id} {...props}>\n {children}\n </h5>\n );\n },\n h6: ({ children, ...props }: any) => {\n const id = generateId(extractAllTextFromChildren(children));\n return (\n <h6 id={id} {...props}>\n {children}\n </h6>\n );\n },\n\n // Code blocks\n pre: Pre,\n\n // Expose your custom components for MDX usage\n Card,\n Accordion,\n Tabs,\n TabContent,\n Callout,\n Icon,\n Columns,\n Field,\n Update,\n Steps,\n Step,\n Button,\n DemoTheme,\n ...components,\n };\n}\n";
|
|
1
|
+
export declare const mdxComponentsTemplate = "import React from \"react\";\ntype MDXComponents = Record<string, React.ComponentType<any>>;\nimport { Space } from \"cherry-styled-components/src/lib\";\nimport { Code as CodeBlock } from \"@/components/layout/Code\";\nimport { Card } from \"@/components/layout/Card\";\nimport { Accordion } from \"@/components/layout/Accordion\";\nimport { Tabs, TabContent } from \"@/components/layout/Tabs\";\nimport { Callout } from \"@/components/layout/Callout\";\nimport { Icon } from \"@/components/layout/Icon\";\nimport { Columns } from \"@/components/layout/Columns\";\nimport { Field } from \"@/components/layout/Field\";\nimport { Update } from \"@/components/layout/Update\";\nimport { Steps, Step } from \"@/components/layout/Steps\";\nimport { Button } from \"@/components/layout/Button\";\nimport { DemoTheme } from \"@/components/layout/DemoTheme\";\n\nfunction extractAllTextFromChildren(children: React.ReactNode): string {\n if (children == null) return \"\";\n if (typeof children === \"string\") return children;\n if (typeof children === \"number\") return String(children);\n if (typeof children === \"boolean\") return \"\";\n if (Array.isArray(children))\n return children.map(extractAllTextFromChildren).join(\"\");\n if (React.isValidElement(children)) {\n const element = children as React.ReactElement<any>;\n return extractAllTextFromChildren(element.props.children);\n }\n return \"\";\n}\n\nfunction generateId(text: string): string {\n return text\n .toLowerCase()\n .replace(/[^\\w\\s-]/g, \"\")\n .replace(/\\s+/g, \"-\")\n .trim();\n}\n\n// Map <pre><code class=\"language-xyz\"> to our <Code /> component\nfunction Pre(props: any) {\n const child = React.Children.only(\n props.children,\n ) as React.ReactElement<any> | null;\n if (child && child.type === \"code\") {\n const className = child.props.className || \"\";\n const match = /language-(\\w+)/.exec(className);\n const language = match ? match[1] : undefined;\n const code =\n typeof child.props.children === \"string\"\n ? child.props.children.replace(/\\n$/, \"\")\n : String(child.props.children ?? \"\");\n if (language) {\n return (\n <CodeBlock className={className} code={code} language={language} />\n );\n }\n }\n return <pre {...props} />;\n}\n\nexport function useMDXComponents(components: MDXComponents): MDXComponents {\n return {\n // Headings with auto-generated ids for TOC and deep links\n h1: ({ children, ...props }: any) => {\n const id = generateId(extractAllTextFromChildren(children));\n return (\n <h1 id={id} {...props}>\n {children}\n </h1>\n );\n },\n h2: ({ children, ...props }: any) => {\n const id = generateId(extractAllTextFromChildren(children));\n return (\n <h2 id={id} {...props}>\n {children}\n </h2>\n );\n },\n h3: ({ children, ...props }: any) => {\n const id = generateId(extractAllTextFromChildren(children));\n return (\n <h3 id={id} {...props}>\n {children}\n </h3>\n );\n },\n h4: ({ children, ...props }: any) => {\n const id = generateId(extractAllTextFromChildren(children));\n return (\n <h4 id={id} {...props}>\n {children}\n </h4>\n );\n },\n h5: ({ children, ...props }: any) => {\n const id = generateId(extractAllTextFromChildren(children));\n return (\n <h5 id={id} {...props}>\n {children}\n </h5>\n );\n },\n h6: ({ children, ...props }: any) => {\n const id = generateId(extractAllTextFromChildren(children));\n return (\n <h6 id={id} {...props}>\n {children}\n </h6>\n );\n },\n\n // Code blocks\n pre: Pre,\n\n // Expose your custom components for MDX usage\n Card,\n Accordion,\n Tabs,\n TabContent,\n Callout,\n Icon,\n Columns,\n Field,\n Update,\n Steps,\n Step,\n Button,\n DemoTheme,\n Space,\n ...components,\n };\n}\n";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export const mdxComponentsTemplate = `import React from "react";
|
|
2
2
|
type MDXComponents = Record<string, React.ComponentType<any>>;
|
|
3
|
+
import { Space } from "cherry-styled-components/src/lib";
|
|
3
4
|
import { Code as CodeBlock } from "@/components/layout/Code";
|
|
4
5
|
import { Card } from "@/components/layout/Card";
|
|
5
6
|
import { Accordion } from "@/components/layout/Accordion";
|
|
@@ -126,6 +127,7 @@ export function useMDXComponents(components: MDXComponents): MDXComponents {
|
|
|
126
127
|
Step,
|
|
127
128
|
Button,
|
|
128
129
|
DemoTheme,
|
|
130
|
+
Space,
|
|
129
131
|
...components,
|
|
130
132
|
};
|
|
131
133
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const globalStylesTemplate = "\"use client\";\nimport { createGlobalStyle } from \"styled-components\";\n\nconst GlobalStyles = createGlobalStyle`\nhtml,\nbody {\n margin: 0;\n padding: 0;\n min-height: 100%;\n scroll-behavior: smooth;\n background-color: ${({ theme }) => theme.colors.light};\n scroll-padding-top: 20px;\n}\n\nbody {\n font-family: \"Inter\", sans-serif;\n -moz-osx-font-smoothing: grayscale;\n -webkit-text-size-adjust: 100%;\n -webkit-font-smoothing: antialiased;\n}\n\n:root {\n interpolate-size: allow-keywords;\n}\n\n* {\n box-sizing: border-box;\n min-width: 0;\n}\n\npre,\ncode,\nkbd,\nsamp {\n font-family: monospace, monospace;\n}\n\npre,\ncode,\nkbd,\nsamp,\nblockquote,\np,\na,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\nul li,\nol li {\n margin: 0;\n padding: 0;\n color: ${({ theme }) => theme.colors.dark};\n}\n\na {\n color: ${({ theme }) => (theme.isDark ? theme.colors.dark : theme.colors.primary)};\n}\n\nol,\nul {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\nfigure {\n margin: 0;\n}\n\nfieldset {\n appearance: none;\n border: none;\n}\n\nbutton,\ninput,\na,\nimg,\nsvg,\nsvg * {\n transition: all 0.3s ease;\n}\n\nstrong,\nb {\n font-weight: 700;\n}`;\n\nexport { GlobalStyles };";
|
|
1
|
+
export declare const globalStylesTemplate = "\"use client\";\nimport { createGlobalStyle } from \"styled-components\";\n\nconst GlobalStyles = createGlobalStyle`\nhtml,\nbody {\n margin: 0;\n padding: 0;\n min-height: 100%;\n scroll-behavior: smooth;\n background-color: ${({ theme }) => theme.colors.light};\n scroll-padding-top: 20px;\n}\n\nbody {\n font-family: \"Inter\", sans-serif;\n -moz-osx-font-smoothing: grayscale;\n -webkit-text-size-adjust: 100%;\n -webkit-font-smoothing: antialiased;\n}\n\n:root {\n interpolate-size: allow-keywords;\n}\n\n* {\n box-sizing: border-box;\n min-width: 0;\n}\n\npre,\ncode,\nkbd,\nsamp {\n font-family: monospace, monospace;\n}\n\npre,\ncode,\nkbd,\nsamp,\nblockquote,\np,\na,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\nul li,\nol li {\n margin: 0;\n padding: 0;\n color: ${({ theme }) => theme.colors.dark};\n}\n\na {\n color: ${({ theme }) => (theme.isDark ? theme.colors.dark : theme.colors.primary)};\n}\n\nol,\nul {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\nfigure {\n margin: 0;\n}\n\nfieldset {\n appearance: none;\n border: none;\n}\n\nbutton,\ninput,\na,\nimg,\nsvg,\nsvg * {\n transition: all 0.3s ease;\n}\n\nstrong,\nb {\n font-weight: 700;\n}\n\n.full-width {\n width: 100%;\n}`;\n\nexport { GlobalStyles };";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const indexMdxTemplate = "---\ntitle: \"Getting Started\"\ndescription: \"Doccupine is a free and open-source document management system that allows you to store, organize, and share your documentation with ease.\"\ndate: \"2025-01-15\"\ncategory: \"General\"\ncategoryOrder: 0\norder: 0\n---\n# Welcome to Doccupine\
|
|
1
|
+
export declare const indexMdxTemplate = "---\ntitle: \"Getting Started\"\ndescription: \"Doccupine is a free and open-source document management system that allows you to store, organize, and share your documentation with ease.\"\ndate: \"2025-01-15\"\ncategory: \"General\"\ncategoryOrder: 0\norder: 0\n---\n# Welcome to Doccupine\nUsing Doccupine, you simply create your documentation in MDX files with traditional Markdown syntax, Doccupine monitors your changes automatically generating a beautiful, modern documentation website.\n\n## Features\n\n<Columns cols={2}>\n <Card>\n <img src=\"https://doccupine.com/mdx.svg\" alt=\"Markdown-based content\" className=\"full-width\" />\n <Space $size={12} />\n Markdown-based content\n </Card>\n <Card>\n <img src=\"https://doccupine.com/structure.svg\" alt=\"Built-in file structure\" className=\"full-width\" />\n <Space $size={12} />\n Built-in file structure\n </Card>\n <Card>\n <img src=\"https://doccupine.com/live-reload.svg\" alt=\"Live Preview & Auto-Update\" className=\"full-width\" />\n <Space $size={12} />\n Live Preview & Auto-Update\n </Card>\n <Card>\n <img src=\"https://doccupine.com/deployment.svg\" alt=\"Easy Deployment\" className=\"full-width\" />\n <Space $size={12} />\n Easy Deployment\n </Card>\n</Columns>\n\n## Getting Started\n\nTo get started with Doccupine, make sure you have [Node.js](https://nodejs.org) and npm installed on your machine. Then, follow these steps:\n\n- **Run Doccupine CLI:**\n\nCreate a new directory for your project and navigate to it in your terminal. Run the following command to create a new Doccupine project:\n\n```bash\nnpx doccupine\n```\n\nOnce you run the command, Doccupine will ask you to select a directory to store your MDX files. Choose the directory where you want to create your documentation files.\nAfter selecting the directory, Doccupine will ask you to enter the name of the directory for the generated website. Enter the name of the directory where you want to create your website.\n\nThis will start the development server on port 3000. Open your browser and navigate to http://localhost:3000 to view your documentation.\n\n## Start documenting\nStart documenting your project by editing the **index.mdx** file in the choosen MDX directory.\n\nIn your MDX directory, you can structure your content using folders and files. Doccupine will automatically generate a navigation menu based on the configured categories and order.\n";
|
|
@@ -7,16 +7,32 @@ categoryOrder: 0
|
|
|
7
7
|
order: 0
|
|
8
8
|
---
|
|
9
9
|
# Welcome to Doccupine
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
## Open Source and Extensible
|
|
13
|
-
Doccupine is built on open standards, enabling customization and extensibility for different documentation needs. You stay in control of your content, with the option to host docs yourself and tailor the website’s look and features to match your organization’s requirements.
|
|
10
|
+
Using Doccupine, you simply create your documentation in MDX files with traditional Markdown syntax, Doccupine monitors your changes automatically generating a beautiful, modern documentation website.
|
|
14
11
|
|
|
15
12
|
## Features
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
-
|
|
13
|
+
|
|
14
|
+
<Columns cols={2}>
|
|
15
|
+
<Card>
|
|
16
|
+
<img src="https://doccupine.com/mdx.svg" alt="Markdown-based content" className="full-width" />
|
|
17
|
+
<Space $size={12} />
|
|
18
|
+
Markdown-based content
|
|
19
|
+
</Card>
|
|
20
|
+
<Card>
|
|
21
|
+
<img src="https://doccupine.com/structure.svg" alt="Built-in file structure" className="full-width" />
|
|
22
|
+
<Space $size={12} />
|
|
23
|
+
Built-in file structure
|
|
24
|
+
</Card>
|
|
25
|
+
<Card>
|
|
26
|
+
<img src="https://doccupine.com/live-reload.svg" alt="Live Preview & Auto-Update" className="full-width" />
|
|
27
|
+
<Space $size={12} />
|
|
28
|
+
Live Preview & Auto-Update
|
|
29
|
+
</Card>
|
|
30
|
+
<Card>
|
|
31
|
+
<img src="https://doccupine.com/deployment.svg" alt="Easy Deployment" className="full-width" />
|
|
32
|
+
<Space $size={12} />
|
|
33
|
+
Easy Deployment
|
|
34
|
+
</Card>
|
|
35
|
+
</Columns>
|
|
20
36
|
|
|
21
37
|
## Getting Started
|
|
22
38
|
|
|
@@ -9,22 +9,22 @@ export const packageJsonTemplate = JSON.stringify({
|
|
|
9
9
|
lint: "next lint",
|
|
10
10
|
},
|
|
11
11
|
dependencies: {
|
|
12
|
-
next: "16.0.
|
|
13
|
-
react: "19.2.
|
|
14
|
-
"react-dom": "19.2.
|
|
12
|
+
next: "16.0.8",
|
|
13
|
+
react: "19.2.1",
|
|
14
|
+
"react-dom": "19.2.1",
|
|
15
15
|
},
|
|
16
16
|
devDependencies: {
|
|
17
17
|
"@mdx-js/react": "^3.1.1",
|
|
18
|
-
"@types/node": "^
|
|
18
|
+
"@types/node": "^25",
|
|
19
19
|
"@types/react": "^19",
|
|
20
20
|
"@types/react-dom": "^19",
|
|
21
21
|
"cherry-styled-components": "^0.1.0-43",
|
|
22
22
|
eslint: "^9",
|
|
23
|
-
"eslint-config-next": "16.0.
|
|
24
|
-
"lucide-react": "^0.
|
|
23
|
+
"eslint-config-next": "16.0.8",
|
|
24
|
+
"lucide-react": "^0.559.0",
|
|
25
25
|
"next-mdx-remote": "^5.0.0",
|
|
26
26
|
polished: "^4.3.1",
|
|
27
|
-
prettier: "^3.
|
|
27
|
+
prettier: "^3.7.4",
|
|
28
28
|
"rehype-highlight": "^7.0.2",
|
|
29
29
|
"rehype-parse": "^9.0.1",
|
|
30
30
|
"rehype-stringify": "^10.0.1",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "doccupine",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.26",
|
|
4
4
|
"description": "Generate beautiful, ready-to-use documentation with just one CLI command – fast, simple, and open source.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"chalk": "^5.6.2",
|
|
33
|
-
"chokidar": "^
|
|
33
|
+
"chokidar": "^5.0.0",
|
|
34
34
|
"commander": "^14.0.2",
|
|
35
35
|
"fs-extra": "^11.3.2",
|
|
36
36
|
"gray-matter": "^4.0.3",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/chokidar": "^2.1.7",
|
|
41
41
|
"@types/fs-extra": "^11.0.4",
|
|
42
|
-
"@types/node": "^
|
|
42
|
+
"@types/node": "^25.0.0",
|
|
43
43
|
"@types/prompts": "^2.4.9",
|
|
44
44
|
"typescript": "^5.9.3"
|
|
45
45
|
},
|