mirror of
https://github.com/zadam/trilium.git
synced 2025-06-05 01:18:44 +02:00
transform
This commit is contained in:
parent
397dd68666
commit
4385a02f6b
@ -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"
|
||||
}
|
||||
]
|
||||
};
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user