Skip to content

Commit 0fd7651

Browse files
committed
feat: add mcp to sync-docs
1 parent 41b34aa commit 0fd7651

File tree

3 files changed

+26
-13
lines changed

3 files changed

+26
-13
lines changed

apps/svelte.dev/scripts/sync-docs/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# sync-docs
22

3-
Documentation lives in external repos (at the time of writing, [`sveltejs/svelte`](https://github.com/sveltejs/svelte), [`sveltejs/kit`](https://github.com/sveltejs/kit) and [`sveltejs/cli`](https://github.com/sveltejs/cli), though the plan is to add others) and synced into this repo.
3+
Documentation lives in external repos (at the time of writing, [`sveltejs/svelte`](https://github.com/sveltejs/svelte), [`sveltejs/kit`](https://github.com/sveltejs/kit), [`sveltejs/cli`](https://github.com/sveltejs/cli) and [`sveltejs/mcp`](https://github.com/sveltejs/mcp), though the plan is to add others) and synced into this repo.
44

55
The repos must be cloned (or linked — see [next section](#setup)) into the `apps/svelte.dev/repos` directory.
66

@@ -24,6 +24,8 @@ New-Item -Path .\repos\kit -ItemType SymbolicLink -Value /path/to/wherever/you/c
2424
New-Item -Path .\repos\cli -ItemType SymbolicLink -Value /path/to/wherever/you/cloned/sveltejs/cli
2525
```
2626

27+
The path needs to be absolute to work properly.
28+
2729
## Syncing
2830

2931
To run the `sync-docs` script locally:

apps/svelte.dev/scripts/sync-docs/index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,14 @@ const packages: Package[] = [
149149
pkg: 'packages/cli',
150150
docs: 'documentation/docs',
151151
types: null
152+
},
153+
{
154+
name: 'mcp',
155+
repo: `${parsed.values.owner}/mcp`,
156+
branch: branches['mcp'] ?? 'main',
157+
pkg: 'packages/mcp-stdio',
158+
docs: 'documentation/docs',
159+
types: null
152160
}
153161
];
154162

apps/svelte.dev/src/routes/+layout.server.ts

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,22 @@ const nav_links: NavigationLink[] = [
99
{
1010
title: 'Docs',
1111
slug: 'docs',
12-
sections: [docs.topics['docs/svelte'], docs.topics['docs/kit'], docs.topics['docs/cli']].map(
13-
(topic) => ({
14-
title: topic.metadata.title,
15-
path: '/' + topic.slug, // this will make the UI show a flyout menu for the docs nav entry
16-
sections: topic.children.map((section) => ({
17-
title: section.metadata.title,
18-
sections: section.children.map((page) => ({
19-
title: page.metadata.title,
20-
path: '/' + page.slug
21-
}))
12+
sections: [
13+
docs.topics['docs/svelte'],
14+
docs.topics['docs/kit'],
15+
docs.topics['docs/cli'],
16+
docs.topics['docs/mcp']
17+
].map((topic) => ({
18+
title: topic.metadata.title,
19+
path: '/' + topic.slug, // this will make the UI show a flyout menu for the docs nav entry
20+
sections: topic.children.map((section) => ({
21+
title: section.metadata.title,
22+
sections: section.children.map((page) => ({
23+
title: page.metadata.title,
24+
path: '/' + page.slug
2225
}))
23-
})
24-
)
26+
}))
27+
}))
2528
},
2629
{
2730
title: 'Tutorial',

0 commit comments

Comments
 (0)