Skip to content

Commit 0cd6f0d

Browse files
authored
Merge branch 'main' into copilot/improve-user-documentation
2 parents ff4cd7e + 0ae4def commit 0cd6f0d

File tree

203 files changed

+3707
-3886
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

203 files changed

+3707
-3886
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010
paths:
1111
- 'docs/**'
1212
- 'apps/edit-docs/**'
13+
- 'apps/build-docs/**'
1314
- 'packages/share-theme/**'
1415

1516
# Allow manual triggering from Actions tab
@@ -23,6 +24,7 @@ on:
2324
paths:
2425
- 'docs/**'
2526
- 'apps/edit-docs/**'
27+
- 'apps/build-docs/**'
2628
- 'packages/share-theme/**'
2729

2830
jobs:
@@ -60,6 +62,8 @@ jobs:
6062
- name: Validate Built Site
6163
run: |
6264
test -f site/index.html || (echo "ERROR: site/index.html not found" && exit 1)
65+
test -f site/developer-guide/index.html || (echo "ERROR: site/developer-guide/index.html not found" && exit 1)
66+
echo "✓ User Guide and Developer Guide built successfully"
6367
6468
- name: Deploy
6569
uses: ./.github/actions/deploy-to-cloudflare-pages

_regroup/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@
3838
"@playwright/test": "1.56.1",
3939
"@stylistic/eslint-plugin": "5.5.0",
4040
"@types/express": "5.0.5",
41-
"@types/node": "24.9.2",
41+
"@types/node": "24.10.0",
4242
"@types/yargs": "17.0.34",
4343
"@vitest/coverage-v8": "3.2.4",
44-
"eslint": "9.39.0",
44+
"eslint": "9.39.1",
4545
"eslint-plugin-simple-import-sort": "12.1.1",
4646
"esm": "3.2.25",
4747
"jsdoc": "4.0.5",

apps/build-docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"keywords": [],
1010
"author": "Elian Doran <[email protected]>",
1111
"license": "AGPL-3.0-only",
12-
"packageManager": "pnpm@10.19.0",
12+
"packageManager": "pnpm@10.20.0",
1313
"devDependencies": {
1414
"@redocly/cli": "2.10.0",
1515
"archiver": "7.0.1",

apps/build-docs/src/build-docs.ts

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,12 @@ import BuildContext from "./context.js";
1414
const DOCS_ROOT = "../../../docs";
1515
const OUTPUT_DIR = "../../site";
1616

17-
async function buildDocsInner() {
18-
const i18n = await import("@triliumnext/server/src/services/i18n.js");
19-
await i18n.initializeTranslations();
20-
21-
const sqlInit = (await import("../../server/src/services/sql_init.js")).default;
22-
await sqlInit.createInitialDatabase(true);
23-
24-
const note = await importData(join(__dirname, DOCS_ROOT, "User Guide"));
17+
async function importAndExportDocs(sourcePath: string, outputSubDir: string) {
18+
const note = await importData(sourcePath);
2519

26-
// Export
27-
const zipFilePath = "output.zip";
20+
// Use a meaningful name for the temporary zip file
21+
const zipName = outputSubDir || "user-guide";
22+
const zipFilePath = `output-${zipName}.zip`;
2823
try {
2924
const { exportToZip } = (await import("@triliumnext/server/src/services/export/zip.js")).default;
3025
const branch = note.getParentBranches()[0];
@@ -36,25 +31,50 @@ async function buildDocsInner() {
3631
const fileOutputStream = fsExtra.createWriteStream(zipFilePath);
3732
await exportToZip(taskContext, branch, "share", fileOutputStream);
3833
await waitForStreamToFinish(fileOutputStream);
39-
await extractZip(zipFilePath, OUTPUT_DIR);
34+
35+
// Output to root directory if outputSubDir is empty, otherwise to subdirectory
36+
const outputPath = outputSubDir ? join(OUTPUT_DIR, outputSubDir) : OUTPUT_DIR;
37+
await extractZip(zipFilePath, outputPath);
4038
} finally {
4139
if (await fsExtra.exists(zipFilePath)) {
4240
await fsExtra.rm(zipFilePath);
4341
}
4442
}
43+
}
44+
45+
async function buildDocsInner() {
46+
const i18n = await import("@triliumnext/server/src/services/i18n.js");
47+
await i18n.initializeTranslations();
48+
49+
const sqlInit = (await import("../../server/src/services/sql_init.js")).default;
50+
await sqlInit.createInitialDatabase(true);
51+
52+
// Wait for becca to be loaded before importing data
53+
const beccaLoader = await import("../../server/src/becca/becca_loader.js");
54+
await beccaLoader.beccaLoaded;
55+
56+
// Build User Guide
57+
console.log("Building User Guide...");
58+
await importAndExportDocs(join(__dirname, DOCS_ROOT, "User Guide"), "user-guide");
59+
60+
// Build Developer Guide
61+
console.log("Building Developer Guide...");
62+
await importAndExportDocs(join(__dirname, DOCS_ROOT, "Developer Guide"), "developer-guide");
4563

4664
// Copy favicon.
4765
await fs.copyFile("../../apps/website/src/assets/favicon.ico", join(OUTPUT_DIR, "favicon.ico"));
66+
await fs.copyFile("../../apps/website/src/assets/favicon.ico", join(OUTPUT_DIR, "user-guide", "favicon.ico"));
67+
await fs.copyFile("../../apps/website/src/assets/favicon.ico", join(OUTPUT_DIR, "developer-guide", "favicon.ico"));
4868

4969
console.log("Documentation built successfully!");
5070
}
5171

5272
export async function importData(path: string) {
5373
const buffer = await createImportZip(path);
54-
const importService = (await import("@triliumnext/server/src/services/import/zip.js")).default;
55-
const TaskContext = (await import("@triliumnext/server/src/services/task_context.js")).default;
74+
const importService = (await import("../../server/src/services/import/zip.js")).default;
75+
const TaskContext = (await import("../../server/src/services/task_context.js")).default;
5676
const context = new TaskContext("no-progress-reporting", "importNotes", null);
57-
const becca = (await import("@triliumnext/server/src/becca/becca.js")).default;
77+
const becca = (await import("../../server/src/becca/becca.js")).default;
5878

5979
const rootNote = becca.getRoot();
6080
if (!rootNote) {

apps/build-docs/src/index.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta http-equiv="refresh" content="0; url=/user-guide">
5+
<title>Redirecting...</title>
6+
</head>
7+
<body>
8+
<p>If you are not redirected automatically, <a href="/user-guide">click here</a>.</p>
9+
</body>
10+
</html>

apps/build-docs/src/main.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { join } from "path";
22
import BuildContext from "./context";
33
import buildSwagger from "./swagger";
4-
import { existsSync, mkdirSync, rmSync } from "fs";
4+
import { cpSync, existsSync, mkdirSync, rmSync } from "fs";
55
import buildDocs from "./build-docs";
66
import buildScriptApi from "./script-api";
77

@@ -21,6 +21,10 @@ async function main() {
2121
await buildDocs(context);
2222
buildSwagger(context);
2323
buildScriptApi(context);
24+
25+
// Copy index and 404 files.
26+
cpSync(join(__dirname, "index.html"), join(context.baseDir, "index.html"));
27+
cpSync(join(context.baseDir, "user-guide/404.html"), join(context.baseDir, "404.html"));
2428
}
2529

2630
main();

apps/client/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"circular-deps": "dpdm -T src/**/*.ts --tree=false --warning=false --skip-dynamic-imports=circular"
1616
},
1717
"dependencies": {
18-
"@eslint/js": "9.39.0",
18+
"@eslint/js": "9.39.1",
1919
"@excalidraw/excalidraw": "0.18.0",
2020
"@fullcalendar/core": "6.1.19",
2121
"@fullcalendar/daygrid": "6.1.19",
@@ -39,7 +39,7 @@
3939
"color": "5.0.2",
4040
"dayjs": "1.11.19",
4141
"dayjs-plugin-utc": "0.1.2",
42-
"debounce": "2.2.0",
42+
"debounce": "3.0.0",
4343
"draggabilly": "3.0.0",
4444
"force-graph": "1.51.0",
4545
"globals": "16.5.0",
@@ -59,7 +59,7 @@
5959
"normalize.css": "8.0.1",
6060
"panzoom": "9.4.3",
6161
"preact": "10.27.2",
62-
"react-i18next": "16.2.3",
62+
"react-i18next": "16.2.4",
6363
"reveal.js": "5.2.1",
6464
"svg-pan-zoom": "3.6.2",
6565
"tabulator-tables": "6.3.1",

apps/client/src/translations/it/translation.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@
109109
"export_type_single": "Solo questa nota, senza le sottostanti",
110110
"format_opml": "OPML - formato per scambio informazioni outline. Formattazione, immagini e files non sono inclusi.",
111111
"opml_version_1": "OPML v.1.0 - solo testo semplice",
112-
"opml_version_2": "OPML v2.0 - supporta anche HTML"
112+
"opml_version_2": "OPML v2.0 - supporta anche HTML",
113+
"share-format": "HTML per la pubblicazione sul web - utilizza lo stesso tema utilizzato per le note condivise, ma può essere pubblicato come sito web statico."
113114
},
114115
"password_not_set": {
115116
"body1": "Le note protette sono crittografate utilizzando una password utente, ma la password non è stata ancora impostata.",

apps/client/src/widgets/ribbon/EditedNotesTab.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ export default function EditedNotesTab({ note }: TabContext) {
1313
useEffect(() => {
1414
if (!note) return;
1515
server.get<EditedNotesResponse>(`edited-notes/${note.getLabelValue("dateNote")}`).then(async editedNotes => {
16-
editedNotes = editedNotes.filter((n) => n.noteId !== note.noteId);
17-
const noteIds = editedNotes.flatMap((n) => n.noteId);
16+
editedNotes = editedNotes.filter((n) => n.noteId !== note.noteId);
17+
const noteIds = editedNotes.flatMap((n) => n.noteId);
1818
await froca.getNotes(noteIds, true); // preload all at once
1919
setEditedNotes(editedNotes);
2020
});
@@ -41,11 +41,11 @@ export default function EditedNotesTab({ note }: TabContext) {
4141
)}
4242
</span>
4343
)
44-
}))}
44+
}), " ")}
4545
</div>
4646
) : (
4747
<div className="no-edited-notes-found">{t("edited_notes.no_edited_notes_found")}</div>
4848
)}
4949
</div>
50-
)
50+
)
5151
}

apps/client/src/widgets/type_widgets/options/text_notes.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ function EditorFeatures() {
7272
return (
7373
<OptionsSection title={t("editorfeatures.title")}>
7474
<EditorFeature name="emoji-completion-enabled" optionName="textNoteEmojiCompletionEnabled" label={t("editorfeatures.emoji_completion_enabled")} description={t("editorfeatures.emoji_completion_description")} />
75-
<EditorFeature name="note-completion-enabled" optionName="textNoteCompletionEnabled" label={t("editorfeatures.note_completion_enabled")} description={t("editorfeatures.emoji_completion_description")} />
76-
<EditorFeature name="slash-commands-enabled" optionName="textNoteSlashCommandsEnabled" label={t("editorfeatures.slash_commands_enabled")} description={t("editorfeatures.emoji_completion_description")} />
75+
<EditorFeature name="note-completion-enabled" optionName="textNoteCompletionEnabled" label={t("editorfeatures.note_completion_enabled")} description={t("editorfeatures.note_completion_description")} />
76+
<EditorFeature name="slash-commands-enabled" optionName="textNoteSlashCommandsEnabled" label={t("editorfeatures.slash_commands_enabled")} description={t("editorfeatures.slash_commands_description")} />
7777
</OptionsSection>
7878
);
7979
}

0 commit comments

Comments
 (0)