Skip to content

Build your personal knowledge base with Trilium Notes

feat(edit-docs): create child note for importing

Elian Doran2b891adc34d6
diff --git a/electron-docs-main.ts b/electron-docs-main.ts
index 9ed19551c0..d389cdae24 100644
--- a/electron-docs-main.ts
+++ b/electron-docs-main.ts
@@ -6,7 +6,7 @@ import type { NoteMetaFile } from "./src/services/meta/note_meta.js";
import cls from "./src/services/cls.js";
import { initializeTranslations } from "./src/services/i18n.js";
-const NOTE_ID_USER_GUIDE = "pOsGYCXsbNQG";
+const NOTE_ID_USER_GUIDE = "_help_user_guide";
const destRootPath = path.join("src", "public", "app", "doc_notes", "en", "User Guide");
async function startElectron() {
@@ -16,6 +16,9 @@ async function startElectron() {
async function main() {
await initializeTranslations();
await initializeDatabase();
+ cls.init(() => {
+ importData();
+ });
await startElectron();
// await exportData();
@@ -31,6 +34,22 @@ async function initializeDatabase() {
});
}
+async function importData() {
+ const beccaLoader = ((await import("./src/becca/becca_loader.js")).default);
+ const notes = ((await import("./src/services/notes.js")).default);
+ beccaLoader.load();
+
+ const becca = ((await import("./src/becca/becca.js")).default);
+
+ notes.createNewNoteWithTarget("into", "none_root", {
+ parentNoteId: "root",
+ noteId: NOTE_ID_USER_GUIDE,
+ title: "User Guide",
+ content: "The sub-children of this note are automatically synced.",
+ type: "text"
+ });
+}
+
async function exportData() {
const zipFilePath = "output.zip";