@raybase/docs 0.0.2 → 0.1.2
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/dist/cli.d.ts +8 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +9 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/install.d.ts +35 -0
- package/dist/install.d.ts.map +1 -0
- package/dist/install.js +29 -0
- package/dist/install.js.map +1 -0
- package/package.json +38 -8
- package/templates/astro-emdash/content/docs/getting-started.mdx +13 -0
- package/templates/astro-emdash/content/docs/index.mdx +13 -0
- package/templates/astro-emdash/content/docs/mcp.mdx +11 -0
- package/templates/astro-emdash/content/docs/meta.json +4 -0
- package/templates/astro-emdash/site/content/docs/getting-started.mdx +12 -0
- package/templates/astro-emdash/site/content/docs/index.mdx +12 -0
- package/templates/astro-emdash/site/content/docs/mcp.mdx +10 -0
- package/templates/astro-emdash/site/content/docs/meta.json +4 -0
- package/templates/astro-emdash/site/source.config.ts +10 -0
- package/templates/astro-emdash/site/src/docs/docs-assets.ts +1 -0
- package/templates/astro-emdash/site/src/docs/docs-client.tsx +22 -0
- package/templates/astro-emdash/site/src/docs/docs-data.ts +24 -0
- package/templates/astro-emdash/site/src/docs/docs-handler.tsx +105 -0
- package/templates/astro-emdash/site/src/docs/docs-layout.tsx +56 -0
- package/templates/astro-emdash/site/src/docs/docs-mdx.tsx +79 -0
- package/templates/astro-emdash/site/src/docs/docs-page-actions.tsx +146 -0
- package/templates/astro-emdash/site/src/docs/docs-page.tsx +70 -0
- package/templates/astro-emdash/site/src/docs/llm-text.ts +61 -0
- package/templates/astro-emdash/site/src/docs/source.ts +7 -0
- package/templates/astro-emdash/site/src/pages/docs/[...slug].ts +6 -0
- package/templates/astro-emdash/site/src/pages/docs/api/markdown.ts +4 -0
- package/templates/astro-emdash/site/src/pages/docs/api/search.ts +4 -0
- package/templates/astro-emdash/site/src/pages/llms.txt.ts +8 -0
- package/templates/astro-emdash/site/src/styles-docs.css +3 -0
- package/templates/astro-emdash/source.config.ts +10 -0
- package/templates/astro-emdash/src/docs/docs-assets.ts +1 -0
- package/templates/astro-emdash/src/docs/docs-client.tsx +22 -0
- package/templates/astro-emdash/src/docs/docs-data.ts +24 -0
- package/templates/astro-emdash/src/docs/docs-handler.tsx +105 -0
- package/templates/astro-emdash/src/docs/docs-layout.tsx +56 -0
- package/templates/astro-emdash/src/docs/docs-mdx.tsx +79 -0
- package/templates/astro-emdash/src/docs/docs-page-actions.tsx +146 -0
- package/templates/astro-emdash/src/docs/docs-page.tsx +70 -0
- package/templates/astro-emdash/src/docs/llm-text.ts +61 -0
- package/templates/astro-emdash/src/docs/source.ts +7 -0
- package/templates/astro-emdash/src/routes/docs/$.tsx +22 -0
- package/templates/astro-emdash/src/routes/docs/api/markdown.ts +12 -0
- package/templates/astro-emdash/src/routes/docs/api/search.ts +12 -0
- package/templates/astro-emdash/src/routes/docs.index.tsx +22 -0
- package/templates/astro-emdash/src/routes/docs.tsx +22 -0
- package/templates/astro-emdash/src/styles-docs.css +3 -0
- package/templates/react-router/app/components/mdx.tsx +79 -0
- package/templates/react-router/app/lib/layout.shared.tsx +54 -0
- package/templates/react-router/app/lib/source.ts +7 -0
- package/templates/react-router/app/routes/docs.$.tsx +49 -0
- package/templates/react-router/app/routes/docs.api.search.ts +10 -0
- package/templates/react-router/app/routes/docs.tsx +13 -0
- package/templates/react-router/content/docs/getting-started.mdx +8 -0
- package/templates/react-router/content/docs/index.mdx +8 -0
- package/templates/react-router/content/docs/mcp.mdx +121 -0
- package/templates/react-router/content/docs/meta.json +4 -0
- package/templates/react-router/source.config.ts +5 -0
- package/templates/tanstack-start/content/docs/getting-started.mdx +10 -0
- package/templates/tanstack-start/content/docs/index.mdx +8 -0
- package/templates/tanstack-start/content/docs/mcp.mdx +121 -0
- package/templates/tanstack-start/content/docs/meta.json +4 -0
- package/templates/tanstack-start/source.config.ts +10 -0
- package/templates/tanstack-start/src/docs/docs-assets.ts +1 -0
- package/templates/tanstack-start/src/docs/docs-client.tsx +22 -0
- package/templates/tanstack-start/src/docs/docs-data.ts +24 -0
- package/templates/tanstack-start/src/docs/docs-handler.tsx +105 -0
- package/templates/tanstack-start/src/docs/docs-layout.tsx +56 -0
- package/templates/tanstack-start/src/docs/docs-mdx.tsx +79 -0
- package/templates/tanstack-start/src/docs/docs-page-actions.tsx +146 -0
- package/templates/tanstack-start/src/docs/docs-page.tsx +70 -0
- package/templates/tanstack-start/src/docs/llm-text.ts +61 -0
- package/templates/tanstack-start/src/docs/source.ts +7 -0
- package/templates/tanstack-start/src/routes/docs/$.tsx +22 -0
- package/templates/tanstack-start/src/routes/docs/api/markdown.ts +12 -0
- package/templates/tanstack-start/src/routes/docs/api/search.ts +12 -0
- package/templates/tanstack-start/src/routes/docs.index.tsx +22 -0
- package/templates/tanstack-start/src/routes/docs.tsx +22 -0
- package/templates/tanstack-start/src/styles-docs.css +3 -0
- package/README.md +0 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Itself & Co
|
|
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/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,eAAe,CAAC;IAC7B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAEF,wBAAgB,aAAa,IAAI,aAAa,CAO7C"}
|
package/dist/cli.js
ADDED
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAOA,MAAM,UAAU,aAAa;IAC3B,OAAO;QACL,EAAE,EAAE,MAAM;QACV,WAAW,EAAE,eAAe;QAC5B,QAAQ,EAAE,EAAE;QACZ,WAAW,EAAE,CAAC,MAAM,CAAC;KACtB,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type RaybaseModule } from "@raybase/core";
|
|
2
|
+
export type DocsPlacement = "spine" | "site";
|
|
3
|
+
export type DocsAudience = "signed-in" | "public";
|
|
4
|
+
export type DocsModuleOptions = {
|
|
5
|
+
placement?: DocsPlacement;
|
|
6
|
+
audience?: DocsAudience;
|
|
7
|
+
pathPrefix?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare function docsModule<Env = any>(options?: DocsModuleOptions): RaybaseModule<Env>;
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAExE,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,MAAM,CAAC;AAC7C,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,QAAQ,CAAC;AAElD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,wBAAgB,UAAU,CAAC,GAAG,GAAG,GAAG,EAAE,OAAO,GAAE,iBAAsB,GAAG,aAAa,CAAC,GAAG,CAAC,CAWzF"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { defineRaybaseModule } from "@raybase/core";
|
|
2
|
+
export function docsModule(options = {}) {
|
|
3
|
+
const placement = options.placement ?? "spine";
|
|
4
|
+
const audience = options.audience ?? (placement === "site" ? "public" : "signed-in");
|
|
5
|
+
const pathPrefix = options.pathPrefix ?? "/docs";
|
|
6
|
+
return defineRaybaseModule({
|
|
7
|
+
id: "docs",
|
|
8
|
+
packageName: "@raybase/docs",
|
|
9
|
+
runtime: () => ({
|
|
10
|
+
agentSurfaces: [{ surface: "docs", pathPrefix, owner: placement, audience }]
|
|
11
|
+
})
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAsB,MAAM,eAAe,CAAC;AAWxE,MAAM,UAAU,UAAU,CAAY,UAA6B,EAAE;IACnE,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC;IAC/C,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,CAAC,SAAS,KAAK,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;IACrF,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC;IACjD,OAAO,mBAAmB,CAAC;QACzB,EAAE,EAAE,MAAM;QACV,WAAW,EAAE,eAAe;QAC5B,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;YACd,aAAa,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC;SAC7E,CAAC;KACH,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export type DocsInstallOptions = {
|
|
2
|
+
template?: "tanstack-start" | "react-router" | "astro-emdash";
|
|
3
|
+
placement?: "spine" | "site";
|
|
4
|
+
};
|
|
5
|
+
export declare const docsModuleManifest: {
|
|
6
|
+
readonly schemaVersion: 1;
|
|
7
|
+
readonly id: "docs";
|
|
8
|
+
readonly name: "Raybase Docs";
|
|
9
|
+
readonly packageName: "@raybase/docs";
|
|
10
|
+
readonly version: "0.1.0";
|
|
11
|
+
readonly skills: readonly ["raybase-docs-writing"];
|
|
12
|
+
readonly commands: readonly [];
|
|
13
|
+
readonly doctorHooks: readonly ["docs"];
|
|
14
|
+
};
|
|
15
|
+
export declare const docsModuleInstaller: {
|
|
16
|
+
readonly schemaVersion: 1;
|
|
17
|
+
readonly id: "docs";
|
|
18
|
+
readonly name: "Raybase Docs";
|
|
19
|
+
readonly packageName: "@raybase/docs";
|
|
20
|
+
readonly version: "0.1.0";
|
|
21
|
+
readonly skills: readonly ["raybase-docs-writing"];
|
|
22
|
+
readonly commands: readonly [];
|
|
23
|
+
readonly doctorHooks: readonly ["docs"];
|
|
24
|
+
};
|
|
25
|
+
export declare function docsInstallRecipe(_options?: DocsInstallOptions): {
|
|
26
|
+
dependencies: string[];
|
|
27
|
+
devDependencies: string[];
|
|
28
|
+
packageTargets: {
|
|
29
|
+
path: string;
|
|
30
|
+
dependencies: string[];
|
|
31
|
+
devDependencies: string[];
|
|
32
|
+
}[];
|
|
33
|
+
skills: string[];
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=install.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,EAAE,gBAAgB,GAAG,cAAc,GAAG,cAAc,CAAC;IAC9D,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;;;;;;CASrB,CAAC;AAEX,eAAO,MAAM,mBAAmB;;;;;;;;;CAAqB,CAAC;AAEtD,wBAAgB,iBAAiB,CAAC,QAAQ,GAAE,kBAAuB;;;;;;;;;EAiBlE"}
|
package/dist/install.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export const docsModuleManifest = {
|
|
2
|
+
schemaVersion: 1,
|
|
3
|
+
id: "docs",
|
|
4
|
+
name: "Raybase Docs",
|
|
5
|
+
packageName: "@raybase/docs",
|
|
6
|
+
version: "0.1.0",
|
|
7
|
+
skills: ["raybase-docs-writing"],
|
|
8
|
+
commands: [],
|
|
9
|
+
doctorHooks: ["docs"]
|
|
10
|
+
};
|
|
11
|
+
export const docsModuleInstaller = docsModuleManifest;
|
|
12
|
+
export function docsInstallRecipe(_options = {}) {
|
|
13
|
+
const placement = _options.placement ?? "spine";
|
|
14
|
+
const rootDependencies = ["@raybase/docs"];
|
|
15
|
+
const fumadocsDependencies = ["fumadocs-core", "fumadocs-ui", "lucide-react"];
|
|
16
|
+
const fumadocsDevDependencies = ["fumadocs-mdx", "@types/mdx"];
|
|
17
|
+
return {
|
|
18
|
+
dependencies: placement === "site" ? rootDependencies : [...rootDependencies, ...fumadocsDependencies],
|
|
19
|
+
devDependencies: placement === "site" ? [] : fumadocsDevDependencies,
|
|
20
|
+
packageTargets: placement === "site"
|
|
21
|
+
? [
|
|
22
|
+
{ path: "package.json", dependencies: rootDependencies, devDependencies: [] },
|
|
23
|
+
{ path: "site/package.json", dependencies: fumadocsDependencies, devDependencies: fumadocsDevDependencies }
|
|
24
|
+
]
|
|
25
|
+
: [{ path: "package.json", dependencies: [...rootDependencies, ...fumadocsDependencies], devDependencies: fumadocsDevDependencies }],
|
|
26
|
+
skills: ["raybase-docs-writing"]
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=install.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.js","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,aAAa,EAAE,CAAC;IAChB,EAAE,EAAE,MAAM;IACV,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,eAAe;IAC5B,OAAO,EAAE,OAAO;IAChB,MAAM,EAAE,CAAC,sBAAsB,CAAC;IAChC,QAAQ,EAAE,EAAE;IACZ,WAAW,EAAE,CAAC,MAAM,CAAC;CACb,CAAC;AAEX,MAAM,CAAC,MAAM,mBAAmB,GAAG,kBAAkB,CAAC;AAEtD,MAAM,UAAU,iBAAiB,CAAC,WAA+B,EAAE;IACjE,MAAM,SAAS,GAAG,QAAQ,CAAC,SAAS,IAAI,OAAO,CAAC;IAChD,MAAM,gBAAgB,GAAG,CAAC,eAAe,CAAC,CAAC;IAC3C,MAAM,oBAAoB,GAAG,CAAC,eAAe,EAAE,aAAa,EAAE,cAAc,CAAC,CAAC;IAC9E,MAAM,uBAAuB,GAAG,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;IAC/D,OAAO;QACL,YAAY,EAAE,SAAS,KAAK,MAAM,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,GAAG,gBAAgB,EAAE,GAAG,oBAAoB,CAAC;QACtG,eAAe,EAAE,SAAS,KAAK,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,uBAAuB;QACpE,cAAc,EACZ,SAAS,KAAK,MAAM;YAClB,CAAC,CAAC;gBACE,EAAE,IAAI,EAAE,cAAc,EAAE,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,EAAE,EAAE;gBAC7E,EAAE,IAAI,EAAE,mBAAmB,EAAE,YAAY,EAAE,oBAAoB,EAAE,eAAe,EAAE,uBAAuB,EAAE;aAC5G;YACH,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,YAAY,EAAE,CAAC,GAAG,gBAAgB,EAAE,GAAG,oBAAoB,CAAC,EAAE,eAAe,EAAE,uBAAuB,EAAE,CAAC;QACxI,MAAM,EAAE,CAAC,sBAAsB,CAAC;KACjC,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,16 +1,46 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@raybase/docs",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
5
|
-
"license": "
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "First-party Raybase Docs module for generated Fumadocs documentation.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./install": {
|
|
15
|
+
"types": "./dist/install.d.ts",
|
|
16
|
+
"default": "./dist/install.js"
|
|
17
|
+
},
|
|
18
|
+
"./cli": {
|
|
19
|
+
"types": "./dist/cli.d.ts",
|
|
20
|
+
"default": "./dist/cli.js"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"dist",
|
|
25
|
+
"templates"
|
|
26
|
+
],
|
|
27
|
+
"peerDependencies": {
|
|
28
|
+
"@raybase/core": "0.3.3"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"typescript": "^5.8.3",
|
|
32
|
+
"@raybase/core": "0.3.3"
|
|
33
|
+
},
|
|
6
34
|
"repository": {
|
|
7
35
|
"type": "git",
|
|
8
|
-
"url": "git+https://github.com/raybasedev/raybase.git"
|
|
36
|
+
"url": "git+https://github.com/raybasedev/raybase.git",
|
|
37
|
+
"directory": "packages/docs"
|
|
9
38
|
},
|
|
10
39
|
"publishConfig": {
|
|
11
40
|
"access": "public"
|
|
12
41
|
},
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
}
|
|
42
|
+
"scripts": {
|
|
43
|
+
"build": "tsc -p tsconfig.json",
|
|
44
|
+
"check": "tsc -p tsconfig.json --noEmit"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Opening the CMS
|
|
3
|
+
description: Sign in and start editing pages.
|
|
4
|
+
public: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Sign in with the account your team gave you, then open the public site and choose CMS from the signed-in menu.
|
|
8
|
+
|
|
9
|
+
Start with Pages. Open an existing draft to review the editing pattern, or create a page when you need a new public URL.
|
|
10
|
+
|
|
11
|
+
Use the page content field to arrange reusable sections. Each section owns its own copy, media, links, and display options.
|
|
12
|
+
|
|
13
|
+
Preview before publishing. If a page needs a new reusable section or a layout change, note the goal clearly and ask the project maintainer to add the building block.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Editing the site
|
|
3
|
+
description: A quick map for signed-in content editors.
|
|
4
|
+
public: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
The CMS is where signed-in editors manage public site pages, drafts, media, and reusable page sections.
|
|
8
|
+
|
|
9
|
+
Use the CMS link in the signed-in site menu to open the editing workspace. If the link is not visible, ask the person who manages access to invite you or adjust your role.
|
|
10
|
+
|
|
11
|
+
Most pages are built from a title, slug, metadata, and a sequence of reusable sections. Edit copy and media in the CMS, preview changes, then publish when the page is ready.
|
|
12
|
+
|
|
13
|
+
Keep structural changes deliberate. If you need a new section type, navigation pattern, layout, or data-backed block, ask the project maintainer to add it safely.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Connecting an assistant
|
|
3
|
+
description: How signed-in members can connect an approved assistant.
|
|
4
|
+
public: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Some apps let signed-in members connect an approved AI assistant through the app's `/mcp` endpoint.
|
|
8
|
+
|
|
9
|
+
Only connect assistants you trust. The assistant should explain what it can read or change before you approve a task.
|
|
10
|
+
|
|
11
|
+
If the connection fails, confirm you are signed in and ask the project maintainer whether assistant access is enabled for your role.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Finding and updating pages
|
|
3
|
+
description: Navigate published pages and make safe CMS edits.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Use the site navigation to find published pages. Editors can sign in, open the CMS from the site menu, and work with drafts before publishing.
|
|
7
|
+
|
|
8
|
+
Start with Pages. Open an existing draft to review the editing pattern, or create a page when you need a new public URL.
|
|
9
|
+
|
|
10
|
+
Use the page content field to arrange reusable sections. Each section owns its own copy, media, links, and display options.
|
|
11
|
+
|
|
12
|
+
Preview before publishing. If a page needs a new reusable section or a layout change, note the goal clearly and ask the project maintainer to add the building block.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Using the site
|
|
3
|
+
description: A quick map for readers and signed-in editors.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
The site is built from pages, reusable sections, and published media. Visitors can read published pages, while signed-in editors can open the CMS to manage drafts and updates.
|
|
7
|
+
|
|
8
|
+
Editors use the CMS link in the signed-in site menu. If the link is not visible, ask the person who manages access to invite you or adjust your role.
|
|
9
|
+
|
|
10
|
+
Most pages are built from a title, slug, metadata, and a sequence of reusable sections. Edit copy and media in the CMS, preview changes, then publish when the page is ready.
|
|
11
|
+
|
|
12
|
+
Keep structural changes deliberate. If you need a new section type, navigation pattern, layout, or data-backed block, ask the project maintainer to add it safely.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Connecting an assistant
|
|
3
|
+
description: How signed-in members can connect an approved assistant.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Some apps let signed-in members connect an approved AI assistant through the app's `/mcp` endpoint.
|
|
7
|
+
|
|
8
|
+
Only connect assistants you trust. The assistant should explain what it can read or change before you approve a task.
|
|
9
|
+
|
|
10
|
+
If the connection fails, confirm you are signed in and ask the project maintainer whether assistant access is enabled for your role.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const docsClientScriptSrc = import.meta.env.DEV ? "/src/docs/docs-client.tsx" : "/assets/raybase-docs-client.js";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import "@vitejs/plugin-react/preamble";
|
|
2
|
+
import { StrictMode, startTransition } from "react";
|
|
3
|
+
import { hydrateRoot } from "react-dom/client";
|
|
4
|
+
import { DocsRoot, preloadDocsContent, type DocsPageData } from "./docs-page";
|
|
5
|
+
|
|
6
|
+
const root = document.getElementById("raybase-docs-root");
|
|
7
|
+
const dataScript = document.getElementById("raybase-docs-page-data");
|
|
8
|
+
|
|
9
|
+
if (root && dataScript?.textContent) {
|
|
10
|
+
const data = JSON.parse(dataScript.textContent) as DocsPageData;
|
|
11
|
+
|
|
12
|
+
startTransition(() => {
|
|
13
|
+
void preloadDocsContent(data).then(() => {
|
|
14
|
+
hydrateRoot(
|
|
15
|
+
root,
|
|
16
|
+
<StrictMode>
|
|
17
|
+
<DocsRoot data={data} />
|
|
18
|
+
</StrictMode>
|
|
19
|
+
);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { SerializedPageTree } from "fumadocs-core/source/client";
|
|
2
|
+
import type { DocsPageData } from "./docs-page";
|
|
3
|
+
import { preloadDocsContent } from "./docs-page";
|
|
4
|
+
import { source } from "./source";
|
|
5
|
+
|
|
6
|
+
export async function loadDocsPageTree(): Promise<SerializedPageTree> {
|
|
7
|
+
return source.serializePageTree(source.getPageTree());
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export async function loadDocsPageData(slugs: string[]): Promise<DocsPageData | null> {
|
|
11
|
+
const page = source.getPage(slugs);
|
|
12
|
+
if (!page) return null;
|
|
13
|
+
|
|
14
|
+
const data = {
|
|
15
|
+
path: page.path,
|
|
16
|
+
url: page.url,
|
|
17
|
+
title: page.data.title,
|
|
18
|
+
description: page.data.description,
|
|
19
|
+
pageTree: await loadDocsPageTree()
|
|
20
|
+
} satisfies DocsPageData;
|
|
21
|
+
|
|
22
|
+
await preloadDocsContent(data);
|
|
23
|
+
return data;
|
|
24
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { createFromSource } from "fumadocs-core/search/server";
|
|
2
|
+
import { renderToReadableStream } from "react-dom/server";
|
|
3
|
+
import docsCss from "../styles-docs.css?inline";
|
|
4
|
+
import { docsClientScriptSrc } from "./docs-assets";
|
|
5
|
+
import { loadDocsPageData, loadDocsPageTree } from "./docs-data";
|
|
6
|
+
import { DocsRoot, type DocsPageData } from "./docs-page";
|
|
7
|
+
import { getDocsMarkdownResponse, getDocsSlugs } from "./llm-text";
|
|
8
|
+
import { source } from "./source";
|
|
9
|
+
|
|
10
|
+
const docsThemeInitScript =
|
|
11
|
+
"(function(){try{var t=localStorage.getItem('theme');var d=t==='dark'||((!t||t==='system')&&matchMedia('(prefers-color-scheme: dark)').matches);document.documentElement.classList.toggle('dark',d);}catch(e){}})();";
|
|
12
|
+
|
|
13
|
+
const search = createFromSource(source, {
|
|
14
|
+
language: "english"
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export async function handleDocsRequest(request: Request): Promise<Response> {
|
|
18
|
+
const url = new URL(request.url);
|
|
19
|
+
|
|
20
|
+
if (url.pathname === "/docs/api/search") {
|
|
21
|
+
return search.GET(request);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (url.pathname === "/docs/api/markdown") {
|
|
25
|
+
const response = await getDocsMarkdownResponse(url.searchParams.get("path"));
|
|
26
|
+
return response ?? new Response("Not found", { status: 404 });
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (/\.mdx?$/.test(url.pathname)) {
|
|
30
|
+
const response = await getDocsMarkdownResponse(url.pathname);
|
|
31
|
+
return response ?? new Response("Not found", { status: 404 });
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const data = await loadDocsPageData(getDocsSlugs(url.pathname));
|
|
35
|
+
if (!data) {
|
|
36
|
+
return docsHtmlResponse(
|
|
37
|
+
{
|
|
38
|
+
path: "",
|
|
39
|
+
url: url.pathname,
|
|
40
|
+
title: "Docs page not found",
|
|
41
|
+
pageTree: await loadDocsPageTree()
|
|
42
|
+
},
|
|
43
|
+
"<main class=\"mx-auto flex min-h-screen max-w-3xl flex-col justify-center px-6 py-16\"><p class=\"text-sm font-medium text-fd-muted-foreground\">404</p><h1 class=\"mt-3 text-3xl font-semibold text-fd-foreground\">Docs page not found</h1><p class=\"mt-3 text-fd-muted-foreground\">The requested documentation page does not exist.</p><a class=\"mt-6 inline-flex text-sm font-medium text-fd-primary underline-offset-4 hover:underline\" href=\"/docs\">Back to docs</a></main>",
|
|
44
|
+
404
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return docsHtmlResponse(data, await renderDocsBody(data));
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
async function renderDocsBody(data: DocsPageData): Promise<string> {
|
|
52
|
+
const stream = await renderToReadableStream(<DocsRoot data={cloneDocsPageData(data)} />);
|
|
53
|
+
await stream.allReady;
|
|
54
|
+
return new Response(stream).text();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function cloneDocsPageData(data: DocsPageData): DocsPageData {
|
|
58
|
+
return JSON.parse(JSON.stringify(data)) as DocsPageData;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function docsHtmlResponse(data: DocsPageData, body: string, status = 200): Response {
|
|
62
|
+
const html = `<!doctype html>
|
|
63
|
+
<html lang="en">
|
|
64
|
+
<head>
|
|
65
|
+
<meta charset="utf-8" />
|
|
66
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
67
|
+
<title>${escapeHtml(data.title)}</title>
|
|
68
|
+
<script>${docsThemeInitScript}</script>
|
|
69
|
+
<style id="raybase-docs-styles">${docsCss}</style>
|
|
70
|
+
</head>
|
|
71
|
+
<body>
|
|
72
|
+
<div id="raybase-docs-root">${body}</div>
|
|
73
|
+
<script type="application/json" id="raybase-docs-page-data">${escapeJson(data)}</script>
|
|
74
|
+
<script type="module" async src="${docsClientScriptSrc}"></script>
|
|
75
|
+
</body>
|
|
76
|
+
</html>`;
|
|
77
|
+
|
|
78
|
+
return new Response(html, {
|
|
79
|
+
status,
|
|
80
|
+
headers: {
|
|
81
|
+
"content-type": "text/html; charset=utf-8"
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function escapeJson(value: unknown): string {
|
|
87
|
+
return JSON.stringify(value).replace(/</g, "\\u003c");
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function escapeHtml(value: string): string {
|
|
91
|
+
return value.replace(/[&<>"']/g, (char) => {
|
|
92
|
+
switch (char) {
|
|
93
|
+
case "&":
|
|
94
|
+
return "&";
|
|
95
|
+
case "<":
|
|
96
|
+
return "<";
|
|
97
|
+
case ">":
|
|
98
|
+
return ">";
|
|
99
|
+
case "\"":
|
|
100
|
+
return """;
|
|
101
|
+
default:
|
|
102
|
+
return "'";
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { DocsLayoutProps } from "fumadocs-ui/layouts/docs";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
import { ThemeSwitch } from "fumadocs-ui/layouts/shared/slots/theme-switch";
|
|
4
|
+
import { ArrowLeft } from "lucide-react";
|
|
5
|
+
import { appConfig } from "../raybase.config";
|
|
6
|
+
|
|
7
|
+
const appHomeHref = "/";
|
|
8
|
+
|
|
9
|
+
export function baseOptions(): Omit<DocsLayoutProps, "children" | "tree"> {
|
|
10
|
+
return {
|
|
11
|
+
nav: {
|
|
12
|
+
title: DocsNavTitle,
|
|
13
|
+
url: appHomeHref
|
|
14
|
+
},
|
|
15
|
+
sidebar: {
|
|
16
|
+
footer: <DocsSidebarFooter />
|
|
17
|
+
},
|
|
18
|
+
themeSwitch: {
|
|
19
|
+
enabled: false
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function DocsNavTitle({ className, href = appHomeHref, ...props }: ComponentProps<"a">) {
|
|
25
|
+
return (
|
|
26
|
+
<div className={className}>
|
|
27
|
+
<div className="inline-flex min-w-0 flex-col items-start gap-0.5 leading-none">
|
|
28
|
+
<a
|
|
29
|
+
{...props}
|
|
30
|
+
href={href}
|
|
31
|
+
title={`Back to ${appConfig.appName}`}
|
|
32
|
+
className="max-w-44 truncate rounded-sm text-[0.9375rem] font-semibold leading-none text-fd-foreground underline-offset-4 transition-colors hover:text-fd-primary hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fd-ring"
|
|
33
|
+
>
|
|
34
|
+
{appConfig.appName}
|
|
35
|
+
</a>
|
|
36
|
+
<span className="text-[0.6875rem] font-medium leading-none text-fd-muted-foreground">Docs</span>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function DocsSidebarFooter() {
|
|
43
|
+
return (
|
|
44
|
+
<div className="mt-2 flex min-w-0 items-center justify-between gap-3 border-t pt-3">
|
|
45
|
+
<a
|
|
46
|
+
href={appHomeHref}
|
|
47
|
+
title={`Back to ${appConfig.appName}`}
|
|
48
|
+
className="inline-flex min-w-0 items-center gap-1.5 rounded-md px-1 py-1 text-xs font-medium text-fd-muted-foreground transition-colors hover:text-fd-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fd-ring"
|
|
49
|
+
>
|
|
50
|
+
<ArrowLeft className="size-3.5 shrink-0" aria-hidden="true" />
|
|
51
|
+
<span className="truncate">Back to app</span>
|
|
52
|
+
</a>
|
|
53
|
+
<ThemeSwitch className="shrink-0 p-0" />
|
|
54
|
+
</div>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { CodeBlock, Pre } from "fumadocs-ui/components/codeblock";
|
|
2
|
+
import defaultMdxComponents from "fumadocs-ui/mdx";
|
|
3
|
+
import type { MDXComponents } from "mdx/types";
|
|
4
|
+
|
|
5
|
+
interface McpServerUrlProps {
|
|
6
|
+
path?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
interface ClaudeMcpAddCommandProps extends McpServerUrlProps {
|
|
10
|
+
name?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface CodexMcpAddCommandProps extends McpServerUrlProps {
|
|
14
|
+
name?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function browserOrigin() {
|
|
18
|
+
return typeof window === "undefined" ? "" : window.location.origin;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function currentUrl(path = "/mcp") {
|
|
22
|
+
const origin = browserOrigin();
|
|
23
|
+
return origin ? new URL(path, origin).toString() : path;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function McpServerUrl(props: McpServerUrlProps) {
|
|
27
|
+
return <code suppressHydrationWarning>{currentUrl(props.path)}</code>;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function McpServerUrlBlock(props: McpServerUrlProps) {
|
|
31
|
+
return (
|
|
32
|
+
<CodeBlock>
|
|
33
|
+
<Pre>
|
|
34
|
+
<code suppressHydrationWarning>{currentUrl(props.path)}</code>
|
|
35
|
+
</Pre>
|
|
36
|
+
</CodeBlock>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function ClaudeMcpAddCommand(props: ClaudeMcpAddCommandProps) {
|
|
41
|
+
const command = `claude mcp add --transport http ${props.name ?? "this-app"} "${currentUrl(props.path)}"`;
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<CodeBlock>
|
|
45
|
+
<Pre>
|
|
46
|
+
<code suppressHydrationWarning>{command}</code>
|
|
47
|
+
</Pre>
|
|
48
|
+
</CodeBlock>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function CodexMcpAddCommand(props: CodexMcpAddCommandProps) {
|
|
53
|
+
const command = `codex mcp add ${props.name ?? "this-app"} --url "${currentUrl(props.path)}"`;
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<CodeBlock>
|
|
57
|
+
<Pre>
|
|
58
|
+
<code suppressHydrationWarning>{command}</code>
|
|
59
|
+
</Pre>
|
|
60
|
+
</CodeBlock>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function getMDXComponents(components?: MDXComponents) {
|
|
65
|
+
return {
|
|
66
|
+
...defaultMdxComponents,
|
|
67
|
+
McpServerUrl,
|
|
68
|
+
McpServerUrlBlock,
|
|
69
|
+
ClaudeMcpAddCommand,
|
|
70
|
+
CodexMcpAddCommand,
|
|
71
|
+
...components
|
|
72
|
+
} satisfies MDXComponents;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export const useMDXComponents = getMDXComponents;
|
|
76
|
+
|
|
77
|
+
declare global {
|
|
78
|
+
type MDXProvidedComponents = ReturnType<typeof getMDXComponents>;
|
|
79
|
+
}
|