u
This commit is contained in:
@@ -438,7 +438,7 @@ function renderReadme(operations) {
|
||||
lines.push(`| [\`routes/${op.file}\`](routes/${op.file}) | \`${op.method.toUpperCase()} ${op.path}\` |`);
|
||||
}
|
||||
lines.push('');
|
||||
lines.push('Route overview: [`routes.md`](routes.md).');
|
||||
lines.push('Route overview: [`routes.md`](routes.md) | All routes: [`routes-all.md`](routes-all.md).');
|
||||
lines.push('');
|
||||
lines.push('## Signals (SSE)');
|
||||
lines.push('');
|
||||
@@ -648,9 +648,9 @@ function summarizeOperationReturns(operation) {
|
||||
return parts.join(', ');
|
||||
}
|
||||
|
||||
function renderRoutesOverview(operations) {
|
||||
function renderRoutesOverview(operations, title = 'Dash API Routes Overview') {
|
||||
const lines = [];
|
||||
lines.push('# Dash API Routes Overview');
|
||||
lines.push(`# ${title}`);
|
||||
lines.push('');
|
||||
lines.push(`Overview of all ${operations.length} API endpoints across all modules.`);
|
||||
lines.push('');
|
||||
@@ -707,7 +707,8 @@ for (const apiPath of paths) {
|
||||
|
||||
const overviewOperations = operations.filter((op) => !op.omittedFromOverview);
|
||||
fs.writeFileSync(path.join(docsDir, 'routes.md'), renderRoutesOverview(overviewOperations));
|
||||
fs.writeFileSync(path.join(docsDir, 'routes-all.md'), renderRoutesOverview(operations, 'Dash API Routes Overview (All)'));
|
||||
fs.writeFileSync(path.join(docsDir, 'README.md'), renderReadme(operations));
|
||||
fs.writeFileSync(path.join(docsDir, 'openapi.json'), JSON.stringify(spec, null, 2));
|
||||
|
||||
console.log(`Wrote ${operations.length} route docs + ${overviewOperations.length} in routes.md + openapi.json → docs/api/`);
|
||||
console.log(`Wrote ${operations.length} route docs + ${overviewOperations.length} in routes.md + ${operations.length} in routes-all.md + openapi.json → docs/api/`);
|
||||
|
||||
Reference in New Issue
Block a user