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

This commit is contained in:
Elian Doran 2025-03-10 17:41:13 +02:00
parent 42d3236fe7
commit 2b891adc34
No known key found for this signature in database

View File

@ -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";