mirror of
https://github.com/zadam/trilium.git
synced 2025-11-07 22:05:44 +01:00
feat(templates): add support for built-in templates
This commit is contained in:
@@ -8,6 +8,7 @@ import migrationService from "./migration.js";
|
||||
import { t } from "i18next";
|
||||
import { cleanUpHelp, getHelpHiddenSubtreeData } from "./in_app_help.js";
|
||||
import buildLaunchBarConfig from "./hidden_subtree_launcherbar.js";
|
||||
import buildHiddenSubtreeTemplates from "./hidden_subtree_templates.js";
|
||||
|
||||
const LBTPL_ROOT = "_lbTplRoot";
|
||||
const LBTPL_BASE = "_lbTplBase";
|
||||
@@ -257,7 +258,8 @@ function buildHiddenSubtreeDefinition(helpSubtree: HiddenSubtreeItem[]): HiddenS
|
||||
icon: "bx-help-circle",
|
||||
children: helpSubtree,
|
||||
isExpanded: true
|
||||
}
|
||||
},
|
||||
buildHiddenSubtreeTemplates()
|
||||
]
|
||||
};
|
||||
}
|
||||
|
||||
28
apps/server/src/services/hidden_subtree_templates.ts
Normal file
28
apps/server/src/services/hidden_subtree_templates.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { HiddenSubtreeItem } from "@triliumnext/commons";
|
||||
|
||||
export default function buildHiddenSubtreeTemplates() {
|
||||
const templates: HiddenSubtreeItem = {
|
||||
id: "_templates",
|
||||
title: "Built-in templates",
|
||||
type: "book",
|
||||
children: [
|
||||
{
|
||||
id: "_template_text_snippet",
|
||||
type: "text",
|
||||
title: "Text Snippet",
|
||||
attributes: [
|
||||
{
|
||||
name: "template",
|
||||
type: "label"
|
||||
},
|
||||
{
|
||||
name: "textSnippet",
|
||||
type: "label"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
return templates;
|
||||
}
|
||||
Reference in New Issue
Block a user