create-notestack 0.0.0-stage → 0.1.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.
- package/LICENSE +21 -0
- package/README.md +24 -2
- package/index.js +95 -0
- package/package.json +37 -4
- package/template/README.md +40 -0
- package/template/app/(home)/layout.tsx +12 -0
- package/template/app/(home)/page.tsx +7 -0
- package/template/app/api/search/route.ts +5 -0
- package/template/app/docs/[[...slug]]/page.tsx +9 -0
- package/template/app/docs/layout.tsx +12 -0
- package/template/app/global.css +2 -0
- package/template/app/icon.svg +27 -0
- package/template/app/layout.tsx +19 -0
- package/template/app/llms-full.txt/route.ts +5 -0
- package/template/app/llms.mdx/[...path]/route.ts +10 -0
- package/template/app/llms.txt/route.ts +5 -0
- package/template/app/og/docs/[...slug]/route.tsx +9 -0
- package/template/content/docs/example/index.mdx +38 -0
- package/template/content/docs/example/meta.json +5 -0
- package/template/content/docs/example/second-page.mdx +10 -0
- package/template/content/docs/glossary.mdx +9 -0
- package/template/content/docs/index.mdx +62 -0
- package/template/content/docs/meta.json +3 -0
- package/template/content/glossary.json +12 -0
- package/template/gitignore +26 -0
- package/template/lib/source.ts +26 -0
- package/template/next.config.mjs +6 -0
- package/template/package.json +32 -0
- package/template/postcss.config.mjs +7 -0
- package/template/site.config.ts +23 -0
- package/template/tsconfig.json +34 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 yx-elite
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
-
#
|
|
1
|
+
# create-notestack
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Creates a new [Notestack](https://github.com/yx-elite/notestack) study-notes site.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm create notestack@latest my-notes
|
|
7
|
+
cd my-notes
|
|
8
|
+
npm run dev
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Then open http://localhost:3000, edit `site.config.ts` and write your notes in `content/docs/`.
|
|
12
|
+
|
|
13
|
+
## What it does
|
|
14
|
+
|
|
15
|
+
1. Copies the Notestack starter into a new folder (`my-notes` above). Leave the name out and it asks.
|
|
16
|
+
2. Names the site after the folder: `stock-trading-notes` becomes "Stock Trading Notes".
|
|
17
|
+
3. Runs `npm install`. Add `--no-install` to skip it.
|
|
18
|
+
|
|
19
|
+
It never writes into a folder that already has files in it.
|
|
20
|
+
|
|
21
|
+
Needs Node.js 22 or later.
|
|
22
|
+
|
|
23
|
+
## License
|
|
24
|
+
|
|
25
|
+
MIT
|
package/index.js
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// npm create notestack@latest my-notes
|
|
3
|
+
// Copies the starter into a new folder, names the site after the folder and installs it.
|
|
4
|
+
import { spawnSync } from "node:child_process";
|
|
5
|
+
import {
|
|
6
|
+
cpSync,
|
|
7
|
+
existsSync,
|
|
8
|
+
readdirSync,
|
|
9
|
+
readFileSync,
|
|
10
|
+
renameSync,
|
|
11
|
+
writeFileSync,
|
|
12
|
+
} from "node:fs";
|
|
13
|
+
import { basename, join, resolve } from "node:path";
|
|
14
|
+
import { createInterface } from "node:readline/promises";
|
|
15
|
+
import { fileURLToPath } from "node:url";
|
|
16
|
+
|
|
17
|
+
const args = process.argv.slice(2);
|
|
18
|
+
const install = !args.includes("--no-install");
|
|
19
|
+
let folder = args.find((arg) => !arg.startsWith("--"));
|
|
20
|
+
|
|
21
|
+
// 1. The folder name: from the command, or ask for it
|
|
22
|
+
if (!folder) {
|
|
23
|
+
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
24
|
+
folder =
|
|
25
|
+
(await rl.question("Folder for your notes site (my-notes): ")).trim() ||
|
|
26
|
+
"my-notes";
|
|
27
|
+
rl.close();
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const target = resolve(folder);
|
|
31
|
+
const slug = basename(target)
|
|
32
|
+
.toLowerCase()
|
|
33
|
+
.replace(/[^a-z0-9._-]+/g, "-");
|
|
34
|
+
const title = slug
|
|
35
|
+
.split(/[-_.]+/)
|
|
36
|
+
.filter(Boolean)
|
|
37
|
+
.map((word) => word[0].toUpperCase() + word.slice(1))
|
|
38
|
+
.join(" ");
|
|
39
|
+
|
|
40
|
+
// 2. Never write into a folder that already has files in it
|
|
41
|
+
if (existsSync(target) && readdirSync(target).length > 0) {
|
|
42
|
+
console.error(
|
|
43
|
+
`${folder} already exists and isn't empty. Choose another name.`,
|
|
44
|
+
);
|
|
45
|
+
process.exit(1);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// 3. Copy the starter, and give .gitignore its real name back
|
|
49
|
+
const template = fileURLToPath(new URL("./template", import.meta.url));
|
|
50
|
+
cpSync(template, target, { recursive: true });
|
|
51
|
+
renameSync(join(target, "gitignore"), join(target, ".gitignore"));
|
|
52
|
+
|
|
53
|
+
// 4. package.json: the site's own name, and the theme version that matches this command
|
|
54
|
+
const own = JSON.parse(
|
|
55
|
+
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
|
|
56
|
+
);
|
|
57
|
+
const pkgPath = join(target, "package.json");
|
|
58
|
+
const pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
|
|
59
|
+
pkg.name = slug;
|
|
60
|
+
pkg.dependencies['@yx-elite/notestack'] = `^${own.version}`;
|
|
61
|
+
writeFileSync(pkgPath, `${JSON.stringify(pkg, null, 2)}\n`);
|
|
62
|
+
|
|
63
|
+
// 5. site.config.ts: the site's name, from the folder name ("my-notes" → "My Notes")
|
|
64
|
+
const configPath = join(target, "site.config.ts");
|
|
65
|
+
writeFileSync(
|
|
66
|
+
configPath,
|
|
67
|
+
readFileSync(configPath, "utf8").replace(
|
|
68
|
+
"name: 'My Notes',",
|
|
69
|
+
`name: '${title}',`,
|
|
70
|
+
),
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
console.log(`\nCreated ${title} in ${target}`);
|
|
74
|
+
|
|
75
|
+
// 6. Install the packages (skip with --no-install)
|
|
76
|
+
if (install) {
|
|
77
|
+
console.log("Installing packages, this takes a minute…\n");
|
|
78
|
+
const result = spawnSync("npm", ["install"], {
|
|
79
|
+
cwd: target,
|
|
80
|
+
stdio: "inherit",
|
|
81
|
+
shell: process.platform === "win32",
|
|
82
|
+
});
|
|
83
|
+
if (result.status !== 0) {
|
|
84
|
+
console.error(`\nnpm install failed. Run it yourself inside ${folder}.`);
|
|
85
|
+
process.exit(1);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// 7. What to do next
|
|
90
|
+
console.log(`
|
|
91
|
+
Next:
|
|
92
|
+
cd ${folder}${install ? "" : "\n npm install"}
|
|
93
|
+
npm run dev
|
|
94
|
+
|
|
95
|
+
Then open http://localhost:3000, edit site.config.ts and write notes in content/docs/.`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-notestack",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Create a Notestack study-notes site: npm create notestack@latest my-notes",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"notestack",
|
|
7
|
+
"fumadocs",
|
|
8
|
+
"create",
|
|
9
|
+
"starter",
|
|
10
|
+
"study-notes"
|
|
11
|
+
],
|
|
12
|
+
"homepage": "https://github.com/yx-elite/notestack#readme",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/yx-elite/notestack/issues"
|
|
15
|
+
},
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"author": "Yi Xian Lan <exian0716@gmail.com> (https://github.com/yx-elite)",
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/yx-elite/notestack.git",
|
|
21
|
+
"directory": "packages/create-notestack"
|
|
22
|
+
},
|
|
23
|
+
"type": "module",
|
|
24
|
+
"bin": {
|
|
25
|
+
"create-notestack": "index.js"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"index.js",
|
|
29
|
+
"template",
|
|
30
|
+
"LICENSE"
|
|
31
|
+
],
|
|
32
|
+
"engines": {
|
|
33
|
+
"node": ">=22"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"template": "node scripts/copy-starter.js",
|
|
37
|
+
"prepack": "npm run template"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# My Notes
|
|
2
|
+
|
|
3
|
+
Study notes written in Markdown and published as a static website, made with [Notestack](https://github.com/yx-elite/notestack) (a theme for [Fumadocs](https://fumadocs.dev)).
|
|
4
|
+
|
|
5
|
+
## Run it
|
|
6
|
+
|
|
7
|
+
You need [Node.js](https://nodejs.org) 22 or later.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install # once, after cloning
|
|
11
|
+
npm run dev # the site at http://localhost:3000, updating as you save
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Write
|
|
15
|
+
|
|
16
|
+
| What | Where |
|
|
17
|
+
| --- | --- |
|
|
18
|
+
| Notes | `content/docs/`, one `.mdx` file per page |
|
|
19
|
+
| Sidebar order and sections | `meta.json` in each folder |
|
|
20
|
+
| Glossary terms | `content/glossary.json` |
|
|
21
|
+
| Site name, links, colour | `site.config.ts` |
|
|
22
|
+
|
|
23
|
+
Everything else (`app/`, `lib/`, the config files) is a few lines that load the theme. You don't need to edit it.
|
|
24
|
+
|
|
25
|
+
## Publish
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm run build # the whole site as plain files in out/
|
|
29
|
+
npm start # look at out/ locally before you upload it
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Upload `out/` to any static host. The Notestack docs have a [step-by-step guide for each one](https://github.com/yx-elite/notestack/tree/main/playground/content/docs/en/deployment).
|
|
33
|
+
|
|
34
|
+
## Update the theme
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npm update @yx-elite/notestack
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
New versions bring fixes and new features. A version that needs you to change a file says so in the [changelog](https://github.com/yx-elite/notestack/blob/main/packages/notestack/CHANGELOG.md), with the exact edit.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { NotesHomeLayout } from '@yx-elite/notestack';
|
|
3
|
+
import { source } from '@/lib/source';
|
|
4
|
+
import site from '@/site.config';
|
|
5
|
+
|
|
6
|
+
export default function Layout({ children }: { children: ReactNode }) {
|
|
7
|
+
return (
|
|
8
|
+
<NotesHomeLayout site={site} tree={source.getPageTree()}>
|
|
9
|
+
{children}
|
|
10
|
+
</NotesHomeLayout>
|
|
11
|
+
);
|
|
12
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createNotesPage } from '@yx-elite/notestack/routes';
|
|
2
|
+
import { source } from '@/lib/source';
|
|
3
|
+
import site from '@/site.config';
|
|
4
|
+
|
|
5
|
+
const docs = createNotesPage({ source, site });
|
|
6
|
+
|
|
7
|
+
export default docs.Page;
|
|
8
|
+
export const generateStaticParams = docs.generateStaticParams;
|
|
9
|
+
export const generateMetadata = docs.generateMetadata;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { NotesLayout } from '@yx-elite/notestack';
|
|
3
|
+
import { source } from '@/lib/source';
|
|
4
|
+
import site from '@/site.config';
|
|
5
|
+
|
|
6
|
+
export default function Layout({ children }: { children: ReactNode }) {
|
|
7
|
+
return (
|
|
8
|
+
<NotesLayout site={site} tree={source.getPageTree()}>
|
|
9
|
+
{children}
|
|
10
|
+
</NotesLayout>
|
|
11
|
+
);
|
|
12
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="1.75 1.75 20.5 20.5">
|
|
2
|
+
<!-- Notestack mark in black and white: NotesLogo with the accent replaced by the text colour.
|
|
3
|
+
Black on light browser themes, white on dark ones. -->
|
|
4
|
+
<style>
|
|
5
|
+
.bg { stop-color: #fff; }
|
|
6
|
+
.fg { stop-color: #000; }
|
|
7
|
+
.line { stroke: #000; }
|
|
8
|
+
.fill { fill: #fff; }
|
|
9
|
+
@media (prefers-color-scheme: dark) {
|
|
10
|
+
.bg { stop-color: #000; }
|
|
11
|
+
.fg { stop-color: #fff; }
|
|
12
|
+
.line { stroke: #fff; }
|
|
13
|
+
.fill { fill: #000; }
|
|
14
|
+
}
|
|
15
|
+
</style>
|
|
16
|
+
<defs>
|
|
17
|
+
<linearGradient id="g" gradientUnits="userSpaceOnUse" x1="-6.7" y1="0" x2="6.7" y2="0">
|
|
18
|
+
<stop offset="15%" class="bg"/>
|
|
19
|
+
<stop offset="85%" class="fg"/>
|
|
20
|
+
</linearGradient>
|
|
21
|
+
</defs>
|
|
22
|
+
<g stroke-width="1.5" vector-effect="non-scaling-stroke">
|
|
23
|
+
<rect class="line fill" x="-6.7" y="-6.7" width="13.4" height="13.4" rx="2.6" opacity="0.45" transform="translate(12 16.4) scale(1 0.5) rotate(45)" vector-effect="non-scaling-stroke" stroke-width="1.5"/>
|
|
24
|
+
<rect class="line fill" x="-6.7" y="-6.7" width="13.4" height="13.4" rx="2.6" opacity="0.75" transform="translate(12 12) scale(1 0.5) rotate(45)" vector-effect="non-scaling-stroke" stroke-width="1.5"/>
|
|
25
|
+
<rect class="line" fill="url(#g)" x="-6.7" y="-6.7" width="13.4" height="13.4" rx="2.6" transform="translate(12 7.6) scale(1 0.5) rotate(45)" vector-effect="non-scaling-stroke" stroke-width="1.5"/>
|
|
26
|
+
</g>
|
|
27
|
+
</svg>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Geist, JetBrains_Mono } from 'next/font/google';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
import { NotesRoot, notesMetadata } from '@yx-elite/notestack';
|
|
4
|
+
import site from '@/site.config';
|
|
5
|
+
import './global.css';
|
|
6
|
+
|
|
7
|
+
// Geist for text, JetBrains Mono for code (the same as fumadocs.dev)
|
|
8
|
+
const sans = Geist({ subsets: ['latin'], variable: '--font-sans' });
|
|
9
|
+
const mono = JetBrains_Mono({ subsets: ['latin'], variable: '--font-mono' });
|
|
10
|
+
|
|
11
|
+
export const metadata = notesMetadata(site);
|
|
12
|
+
|
|
13
|
+
export default function Layout({ children }: { children: ReactNode }) {
|
|
14
|
+
return (
|
|
15
|
+
<NotesRoot site={site} className={`${sans.variable} ${mono.variable}`}>
|
|
16
|
+
{children}
|
|
17
|
+
</NotesRoot>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { llmsPageRoute } from '@yx-elite/notestack/routes';
|
|
2
|
+
import { source } from '@/lib/source';
|
|
3
|
+
|
|
4
|
+
const pages = llmsPageRoute(source);
|
|
5
|
+
|
|
6
|
+
export const revalidate = false;
|
|
7
|
+
// other paths are 404s, never cached responses
|
|
8
|
+
export const dynamicParams = false;
|
|
9
|
+
export const GET = pages.GET;
|
|
10
|
+
export const generateStaticParams = pages.generateStaticParams;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ogImageRoute } from '@yx-elite/notestack/routes';
|
|
2
|
+
import { source } from '@/lib/source';
|
|
3
|
+
import site from '@/site.config';
|
|
4
|
+
|
|
5
|
+
const og = ogImageRoute({ source, site });
|
|
6
|
+
|
|
7
|
+
export const revalidate = false;
|
|
8
|
+
export const GET = og.GET;
|
|
9
|
+
export const generateStaticParams = og.generateStaticParams;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Example topic
|
|
3
|
+
description: A sample note. Copy what you need, then delete this folder.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
A note is plain Markdown. The theme styles every part of it: headings, lists, tables, code and the components below.
|
|
7
|
+
|
|
8
|
+
## Key points
|
|
9
|
+
|
|
10
|
+
- A **bold word** stands out from the paler body text.
|
|
11
|
+
- Links to other notes use the file path: see the [second page](./second-page.mdx).
|
|
12
|
+
- `inline code` for commands and names.
|
|
13
|
+
|
|
14
|
+
<Callout type="warn" title="Exam tip">
|
|
15
|
+
Callouts come in five types: `info`, `warn`, `error`, `success` and `idea`. Each has its own colour and icon.
|
|
16
|
+
</Callout>
|
|
17
|
+
|
|
18
|
+
<Callout type="idea" color="teal" icon="Sparkles" title="Your own colour and icon">
|
|
19
|
+
`color` takes a named colour such as `teal` or `accent`, or any CSS colour. `icon` takes any Lucide icon name.
|
|
20
|
+
</Callout>
|
|
21
|
+
|
|
22
|
+
## Compare options
|
|
23
|
+
|
|
24
|
+
| Option | Good for | Watch out for |
|
|
25
|
+
| --- | --- | --- |
|
|
26
|
+
| Option A | Simple setups | Limited control |
|
|
27
|
+
| Option B | Large setups | More to configure |
|
|
28
|
+
|
|
29
|
+
## Code
|
|
30
|
+
|
|
31
|
+
```bash title="Terminal"
|
|
32
|
+
npm run dev
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
<Tabs items={['Light', 'Dark']}>
|
|
36
|
+
<Tab value="Light">Tabs hold alternatives side by side.</Tab>
|
|
37
|
+
<Tab value="Dark">Only one shows at a time.</Tab>
|
|
38
|
+
</Tabs>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Second page
|
|
3
|
+
description: A second page in the example folder.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Each `.mdx` file in `content/docs/example/` is a page. `"...example"` in `content/docs/meta.json` lists them in the *Notes* section, in the order the folder's own `meta.json` gives.
|
|
7
|
+
|
|
8
|
+
## Use a glossary term
|
|
9
|
+
|
|
10
|
+
Write a definition once in `content/glossary.json` and link to it from any note: [Static site](/docs/glossary#term-static-site).
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Welcome
|
|
3
|
+
description: How this notes site works, and where to start writing.
|
|
4
|
+
icon: House
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
This site is made with [Notestack](https://github.com/yx-elite/notestack), a theme for [Fumadocs](https://fumadocs.dev). Your notes are Markdown files in `content/docs/`, and every change you save shows up straight away while `npm run dev` is running.
|
|
8
|
+
|
|
9
|
+
## Make it yours
|
|
10
|
+
|
|
11
|
+
<Steps>
|
|
12
|
+
<Step>
|
|
13
|
+
|
|
14
|
+
### Name the site
|
|
15
|
+
|
|
16
|
+
Open `site.config.ts` and change `name`, `author`, `description` and `repo`. Uncomment `accent` to pick your own colour.
|
|
17
|
+
|
|
18
|
+
</Step>
|
|
19
|
+
<Step>
|
|
20
|
+
|
|
21
|
+
### Write your first note
|
|
22
|
+
|
|
23
|
+
Add a file to `content/docs/`, for example `content/docs/networking.mdx`:
|
|
24
|
+
|
|
25
|
+
```mdx title="content/docs/networking.mdx"
|
|
26
|
+
---
|
|
27
|
+
title: Networking
|
|
28
|
+
description: How computers find and talk to each other.
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
Your note starts here.
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
It appears in the sidebar, under *Notes*, and in search as soon as you save it.
|
|
35
|
+
|
|
36
|
+
</Step>
|
|
37
|
+
<Step>
|
|
38
|
+
|
|
39
|
+
### Order the sidebar
|
|
40
|
+
|
|
41
|
+
`content/docs/meta.json` lists the pages in order. `---Notes---` starts a section, `...example` adds every page in the `example` folder, and `...` adds every page that isn't listed, in A to Z order. List a page by its file name, without `.mdx`, to put it in a fixed place.
|
|
42
|
+
|
|
43
|
+
</Step>
|
|
44
|
+
<Step>
|
|
45
|
+
|
|
46
|
+
### Delete the samples
|
|
47
|
+
|
|
48
|
+
When you no longer need them, delete `content/docs/example/`, then remove `"...example"` from `meta.json`. Replace the terms in `content/glossary.json` with your own.
|
|
49
|
+
|
|
50
|
+
</Step>
|
|
51
|
+
</Steps>
|
|
52
|
+
|
|
53
|
+
## What else is here
|
|
54
|
+
|
|
55
|
+
<Cards>
|
|
56
|
+
<Card title="Example topic" href="/docs/example" description="A sample note showing callouts, tables, tabs and code." />
|
|
57
|
+
<Card title="Glossary" href="/docs/glossary" description="Every term from content/glossary.json, A to Z." />
|
|
58
|
+
</Cards>
|
|
59
|
+
|
|
60
|
+
<Callout type="info" title="Keep your notes in git">
|
|
61
|
+
Commit and push to save your notes. Each page's *Last updated* date comes from its latest commit.
|
|
62
|
+
</Callout>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"term": "Front matter",
|
|
4
|
+
"definition": "The block between --- lines at the top of a note: its title, description and sidebar icon.",
|
|
5
|
+
"href": "/docs/example",
|
|
6
|
+
"label": "Example topic"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"term": "Static site",
|
|
10
|
+
"definition": "A website made of plain files, built ahead of time, so any file host can serve it with no server."
|
|
11
|
+
}
|
|
12
|
+
]
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# deps
|
|
2
|
+
/node_modules
|
|
3
|
+
|
|
4
|
+
# generated content
|
|
5
|
+
.source
|
|
6
|
+
|
|
7
|
+
# test & build
|
|
8
|
+
/coverage
|
|
9
|
+
/.next/
|
|
10
|
+
/out/
|
|
11
|
+
/build
|
|
12
|
+
*.tsbuildinfo
|
|
13
|
+
|
|
14
|
+
# misc
|
|
15
|
+
.DS_Store
|
|
16
|
+
*.pem
|
|
17
|
+
/.pnp
|
|
18
|
+
.pnp.js
|
|
19
|
+
npm-debug.log*
|
|
20
|
+
yarn-debug.log*
|
|
21
|
+
yarn-error.log*
|
|
22
|
+
|
|
23
|
+
# others
|
|
24
|
+
.env*.local
|
|
25
|
+
.vercel
|
|
26
|
+
next-env.d.ts
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { loader } from 'fumadocs-core/source';
|
|
2
|
+
import { defineDocs } from 'fumadocs-mdx/macro';
|
|
3
|
+
import { metaSchema, pageSchema } from 'fumadocs-core/source/schema';
|
|
4
|
+
import { notesLanguages } from '@yx-elite/notestack';
|
|
5
|
+
import { notesSourcePlugins } from '@yx-elite/notestack/source';
|
|
6
|
+
import site from '@/site.config';
|
|
7
|
+
|
|
8
|
+
const docs = defineDocs({
|
|
9
|
+
dir: 'content/docs',
|
|
10
|
+
docs: {
|
|
11
|
+
schema: pageSchema,
|
|
12
|
+
// Last-updated date from each file's latest git commit
|
|
13
|
+
lastModified: true,
|
|
14
|
+
// The Markdown that "Copy Markdown" and llms.txt serve
|
|
15
|
+
postprocess: { includeProcessedMarkdown: true },
|
|
16
|
+
},
|
|
17
|
+
meta: { schema: metaSchema },
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
// Your notes in content/docs/. With `languages` in site.config.ts, one folder per language (content/docs/en/…).
|
|
21
|
+
export const source = loader({
|
|
22
|
+
i18n: notesLanguages(site),
|
|
23
|
+
baseUrl: '/docs',
|
|
24
|
+
source: docs.toFumadocsSource(),
|
|
25
|
+
plugins: notesSourcePlugins,
|
|
26
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "notestack-starter",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "next dev",
|
|
7
|
+
"build": "next build",
|
|
8
|
+
"start": "serve out",
|
|
9
|
+
"types:check": "next typegen && tsc --noEmit"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@yx-elite/notestack": "*",
|
|
13
|
+
"fumadocs-core": "16.19.7",
|
|
14
|
+
"fumadocs-mdx": "15.6.4",
|
|
15
|
+
"fumadocs-ui": "npm:@fumadocs/base-ui@16.19.7",
|
|
16
|
+
"lucide-react": "^1.71.0",
|
|
17
|
+
"next": "16.4.6",
|
|
18
|
+
"react": "^19.3.1",
|
|
19
|
+
"react-dom": "^19.3.1"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@tailwindcss/postcss": "^4.3.5",
|
|
23
|
+
"@types/mdx": "^2.0.14",
|
|
24
|
+
"@types/node": "^26.6.6",
|
|
25
|
+
"@types/react": "^19.3.0",
|
|
26
|
+
"@types/react-dom": "^19.3.0",
|
|
27
|
+
"postcss": "^8.5.32",
|
|
28
|
+
"serve": "^14.2.7",
|
|
29
|
+
"tailwindcss": "^4.3.5",
|
|
30
|
+
"typescript": "^7.0.2"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { defineSiteConfig } from '@yx-elite/notestack';
|
|
2
|
+
|
|
3
|
+
// Your site's settings: the only code file you need to edit.
|
|
4
|
+
// Every option is explained in the Notestack docs:
|
|
5
|
+
// https://github.com/yx-elite/notestack/blob/main/playground/content/docs/en/configuration.mdx
|
|
6
|
+
export default defineSiteConfig({
|
|
7
|
+
// Shown in the header, the sidebar banner and the browser tab
|
|
8
|
+
name: 'My Notes',
|
|
9
|
+
author: 'your-name',
|
|
10
|
+
// One sentence about the notes (also the description search engines show)
|
|
11
|
+
description: 'My study notes, written in Markdown and published as a fast static site.',
|
|
12
|
+
// Your GitHub repo as "owner/name", for the GitHub links
|
|
13
|
+
repo: 'your-name/my-notes',
|
|
14
|
+
|
|
15
|
+
// The address the site will be served from, for link previews. Add it once you have one.
|
|
16
|
+
// url: 'https://notes.example.com',
|
|
17
|
+
|
|
18
|
+
// A colour for each mode: links, the active page, the glow and the banner follow it
|
|
19
|
+
// accent: { light: '#0092b3', dark: '#3ad1ff' },
|
|
20
|
+
|
|
21
|
+
// A small badge next to the name, e.g. a course code
|
|
22
|
+
// tag: 'NET-101',
|
|
23
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ESNext",
|
|
4
|
+
"lib": ["dom", "dom.iterable", "esnext"],
|
|
5
|
+
"allowJs": true,
|
|
6
|
+
"skipLibCheck": true,
|
|
7
|
+
"strict": true,
|
|
8
|
+
"forceConsistentCasingInFileNames": true,
|
|
9
|
+
"noEmit": true,
|
|
10
|
+
"esModuleInterop": true,
|
|
11
|
+
"module": "esnext",
|
|
12
|
+
"moduleResolution": "bundler",
|
|
13
|
+
"resolveJsonModule": true,
|
|
14
|
+
"isolatedModules": true,
|
|
15
|
+
"jsx": "react-jsx",
|
|
16
|
+
"incremental": true,
|
|
17
|
+
"paths": {
|
|
18
|
+
"@/*": ["./*"]
|
|
19
|
+
},
|
|
20
|
+
"plugins": [
|
|
21
|
+
{
|
|
22
|
+
"name": "next"
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
"include": [
|
|
27
|
+
"next-env.d.ts",
|
|
28
|
+
"**/*.ts",
|
|
29
|
+
"**/*.tsx",
|
|
30
|
+
".next/types/**/*.ts",
|
|
31
|
+
".next/dev/types/**/*.ts"
|
|
32
|
+
],
|
|
33
|
+
"exclude": ["node_modules"]
|
|
34
|
+
}
|