mirror of
https://github.com/spacedriveapp/spacedrive.git
synced 2026-10-31 13:28:42 -04:00
Replaces the Mintlify setup (mint.json, docs.json, snippets) with a standalone Fumadocs app in docs/: Next.js app router, meta.json nav per section, its own bun install. Run with `just dev-docs`. Content pass alongside the migration: core architecture, data model, CLI, and networking pages rewritten around the daemon/source-store/ library split, new product-direction.mdx defining the product boundary, new drive-catalog plan, and the physical-drives plan updated to reference it. Whitepaper page retired.
60 lines
1.5 KiB
TypeScript
60 lines
1.5 KiB
TypeScript
import {llms, loader} from 'fumadocs-core/source';
|
|
import {lucideIconsPlugin} from 'fumadocs-core/source/lucide-icons';
|
|
import {metaSchema, pageSchema} from 'fumadocs-core/source/schema';
|
|
import {defineDocs} from 'fumadocs-mdx/macro';
|
|
import {z} from 'zod';
|
|
import {docsRoute} from './shared';
|
|
|
|
// Content lives at the repo's docs root, alongside internal plans and design
|
|
// notes that stay out of the site. Only the published sections are collected.
|
|
const docs = defineDocs({
|
|
dir: '.',
|
|
docs: {
|
|
schema: pageSchema.extend({
|
|
sidebarTitle: z.string().optional()
|
|
}),
|
|
files: ['{overview,core,extensions,cli,react,gpui}/**/*.mdx'],
|
|
postprocess: {
|
|
includeProcessedMarkdown: true
|
|
}
|
|
},
|
|
meta: {
|
|
schema: metaSchema,
|
|
files: [
|
|
'meta.json',
|
|
'{overview,core,extensions,cli,react,gpui}/**/meta.json'
|
|
]
|
|
}
|
|
});
|
|
|
|
export const source = loader({
|
|
baseUrl: docsRoute,
|
|
source: docs.toFumadocsSource(),
|
|
plugins: [lucideIconsPlugin()],
|
|
pageTree: {
|
|
transformers: [
|
|
{
|
|
// Pages can set `sidebarTitle` to show a shorter name in the sidebar
|
|
// than the full page title.
|
|
file(node, filePath) {
|
|
if (!filePath) return node;
|
|
const file = this.storage.read(filePath);
|
|
if (file?.format === 'page') {
|
|
const {sidebarTitle} = file.data as {
|
|
sidebarTitle?: string;
|
|
};
|
|
if (sidebarTitle) node.name = sidebarTitle;
|
|
}
|
|
return node;
|
|
}
|
|
}
|
|
]
|
|
}
|
|
});
|
|
|
|
export const docsLlms = llms(source, {
|
|
renderPage: async (page) => `# ${page.data.title} (${page.url})
|
|
|
|
${await page.data.getText('processed')}`
|
|
});
|