From 4385a02f6b5d53dc2704e0d17d532a33cb475330 Mon Sep 17 00:00:00 2001 From: zadam Date: Tue, 10 Jan 2023 16:51:50 +0100 Subject: [PATCH] transform --- src/transform_api_docs.js | 64 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/src/transform_api_docs.js b/src/transform_api_docs.js index 2db0f09a9..6791e2501 100644 --- a/src/transform_api_docs.js +++ b/src/transform_api_docs.js @@ -75,3 +75,67 @@ for (const sourcePath of sourceFiles) { console.log(destPath); } + +const META_PATH = './docs/user_guide/!!!meta.json'; +const meta = JSON.parse(fs.readFileSync(META_PATH).toString()); + +meta.files[0].children = meta.files[0].children.filter(note => note.title !== 'API docs'); +meta.files[0].children.push(getApiMeta()); + +fs.writeFileSync(META_PATH, JSON.stringify(meta, null, 2)); + +function getApiMeta() { + return { + "isClone": false, + "noteId": "_apiDocs", + "notePath": [ + "_userGuide", + "_apiDocs" + ], + "title": "API docs", + "notePosition": 10, + "prefix": null, + "isExpanded": false, + "type": "text", + "mime": "text/html", + "attributes": [], + "format": "html", + "dataFileName": "API docs.html", + "children": [ + { + "isClone": false, + "noteId": "_frontendApi", + "notePath": [ + "_userGuide", + "_frontendApi" + ], + "title": "API docs", + "notePosition": 10, + "prefix": null, + "isExpanded": false, + "type": "text", + "mime": "text/html", + "attributes": [], + "format": "html", + "dataFileName": "FrontendScriptApi.html" + }, + { + "isClone": false, + "noteId": "_backendApi", + "notePath": [ + "_userGuide", + "_backendApi" + ], + "title": "API docs", + "notePosition": 20, + "prefix": null, + "isExpanded": false, + "type": "text", + "mime": "text/html", + "attributes": [], + "format": "html", + "dataFileName": "BackendScriptApi.html" + } + ] + }; +} \ No newline at end of file