mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-05 06:42:12 +03:00
Merge PR #2019 and resolve conflicts
This commit is contained in:
@@ -116,6 +116,52 @@ function extractContentPreview(content) {
|
||||
|
||||
// ---------- Main ----------
|
||||
|
||||
if (!fs.existsSync(DOCS_DIR)) {
|
||||
if (fs.existsSync(OUT_FILE)) {
|
||||
console.warn(
|
||||
`[generate-docs-index] ${DOCS_DIR} not found; keeping existing generated docs index.`
|
||||
);
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
fs.mkdirSync(path.dirname(OUT_FILE), { recursive: true });
|
||||
fs.writeFileSync(
|
||||
OUT_FILE,
|
||||
`// AUTO-GENERATED by scripts/generate-docs-index.mjs — DO NOT EDIT MANUALLY
|
||||
// Regenerate with: node scripts/generate-docs-index.mjs
|
||||
|
||||
export interface AutoGenDocItem {
|
||||
slug: string;
|
||||
title: string;
|
||||
fileName: string;
|
||||
}
|
||||
|
||||
export interface AutoGenNavSection {
|
||||
title: string;
|
||||
items: AutoGenDocItem[];
|
||||
}
|
||||
|
||||
export interface AutoGenSearchItem {
|
||||
slug: string;
|
||||
title: string;
|
||||
fileName: string;
|
||||
section: string;
|
||||
content: string;
|
||||
headings: string[];
|
||||
}
|
||||
|
||||
export const autoNavSections: AutoGenNavSection[] = [];
|
||||
|
||||
export const autoSearchIndex: AutoGenSearchItem[] = [];
|
||||
|
||||
export const autoAllSlugs: string[] = [];
|
||||
`,
|
||||
"utf8"
|
||||
);
|
||||
console.warn(`[generate-docs-index] ${DOCS_DIR} not found; generated empty docs index.`);
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
const files = fs.readdirSync(DOCS_DIR).filter((f) => f.endsWith(".md") || f.endsWith(".mdx"));
|
||||
|
||||
const docs = [];
|
||||
|
||||
Reference in New Issue
Block a user