create-opendocs 0.1.0 → 0.1.1
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/README.md +70 -16
- package/package.json +10 -1
- package/template/README.md +1 -0
- package/template/content/guides/getting-started.md +10 -0
- package/template/package-lock.json +2250 -59
- package/template/package.json +12 -11
- package/template/src/app/[[...slug]]/page.tsx +38 -5
- package/template/src/components/MermaidDiagram.tsx +75 -0
package/README.md
CHANGED
|
@@ -2,22 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
`create-opendocs` scaffolds a new OpenDocs-powered documentation site.
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
The generated project is a Next.js docs app with:
|
|
5
|
+
## Quick Start
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
- Sidebar navigation configured in `content/config.json`
|
|
11
|
-
- Markdown and MDX page support
|
|
12
|
-
- A footer CTA block driven by config
|
|
13
|
-
- Static page generation and sitemap support
|
|
7
|
+
Create a new docs site with `npx`:
|
|
14
8
|
|
|
15
|
-
|
|
9
|
+
```bash
|
|
10
|
+
npx create-opendocs my-docs
|
|
11
|
+
```
|
|
16
12
|
|
|
17
|
-
|
|
13
|
+
Then run it locally:
|
|
18
14
|
|
|
19
15
|
```bash
|
|
20
|
-
|
|
16
|
+
cd my-docs
|
|
17
|
+
npm run dev
|
|
21
18
|
```
|
|
22
19
|
|
|
23
20
|
Create a project with custom defaults:
|
|
@@ -26,12 +23,18 @@ Create a project with custom defaults:
|
|
|
26
23
|
npx create-opendocs my-docs --site-name "My Docs" --support-email docs@example.com --site-url https://docs.example.com
|
|
27
24
|
```
|
|
28
25
|
|
|
29
|
-
|
|
26
|
+
## What It Creates
|
|
30
27
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
The generated project is a Next.js docs app with:
|
|
29
|
+
|
|
30
|
+
- File-based content in `content/`
|
|
31
|
+
- Sidebar navigation configured in `content/config.json`
|
|
32
|
+
- Markdown and MDX page support
|
|
33
|
+
- Mermaid diagram support with fenced `mermaid` blocks
|
|
34
|
+
- A footer CTA block driven by config
|
|
35
|
+
- Static page generation and sitemap support
|
|
36
|
+
|
|
37
|
+
The generated project includes starter docs content, sidebar configuration, and a working homepage out of the box.
|
|
35
38
|
|
|
36
39
|
## Options
|
|
37
40
|
|
|
@@ -42,6 +45,57 @@ npm run dev
|
|
|
42
45
|
- `--no-install`: skip `npm install`
|
|
43
46
|
- `--force`: allow copying into a non-empty directory
|
|
44
47
|
|
|
48
|
+
## Generated Project
|
|
49
|
+
|
|
50
|
+
After scaffolding, the generated app is a normal Next.js project. The main files you’ll edit are:
|
|
51
|
+
|
|
52
|
+
- `content/config.json`: homepage, sidebar, and footer settings
|
|
53
|
+
- `content/`: Markdown and MDX docs content
|
|
54
|
+
- `src/app/`: app shell and page routes
|
|
55
|
+
- `src/lib/docs.ts`: docs loading and sidebar generation
|
|
56
|
+
|
|
57
|
+
## Editing Config After Creation
|
|
58
|
+
|
|
59
|
+
After the project is created, you can update the docs structure in `content/config.json`.
|
|
60
|
+
|
|
61
|
+
Example:
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"homepage": "index.md",
|
|
66
|
+
"sidebar": [
|
|
67
|
+
{
|
|
68
|
+
"title": "Getting Started",
|
|
69
|
+
"items": [
|
|
70
|
+
"index.md",
|
|
71
|
+
"guides/getting-started.md"
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"title": "Reference",
|
|
76
|
+
"items": [
|
|
77
|
+
"api/authentication.md",
|
|
78
|
+
"api/webhooks.mdx"
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
],
|
|
82
|
+
"contactSupport": {
|
|
83
|
+
"title": "Need help?",
|
|
84
|
+
"description": "Contact the docs team if anything is unclear.",
|
|
85
|
+
"buttonText": "Email us",
|
|
86
|
+
"buttonLink": "mailto:docs@example.com"
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
What you can change:
|
|
92
|
+
|
|
93
|
+
- `homepage`: which file renders at `/`
|
|
94
|
+
- `sidebar`: the navigation groups and page order
|
|
95
|
+
- `contactSupport`: the footer title, text, button label, and link
|
|
96
|
+
|
|
97
|
+
To add a page to the nav, create a matching file in `content/` and then add its path to `sidebar.items`.
|
|
98
|
+
|
|
45
99
|
## Repository Layout
|
|
46
100
|
|
|
47
101
|
- `src/create-opendocs.js`: the CLI entrypoint
|
package/package.json
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-opendocs",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Scaffold a new OpenDocs documentation site.",
|
|
5
|
+
"author": "Alex Connolly",
|
|
5
6
|
"license": "MIT",
|
|
6
7
|
"preferGlobal": true,
|
|
8
|
+
"homepage": "https://github.com/AlexConnolly/OpenDocs#readme",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/AlexConnolly/OpenDocs.git"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/AlexConnolly/OpenDocs/issues"
|
|
15
|
+
},
|
|
7
16
|
"bin": {
|
|
8
17
|
"create-opendocs": "./src/create-opendocs.js"
|
|
9
18
|
},
|
package/template/README.md
CHANGED
|
@@ -29,6 +29,7 @@ $env:NEXT_PUBLIC_SITE_URL="__SITE_URL__"
|
|
|
29
29
|
- Loads docs from the `content/` folder
|
|
30
30
|
- Builds the sidebar from `content/config.json`
|
|
31
31
|
- Renders Markdown and MDX pages automatically from file paths
|
|
32
|
+
- Supports Mermaid diagrams via fenced `mermaid` code blocks
|
|
32
33
|
- Shows an optional footer CTA from config
|
|
33
34
|
- Generates a sitemap from your docs pages
|
|
34
35
|
|
|
@@ -19,3 +19,13 @@ Open `http://localhost:3000` to view your docs site.
|
|
|
19
19
|
## Add Pages
|
|
20
20
|
|
|
21
21
|
Create Markdown or MDX files in `content/`, then list them in `content/config.json` if you want them to appear in the sidebar.
|
|
22
|
+
|
|
23
|
+
## Mermaid Diagrams
|
|
24
|
+
|
|
25
|
+
Mermaid code fences render automatically:
|
|
26
|
+
|
|
27
|
+
```mermaid
|
|
28
|
+
flowchart TD
|
|
29
|
+
A[Write docs] --> B[Commit changes]
|
|
30
|
+
B --> C[Deploy site]
|
|
31
|
+
```
|