Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/dev/mcp/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,17 +120,18 @@ async function buildPageIndex(library: Library): Promise<PageInfo[]> {
// Read llms.txt to enumerate available pages without downloading them all.
const llmsUrl = `${libBaseUrl(library)}/llms.txt`;
const txt = await fetchText(llmsUrl);
const re = /^\s*-\s*\[([^\]]+)\]\(([^)]+)\)\s*$/;
const re = /^\s*-\s*\[([^\]]+)\]\(([^)]+)\)(?:\s*:\s*(.*))?\s*$/;
for (const line of txt.split(/\r?\n/)) {
const m = line.match(re);
if (!m) {continue;}
const display = (m[1] || '').trim();
const href = (m[2] || '').trim();
const desc = (m[3] || '').trim() || undefined;
if (!href || !/\.md$/i.test(href)) {continue;}
const key = href.replace(/\.md$/i, '').replace(/\\/g, '/');
const title = display || path.basename(key);
const url = `${DEFAULT_CDN_BASE}/${key}.md`;
const info: PageInfo = {key, title, description: undefined, filePath: url, sections: []};
const info: PageInfo = {key, title, description: desc, filePath: url, sections: []};
pages.push(info);
pageCache.set(info.key, info);
}
Expand Down
1 change: 1 addition & 0 deletions packages/dev/s2-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
}
},
"dependencies": {
"@babel/parser": "^7.26.3",
"@parcel/plugin": "^2.16.0",
"@parcel/rsc": "^2.16.0",
"@react-aria/focus": "^3.20.4",
Expand Down
Loading