From 1acbf5ba45d1b1eef8a86f42a0503e597e33437e Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Fri, 17 Apr 2026 23:26:24 +0300 Subject: [PATCH 01/79] feat(electron): generate appimage (closes #409) --- .github/actions/build-electron/action.yml | 18 +++- apps/desktop/scripts/build-appimage.sh | 101 ++++++++++++++++++++++ 2 files changed, 118 insertions(+), 1 deletion(-) create mode 100755 apps/desktop/scripts/build-appimage.sh diff --git a/.github/actions/build-electron/action.yml b/.github/actions/build-electron/action.yml index 58fa9743a5..d4dfc5b570 100644 --- a/.github/actions/build-electron/action.yml +++ b/.github/actions/build-electron/action.yml @@ -66,12 +66,20 @@ runs: if: ${{ inputs.os == 'linux' }} shell: ${{ inputs.shell }} run: | - sudo apt-get update && sudo apt-get install rpm flatpak-builder elfutils + sudo apt-get update && sudo apt-get install rpm flatpak-builder elfutils libfuse2 flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo FLATPAK_ARCH=$(if [[ ${{ inputs.arch }} = 'arm64' ]]; then echo 'aarch64'; else echo 'x86_64'; fi) FLATPAK_VERSION='24.08' flatpak install --user --no-deps --arch $FLATPAK_ARCH --assumeyes runtime/org.freedesktop.Platform/$FLATPAK_ARCH/$FLATPAK_VERSION runtime/org.freedesktop.Sdk/$FLATPAK_ARCH/$FLATPAK_VERSION org.electronjs.Electron2.BaseApp/$FLATPAK_ARCH/$FLATPAK_VERSION + - name: Install appimagetool + if: ${{ inputs.os == 'linux' }} + shell: ${{ inputs.shell }} + run: | + APPIMAGETOOL_ARCH=$(if [[ ${{ inputs.arch }} = 'arm64' ]]; then echo 'aarch64'; else echo 'x86_64'; fi) + wget -q "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-${APPIMAGETOOL_ARCH}.AppImage" -O /usr/local/bin/appimagetool + chmod +x /usr/local/bin/appimagetool + - name: Update build info shell: ${{ inputs.shell }} run: pnpm run chore:update-build-info @@ -90,6 +98,14 @@ runs: TARGET_ARCH: ${{ inputs.arch }} run: pnpm run --filter desktop electron-forge:make --arch=${{ inputs.arch }} --platform=${{ inputs.forge_platform }} + - name: Build AppImage + if: ${{ inputs.os == 'linux' }} + shell: ${{ inputs.shell }} + env: + TRILIUM_ARTIFACT_NAME_HINT: TriliumNotes-${{ github.ref_name }}-${{ inputs.os }}-${{ inputs.arch }} + APPIMAGE_EXTRACT_AND_RUN: "1" + run: bash apps/desktop/scripts/build-appimage.sh ${{ inputs.arch }} + # Add DMG signing step - name: Sign DMG if: inputs.os == 'macos' diff --git a/apps/desktop/scripts/build-appimage.sh b/apps/desktop/scripts/build-appimage.sh new file mode 100755 index 0000000000..d4016ce134 --- /dev/null +++ b/apps/desktop/scripts/build-appimage.sh @@ -0,0 +1,101 @@ +#!/usr/bin/env bash +# +# Build an AppImage from the packaged Electron app. +# +# Usage: ./build-appimage.sh [arch] +# arch: x64 or arm64 (default: x64) +# +# Prerequisites: +# - The Electron app must already be packaged via `electron-forge make` or `electron-forge package` +# - appimagetool must be available in PATH +# +# Environment variables: +# TRILIUM_ARTIFACT_NAME_HINT: If set, used as the base name for the output file + +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +DESKTOP_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" +FORGE_DIR="$DESKTOP_DIR/electron-forge" + +ARCH="${1:-x64}" +EXECUTABLE_NAME="trilium" +PRODUCT_NAME="Trilium Notes" + +# Map architecture names +case "$ARCH" in + x64) APPIMAGE_ARCH="x86_64" ;; + arm64) APPIMAGE_ARCH="aarch64" ;; + *) echo "Unsupported architecture: $ARCH"; exit 1 ;; +esac + +# Find the packaged app directory +PACKAGED_DIR="$DESKTOP_DIR/out/$PRODUCT_NAME-linux-$ARCH" +if [ ! -d "$PACKAGED_DIR" ]; then + echo "Error: Packaged app not found at $PACKAGED_DIR" + echo "Run 'electron-forge make' or 'electron-forge package' first." + exit 1 +fi + +echo "Building AppImage from: $PACKAGED_DIR" + +# Create AppDir structure +APPDIR="$DESKTOP_DIR/out/$PRODUCT_NAME.AppDir" +rm -rf "$APPDIR" +mkdir -p "$APPDIR" + +# Copy the packaged app contents into the AppDir +cp -a "$PACKAGED_DIR"/. "$APPDIR/" + +# Create the AppRun entry point +cat > "$APPDIR/AppRun" << 'APPRUN_EOF' +#!/bin/bash +HERE="$(dirname "$(readlink -f "$0")")" +exec "$HERE/trilium" "$@" +APPRUN_EOF +chmod +x "$APPDIR/AppRun" + +# Create the .desktop file +cat > "$APPDIR/$EXECUTABLE_NAME.desktop" << DESKTOP_EOF +[Desktop Entry] +Name=$PRODUCT_NAME +Comment=Build your personal knowledge base with Trilium Notes +GenericName=Note Taking Application +Exec=$EXECUTABLE_NAME %U +Icon=$EXECUTABLE_NAME +Type=Application +StartupNotify=true +StartupWMClass=$PRODUCT_NAME +Categories=Office;Utility; +DESKTOP_EOF + +# Copy the icon (AppImage expects it at the root of AppDir) +if [ -f "$FORGE_DIR/app-icon/png/256x256.png" ]; then + cp "$FORGE_DIR/app-icon/png/256x256.png" "$APPDIR/$EXECUTABLE_NAME.png" +elif [ -f "$APPDIR/icon.png" ]; then + cp "$APPDIR/icon.png" "$APPDIR/$EXECUTABLE_NAME.png" +else + echo "Warning: No icon found" +fi + +# Determine output filename +UPLOAD_DIR="$DESKTOP_DIR/upload" +mkdir -p "$UPLOAD_DIR" + +if [ -n "${TRILIUM_ARTIFACT_NAME_HINT:-}" ]; then + OUTPUT_NAME="${TRILIUM_ARTIFACT_NAME_HINT//\//-}.AppImage" +else + VERSION=$(node -e "console.log(require('$DESKTOP_DIR/package.json').version)") + OUTPUT_NAME="TriliumNotes-v${VERSION}-linux-${ARCH}.AppImage" +fi + +OUTPUT_PATH="$UPLOAD_DIR/$OUTPUT_NAME" + +# Build the AppImage +echo "Creating AppImage: $OUTPUT_PATH" +ARCH="$APPIMAGE_ARCH" appimagetool "$APPDIR" "$OUTPUT_PATH" + +# Clean up the AppDir +rm -rf "$APPDIR" + +echo "AppImage created successfully: $OUTPUT_PATH" From e99cf749883423c5c864580973cefc7e09605c54 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Fri, 17 Apr 2026 23:29:27 +0300 Subject: [PATCH 02/79] feat(electron): customizable Electron directory (closes #4192) --- apps/desktop/src/main.ts | 13 +++++++++++++ .../Installation & Setup/Data directory.md | 11 ++++++++++- .../Installation & Setup/Desktop Installation.md | 2 +- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/apps/desktop/src/main.ts b/apps/desktop/src/main.ts index 3617c4c9f4..6a3ca896ce 100644 --- a/apps/desktop/src/main.ts +++ b/apps/desktop/src/main.ts @@ -101,9 +101,22 @@ async function main() { /** * Returns a unique user data directory for Electron so that single instance locks between legitimately different instances such as different port or data directory can still act independently, but we are focusing the main window otherwise. + * + * When running in portable mode (TRILIUM_DATA_DIR is set), the user data is stored inside the data directory + * so that no files are written to the system's roaming profile (e.g. %APPDATA% on Windows). + * This can be overridden by setting TRILIUM_ELECTRON_DATA_DIR to a custom path. */ function getUserData() { + if (process.env.TRILIUM_ELECTRON_DATA_DIR) { + return process.env.TRILIUM_ELECTRON_DATA_DIR; + } + const name = `${app.getName()}-${port}`; + + if (process.env.TRILIUM_DATA_DIR) { + return join(process.env.TRILIUM_DATA_DIR, "electron-user-data", name); + } + return join(app.getPath("appData"), name); } diff --git a/docs/User Guide/User Guide/Installation & Setup/Data directory.md b/docs/User Guide/User Guide/Installation & Setup/Data directory.md index 3d66bafe90..3a447f82f2 100644 --- a/docs/User Guide/User Guide/Installation & Setup/Data directory.md +++ b/docs/User Guide/User Guide/Installation & Setup/Data directory.md @@ -77,6 +77,14 @@ TRILIUM_DATA_DIR=/home/myuser/data/my-trilium-data trilium You can then save the above command as a shell script on your path for convenience. +## Electron user data directory (desktop only) + +When running the desktop application, Electron stores internal data (caches, spell-check dictionaries, session storage, etc.) separately from the Trilium data directory. By default this goes to the system's application data folder (e.g. `%APPDATA%` on Windows), which may be undesirable in corporate environments with roaming profiles or when running in portable mode. + +When `TRILIUM_DATA_DIR` is set (e.g. via the `trilium-portable` script), the Electron user data is automatically redirected into `${TRILIUM_DATA_DIR}/electron-user-data/`, so no files are written to the system's roaming profile. + +If you need to store the Electron data in a different location than the Trilium data directory, you can set the `TRILIUM_ELECTRON_DATA_DIR` environment variable to an explicit path. + ## Fine-grained directory/path location Apart from the data directory, some of the subdirectories of it can be moved elsewhere by changing an environment variable: @@ -88,4 +96,5 @@ Apart from the data directory, some of the subdirectories of it can be moved els | `TRILIUM_LOG_DIR` | `${TRILIUM_DATA_DIR}/log` | Directory where daily Backend (server) logs are stored. | | `TRILIUM_TMP_DIR` | `${TRILIUM_DATA_DIR}/tmp` | Directory where temporary files are stored (for example when opening in an external app). | | `TRILIUM_ANONYMIZED_DB_DIR` | `${TRILIUM_DATA_DIR}/anonymized-db` | Directory where a Anonymized Database is stored. | -| `TRILIUM_CONFIG_INI_PATH` | `${TRILIUM_DATA_DIR}/config.ini` | Path to Configuration (config.ini or environment variables) file. | \ No newline at end of file +| `TRILIUM_CONFIG_INI_PATH` | `${TRILIUM_DATA_DIR}/config.ini` | Path to Configuration (config.ini or environment variables) file. | +| `TRILIUM_ELECTRON_DATA_DIR` | `${TRILIUM_DATA_DIR}/electron-user-data` (portable) or system appData (default) | Directory where Electron stores internal data such as caches and spell-check dictionaries (desktop only). | diff --git a/docs/User Guide/User Guide/Installation & Setup/Desktop Installation.md b/docs/User Guide/User Guide/Installation & Setup/Desktop Installation.md index c8eb58ee57..b39241c459 100644 --- a/docs/User Guide/User Guide/Installation & Setup/Desktop Installation.md +++ b/docs/User Guide/User Guide/Installation & Setup/Desktop Installation.md @@ -11,7 +11,7 @@ Trilium offers various startup scripts to customize your experience: * `trilium-no-cert-check`: Starts Trilium without validating [TLS certificates](Server%20Installation/HTTPS%20\(TLS\).md), useful if connecting to a server with a self-signed certificate. * Alternatively, set the `NODE_TLS_REJECT_UNAUTHORIZED=0` environment variable before starting Trilium. -* `trilium-portable`: Launches Trilium in portable mode, where the [data directory](Data%20directory.md) is created within the application's directory, making it easy to move the entire setup. +* `trilium-portable`: Launches Trilium in portable mode, where the [data directory](Data%20directory.md) is created within the application's directory, making it easy to move the entire setup. Electron's internal data (caches, dictionaries, etc.) is also stored within the data directory, so no files are written to the system's roaming profile. * `trilium-safe-mode`: Boots Trilium in "safe mode," disabling any startup scripts that might cause the application to crash. ## Synchronization From 1a07dff37359ecffe64d85e8904015dd2c596f67 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Fri, 17 Apr 2026 23:29:38 +0300 Subject: [PATCH 03/79] feat(electron): disable terminal from portable mode --- apps/desktop/electron-forge/trilium-portable.bat | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/desktop/electron-forge/trilium-portable.bat b/apps/desktop/electron-forge/trilium-portable.bat index 5b71c9cf2a..6b4610215c 100644 --- a/apps/desktop/electron-forge/trilium-portable.bat +++ b/apps/desktop/electron-forge/trilium-portable.bat @@ -6,7 +6,7 @@ WHERE powershell.exe > NUL 2>&1 IF %ERRORLEVEL% NEQ 0 GOTO BATCH ELSE GOTO POWERSHELL :POWERSHELL -powershell -ExecutionPolicy Bypass -NonInteractive -NoLogo -Command "Set-Item -Path Env:TRILIUM_DATA_DIR -Value './trilium-data'; ./trilium.exe" +powershell -ExecutionPolicy Bypass -NonInteractive -NoLogo -Command "Set-Item -Path Env:TRILIUM_DATA_DIR -Value './trilium-data'; Set-Item -Path Env:ELECTRON_NO_ATTACH_CONSOLE -Value '1'; ./trilium.exe" GOTO END :BATCH @@ -17,6 +17,7 @@ chcp 65001 SET DIR=%~dp0 SET DIR=%DIR:~0,-1% SET TRILIUM_DATA_DIR=%DIR%\trilium-data +SET ELECTRON_NO_ATTACH_CONSOLE=1 cd "%DIR%" start trilium.exe GOTO END From 7d6fd54562b19603519464c832dd11d4f803478c Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Fri, 17 Apr 2026 23:32:24 +0300 Subject: [PATCH 04/79] chore(client): fix TODO related to hidden node --- apps/client/src/types-fancytree.d.ts | 2 ++ apps/client/src/widgets/note_tree.ts | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/client/src/types-fancytree.d.ts b/apps/client/src/types-fancytree.d.ts index a8a151b55d..67130be1d2 100644 --- a/apps/client/src/types-fancytree.d.ts +++ b/apps/client/src/types-fancytree.d.ts @@ -269,6 +269,8 @@ declare namespace Fancytree { lazy: boolean; /** Alternative description used as hover banner */ tooltip: string; + /** `
  • ` element wrapping this node. `null` if the node has not been rendered yet. */ + li: HTMLLIElement | null; /** Outer element of single nodes */ span: HTMLElement; /** Outer element of single nodes for table extension */ diff --git a/apps/client/src/widgets/note_tree.ts b/apps/client/src/widgets/note_tree.ts index 5c2aadb1ea..5918fa800b 100644 --- a/apps/client/src/widgets/note_tree.ts +++ b/apps/client/src/widgets/note_tree.ts @@ -1568,8 +1568,9 @@ export default class NoteTreeWidget extends NoteContextAwareWidget { toggleHiddenNode(show: boolean) { const hiddenNode = this.getNodesByNoteId("_hidden")[0]; - // TODO: Check how .li exists here. - $((hiddenNode as any).li).toggleClass("hidden-node-is-hidden", !show); + if (hiddenNode?.li) { + $(hiddenNode.li).toggleClass("hidden-node-is-hidden", !show); + } } async frocaReloadedEvent() { From 65d3224c1a6c16aab7a9446d92d194d308718c38 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Fri, 17 Apr 2026 23:47:59 +0300 Subject: [PATCH 05/79] fix(tree): hidden notes appearing on root import (closes #5520) --- apps/client/src/widgets/note_tree.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/client/src/widgets/note_tree.ts b/apps/client/src/widgets/note_tree.ts index 5918fa800b..27af4490ed 100644 --- a/apps/client/src/widgets/note_tree.ts +++ b/apps/client/src/widgets/note_tree.ts @@ -1534,8 +1534,11 @@ export default class NoteTreeWidget extends NoteContextAwareWidget { const hoistedNotePath = await treeService.resolveNotePath(this.noteContext.hoistedNoteId); if (!forceUpdate && this.lastFilteredHoistedNotePath === hoistedNotePath) { - // no need to re-filter if the hoisting did not change - // (helps with flickering on simple note change with large subtrees) + // Hoisting did not change, so skip the expensive re-filter (avoids flickering on + // simple note changes with large subtrees). The hidden-node class must still be + // reapplied — the
  • may have been recreated by a lazy reload (e.g. via + // `getNodeFromPath` → `parentNode.load(true)` after an import into root). + this.toggleHiddenNode(this.noteContext.hoistedNoteId !== "root"); return; } From 77b89c5a01e237aa017fe5d51c877ee54a2a2294 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 18 Apr 2026 02:32:03 +0000 Subject: [PATCH 06/79] chore(deps): update dependency wxt to v0.20.22 --- apps/web-clipper/package.json | 2 +- pnpm-lock.yaml | 38 +++++++++-------------------------- 2 files changed, 10 insertions(+), 30 deletions(-) diff --git a/apps/web-clipper/package.json b/apps/web-clipper/package.json index 82e8ffd6e7..f0d8f93f84 100644 --- a/apps/web-clipper/package.json +++ b/apps/web-clipper/package.json @@ -16,7 +16,7 @@ "packageManager": "pnpm@10.33.0", "devDependencies": { "@wxt-dev/auto-icons": "1.1.1", - "wxt": "0.20.21" + "wxt": "0.20.22" }, "dependencies": { "cash-dom": "8.1.5" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6c1c7168a7..693bc35b0d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -890,10 +890,10 @@ importers: devDependencies: '@wxt-dev/auto-icons': specifier: 1.1.1 - version: 1.1.1(wxt@0.20.21(@types/node@24.12.2)(eslint@10.2.0(jiti@2.6.1))(jiti@2.6.1)(less@4.1.3)(rollup@4.60.1)(sass-embedded@1.91.0)(sass@1.91.0)(terser@5.44.0)(tsx@4.21.0)(yaml@2.8.3)) + version: 1.1.1(wxt@0.20.22(@types/node@24.12.2)(eslint@10.2.0(jiti@2.6.1))(jiti@2.6.1)(less@4.1.3)(rollup@4.60.1)(sass-embedded@1.91.0)(sass@1.91.0)(terser@5.44.0)(tsx@4.21.0)(yaml@2.8.3)) wxt: - specifier: 0.20.21 - version: 0.20.21(@types/node@24.12.2)(eslint@10.2.0(jiti@2.6.1))(jiti@2.6.1)(less@4.1.3)(rollup@4.60.1)(sass-embedded@1.91.0)(sass@1.91.0)(terser@5.44.0)(tsx@4.21.0)(yaml@2.8.3) + specifier: 0.20.22 + version: 0.20.22(@types/node@24.12.2)(eslint@10.2.0(jiti@2.6.1))(jiti@2.6.1)(less@4.1.3)(rollup@4.60.1)(sass-embedded@1.91.0)(sass@1.91.0)(terser@5.44.0)(tsx@4.21.0)(yaml@2.8.3) apps/website: dependencies: @@ -10852,9 +10852,6 @@ packages: engines: {node: '>=10'} hasBin: true - mlly@1.7.4: - resolution: {integrity: sha512-qmdSIPC4bDJXgZTCR7XosJiNKySV7O215tsPtDN9iEO/7q/76b/ijtgRu/+epFXSJhijtTCCGp3DWS549P3xKw==} - mlly@1.8.0: resolution: {integrity: sha512-l8D9ODSRWLe2KHJSifWGwBqpTZXIXTeo8mlKjY+E2HAakaTeNpqAyBZ8GSqLzHgw4XmHmC8whvpjJNMbFZN7/g==} @@ -11656,10 +11653,6 @@ packages: resolution: {integrity: sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==} engines: {node: ^10 || ^12 || >=14} - postcss@8.5.8: - resolution: {integrity: sha512-OW/rX8O/jXnm82Ey1k44pObPtdblfiuWnrd8X7GJ7emImCOstunGbXUpp7HdBrFQX6rJzn3sPT397Wp5aCwCHg==} - engines: {node: ^10 || ^12 || >=14} - postcss@8.5.9: resolution: {integrity: sha512-7a70Nsot+EMX9fFU3064K/kdHWZqGVY+BADLyXc8Dfv+mTLLVl6JzJpPaCZ2kQL9gIJvKXSLMHhqdRRjwQeFtw==} engines: {node: ^10 || ^12 || >=14} @@ -14091,8 +14084,8 @@ packages: resolution: {integrity: sha512-g/eziiSUNBSsdDJtCLB8bdYEUMj4jR7AGeUo96p/3dTafgjHhpF4RiCFPiRILwjQoDXx5MqkBr4fwWtR3Ky4Wg==} engines: {node: '>=20'} - wxt@0.20.21: - resolution: {integrity: sha512-rDocJ9QEWKnGd7NTTTxKIJ5MsXwv9lXk4/ITFS9eeksTCYotshxzAiptkRPEHCgsJNiGMNY/UFNxVDyqWGe7Bw==} + wxt@0.20.22: + resolution: {integrity: sha512-njFI77H0dAbK/bQCN8u8QYiusg6GKDPMtsQDCqIfrh1oGHMHgrMEMgeGOlqAltG9OOGGB1DvFYDzTvxqfEKVKQ==} engines: {bun: '>=1.2.0', node: '>=20.12.0'} hasBin: true peerDependencies: @@ -21569,12 +21562,12 @@ snapshots: optionalDependencies: react: 19.2.4 - '@wxt-dev/auto-icons@1.1.1(wxt@0.20.21(@types/node@24.12.2)(eslint@10.2.0(jiti@2.6.1))(jiti@2.6.1)(less@4.1.3)(rollup@4.60.1)(sass-embedded@1.91.0)(sass@1.91.0)(terser@5.44.0)(tsx@4.21.0)(yaml@2.8.3))': + '@wxt-dev/auto-icons@1.1.1(wxt@0.20.22(@types/node@24.12.2)(eslint@10.2.0(jiti@2.6.1))(jiti@2.6.1)(less@4.1.3)(rollup@4.60.1)(sass-embedded@1.91.0)(sass@1.91.0)(terser@5.44.0)(tsx@4.21.0)(yaml@2.8.3))': dependencies: defu: 6.1.6 fs-extra: 11.3.4 sharp: 0.34.5 - wxt: 0.20.21(@types/node@24.12.2)(eslint@10.2.0(jiti@2.6.1))(jiti@2.6.1)(less@4.1.3)(rollup@4.60.1)(sass-embedded@1.91.0)(sass@1.91.0)(terser@5.44.0)(tsx@4.21.0)(yaml@2.8.3) + wxt: 0.20.22(@types/node@24.12.2)(eslint@10.2.0(jiti@2.6.1))(jiti@2.6.1)(less@4.1.3)(rollup@4.60.1)(sass-embedded@1.91.0)(sass@1.91.0)(terser@5.44.0)(tsx@4.21.0)(yaml@2.8.3) '@wxt-dev/browser@0.1.40': dependencies: @@ -25905,7 +25898,7 @@ snapshots: local-pkg@1.1.1: dependencies: - mlly: 1.7.4 + mlly: 1.8.0 pkg-types: 2.3.0 quansync: 0.2.10 @@ -26688,13 +26681,6 @@ snapshots: mkdirp@1.0.4: {} - mlly@1.7.4: - dependencies: - acorn: 8.16.0 - pathe: 2.0.3 - pkg-types: 1.3.1 - ufo: 1.6.1 - mlly@1.8.0: dependencies: acorn: 8.16.0 @@ -27552,12 +27538,6 @@ snapshots: picocolors: 1.1.1 source-map-js: 1.2.1 - postcss@8.5.8: - dependencies: - nanoid: 3.3.11 - picocolors: 1.1.1 - source-map-js: 1.2.1 - postcss@8.5.9: dependencies: nanoid: 3.3.11 @@ -30403,7 +30383,7 @@ snapshots: is-wsl: 3.1.1 powershell-utils: 0.1.0 - wxt@0.20.21(@types/node@24.12.2)(eslint@10.2.0(jiti@2.6.1))(jiti@2.6.1)(less@4.1.3)(rollup@4.60.1)(sass-embedded@1.91.0)(sass@1.91.0)(terser@5.44.0)(tsx@4.21.0)(yaml@2.8.3): + wxt@0.20.22(@types/node@24.12.2)(eslint@10.2.0(jiti@2.6.1))(jiti@2.6.1)(less@4.1.3)(rollup@4.60.1)(sass-embedded@1.91.0)(sass@1.91.0)(terser@5.44.0)(tsx@4.21.0)(yaml@2.8.3): dependencies: '@1natsu/wait-element': 4.1.2 '@aklinker1/rollup-plugin-visualizer': 5.12.0(rollup@4.60.1) From 6c2ce8f39cc222868937a1c9b8addbab66eceb00 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 18 Apr 2026 02:32:56 +0000 Subject: [PATCH 07/79] fix(deps): update ai sdk --- apps/server/package.json | 4 ++-- pnpm-lock.yaml | 38 ++++++++++++++------------------------ 2 files changed, 16 insertions(+), 26 deletions(-) diff --git a/apps/server/package.json b/apps/server/package.json index 3f5871dfda..14852983f0 100644 --- a/apps/server/package.json +++ b/apps/server/package.json @@ -32,9 +32,9 @@ "dependencies": { "@ai-sdk/anthropic": "3.0.69", "@ai-sdk/google": "3.0.63", - "@ai-sdk/openai": "3.0.52", + "@ai-sdk/openai": "3.0.53", "@modelcontextprotocol/sdk": "^1.12.1", - "ai": "6.0.159", + "ai": "6.0.161", "better-sqlite3": "12.9.0", "html-to-text": "9.0.5", "js-yaml": "4.1.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6c1c7168a7..5929ba957e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -575,14 +575,14 @@ importers: specifier: 3.0.63 version: 3.0.63(zod@4.3.6) '@ai-sdk/openai': - specifier: 3.0.52 - version: 3.0.52(zod@4.3.6) + specifier: 3.0.53 + version: 3.0.53(zod@4.3.6) '@modelcontextprotocol/sdk': specifier: ^1.12.1 version: 1.29.0(zod@4.3.6) ai: - specifier: 6.0.159 - version: 6.0.159(zod@4.3.6) + specifier: 6.0.161 + version: 6.0.161(zod@4.3.6) better-sqlite3: specifier: 12.9.0 version: 12.9.0 @@ -1482,8 +1482,8 @@ packages: peerDependencies: zod: ^3.25.76 || ^4.1.8 - '@ai-sdk/gateway@3.0.96': - resolution: {integrity: sha512-BDiVEMUVHGpngReeigzLyJobG0TvzYbNGzdHI8JYBZHrjOX4aL6qwIls7z3p7V4TuXVWUCbG8TSWEe7ksX4Vhw==} + '@ai-sdk/gateway@3.0.98': + resolution: {integrity: sha512-Ol+nP8PIlj8FjN8qKlxhE89N0woqAaGi9CUBGp1boe3RafpphJ7WMuq/RErSvxtwTqje03TP+zIdzP113krxRg==} engines: {node: '>=18'} peerDependencies: zod: ^3.25.76 || ^4.1.8 @@ -1494,8 +1494,8 @@ packages: peerDependencies: zod: ^3.25.76 || ^4.1.8 - '@ai-sdk/openai@3.0.52': - resolution: {integrity: sha512-4Rr8NCGmfWTz6DCUvixn9UmyZcMatiHn0zWoMzI3JCUe9R1P/vsPOpCBALKoSzVYOjyJnhtnVIbfUKujcS39uw==} + '@ai-sdk/openai@3.0.53': + resolution: {integrity: sha512-Wld+Rbc05KaUn08uBt06eEuwcgalcIFtIl32Yp+GxuZXUQwOb6YeAuq+C6da4ch6BurFoqEaLemJVwjBb7x+PQ==} engines: {node: '>=18'} peerDependencies: zod: ^3.25.76 || ^4.1.8 @@ -6766,8 +6766,8 @@ packages: resolution: {integrity: sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==} engines: {node: '>=8'} - ai@6.0.159: - resolution: {integrity: sha512-S18ozG7Dkm3Ud1tzOtAK5acczD4vygfml80RkpM9VWMFpvAFwAKSHaGYkATvPQHIE+VpD1tJY9zcTXLZ/zR5cw==} + ai@6.0.161: + resolution: {integrity: sha512-ufhmijmx2YyWTPAicGgtpLOB/xD7mG8zKs1pT1Trj+JL/3r1rS8fkMi/cHZoChSAQSGB4pgmcWVxDrVTUvK2IQ==} engines: {node: '>=18'} peerDependencies: zod: ^3.25.76 || ^4.1.8 @@ -11656,10 +11656,6 @@ packages: resolution: {integrity: sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==} engines: {node: ^10 || ^12 || >=14} - postcss@8.5.8: - resolution: {integrity: sha512-OW/rX8O/jXnm82Ey1k44pObPtdblfiuWnrd8X7GJ7emImCOstunGbXUpp7HdBrFQX6rJzn3sPT397Wp5aCwCHg==} - engines: {node: ^10 || ^12 || >=14} - postcss@8.5.9: resolution: {integrity: sha512-7a70Nsot+EMX9fFU3064K/kdHWZqGVY+BADLyXc8Dfv+mTLLVl6JzJpPaCZ2kQL9gIJvKXSLMHhqdRRjwQeFtw==} engines: {node: ^10 || ^12 || >=14} @@ -14262,7 +14258,7 @@ snapshots: '@ai-sdk/provider-utils': 4.0.23(zod@4.3.6) zod: 4.3.6 - '@ai-sdk/gateway@3.0.96(zod@4.3.6)': + '@ai-sdk/gateway@3.0.98(zod@4.3.6)': dependencies: '@ai-sdk/provider': 3.0.8 '@ai-sdk/provider-utils': 4.0.23(zod@4.3.6) @@ -14275,7 +14271,7 @@ snapshots: '@ai-sdk/provider-utils': 4.0.23(zod@4.3.6) zod: 4.3.6 - '@ai-sdk/openai@3.0.52(zod@4.3.6)': + '@ai-sdk/openai@3.0.53(zod@4.3.6)': dependencies: '@ai-sdk/provider': 3.0.8 '@ai-sdk/provider-utils': 4.0.23(zod@4.3.6) @@ -21658,9 +21654,9 @@ snapshots: clean-stack: 2.2.0 indent-string: 4.0.0 - ai@6.0.159(zod@4.3.6): + ai@6.0.161(zod@4.3.6): dependencies: - '@ai-sdk/gateway': 3.0.96(zod@4.3.6) + '@ai-sdk/gateway': 3.0.98(zod@4.3.6) '@ai-sdk/provider': 3.0.8 '@ai-sdk/provider-utils': 4.0.23(zod@4.3.6) '@opentelemetry/api': 1.9.0 @@ -27552,12 +27548,6 @@ snapshots: picocolors: 1.1.1 source-map-js: 1.2.1 - postcss@8.5.8: - dependencies: - nanoid: 3.3.11 - picocolors: 1.1.1 - source-map-js: 1.2.1 - postcss@8.5.9: dependencies: nanoid: 3.3.11 From 84d46c0a293e1afc90d14a3927911d103ec4e84f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 18 Apr 2026 02:34:41 +0000 Subject: [PATCH 08/79] fix(deps): update dependency react-i18next to v17.0.3 --- apps/client/package.json | 2 +- apps/website/package.json | 2 +- pnpm-lock.yaml | 24 +++++++----------------- 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/apps/client/package.json b/apps/client/package.json index 0978d1b745..8f0026fbf9 100644 --- a/apps/client/package.json +++ b/apps/client/package.json @@ -66,7 +66,7 @@ "mind-elixir": "5.10.0", "panzoom": "9.4.4", "preact": "10.29.1", - "react-i18next": "17.0.2", + "react-i18next": "17.0.3", "react-window": "2.2.7", "reveal.js": "6.0.1", "rrule": "2.8.1", diff --git a/apps/website/package.json b/apps/website/package.json index e0f95b7596..8d6267f184 100644 --- a/apps/website/package.json +++ b/apps/website/package.json @@ -13,7 +13,7 @@ "preact": "10.29.1", "preact-iso": "2.11.1", "preact-render-to-string": "6.6.7", - "react-i18next": "17.0.2" + "react-i18next": "17.0.3" }, "devDependencies": { "@preact/preset-vite": "2.10.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6c1c7168a7..f6130f62e0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -358,8 +358,8 @@ importers: specifier: 10.29.1 version: 10.29.1 react-i18next: - specifier: 17.0.2 - version: 17.0.2(i18next@26.0.4(typescript@6.0.2))(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@6.0.2) + specifier: 17.0.3 + version: 17.0.3(i18next@26.0.4(typescript@6.0.2))(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@6.0.2) react-window: specifier: 2.2.7 version: 2.2.7(react-dom@19.2.4(react@19.2.4))(react@19.2.4) @@ -910,8 +910,8 @@ importers: specifier: 6.6.7 version: 6.6.7(preact@10.29.1) react-i18next: - specifier: 17.0.2 - version: 17.0.2(i18next@26.0.4(typescript@6.0.2))(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@6.0.2) + specifier: 17.0.3 + version: 17.0.3(i18next@26.0.4(typescript@6.0.2))(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@6.0.2) devDependencies: '@preact/preset-vite': specifier: 2.10.5 @@ -11656,10 +11656,6 @@ packages: resolution: {integrity: sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==} engines: {node: ^10 || ^12 || >=14} - postcss@8.5.8: - resolution: {integrity: sha512-OW/rX8O/jXnm82Ey1k44pObPtdblfiuWnrd8X7GJ7emImCOstunGbXUpp7HdBrFQX6rJzn3sPT397Wp5aCwCHg==} - engines: {node: ^10 || ^12 || >=14} - postcss@8.5.9: resolution: {integrity: sha512-7a70Nsot+EMX9fFU3064K/kdHWZqGVY+BADLyXc8Dfv+mTLLVl6JzJpPaCZ2kQL9gIJvKXSLMHhqdRRjwQeFtw==} engines: {node: ^10 || ^12 || >=14} @@ -11887,8 +11883,8 @@ packages: peerDependencies: react: ^19.2.4 - react-i18next@17.0.2: - resolution: {integrity: sha512-shBftH2vaTWK2Bsp7FiL+cevx3xFJlvFxmsDFQSrJc+6twHkP0tv/bGa01VVWzpreUVVwU+3Hev5iFqRg65RwA==} + react-i18next@17.0.3: + resolution: {integrity: sha512-x4xjvUNZ56T+zfXWNedNnCET9Xq1IBYWX7IsWo5cCQ/RT+Rm7GWqt0h9PShFi4IhyMnsdiu1C6Jc4DE+/S3PFQ==} peerDependencies: i18next: '>= 26.0.1' react: '>= 16.8.0' @@ -27552,12 +27548,6 @@ snapshots: picocolors: 1.1.1 source-map-js: 1.2.1 - postcss@8.5.8: - dependencies: - nanoid: 3.3.11 - picocolors: 1.1.1 - source-map-js: 1.2.1 - postcss@8.5.9: dependencies: nanoid: 3.3.11 @@ -27801,7 +27791,7 @@ snapshots: react: 19.2.4 scheduler: 0.27.0 - react-i18next@17.0.2(i18next@26.0.4(typescript@6.0.2))(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@6.0.2): + react-i18next@17.0.3(i18next@26.0.4(typescript@6.0.2))(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@6.0.2): dependencies: '@babel/runtime': 7.29.2 html-parse-stringify: 3.0.1 From e5daa75cb4586f60d51133da74fa3e3de85dbff5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 18 Apr 2026 02:36:30 +0000 Subject: [PATCH 09/79] chore(deps): update node.js to v24.15.0 --- .nvmrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.nvmrc b/.nvmrc index 045200741c..eefb690f4a 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -24.14.1 \ No newline at end of file +24.15.0 \ No newline at end of file From a617b597656a22f142299a8bbde88f901af3e84b Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 18 Apr 2026 09:26:50 +0300 Subject: [PATCH 10/79] fix(print): text notes would override custom font --- apps/client/src/print.css | 11 +- .../Notes/Printing & Exporting as PDF.html | 27 +- .../Note types with split view.html | 18 +- .../Installation & Setup/Data directory.html | 23 ++ .../Desktop Installation.html | 4 +- .../en/User Guide/User Guide/Note Types.html | 190 +++++----- .../User Guide/Note Types/File.html | 37 +- .../User Guide/Note Types/Markdown.html | 88 ++--- .../Note Types/Mermaid Diagrams.html | 34 +- .../User Guide/Note Types/Render Note.html | 30 +- .../User Guide/Note Types/Spreadsheets.html | 8 +- .../User Guide/Note Types/Text.html | 333 +++++++++--------- .../Developer Guide/Documentation.md | 2 +- docs/User Guide/!!!meta.json | 141 ++++---- .../Notes/Printing & Exporting as PDF.md | 6 +- .../Installation & Setup/Data directory.md | 2 +- .../User Guide/Note Types/Markdown.md | 7 +- 17 files changed, 472 insertions(+), 489 deletions(-) diff --git a/apps/client/src/print.css b/apps/client/src/print.css index d0123c810e..b08ae29c36 100644 --- a/apps/client/src/print.css +++ b/apps/client/src/print.css @@ -1,8 +1,8 @@ @import "boxicons/css/boxicons.min.css"; :root { + --print-font-family: sans-serif; --print-font-size: 11pt; - --ck-content-color-image-caption-background: transparent !important; } @page { @@ -14,6 +14,7 @@ body { width: 100%; height: 100%; color: black; + font-family: var(--print-font-family); } .note-list-widget.full-height, @@ -26,6 +27,12 @@ body { } body[data-note-type="text"] .ck-content { + --ck-content-font-family: var(--print-font-family); + --ck-content-font-size: var(--print-font-size); + --ck-content-font-color: black; + --ck-content-line-height: 1.5; + --ck-content-color-image-caption-background: transparent; + font-size: var(--print-font-size); text-align: justify; } @@ -154,4 +161,4 @@ span[style] { .page-break::after { display: none !important; } -/* #endregion */ \ No newline at end of file +/* #endregion */ diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/Notes/Printing & Exporting as PDF.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/Notes/Printing & Exporting as PDF.html index 3083d72a84..cae0118ea7 100644 --- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/Notes/Printing & Exporting as PDF.html +++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/Notes/Printing & Exporting as PDF.html @@ -61,7 +61,8 @@ class="admonition note">
    • To print in landscape mode instead of portrait (useful for big diagrams or slides), add #printLandscape.
    • -
    • By default, the resulting PDF will be in Letter format. It is possible +
    • By default, the resulting PDF will be in Letter format. It is possible to adjust it to another page size via the #printPageSize attribute, with one of the following values: A0,
      1. First create a collection.
      2. Configure it to use List View.
      3. -
      4. Print the collection note normally.
      5. +
      6. Print the collection note normally.

      The resulting collection will contain all the children of the collection, while maintaining the hierarchy.

      @@ -100,9 +102,9 @@ class="admonition note"> href="#root/_help_4TIF1oA4VQRO">Options and assigning a key combination for:

        -
      • Print Active Note +
      • Print Active Note
      • -
      • Export Active Note as PDF +
      • Export Active Note as PDF

      Constraints & limitations

      @@ -165,19 +167,20 @@ class="admonition note"> class="reference-link" href="#root/_help_KC1HB96bqqHX">Templates.

    For example, to change the font of the document from the one defined by - the theme or the user to a serif one:

    body {
    -	--main-font-family: serif !important;
    -    --detail-font-family: var(--main-font-family) !important;
    +    the theme or the user to a serif one:

    :root {
    +	--print-font-family: serif;
    +    --print-font-size: 11pt;
     }

    To remark:

    • Multiple CSS notes can be add by using multiple ~printCss relations.
    • -
    • If the note pointing to the printCss doesn't +
    • If the note pointing to the printCss doesn't have the right note type or mime type, it will be ignored.
    • -
    • If migrating from a previous version where Custom app-wide CSS, there's no need for - @media print { since the style-sheet is used only for printing.
    • +
    • If migrating from a previous version where Custom app-wide CSS, there's no need for + @media print { since the style-sheet is used only for printing.

    Under the hood

    Both printing and exporting as PDF use the same mechanism: a note is rendered diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note types with split view.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note types with split view.html index 0f3b39ee11..605062dcaa 100644 --- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note types with split view.html +++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note types with split view.html @@ -1,8 +1,8 @@ -

    Split view is a feature of Mermaid Diagrams and  +

    Split view is a feature of Mermaid Diagrams and  Markdown notes which displays both the source code on one side + class="reference-link" href="#root/_help_6RM1Q7ppFVoj">Markdown notes which displays both the source code on one side and the preview of the content on the other.

    -

    Mermaid Diagrams also +

    Mermaid Diagrams also allow changing between a horizontal or a vertical split, to accommodate for the various sizes of diagrams.

    Display modes and interaction

    @@ -20,12 +20,12 @@
  • Preview which displays only the rendering of the diagram or text in full screen, especially useful for read-only notes.
  • -

    These buttons can be found near the Note buttons section - on the New Layout, - or in the Floating buttons on +

    These buttons can be found near the Note buttons section + on the New Layout, + or in the Floating buttons on the old layout.

    The display node is stored at note level.

    Relation to read-only notes

    -

    If a note is marked as read-only, - the source view will not be editable. While in preview mode, marking a - note as read-only has no effect since the preview itself is not editable.

    \ No newline at end of file +

    If a note is marked as read-only, the + source view will not be editable. While in preview mode, marking a note + as read-only has no effect since the preview itself is not editable.

    \ No newline at end of file diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Data directory.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Data directory.html index fbd042717a..ecd52a4302 100644 --- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Data directory.html +++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Data directory.html @@ -70,6 +70,21 @@ this:

    TRILIUM_DATA_DIR=/home/myuser/data/my-trilium-data trilium

    You can then save the above command as a shell script on your path for convenience.

    +

    Electron user data directory (desktop only)

    +

    When running the desktop application, Electron stores internal data (caches, + spell-check dictionaries, session storage, etc.) separately from the Trilium + data directory. By default this goes to the system's application data folder + (e.g. %APPDATA% on Windows), which may be + undesirable in corporate environments with roaming profiles or when running + in portable mode.

    +

    When TRILIUM_DATA_DIR is set (e.g. via the + trilium-portablescript), the Electron user data is automatically + redirected into ${TRILIUM_DATA_DIR}/electron-user-data/, + so no files are written to the system's roaming profile.

    +

    If you need to store the Electron data in a different location than the + Trilium data directory, you can set the TRILIUM_ELECTRON_DATA_DIR environment + variable to an explicit path.

    Fine-grained directory/path location

    Apart from the data directory, some of the subdirectories of it can be moved elsewhere by changing an environment variable:

    @@ -129,5 +144,13 @@ Path to Configuration (config.ini or environment variables) file. + + TRILIUM_ELECTRON_DATA_DIR + + ${TRILIUM_DATA_DIR}/electron-user-data (portable) + or system appData (default) + Directory where Electron stores internal data such as caches and spell-check + dictionaries (desktop only). + \ No newline at end of file diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Desktop Installation.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Desktop Installation.html index 40d7ddd89c..e1ea2fc9b7 100644 --- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Desktop Installation.html +++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Desktop Installation.html @@ -23,7 +23,9 @@
  • trilium-portable: Launches Trilium in portable mode, where the data directory is created within the application's directory, making it easy to move the - entire setup.
  • + entire setup. Electron's internal data (caches, dictionaries, etc.) is + also stored within the data directory, so no files are written to the system's + roaming profile.
  • trilium-safe-mode: Boots Trilium in "safe mode," disabling any startup scripts that might cause the application to crash.
  • diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types.html index 2607200081..d468c589c9 100644 --- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types.html +++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types.html @@ -9,8 +9,7 @@ note where to place the new one and select:

    • Insert note after, to put the new note underneath the one selected.
    • -
    • Insert child note, to insert the note as a child of the selected +
    • Insert child note, to insert the note as a child of the selected note.

    @@ -21,8 +20,7 @@

  • When adding a link in a Text note, type the desired title of the new note and press Enter. Afterwards the type of the note will be asked.
  • -
  • Similarly, when creating a new tab, type the desired title and press Enter.
  • +
  • Similarly, when creating a new tab, type the desired title and press Enter.
  • Changing the type of a note

    It is possible to change the type of a note after it has been created @@ -32,96 +30,94 @@ edit the source of a note.

    Supported note types

    The following note types are supported by Trilium:

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Note TypeDescription
    Text - The default note type, which allows for rich text formatting, images, - admonitions and right-to-left support.
    Code - Uses a mono-space font and can be used to store larger chunks of code - or plain text than a text note, and has better syntax highlighting.
    Saved Search - Stores the information about a search (the search text, criteria, etc.) - for later use. Can be used for quick filtering of a large amount of notes, - for example. The search can easily be triggered.
    Relation Map - Allows easy creation of notes and relations between them. Can be used - for mainly relational data such as a family tree.
    Note Map - Displays the relationships between the notes, whether via relations or - their hierarchical structure.
    Render Note - Used in Scripting, - it displays the HTML content of another note. This allows displaying any - kind of content, provided there is a script behind it to generate it.
    Collections - Displays the children of the note either as a grid, a list, or for a more - specialized case: a calendar.   -
    -
    Generally useful for easy reading of short notes.
    Mermaid Diagrams - Displays diagrams such as bar charts, flow charts, state diagrams, etc. - Requires a bit of technical knowledge since the diagrams are written in - a specialized format.
    Canvas - Allows easy drawing of sketches, diagrams, handwritten content. Uses the - same technology behind excalidraw.com.
    Web View - Displays the content of an external web page, similar to a browser.
    Mind Map - Easy for brainstorming ideas, by placing them in a hierarchical layout.
    Geo Map - Displays the children of the note as a geographical map, one use-case - would be to plan vacations. It even has basic support for tracks. Notes - can also be created from it.
    File - Represents an uploaded file such as PDFs, images, video or audio files.
    -
    \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Note TypeDescription
    Text + The default note type, which allows for rich text formatting, images, + admonitions and right-to-left support.
    Code + Uses a mono-space font and can be used to store larger chunks of code + or plain text than a text note, and has better syntax highlighting.
    Saved Search + Stores the information about a search (the search text, criteria, etc.) + for later use. Can be used for quick filtering of a large amount of notes, + for example. The search can easily be triggered.
    Relation Map + Allows easy creation of notes and relations between them. Can be used + for mainly relational data such as a family tree.
    Note Map + Displays the relationships between the notes, whether via relations or + their hierarchical structure.
    Render Note + Used in Scripting, + it displays the HTML content of another note. This allows displaying any + kind of content, provided there is a script behind it to generate it.
    Collections + Displays the children of the note either as a grid, a list, or for a more + specialized case: a calendar.   +
    +
    Generally useful for easy reading of short notes.
    Mermaid Diagrams + Displays diagrams such as bar charts, flow charts, state diagrams, etc. + Requires a bit of technical knowledge since the diagrams are written in + a specialized format.
    Canvas + Allows easy drawing of sketches, diagrams, handwritten content. Uses the + same technology behind excalidraw.com.
    Web View + Displays the content of an external web page, similar to a browser.
    Mind Map + Easy for brainstorming ideas, by placing them in a hierarchical layout.
    Geo Map + Displays the children of the note as a geographical map, one use-case + would be to plan vacations. It even has basic support for tracks. Notes + can also be created from it.
    File + Represents an uploaded file such as PDFs, images, video or audio files.
    \ No newline at end of file diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/File.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/File.html index 152140d5ed..f64ba7eade 100644 --- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/File.html +++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/File.html @@ -5,8 +5,7 @@ create a File note type directly:

    • Drag a file into the Note Tree.
    • -
    • Right click a note and select Import into note and point it to +
    • Right click a note and select Import into note and point it to one of the supported files.

    Supported file types

    @@ -83,30 +82,28 @@ href="#root/_help_BlN9DFI679QC">Ribbon.
    • Download, which will download the file for local use.
    • -
    • Open, will will open the file with the system-default application.
    • -
    • Upload new revision to replace the file with a new one.
    • +
    • Open, will will open the file with the system-default application.
    • +
    • Upload new revision to replace the file with a new one.
    - -
  • It is not possible to change the note type of a File note.
  • -
  • Convert into an attachment from the note menu.
  • + +
  • It is not possible to change the note type of a File note.
  • +
  • Convert into an attachment from the note menu.
  • Relation with other notes

    • Files are also displayed in the Note List based on their type:

      -

      - -

      + +
    • +
    • +

      Non-image files can be embedded into text notes as read-only widgets via + the Include Note functionality.

      +
    • +
    • +

      Image files can be embedded into text notes like normal images via  + Image references.

    • -
    • Non-image files can be embedded into text notes as read-only widgets via - the Include Note functionality.
    • -
    • Image files can be embedded into text notes like normal images via  - Image references.
    \ No newline at end of file diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Markdown.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Markdown.html index 74cf113776..2d3d41e7f9 100644 --- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Markdown.html +++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Markdown.html @@ -1,13 +1,12 @@ -

    Trilium has always supported Markdown through its import feature, +

    Trilium has always supported Markdown through its import feature, however the file was either transformed to a Text note - (converted to Trilium's internal HTML format) or saved as a Code note + href="#root/_help_iPIMuisry3hd">Text note (converted to Trilium's internal + HTML format) or saved as a Code note with only syntax highlight.

    This note type is a split view, meaning that both the source code and a preview of the document are displayed side-by-side. See Note types with split view for - more information.

    + href="#root/_help_SL5f1Auq7sVN">Note types with split view for more + information.

    Rationale

    The goal of this note type is to fill a gap: rendering Markdown but not altering its structure or its whitespace which would inevitably change @@ -33,65 +32,53 @@

    The following features are supported by Trilium's Markdown format and will show up in the preview pane:

      -
    • All standard and GitHub-flavored syntax (basic formatting, tables, blockquotes)
    • -
    • Code blocks with syntax highlight (e.g. ```js) - and automatic syntax highlight
    • -
    • Block quotes & admonitions -
    • -
    • Math Equations -
    • -
    • Mermaid Diagrams using - ```mermaid -
    • -
    • -

      Include Note (no - builtin Markdown syntax, but HTML syntax works just fine):

      <section class="include-note" data-note-id="vJDjQm0VK8Na" data-box-size="expandable">
      -	&nbsp;
      +  
    • +

      All standard and GitHub-flavored syntax (basic formatting, tables, blockquotes)

      +
    • +
    • +

      Code blocks with syntax highlight (e.g. <!--CODE_BLOCK_1776493385878_0-->mermaid +

      +
    • +
    • +

      Include Note (no + builtin Markdown syntax, but HTML syntax works just fine):

      <section class="include-note" data-note-id="vJDjQm0VK8Na" data-box-size="expandable">
      +    &nbsp;
       </section>n
      -
    • -
    • -

      Internal (reference) links via - its HTML syntax, or through a Wikilinks-like format (only  - Note ID):

      [[Hg8TS5ZOxti6]]
      -
    • +
    • +
    • +

      Internal (reference) links via + its HTML syntax, or through a Wikilinks-like format (only  + Note ID):

      [[Hg8TS5ZOxti6]]
      +

    Creating Markdown notes

    There are two ways to create a Markdown note:

      -
    1. Create a new note (e.g. in the Note Tree) +
    2. Create a new note (e.g. in the Note Tree) and select the type Markdown, just like all the other note types.
    3. -
    4. Create a note of type Code and - select as the language either Markdown or GitHub-Flavored Markdown. +
    5. Create a note of type Code and + select as the language either Markdown or GitHub-Flavored Markdown. This maintains compatibility with your existing notes prior to the introduction of this feature.

    Import/export

    • By default, when importing a single Markdown file it automatically gets - converted to a Text note. + converted to a Text note. To avoid that and have it imported as a Markdown note instead:

        -
      • -

        Right click the Note Tree and - select Import into note.

        -
      • -
      • -

        Select the file normally.

        -
      • -
      • -

        Uncheck Import HTML, Markdown and TXT as text notes if it's unclear from the metadata.

        -
      • +
      • Right click the Note Tree and + select Import into note.
      • +
      • Select the file normally.
      • +
      • Uncheck Import HTML, Markdown and TXT as text notes if it's unclear from the metadata.
    • @@ -105,9 +92,8 @@

    Conversion between text notes and Markdown notes

    Currently there is no built-in functionality to convert a Text note - into a Markdown note or vice-versa. We do have plans to address this in - the future.

    + href="#root/_help_iPIMuisry3hd">Text note into a Markdown note or vice-versa. + We do have plans to address this in the future.

    This can be achieved manually, for a single note:

    1. Export the file as Markdown, with single format.
    2. @@ -135,6 +121,6 @@

      This feature of synchronizing the scroll is based on blocks but it's provided on a best-effort basis since our underlying Markdown library doesn't support this feature natively, so we had to implement our own algorithm. Feel free - to report issues, - but always provide a sample Markdown file to be able to reproduce it.

      + to report issues, but always provide a + sample Markdown file to be able to reproduce it.

      \ No newline at end of file diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Mermaid Diagrams.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Mermaid Diagrams.html index d6ff44cd93..a17a7ea0a8 100644 --- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Mermaid Diagrams.html +++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Mermaid Diagrams.html @@ -12,8 +12,8 @@ the diagram.

      This note type is a split view, meaning that both the source code and a preview of the document are displayed side-by-side. See Note types with split view for - more information.

      + href="#root/_help_SL5f1Auq7sVN">Note types with split view for more + information.

      Sample diagrams

      Starting with v0.103.0, Mermaid diagrams no longer start with a sample flowchart, but instead a pane at the bottom will show all the supported @@ -52,34 +52,30 @@

    3. The preview can be moved around by holding the left mouse button and dragging.
    4. -
    5. Zooming can also be done by using the scroll wheel.
    6. -
    7. The zoom and position on the preview will remain fixed as the diagram - changes, to be able to work more easily with large diagrams.
    8. - +
    9. Zooming can also be done by using the scroll wheel.
    10. +
    11. The zoom and position on the preview will remain fixed as the diagram + changes, to be able to work more easily with large diagrams.
    12. +
    13. The size of the source/preview panes can be adjusted by hovering over the border between them and dragging it with the mouse.
    14. In the Floating buttons area:
      • The source/preview can be laid out left-right or bottom-top via the Move editing pane to the left / bottom option.
      • -
      • Press Lock editing to automatically mark the note as read-only. +
      • Press Lock editing to automatically mark the note as read-only. In this mode, the code pane is hidden and the diagram is displayed full-size. Similarly, press Unlock editing to mark a read-only note as editable.
      • -
      • Press the Copy image reference to the clipboard to be able to insert - the image representation of the diagram into a text note. See Image references for more information.
      • -
      • Press the Export diagram as SVG to download a scalable/vector rendering - of the diagram. Can be used to present the diagram without degrading when - zooming.
      • +
      • Press the Copy image reference to the clipboard to be able to insert + the image representation of the diagram into a text note. See Image references for more information.
      • +
      • Press the Export diagram as SVG to download a scalable/vector rendering + of the diagram. Can be used to present the diagram without degrading when + zooming.
      • Press the Export diagram as PNG to download a normal image (at 1x scale, raster) of the diagram. Can be used to send the diagram in more traditional channels such as e-mail.
      • -
      -
    15. + +

      Errors in the diagram

      If there is an error in the source code, the error will be displayed in diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Render Note.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Render Note.html index 4a33c30bfe..efff5c09b9 100644 --- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Render Note.html +++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Render Note.html @@ -13,13 +13,11 @@

      1. HTML language for the legacy/vanilla method, with what needs to be displayed (for example <p>Hello world.</p>).
      2. -
      3. JSX for the Preact-based approach (see below).
      4. -
      +
    16. JSX for the Preact-based approach (see below).
    17. +
  • Create a Render Note.
  • -
  • Assign the renderNote relation to +
  • Assign the renderNote relation to point at the previously created code note.
  • Legacy scripting using jQuery

    @@ -48,9 +46,10 @@ $dateEl.text(new Date());
    need to provide a HTML anymore.

    Here are the steps to creating a simple render note:

      -
    1. Create a note of type Render Note.
    2. -
    3. +
    4. +

      Create a note of type Render Note.

      +
    5. +
    6. Create a child Code note with JSX as the language.
      As an example, use the following content:

      export default function() {
      @@ -60,17 +59,20 @@ $dateEl.text(new Date());
      </> ); }
      -
    7. -
    8. In the parent render note, define a ~renderNote relation - pointing to the newly created child.
    9. -
    10. Refresh the render note and it should display a “Hello world” message.
    11. + +
    12. +

      In the parent render note, define a ~renderNote relation + pointing to the newly created child.

      +
    13. +
    14. +

      Refresh the render note and it should display a “Hello world” message.

      +

    Refreshing the note

    It's possible to refresh the note via:

    Examples

    diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Spreadsheets.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Spreadsheets.html index 06f944a848..b9ab252d4c 100644 --- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Spreadsheets.html +++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Spreadsheets.html @@ -64,9 +64,8 @@ yet:

    • Trilium-specific formulas (e.g. to obtain the title of a note).
    • -
    • User-defined formulas
    • -
    • Cross-workbook calculation
    • +
    • User-defined formulas
    • +
    • Cross-workbook calculation

    If you would like us to work on these features, consider supporting us.

    Known limitations

    @@ -81,8 +80,7 @@
  • There is currently no export functionality, as stated previously.
  • -
  • There is no dedicated mobile support. Mobile support is currently experimental +
  • There is no dedicated mobile support. Mobile support is currently experimental in Univer and when it becomes stable, we could potentially integrate it into Trilium as well.
  • \ No newline at end of file diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Text.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Text.html index 26a0791ace..42dbe0fa44 100644 --- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Text.html +++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Text.html @@ -20,171 +20,168 @@

    Fore more information see Formatting toolbar.

    Features and formatting

    Here's a list of various features supported by text notes:

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Dedicated articleFeature
    General formatting - -
      -
    • Headings (section titles, paragraph)
    • -
    • Font size
    • -
    • Bold, italic, underline, strike-through
    • -
    • Superscript, subscript
    • -
    • Font color & background color
    • -
    • Remove formatting
    • -
    -
    Lists - -
      -
    • Bulleted lists
    • -
    • Numbered lists
    • -
    • To-do lists
    • -
    -
    Block quotes & admonitions - -
      -
    • Block quotes
    • -
    • Admonitions
    • -
    -
    Tables - -
      -
    • Basic tables
    • -
    • Merging cells
    • -
    • Styling tables and cells.
    • -
    • Table captions
    • -
    -
    Developer-specific formatting - -
      -
    • Inline code
    • -
    • Code blocks
    • -
    • Keyboard shortcuts
    • -
    -
    Footnotes - -
      -
    • Footnotes
    • -
    -
    Images - -
      -
    • Images
    • -
    -
    Links - -
      -
    • External links
    • -
    • Internal Trilium links
    • -
    -
    Include Note - -
      -
    • Include note
    • -
    -
    Insert buttons - -
      -
    • Symbols
    • -
    • Math Equations -
    • -
    • Mermaid diagrams
    • -
    • Horizontal ruler
    • -
    • Page break
    • -
    -
    Other features - - -
    Premium features - - -
    -
    -

    Read-Only vs. Editing Mode

    -

    Text notes are usually opened in edit mode. However, they may open in - read-only mode if the note is too big or the note is explicitly marked - as read-only. For more information, see Read-Only Notes.

    -

    Keyboard shortcuts

    -

    There are numerous keyboard shortcuts to format the text without having - to use the mouse. For a reference of all the key combinations, see  - Keyboard Shortcuts. In addition, see Markdown-like formatting as an alternative - to the keyboard shortcuts.

    -

    Technical details

    -

    For the text editing functionality, Trilium uses a commercial product - (with an open-source base) called CKEditor. - This brings the benefit of having a powerful WYSIWYG (What You See Is What - You Get) editor.

    \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Dedicated articleFeature
    General formatting + +
      +
    • Headings (section titles, paragraph)
    • +
    • Font size
    • +
    • Bold, italic, underline, strike-through
    • +
    • Superscript, subscript
    • +
    • Font color & background color
    • +
    • Remove formatting
    • +
    +
    Lists + +
      +
    • Bulleted lists
    • +
    • Numbered lists
    • +
    • To-do lists
    • +
    +
    Block quotes & admonitions + +
      +
    • Block quotes
    • +
    • Admonitions
    • +
    +
    Tables + +
      +
    • Basic tables
    • +
    • Merging cells
    • +
    • Styling tables and cells.
    • +
    • Table captions
    • +
    +
    Developer-specific formatting + +
      +
    • Inline code
    • +
    • Code blocks
    • +
    • Keyboard shortcuts
    • +
    +
    Footnotes + +
      +
    • Footnotes
    • +
    +
    Images + +
      +
    • Images
    • +
    +
    Links + +
      +
    • External links
    • +
    • Internal Trilium links
    • +
    +
    Include Note + +
      +
    • Include note
    • +
    +
    Insert buttons + +
      +
    • Symbols
    • +
    • Math Equations +
    • +
    • Mermaid diagrams
    • +
    • Horizontal ruler
    • +
    • Page break
    • +
    +
    Other features + + +
    Premium features + + +
    +

    Read-Only vs. Editing Mode

    +

    Text notes are usually opened in edit mode. However, they may open in + read-only mode if the note is too big or the note is explicitly marked + as read-only. For more information, see Read-Only Notes.

    +

    Keyboard shortcuts

    +

    There are numerous keyboard shortcuts to format the text without having + to use the mouse. For a reference of all the key combinations, see  + Keyboard Shortcuts. In addition, see Markdown-like formatting as an alternative + to the keyboard shortcuts.

    +

    Technical details

    +

    For the text editing functionality, Trilium uses a commercial product + (with an open-source base) called CKEditor. + This brings the benefit of having a powerful WYSIWYG (What You See Is What + You Get) editor.

    \ No newline at end of file diff --git a/docs/Developer Guide/Developer Guide/Documentation.md b/docs/Developer Guide/Developer Guide/Documentation.md index aae807a49d..8b2fdc9998 100644 --- a/docs/Developer Guide/Developer Guide/Documentation.md +++ b/docs/Developer Guide/Developer Guide/Documentation.md @@ -1,5 +1,5 @@ # Documentation -There are multiple types of documentation for Trilium: +There are multiple types of documentation for Trilium: * The _User Guide_ represents the user-facing documentation. This documentation can be browsed by users directly from within Trilium, by pressing F1. * The _Developer's Guide_ represents a set of Markdown documents that present the internals of Trilium, for developers. diff --git a/docs/User Guide/!!!meta.json b/docs/User Guide/!!!meta.json index d1b8f5d265..92af202232 100644 --- a/docs/User Guide/!!!meta.json +++ b/docs/User Guide/!!!meta.json @@ -3984,42 +3984,42 @@ "name": "internalLink", "value": "s1aBHPd79XYj", "isInheritable": false, - "position": 30 + "position": 10 }, { "type": "relation", "name": "internalLink", "value": "6RM1Q7ppFVoj", "isInheritable": false, - "position": 40 - }, - { - "type": "relation", - "name": "internalLink", - "value": "CoFPLs3dRlXc", - "isInheritable": false, - "position": 50 + "position": 20 }, { "type": "relation", "name": "internalLink", "value": "8YBEPzcpUgxw", "isInheritable": false, - "position": 60 + "position": 30 }, { "type": "relation", "name": "internalLink", "value": "IjZS7iK5EXtb", "isInheritable": false, - "position": 70 + "position": 40 }, { "type": "relation", "name": "internalLink", "value": "XpOYSgsLkTJy", "isInheritable": false, - "position": 80 + "position": 50 + }, + { + "type": "relation", + "name": "internalLink", + "value": "CoFPLs3dRlXc", + "isInheritable": false, + "position": 60 }, { "type": "label", @@ -10147,17 +10147,24 @@ { "type": "relation", "name": "internalLink", - "value": "XpOYSgsLkTJy", + "value": "SL5f1Auq7sVN", "isInheritable": false, "position": 20 }, { "type": "relation", "name": "internalLink", - "value": "0Ofbk1aSuVRu", + "value": "XpOYSgsLkTJy", "isInheritable": false, "position": 30 }, + { + "type": "relation", + "name": "internalLink", + "value": "0Ofbk1aSuVRu", + "isInheritable": false, + "position": 40 + }, { "type": "label", "name": "shareAlias", @@ -10171,13 +10178,6 @@ "value": "bx bx-selection", "isInheritable": false, "position": 20 - }, - { - "type": "relation", - "name": "internalLink", - "value": "SL5f1Auq7sVN", - "isInheritable": false, - "position": 40 } ], "format": "markdown", @@ -10839,39 +10839,53 @@ "type": "text", "mime": "text/html", "attributes": [ - { - "type": "label", - "name": "iconClass", - "value": "bx bxl-markdown", - "isInheritable": false, - "position": 30 - }, - { - "type": "label", - "name": "shareAlias", - "value": "markdown", - "isInheritable": false, - "position": 40 - }, { "type": "relation", "name": "internalLink", "value": "Oau6X9rCuegd", "isInheritable": false, - "position": 50 + "position": 10 }, { "type": "relation", "name": "internalLink", "value": "iPIMuisry3hd", "isInheritable": false, - "position": 60 + "position": 20 }, { "type": "relation", "name": "internalLink", "value": "6f9hih2hXXZk", "isInheritable": false, + "position": 30 + }, + { + "type": "relation", + "name": "internalLink", + "value": "SL5f1Auq7sVN", + "isInheritable": false, + "position": 40 + }, + { + "type": "relation", + "name": "internalLink", + "value": "nBAXQFj20hS1", + "isInheritable": false, + "position": 50 + }, + { + "type": "relation", + "name": "internalLink", + "value": "hrZ1D00cLbal", + "isInheritable": false, + "position": 60 + }, + { + "type": "relation", + "name": "internalLink", + "value": "m1lbrzyKDaRB", + "isInheritable": false, "position": 70 }, { @@ -10886,56 +10900,21 @@ "name": "internalLink", "value": "wy8So3yZZlH9", "isInheritable": false, - "position": 150 + "position": 90 }, { - "type": "relation", - "name": "internalLink", - "value": "SL5f1Auq7sVN", + "type": "label", + "name": "iconClass", + "value": "bx bxl-markdown", "isInheritable": false, - "position": 160 + "position": 30 }, { - "type": "relation", - "name": "internalLink", - "value": "NwBbFdNZ9h7O", + "type": "label", + "name": "shareAlias", + "value": "markdown", "isInheritable": false, - "position": 170 - }, - { - "type": "relation", - "name": "internalLink", - "value": "YfYAtQBcfo5V", - "isInheritable": false, - "position": 180 - }, - { - "type": "relation", - "name": "internalLink", - "value": "s1aBHPd79XYj", - "isInheritable": false, - "position": 190 - }, - { - "type": "relation", - "name": "internalLink", - "value": "nBAXQFj20hS1", - "isInheritable": false, - "position": 200 - }, - { - "type": "relation", - "name": "internalLink", - "value": "hrZ1D00cLbal", - "isInheritable": false, - "position": 210 - }, - { - "type": "relation", - "name": "internalLink", - "value": "m1lbrzyKDaRB", - "isInheritable": false, - "position": 220 + "position": 40 } ], "format": "markdown", diff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Printing & Exporting as PDF.md b/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Printing & Exporting as PDF.md index b110d09b03..221ba93c9a 100644 --- a/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Printing & Exporting as PDF.md +++ b/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Printing & Exporting as PDF.md @@ -99,9 +99,9 @@ To do so: For example, to change the font of the document from the one defined by the theme or the user to a serif one: ``` -body { - --main-font-family: serif !important; - --detail-font-family: var(--main-font-family) !important; +:root { + --print-font-family: serif; + --print-font-size: 11pt; } ``` diff --git a/docs/User Guide/User Guide/Installation & Setup/Data directory.md b/docs/User Guide/User Guide/Installation & Setup/Data directory.md index 3a447f82f2..b9df162b9e 100644 --- a/docs/User Guide/User Guide/Installation & Setup/Data directory.md +++ b/docs/User Guide/User Guide/Installation & Setup/Data directory.md @@ -97,4 +97,4 @@ Apart from the data directory, some of the subdirectories of it can be moved els | `TRILIUM_TMP_DIR` | `${TRILIUM_DATA_DIR}/tmp` | Directory where temporary files are stored (for example when opening in an external app). | | `TRILIUM_ANONYMIZED_DB_DIR` | `${TRILIUM_DATA_DIR}/anonymized-db` | Directory where a Anonymized Database is stored. | | `TRILIUM_CONFIG_INI_PATH` | `${TRILIUM_DATA_DIR}/config.ini` | Path to Configuration (config.ini or environment variables) file. | -| `TRILIUM_ELECTRON_DATA_DIR` | `${TRILIUM_DATA_DIR}/electron-user-data` (portable) or system appData (default) | Directory where Electron stores internal data such as caches and spell-check dictionaries (desktop only). | +| `TRILIUM_ELECTRON_DATA_DIR` | `${TRILIUM_DATA_DIR}/electron-user-data` (portable) or system appData (default) | Directory where Electron stores internal data such as caches and spell-check dictionaries (desktop only). | \ No newline at end of file diff --git a/docs/User Guide/User Guide/Note Types/Markdown.md b/docs/User Guide/User Guide/Note Types/Markdown.md index b96b627329..4913eb5f83 100644 --- a/docs/User Guide/User Guide/Note Types/Markdown.md +++ b/docs/User Guide/User Guide/Note Types/Markdown.md @@ -25,15 +25,12 @@ Even if Markdown is now specially treated by having a preview mechanism, Trilium The following features are supported by Trilium's Markdown format and will show up in the preview pane: * All standard and GitHub-flavored syntax (basic formatting, tables, blockquotes) -* Code blocks with syntax highlight (e.g. ` ```js `) and automatic syntax highlight -* Block quotes & admonitions -* Math Equations -* Mermaid Diagrams using ` ```mermaid ` +* Code blocks with syntax highlight (e.g. `mermaid` * Include Note (no builtin Markdown syntax, but HTML syntax works just fine): ```
    -   +  
    n ``` * Internal (reference) links via its HTML syntax, or through a _Wikilinks_\-like format (only Note ID): From 1674bf0a87feb839865eb2cb4c093f2bd645d03d Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 18 Apr 2026 09:28:54 +0300 Subject: [PATCH 11/79] fix(print): wait for custom fonts to be loaded (closes #8097) --- apps/client/src/print.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/client/src/print.tsx b/apps/client/src/print.tsx index c943413c49..11d1cad7b8 100644 --- a/apps/client/src/print.tsx +++ b/apps/client/src/print.tsx @@ -105,6 +105,9 @@ function SingleNoteRenderer({ note, onReady }: RendererProps) { // Check custom CSS. await loadCustomCss(note); + + // Wait for all fonts (including those from custom CSS) to finish loading. + await document.fonts.ready; } load().then(() => requestAnimationFrame(() => onReady({ @@ -130,6 +133,7 @@ function CollectionRenderer({ note, onReady, onProgressChanged }: RendererProps) media="print" onReady={async (data: PrintReport) => { await loadCustomCss(note); + await document.fonts.ready; onReady(data); }} onProgressChanged={onProgressChanged} From 374eeaeb08bc60c734412d95bf9b5b4314993e43 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 18 Apr 2026 09:37:30 +0300 Subject: [PATCH 12/79] feat(print): respect user's detail font when printing --- apps/client/src/print.css | 3 ++- apps/client/src/print.tsx | 7 +++++++ .../Notes/Printing & Exporting as PDF.html | 8 +++++++- .../Notes/Printing & Exporting as PDF.md | 5 ++++- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/apps/client/src/print.css b/apps/client/src/print.css index b08ae29c36..25a61e5bf4 100644 --- a/apps/client/src/print.css +++ b/apps/client/src/print.css @@ -1,7 +1,6 @@ @import "boxicons/css/boxicons.min.css"; :root { - --print-font-family: sans-serif; --print-font-size: 11pt; } @@ -11,6 +10,8 @@ html, body { + --print-font-family: var(--detail-font-family, sans-serif); + width: 100%; height: 100%; color: black; diff --git a/apps/client/src/print.tsx b/apps/client/src/print.tsx index 11d1cad7b8..2a7f25161a 100644 --- a/apps/client/src/print.tsx +++ b/apps/client/src/print.tsx @@ -31,6 +31,13 @@ async function main() { if (!noteId) return; await import("./print.css"); + + // Load the user's font preferences so that --detail-font-family is available. + const fontLink = document.createElement("link"); + fontLink.rel = "stylesheet"; + fontLink.href = "api/fonts"; + document.head.appendChild(fontLink); + const note = await froca.getNote(noteId); const bodyWrapper = document.createElement("div"); diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/Notes/Printing & Exporting as PDF.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/Notes/Printing & Exporting as PDF.html index cae0118ea7..95992cf3d4 100644 --- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/Notes/Printing & Exporting as PDF.html +++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/Notes/Printing & Exporting as PDF.html @@ -167,10 +167,16 @@ class="admonition note"> class="reference-link" href="#root/_help_KC1HB96bqqHX">Templates.

    For example, to change the font of the document from the one defined by - the theme or the user to a serif one:

    :root {
    +    the theme or the user to a serif one:

    body {
     	--print-font-family: serif;
         --print-font-size: 11pt;
     }
    +

    To remark:

    -

    Limitations

    -
      -
    • Currently it's not possible to create a link to a bookmark from a different - note. This functionality will be added after the internal links feature - is enhanced to support bookmarks.
    • -
    \ No newline at end of file +

    Linking across notes

    +

    Trilium v0.103.0 introduces cross-note bookmarks, which makes it possible + to create Internal (reference) links which + point to a specific bookmark in that document.

    +

    To do so:

    +
      +
    1. +

      First, create a bookmark in the target note using the same process as + described above.

      +
    2. +
    3. +

      In another note, press Ctrl+L to insert an internal + link. Select the target note containing bookmarks.

      +
    4. +
    5. +

      If the target note contains bookmarks, a section will appear underneath + the note selector with the list of bookmarks.

      +
    6. +
    7. +

      Add the link normally.

      +
    8. +
    +

    Clicking on a reference link pointing to a bookmark will automatically + scroll to the desired section.

    + \ No newline at end of file diff --git a/docs/Developer Guide/Developer Guide/Documentation.md b/docs/Developer Guide/Developer Guide/Documentation.md index 8b2fdc9998..18b7705caf 100644 --- a/docs/Developer Guide/Developer Guide/Documentation.md +++ b/docs/Developer Guide/Developer Guide/Documentation.md @@ -1,5 +1,5 @@ # Documentation -There are multiple types of documentation for Trilium: +There are multiple types of documentation for Trilium: * The _User Guide_ represents the user-facing documentation. This documentation can be browsed by users directly from within Trilium, by pressing F1. * The _Developer's Guide_ represents a set of Markdown documents that present the internals of Trilium, for developers. diff --git a/docs/User Guide/!!!meta.json b/docs/User Guide/!!!meta.json index 92af202232..61858de2ff 100644 --- a/docs/User Guide/!!!meta.json +++ b/docs/User Guide/!!!meta.json @@ -5413,6 +5413,20 @@ "value": "bx bx-bookmarks", "isInheritable": false, "position": 30 + }, + { + "type": "relation", + "name": "internalLink", + "value": "oSuaNgyyKnhu", + "isInheritable": false, + "position": 40 + }, + { + "type": "relation", + "name": "internalLink", + "value": "iPIMuisry3hd", + "isInheritable": false, + "position": 50 } ], "format": "markdown", @@ -7305,6 +7319,34 @@ "value": "bookmarks", "isInheritable": false, "position": 30 + }, + { + "type": "relation", + "name": "internalLink", + "value": "u3YFHC9tQlpm", + "isInheritable": false, + "position": 40 + }, + { + "type": "relation", + "name": "internalLink", + "value": "xYmIYSP6wE3F", + "isInheritable": false, + "position": 50 + }, + { + "type": "relation", + "name": "internalLink", + "value": "ZlN4nump6EbW", + "isInheritable": false, + "position": 60 + }, + { + "type": "relation", + "name": "internalLink", + "value": "hrZ1D00cLbal", + "isInheritable": false, + "position": 70 } ], "format": "markdown", diff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Bookmarks.md b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Bookmarks.md index 332ec24172..321cf83f21 100644 --- a/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Bookmarks.md +++ b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Bookmarks.md @@ -1,4 +1,7 @@ # Bookmarks +> [!NOTE] +> Not to be confused with the Bookmarks concept for Text notes which acts like anchors, allowing navigation to a particular section. + Frequently used notes can be bookmarked, which will make them appear in the Launch Bar for easy access. ## Configuring the launch bar diff --git a/docs/User Guide/User Guide/Note Types/Text/Bookmarks.md b/docs/User Guide/User Guide/Note Types/Text/Bookmarks.md index e6321b5b89..6a699b139c 100644 --- a/docs/User Guide/User Guide/Note Types/Text/Bookmarks.md +++ b/docs/User Guide/User Guide/Note Types/Text/Bookmarks.md @@ -1,5 +1,8 @@ # Bookmarks -Bookmarks allows creating [links](Links.md) to a certain part of a note, such as referencing a particular heading. +> [!NOTE] +> Not to be confused with [bookmarked notes](../../Basic%20Concepts%20and%20Features/Navigation/Bookmarks.md), which simply pins a particular note to the Launch Bar for easy access. + +Bookmarks allows creating [links](Links.md) to a certain part of a note, such as referencing a particular heading or section within a note. Technically, bookmarks are HTML anchors. @@ -10,10 +13,26 @@ This feature was introduced in TriliumNext 0.94.0. * To create a bookmark: * Place the cursor at the desired position where to place the bookmark. * Look for the button in the Formatting toolbar, and then press the button. + * Alternatively, use Slash Commands and look for _Bookmark_. * To place a link to a bookmark: * Place the cursor at the desired position of the link. * From the [link](Links.md) pane, select the _Bookmarks_ section and select the desired bookmark. -## Limitations +## Linking across notes -* Currently it's not possible to create a link to a bookmark from a different note. This functionality will be added after the internal links feature is enhanced to support bookmarks. \ No newline at end of file +Trilium v0.103.0 introduces cross-note bookmarks, which makes it possible to create Internal (reference) links which point to a specific bookmark in that document. + +To do so: + +1. First, create a bookmark in the target note using the same process as described above. +2. In another note, press Ctrl+L to insert an internal link. Select the target note containing bookmarks. +3. If the target note contains bookmarks, a section will appear underneath the note selector with the list of bookmarks. +4. Add the link normally. + +Clicking on a reference link pointing to a bookmark will automatically scroll to the desired section. + +> [!NOTE] +> For notes created prior to Trilium v0.103.0, you might notice that the bookmarks might not be identified: +> +> * To fix this, simply go that note and make any change (e.g. inserting a space), this will trigger the recalculation of the links. +> * This limitation is intentional in order not to have to re-process all the notes, looking for anchors. \ No newline at end of file From 4244b66ceaccceb5515b5c6a645c43b0e85d23df Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 18 Apr 2026 11:04:20 +0300 Subject: [PATCH 26/79] feat(text): rebrand bookmarks to anchors --- .../src/translations/en/translation.json | 4 +- apps/client/src/widgets/dialogs/add_link.tsx | 4 +- .../doc_notes/en/User Guide/!!!meta.json | 2 +- .../Navigation/Bookmarks.html | 5 - ..._Bookmarks_plus.png => 1_Anchors_plus.png} | Bin .../User Guide/Note Types/Text/Anchors.html | 62 ++++++ .../{Bookmarks_plus.png => Anchors_plus.png} | Bin .../User Guide/Note Types/Text/Bookmarks.html | 73 ------- .../Links/Internal (reference) links.html | 7 +- docs/User Guide/!!!meta.json | 197 ++++++++---------- .../Navigation/Bookmarks.md | 3 - ..._Bookmarks_plus.png => 1_Anchors_plus.png} | Bin .../User Guide/Note Types/Text/Anchors.md | 36 ++++ .../{Bookmarks_plus.png => Anchors_plus.png} | Bin .../User Guide/Note Types/Text/Bookmarks.md | 38 ---- .../Note Types/Text/Insert buttons.md | 2 +- .../ckeditor5/src/extra_slash_commands.ts | 8 +- .../ckeditor5/src/translation_overrides.ts | 11 +- 18 files changed, 210 insertions(+), 242 deletions(-) rename apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Text/{1_Bookmarks_plus.png => 1_Anchors_plus.png} (100%) create mode 100644 apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Text/Anchors.html rename apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Text/{Bookmarks_plus.png => Anchors_plus.png} (100%) delete mode 100644 apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Text/Bookmarks.html rename docs/User Guide/User Guide/Note Types/Text/{1_Bookmarks_plus.png => 1_Anchors_plus.png} (100%) create mode 100644 docs/User Guide/User Guide/Note Types/Text/Anchors.md rename docs/User Guide/User Guide/Note Types/Text/{Bookmarks_plus.png => Anchors_plus.png} (100%) delete mode 100644 docs/User Guide/User Guide/Note Types/Text/Bookmarks.md diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json index 3145ff7f03..79cf207780 100644 --- a/apps/client/src/translations/en/translation.json +++ b/apps/client/src/translations/en/translation.json @@ -41,8 +41,8 @@ "link_title_mirrors": "link title mirrors the note's current title", "link_title_arbitrary": "link title can be changed arbitrarily", "link_title": "Link title", - "bookmark": "Bookmark (optional)", - "bookmark_none": "None (link to note)", + "anchor": "Anchor (optional)", + "anchor_none": "None (link to note)", "button_add_link": "Add link" }, "branch_prefix": { diff --git a/apps/client/src/widgets/dialogs/add_link.tsx b/apps/client/src/widgets/dialogs/add_link.tsx index e61e476190..f68e38bfc4 100644 --- a/apps/client/src/widgets/dialogs/add_link.tsx +++ b/apps/client/src/widgets/dialogs/add_link.tsx @@ -163,13 +163,13 @@ export default function AddLinkDialog() { {bookmarks.length > 0 && ( - + setDescription((e.target as HTMLInputElement).value)} + style={{ width: "200px" }} + /> + + )} + + {titleBarButtons?.filter((b) => b !== null).map((titleBarButton) => ( + - )} - - {titleBarButtons?.filter((b) => b !== null).map((titleBarButton) => ( -