60d326880a
- Add per-submodule docs structure (server-core, dashboard-ui, device-agent) - Restructure VitePress with i18n support (Indonesian default + English) - Add Swagger API reference pages with Swagger UI CDN embed - Create merge.js script for combining sidebar manifests - Integrate docs build into Docker (update.sh + nginx volume mount) - Add documentation section to root README
27 lines
802 B
JavaScript
27 lines
802 B
JavaScript
import { readFileSync } from 'node:fs';
|
|
import { join, dirname } from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
|
|
const submodules = [
|
|
{ name: 'server-core', path: '../server-core/docs/sidebar.json' },
|
|
{ name: 'dashboard-ui', path: '../dashboard-ui/docs/sidebar.json' },
|
|
{ name: 'device-agent', path: '../device-agent/docs/sidebar.json' }
|
|
];
|
|
|
|
const sidebar = [];
|
|
|
|
for (const mod of submodules) {
|
|
const filePath = join(__dirname, mod.path);
|
|
try {
|
|
const content = JSON.parse(readFileSync(filePath, 'utf-8'));
|
|
sidebar.push(content);
|
|
console.error(`\u2713 Loaded ${mod.name}`);
|
|
} catch (e) {
|
|
console.error(`\u26A0 Skipping ${mod.name}: ${e.message}`);
|
|
}
|
|
}
|
|
|
|
console.log(JSON.stringify(sidebar, null, 2));
|