Merge remote-tracking branch 'origin/main'

This commit is contained in:
Elian Doran
2025-11-05 21:00:28 +02:00
26 changed files with 333 additions and 118 deletions

View File

@@ -11,7 +11,7 @@
"license": "AGPL-3.0-only",
"packageManager": "pnpm@10.20.0",
"devDependencies": {
"@redocly/cli": "2.10.0",
"@redocly/cli": "2.11.0",
"archiver": "7.0.1",
"fs-extra": "11.3.2",
"react": "19.2.0",

View File

@@ -159,7 +159,7 @@ describe("shortcuts", () => {
expect(matchesShortcut(event, "Shift+F1")).toBeTruthy();
// Special keys
for (const keyCode of [ "Delete", "Enter" ]) {
for (const keyCode of [ "Delete", "Enter", "NumpadEnter" ]) {
event = createKeyboardEvent({ key: keyCode, code: keyCode });
expect(matchesShortcut(event, keyCode), `Key ${keyCode}`).toBeTruthy();
}

View File

@@ -46,6 +46,7 @@ for (let i = 1; i <= 19; i++) {
const KEYCODES_WITH_NO_MODIFIER = new Set([
"Delete",
"Enter",
"NumpadEnter",
...functionKeyCodes
]);

View File

@@ -1,6 +1,6 @@
{
"formatVersion": 2,
"appVersion": "0.99.2",
"appVersion": "0.99.3",
"files": [
{
"isClone": false,
@@ -2700,6 +2700,7 @@
}
],
"format": "html",
"dataFileName": "Note Types.html",
"attachments": [],
"dirFileName": "Note Types",
"children": [

View File

@@ -270,7 +270,7 @@
</li>
</ul>
</li>
<li>Note Types
<li><a href="root/Trilium%20Demo/Note%20Types.html" target="detail">Note Types</a>
<ul>
<li><a href="root/Trilium%20Demo/Note%20Types/Canvas.json" target="detail">Canvas</a>
</li>

View File

@@ -14,6 +14,7 @@
<div class="ck-content">
<h2>☑️ Tasks</h2>
<ul>
<li data-list-item-id="e4b26220d6ce48997f1116dc1d1d83dc0">[…]</li>
</ul>

View File

@@ -14,11 +14,10 @@
<div class="ck-content">
<figure class="image image-style-align-right image_resized" style="width:29.84%;">
<img style="aspect-ratio:150/150;" src="Trilium Demo_icon-color.svg" width="150"
height="150">
<img style="aspect-ratio:150/150;" src="Trilium Demo_icon-color.svg"
width="150" height="150">
</figure>
<p><strong>Welcome to Trilium Notes!</strong>
</p>
<p>This is a "demo" document packaged with Trilium to showcase some of its
features and also give you some ideas on how you might structure your notes.
@@ -26,22 +25,17 @@
you wish.</p>
<p>If you need any help, visit <a href="https://triliumnotes.org">triliumnotes.org</a> or
our <a href="https://github.com/TriliumNext">GitHub repository</a>
</p>
<h2>Cleanup</h2>
<p>Once you're finished with experimenting and want to cleanup these pages,
you can simply delete them all.</p>
<h2>Formatting</h2>
<p>Trilium supports classic formatting like <em>italic</em>, <strong>bold</strong>, <em><strong>bold and italic</strong></em>.
You can add links pointing to <a href="https://triliumnotes.org/">external pages</a> or&nbsp;
<a
class="reference-link" href="Trilium%20Demo/Formatting%20examples">Formatting examples</a>.</p>
<h3>Lists</h3>
<p><strong>Ordered:</strong>
</p>
<ol>
<li data-list-item-id="e877cc655d0239b8bb0f38696ad5d8abb">First Item</li>
@@ -56,7 +50,6 @@
</li>
</ol>
<p><strong>Unordered:</strong>
</p>
<ul>
<li data-list-item-id="e68bf4b518a16671c314a72073c3d900a">Item</li>
@@ -67,7 +60,6 @@
</li>
</ul>
<h3>Block quotes</h3>
<blockquote>
<p>Whereof one cannot speak, thereof one must be silent”</p>
<p> Ludwig Wittgenstein</p>
@@ -75,9 +67,9 @@
<hr>
<p>See also other examples like <a href="Trilium%20Demo/Formatting%20examples/School%20schedule.html">tables</a>,
<a
href="Trilium%20Demo/Formatting%20examples/Checkbox%20lists.html">checkbox lists,</a> <a href="Trilium%20Demo/Formatting%20examples/Highlighting.html">highlighting</a>,
href="Trilium%20Demo/Formatting%20examples/Checkbox%20lists.html">checkbox lists,</a> <a href="Trilium%20Demo/Formatting%20examples/Highlighting.html">highlighting</a>, <a href="Trilium%20Demo/Formatting%20examples/Code%20blocks.html">code blocks</a>and
<a
href="Trilium%20Demo/Formatting%20examples/Code%20blocks.html">code blocks</a>and <a href="Trilium%20Demo/Formatting%20examples/Math.html">math examples</a>.</p>
href="Trilium%20Demo/Formatting%20examples/Math.html">math examples</a>.</p>
</div>
</div>
</body>

View File

@@ -21,8 +21,12 @@
language, should that fail it is possible to manually adjust it. The color
scheme for the syntax highlighting is adjustable in settings.&nbsp;</p><pre><code class="language-application-javascript-env-frontend">function helloWorld() {
alert("Hello world");
}</code></pre>
<p>For larger pieces of code it is better to use a code note, which uses
a fully-fledged code editor (CodeMirror). For an example of a code note,

View File

@@ -0,0 +1,21 @@
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../../style.css">
<base target="_parent">
<title data-trilium-title>Note Types</title>
</head>
<body>
<div class="content">
<h1 data-trilium-h1>Note Types</h1>
<div class="ck-content">
<p>T</p>
</div>
</div>
</body>
</html>

View File

@@ -13,9 +13,8 @@
<h1 data-trilium-h1>Task manager</h1>
<div class="ck-content">
<p>This is a simple TODO/Task manager. You can see some description and explanation
here: <a href="https://github.com/zadam/trilium/wiki/Task-manager">https://github.com/zadam/trilium/wiki/Task-manager</a>
</p>
<p>This is a simple TODO/Task manager. See the <a href="https://docs.triliumnotes.org/user-guide/advanced-usage/advanced-showcases/task-manager">Trilium documentation</a> for
information on how it works.</p>
<p>Please note that this is meant as scripting example only and feature/bug
support is very limited.</p>
</div>

View File

@@ -16,18 +16,32 @@
<p>Documentation: <a href="http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_09_02.html">http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_09_02.html</a>
</p><pre><code class="language-text-x-sh">#!/bin/bash
# This script opens 4 terminal windows.
i="0"
while [ $i -lt 4 ]
do
xterm &amp;
i=$[$i+1]
done</code></pre>
</div>
</div>

View File

@@ -17,6 +17,6 @@
},
"scripts": {
"edit-docs": "cross-env TRILIUM_PORT=37741 TRILIUM_DATA_DIR=data TRILIUM_INTEGRATION_TEST=memory-no-store DOCS_ROOT=../../../docs USER_GUIDE_ROOT=\"../../server/src/assets/doc_notes/en/User Guide\" tsx ../../scripts/electron-start.mts src/edit-docs.ts",
"edit-demo": "cross-env TRILIUM_PORT=37741 TRILIUM_DATA_DIR=data TRILIUM_INTEGRATION_TEST=memory-no-store DOCS_ROOT=../../../docs USER_GUIDE_ROOT=\"../../server/src/assets/doc_notes/en/User Guide\" tsx ../../scripts/electron-start.mts src/edit-demo.ts"
"edit-demo": "cross-env TRILIUM_PORT=37744 TRILIUM_DATA_DIR=data TRILIUM_INTEGRATION_TEST=memory-no-store DOCS_ROOT=../../../docs USER_GUIDE_ROOT=\"../../server/src/assets/doc_notes/en/User Guide\" tsx ../../scripts/electron-start.mts src/edit-demo.ts"
}
}

View File

@@ -67,7 +67,7 @@
"@types/xml2js": "0.4.14",
"archiver": "7.0.1",
"async-mutex": "0.5.0",
"axios": "1.13.1",
"axios": "1.13.2",
"bindings": "1.5.0",
"bootstrap": "5.3.8",
"chardet": "2.1.1",
@@ -115,7 +115,7 @@
"safe-compare": "1.1.4",
"sanitize-filename": "1.6.3",
"sanitize-html": "2.17.0",
"sax": "1.4.2",
"sax": "1.4.3",
"serve-favicon": "2.5.1",
"stream-throttle": "0.1.3",
"strip-bom": "5.0.0",

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@@ -145,17 +145,18 @@ class="image image_resized" style="width:74.04%;">
<p>You don't need to tell the LLM to execute a certain tool, it should “smartly”
call tools and automatically execute them as needed.</p>
<h2>Overview</h2>
<p>Now that you know about embeddings and tools, you can just go ahead and
use the “Chat with Notes” button, where you can go ahead and start chatting!:</p>
<figure
class="image image_resized" style="width:60.77%;">
<p>To start, simply press the <em>Chat with Notes</em> button in the&nbsp;
<a
class="reference-link" href="#root/_help_xYmIYSP6wE3F">Launch Bar</a>.</p>
<figure class="image image_resized" style="width:60.77%;">
<img style="aspect-ratio:1378/539;" src="2_AI_image.png"
width="1378" height="539">
</figure>
<p>If you don't see the “Chat with Notes” button on your side launchbar,
you might need to move it from the Available Launchers section to the
Visible Launchers section:</p>
<figure class="image image_resized" style="width:69.81%;">
<img style="aspect-ratio:1765/1287;" src="9_AI_image.png"
width="1765" height="1287">
</figure>
</figure>
<p>If you don't see the button in the&nbsp;<a class="reference-link" href="#root/_help_xYmIYSP6wE3F">Launch Bar</a>,
you might need to move it from the <em>Available Launchers</em> section to
the <em>Visible Launchers</em> section:</p>
<figure class="image image_resized"
style="width:69.81%;">
<img style="aspect-ratio:1765/1287;" src="9_AI_image.png"
width="1765" height="1287">
</figure>

View File

@@ -0,0 +1,41 @@
<aside class="admonition warning">
<p>This functionality is still in preview, expect possible issues or even
the feature disappearing completely.
<br>Feel free to <a href="#root/_help_wy8So3yZZlH9">report</a> any issues you might
have.</p>
</aside>
<p>The read-only database is an alternative to&nbsp;<a class="reference-link"
href="#root/_help_R9pX4DGra2Vt">Sharing</a>&nbsp;notes. Although the share functionality
works pretty well to publish pages to the Internet in a wiki, blog-like
format it does not offer the full functionality behind Trilium (such as
the advanced&nbsp;<a class="reference-link" href="#root/_help_eIg8jdvaoNNd">Search</a>&nbsp;or
the interactivity behind&nbsp;<a class="reference-link" href="#root/_help_GTwFsgaA0lCt">Collections</a>&nbsp;or
the various&nbsp;<a class="reference-link" href="#root/_help_KSZ04uQ2D1St">Note Types</a>).</p>
<p>When the database is in read-only mode, the Trilium application can be
used as normal, but editing is disabled and changes are made in-memory
only.</p>
<h2>What it does</h2>
<ul>
<li>All notes are read-only, without the possibility of editing them.</li>
<li>Features that would normally alter the database such as the list of recent
notes are disabled.</li>
</ul>
<h2>Limitations</h2>
<ul>
<li>Some features might “slip through” and still end up creating a note, for
example.
<ul>
<li>However, the database is still read-only, so all modifications will be
reset if the server is restarted.</li>
<li>Whenever this occurs, <code>ERROR: read-only DB ignored</code> will be shown
in the logs.</li>
</ul>
</li>
</ul>
<h2>Setting a database as read-only</h2>
<p>First, make sure the database is initialized (e.g. the first set up is
complete). Then modify the <a href="#root/_help_Gzjqa934BdH4">config.ini</a> by
looking for the <code>[General]</code> section and adding a new <code>readOnly</code> field:</p><pre><code class="language-text-x-trilium-auto">[General]
readOnly=true</code></pre>
<p>If your server is already running, restart it to apply the changes.</p>
<p>Similarly, to disable read-only remove the line or set it to <code>false</code>.</p>

View File

@@ -28,20 +28,27 @@
- it contains everything you need.</p>
<h3>Changing the location of data directory</h3>
<p>If you want to use some other location for the data directory than the
default one, you may change it via TRILIUM_DATA_DIR environment variable
to some other location:</p>
default one, you may change it via <code>TRILIUM_DATA_DIR</code> environment
variable to some other location:</p>
<h3>Windows</h3>
<ol>
<li>Press the Windows key on your keyboard.</li>
<li>Search and select “Edit the system variables”.</li>
<li>Press the “Environment Variables…” button in the bottom-right of the newly
opened screen.</li>
<li>On the top section ("User variables for [user]"), press the “New…” button.</li>
<li>In the <em>Variable name</em> field insert <code>TRILIUM_DATA_DIR</code>.</li>
<li>Press the <em>Browse Directory…</em> button and select the new directory
where to store the database.</li>
<li>Close all the windows by pressing the <em>OK</em> button for each of them.</li>
</ol>
<h4>Linux</h4><pre><code class="language-text-x-trilium-auto">export TRILIUM_DATA_DIR=/home/myuser/data/my-trilium-data</code></pre>
<h4>Mac OS X</h4>
<p>You need to create a <code>.plist</code> file under <code>~/Library/LaunchAgents</code> to
load it properly each login.</p>
<p>To load it manually, you need to use <code>launchctl setenv TRILIUM_DATA_DIR &lt;yourpath&gt;</code>
</p>
<p>Here is a pre-defined template, where you just need to add your path to:</p><pre><code class="language-text-x-trilium-auto">
Label
<p>Here is a pre-defined template, where you just need to add your path to:</p><pre><code class="language-text-x-trilium-auto"> Label
set.trilium.env
RunAtLoad
@@ -50,16 +57,13 @@
launchctl
setenv
TRILIUM_DATA_DIR
/Users/YourUserName/Library/Application Support/trilium-data
</code></pre>
/Users/YourUserName/Library/Application Support/trilium-data </code></pre>
<h3>Create a script to run with specific data directory</h3>
<p>An alternative to globally setting environment variable is to run only
the Trilium Notes with this environment variable. This then allows for
different setup styles like two <a href="#root/_help_wX4HbRucYSDD">database</a> instances
or "portable" installation.</p>
<p>To do this in unix based systems simply run trilium like this:</p><pre><code class="language-text-x-trilium-auto">TRILIUM_DATA_DIR=/home/myuser/data/my-trilium-data trilium</code></pre>
<p>To do this in Unix-based systems simply run <code>trilium</code> like this:</p><pre><code class="language-text-x-trilium-auto">TRILIUM_DATA_DIR=/home/myuser/data/my-trilium-data trilium</code></pre>
<p>You can then save the above command as a shell script on your path for
convenience.</p>
<h2>Fine-grained directory/path location</h2>

View File

@@ -8,7 +8,7 @@
get parentWidget() { return "left-pane"; }
doRender() {
this.$widget = $("");
this.$widget = $("&lt;div id='my-widget'&gt;");
return this.$widget;
}
}
@@ -16,19 +16,19 @@
module.exports = new MyWidget();</code></pre>
<p>To implement this widget:</p>
<ol>
<li>Create a new <code>JS Frontend</code> note in Trilium and paste in the code
<li data-list-item-id="ed70b15c6cddbf0d0ac049dccd6835c5b">Create a new <code>JS Frontend</code> note in Trilium and paste in the code
above.</li>
<li>Assign the <code>#widget</code> <a href="#root/_help_zEY4DaJG4YT5">attribute</a> to
<li data-list-item-id="e507afc0bb1d604a590eba80b6137d84b">Assign the <code>#widget</code> <a href="#root/_help_zEY4DaJG4YT5">attribute</a> to
the <a href="#root/_help_BFs8mudNFgCS">note</a>.</li>
<li>Restart Trilium or reload the window.</li>
<li data-list-item-id="e876a226740e2dcfb2a900ebd674b2b6b">Restart Trilium or reload the window.</li>
</ol>
<p>To verify that the widget is working, open the developer tools (<code>Cmd</code> + <code>Shift</code> + <code>I</code>)
<p>To verify that the widget is working, open the developer tools (<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>I</kbd>)
and run <code>document.querySelector("#my-widget")</code>. If the element
is found, the widget is functioning correctly. If <code>undefined</code> is
returned, double-check that the <a href="#root/_help_BFs8mudNFgCS">note</a> has
the <code>#widget</code> <a href="#root/_help_zEY4DaJG4YT5">attribute</a>.</p>
<h3>Step 2: Adding an UI Element</h3>
<p>Next, let's improve the widget by adding a button to it.</p><pre><code class="language-text-x-trilium-auto">const template = ``;
<p>Next, let's improve the widget by adding a button to it.</p><pre><code class="language-text-x-trilium-auto">const template = `&lt;div id="my-widget"&gt;&lt;button&gt;Click Me!&lt;/button&gt;&lt;/div&gt;`;
class MyWidget extends api.BasicWidget {
get position() {return 1;}
@@ -47,7 +47,7 @@ module.exports = new MyWidget();</code></pre>
<p>To make the button more visually appealing and position it correctly,
we'll apply some custom styling. Trilium includes <a href="https://boxicons.com">Box Icons</a>,
which we'll use to replace the button text with an icon. For example the <code>bx bxs-magic-wand</code> icon.</p>
<p>Here's the updated template:</p><pre><code class="language-text-x-trilium-auto">const template = ``;</code></pre>
<p>Here's the updated template:</p><pre><code class="language-text-x-trilium-auto">const template = `&lt;div id="my-widget"&gt;&lt;button class="tree-floating-button bx bxs-magic-wand tree-settings-button"&gt;&lt;/button&gt;&lt;/div&gt;`;</code></pre>
<p>Next, we'll adjust the button's position using CSS:</p><pre><code class="language-text-x-trilium-auto">class MyWidget extends api.BasicWidget {
get position() { return 1; }
get parentWidget() { return "left-pane"; }
@@ -89,13 +89,14 @@ module.exports = new MyWidget();</code></pre>
module.exports = new MyWidget();</code></pre>
<p><code>parentWidget()</code> can be given the following values:</p>
<ul>
<li><code>left-pane</code> - This renders the widget on the left side of the
<li data-list-item-id="e8b62dcf10b3cfccc9f4bc80ded18346f"><code>left-pane</code> - This renders the widget on the left side of the
screen where the note tree lives.</li>
<li><code>center-pane</code> - This renders the widget in the center of the
<li data-list-item-id="eeeef623e323425e2c362acb5fb5fcc91"><code>center-pane</code> - This renders the widget in the center of the
layout in the same location that notes and splits appear.</li>
<li><code>note-detail-pane</code> - This renders the widget <em>with</em> the
<li data-list-item-id="e95ab9fba1601f210196b628eccc2e3d0"><code>note-detail-pane</code> - This renders the widget <em>with</em> the
note in the center pane. This means it can appear multiple times with splits.</li>
<li><code>right-pane</code> - This renders the widget to the right of any opened
<li
data-list-item-id="e0f1f65f68ce610bcc85f51de7ff47f37"><code>right-pane</code> - This renders the widget to the right of any opened
notes.</li>
</ul>
<p><a href="#root/_help_s8alTXmpFR61">Reload</a> the application one last time.

View File

@@ -1,5 +1,5 @@
# Documentation
There are multiple types of documentation for Trilium:<img class="image-style-align-right" src="api/images/OrRMknW5zkc4/Documentation_image.png" width="205" height="162">
There are multiple types of documentation for Trilium:<img class="image-style-align-right" src="api/images/OdhZWHj05SLY/Documentation_image.png" width="205" height="162">
* The _User Guide_ represents the user-facing documentation. This documentation can be browsed by users directly from within Trilium, by pressing <kbd>F1</kbd>.
* The _Developer's Guide_ represents a set of Markdown documents that present the internals of Trilium, for developers.

View File

@@ -14150,6 +14150,82 @@
"format": "markdown",
"dataFileName": "Nightly release.md",
"attachments": []
},
{
"isClone": false,
"noteId": "ZmT9ln8XJX2o",
"notePath": [
"pOsGYCXsbNQG",
"tC7s2alapj8V",
"ZmT9ln8XJX2o"
],
"title": "Read-only database",
"notePosition": 270,
"prefix": null,
"isExpanded": false,
"type": "text",
"mime": "text/html",
"attributes": [
{
"type": "relation",
"name": "internalLink",
"value": "Gzjqa934BdH4",
"isInheritable": false,
"position": 10
},
{
"type": "relation",
"name": "internalLink",
"value": "wy8So3yZZlH9",
"isInheritable": false,
"position": 20
},
{
"type": "relation",
"name": "internalLink",
"value": "R9pX4DGra2Vt",
"isInheritable": false,
"position": 30
},
{
"type": "relation",
"name": "internalLink",
"value": "eIg8jdvaoNNd",
"isInheritable": false,
"position": 40
},
{
"type": "relation",
"name": "internalLink",
"value": "GTwFsgaA0lCt",
"isInheritable": false,
"position": 50
},
{
"type": "relation",
"name": "internalLink",
"value": "KSZ04uQ2D1St",
"isInheritable": false,
"position": 60
},
{
"type": "label",
"name": "iconClass",
"value": "bx bx-book-reader",
"isInheritable": false,
"position": 30
},
{
"type": "label",
"name": "shareAlias",
"value": "read-only-db",
"isInheritable": false,
"position": 40
}
],
"format": "markdown",
"dataFileName": "Read-only database.md",
"attachments": []
}
]
},
@@ -14174,6 +14250,13 @@
"isInheritable": false,
"position": 10
},
{
"type": "relation",
"name": "internalLink",
"value": "xYmIYSP6wE3F",
"isInheritable": false,
"position": 20
},
{
"type": "label",
"name": "shareAlias",

View File

@@ -80,10 +80,10 @@ You don't need to tell the LLM to execute a certain tool, it should “smartly
## Overview
Now that you know about embeddings and tools, you can just go ahead and use the Chat with Notes button, where you can go ahead and start chatting!:
To start, simply press the _Chat with Notes_ button in the <a class="reference-link" href="Basic%20Concepts%20and%20Features/UI%20Elements/Launch%20Bar.md">Launch Bar</a>.
<figure class="image image_resized" style="width:60.77%;"><img style="aspect-ratio:1378/539;" src="2_AI_image.png" width="1378" height="539"></figure>
If you don't see the “Chat with Notes” button on your side launchbar, you might need to move it from the Available Launchers section to the Visible Launchers section:
If you don't see the button in the <a class="reference-link" href="Basic%20Concepts%20and%20Features/UI%20Elements/Launch%20Bar.md">Launch Bar</a>, you might need to move it from the _Available Launchers_ section to the _Visible Launchers_ section:
<figure class="image image_resized" style="width:69.81%;"><img style="aspect-ratio:1765/1287;" src="9_AI_image.png" width="1765" height="1287"></figure>

View File

@@ -0,0 +1,32 @@
# Read-only database
> [!WARNING]
> This functionality is still in preview, expect possible issues or even the feature disappearing completely.
> Feel free to [report](../Troubleshooting/Reporting%20issues.md) any issues you might have.
The read-only database is an alternative to <a class="reference-link" href="Sharing.md">Sharing</a> notes. Although the share functionality works pretty well to publish pages to the Internet in a wiki, blog-like format it does not offer the full functionality behind Trilium (such as the advanced <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Navigation/Search.md">Search</a> or the interactivity behind <a class="reference-link" href="../Collections.md">Collections</a> or the various <a class="reference-link" href="../Note%20Types.md">Note Types</a>).
When the database is in read-only mode, the Trilium application can be used as normal, but editing is disabled and changes are made in-memory only.
## What it does
* All notes are read-only, without the possibility of editing them.
* Features that would normally alter the database such as the list of recent notes are disabled.
## Limitations
* Some features might “slip through” and still end up creating a note, for example.
* However, the database is still read-only, so all modifications will be reset if the server is restarted.
* Whenever this occurs, `ERROR: read-only DB ignored` will be shown in the logs.
## Setting a database as read-only
First, make sure the database is initialized (e.g. the first set up is complete). Then modify the [config.ini](Configuration%20\(config.ini%20or%20e.md) by looking for the `[General]` section and adding a new `readOnly` field:
```
[General]
readOnly=true
```
If your server is already running, restart it to apply the changes.
Similarly, to disable read-only remove the line or set it to `false`.

View File

@@ -26,7 +26,17 @@ If you want to back up your Trilium data, just backup this single directory - it
### Changing the location of data directory
If you want to use some other location for the data directory than the default one, you may change it via TRILIUM\_DATA\_DIR environment variable to some other location:
If you want to use some other location for the data directory than the default one, you may change it via `TRILIUM_DATA_DIR` environment variable to some other location:
### Windows
1. Press the Windows key on your keyboard.
2. Search and select “Edit the system variables”.
3. Press the “Environment Variables…” button in the bottom-right of the newly opened screen.
4. On the top section ("User variables for \[user\]"), press the “New…” button.
5. In the _Variable name_ field insert `TRILIUM_DATA_DIR`.
6. Press the _Browse Directory…_ button and select the new directory where to store the database.
7. Close all the windows by pressing the _OK_ button for each of them.
#### Linux
@@ -43,11 +53,6 @@ To load it manually, you need to use `launchctl setenv TRILIUM_DATA_DIR <yourpat
Here is a pre-defined template, where you just need to add your path to:
```
Label
set.trilium.env
RunAtLoad
@@ -57,17 +62,14 @@ Here is a pre-defined template, where you just need to add your path to:
launchctl
setenv
TRILIUM_DATA_DIR
/Users/YourUserName/Library/Application Support/trilium-data
/Users/YourUserName/Library/Application Support/trilium-data
```
### Create a script to run with specific data directory
An alternative to globally setting environment variable is to run only the Trilium Notes with this environment variable. This then allows for different setup styles like two [database](../Advanced%20Usage/Database.md) instances or "portable" installation.
To do this in unix based systems simply run trilium like this:
To do this in Unix-based systems simply run `trilium` like this:
```
TRILIUM_DATA_DIR=/home/myuser/data/my-trilium-data trilium

View File

@@ -11,7 +11,7 @@ class MyWidget extends api.BasicWidget {
get parentWidget() { return "left-pane"; }
doRender() {
this.$widget = $("");
this.$widget = $("<div id='my-widget'>");
return this.$widget;
}
}
@@ -25,14 +25,14 @@ To implement this widget:
2. Assign the `#widget` [attribute](../../../Advanced%20Usage/Attributes.md) to the [note](../../../Basic%20Concepts%20and%20Features/Notes.md).
3. Restart Trilium or reload the window.
To verify that the widget is working, open the developer tools (`Cmd` + `Shift` + `I`) and run `document.querySelector("#my-widget")`. If the element is found, the widget is functioning correctly. If `undefined` is returned, double-check that the [note](../../../Basic%20Concepts%20and%20Features/Notes.md) has the `#widget` [attribute](../../../Advanced%20Usage/Attributes.md).
To verify that the widget is working, open the developer tools (<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>I</kbd>) and run `document.querySelector("#my-widget")`. If the element is found, the widget is functioning correctly. If `undefined` is returned, double-check that the [note](../../../Basic%20Concepts%20and%20Features/Notes.md) has the `#widget` [attribute](../../../Advanced%20Usage/Attributes.md).
### Step 2: Adding an UI Element
Next, let's improve the widget by adding a button to it.
```
const template = ``;
const template = `<div id="my-widget"><button>Click Me!</button></div>`;
class MyWidget extends api.BasicWidget {
get position() {return 1;}
@@ -56,7 +56,7 @@ To make the button more visually appealing and position it correctly, we'll appl
Here's the updated template:
```
const template = ``;
const template = `<div id="my-widget"><button class="tree-floating-button bx bxs-magic-wand tree-settings-button"></button></div>`;
```
Next, we'll adjust the button's position using CSS:

100
pnpm-lock.yaml generated
View File

@@ -131,8 +131,8 @@ importers:
apps/build-docs:
devDependencies:
'@redocly/cli':
specifier: 2.10.0
version: 2.10.0(@opentelemetry/api@1.9.0)(ajv@8.17.1)(bufferutil@4.0.9)(core-js@3.46.0)(encoding@0.1.13)(utf-8-validate@6.0.5)
specifier: 2.11.0
version: 2.11.0(@opentelemetry/api@1.9.0)(ajv@8.17.1)(bufferutil@4.0.9)(core-js@3.46.0)(encoding@0.1.13)(utf-8-validate@6.0.5)
archiver:
specifier: 7.0.1
version: 7.0.1
@@ -604,8 +604,8 @@ importers:
specifier: 0.5.0
version: 0.5.0
axios:
specifier: 1.13.1
version: 1.13.1(debug@4.4.3)
specifier: 1.13.2
version: 1.13.2(debug@4.4.3)
bindings:
specifier: 1.5.0
version: 1.5.0
@@ -748,8 +748,8 @@ importers:
specifier: 2.17.0
version: 2.17.0
sax:
specifier: 1.4.2
version: 1.4.2
specifier: 1.4.3
version: 1.4.3
serve-favicon:
specifier: 2.5.1
version: 2.5.1
@@ -4223,27 +4223,27 @@ packages:
'@redocly/ajv@8.11.3':
resolution: {integrity: sha512-4P3iZse91TkBiY+Dx5DUgxQ9GXkVJf++cmI0MOyLDxV9b5MUBI4II6ES8zA5JCbO72nKAJxWrw4PUPW+YP3ZDQ==}
'@redocly/cli@2.10.0':
resolution: {integrity: sha512-wKuF/30MSmcc4SJwWTuVnIeFKyW60DVOgxTzvvA+wC1HRBZ24X3UTRyt6MtDEFGcNl6hv5/J9l2lodStwwqelQ==}
'@redocly/cli@2.11.0':
resolution: {integrity: sha512-Wr8me9M5tQ4pZT7Z0Llxojlo8L0GBBt45zceQ8iKyBmJUHWDbKYYdKubZBCH0XktQLEA8HitYBGN1unsxwx20g==}
engines: {node: '>=22.12.0 || >=20.19.0 <21.0.0', npm: '>=10'}
hasBin: true
'@redocly/config@0.22.2':
resolution: {integrity: sha512-roRDai8/zr2S9YfmzUfNhKjOF0NdcOIqF7bhf4MVC5UxpjIysDjyudvlAiVbpPHp3eDRWbdzUgtkK1a7YiDNyQ==}
'@redocly/config@0.36.2':
resolution: {integrity: sha512-gwIjFOzyq9bdJCdtEHDMf2hEJ9hHXUHkY1U3IPWyZmRoFcibzlpXOLrT0xVgnn10IEttMwD+SZtZBE593yDXsw==}
'@redocly/config@0.37.0':
resolution: {integrity: sha512-cYN+rTTCQIp5mVt1xumJsNqpZcaPVUf1x0ryD0QKXpVKsxKc+lHaMF2P1CqMgdQNY9B7i84z/kvxD0EhxzlxbQ==}
'@redocly/openapi-core@1.34.5':
resolution: {integrity: sha512-0EbE8LRbkogtcCXU7liAyC00n9uNG9hJ+eMyHFdUsy9lB/WGqnEBgwjA9q2cyzAVcdTkQqTBBU1XePNnN3OijA==}
engines: {node: '>=18.17.0', npm: '>=9.5.0'}
'@redocly/openapi-core@2.10.0':
resolution: {integrity: sha512-OmWvnpA11J6Tp3+h8I3nrfpTcXROLllr/9yIUB7ofi7s1yOOKOqlZ4HTs+zaeNmk9vclwmbgc2HVdSsBKUXp6g==}
'@redocly/openapi-core@2.11.0':
resolution: {integrity: sha512-CF4QpCoxxHIB7Dib1XnhdL0WuW4dO4zvNfaEWpN7TASlitOX2mhrc6sD3dYG9knW1iG16e3Oauv2O+tVJx1E9Q==}
engines: {node: '>=22.12.0 || >=20.19.0 <21.0.0', npm: '>=10'}
'@redocly/respect-core@2.10.0':
resolution: {integrity: sha512-4XFOR3kbuhlPBeW2G/G3yPs7YJKV0d/k2BgDwKIQH8Edld4fHvknEAR9TFUaWsiA7JGWrP3CQ58P5VoDNW5O0Q==}
'@redocly/respect-core@2.11.0':
resolution: {integrity: sha512-lAvDILvq82IIei2gVyapGyfuWEamJgCiGO++yQriVk4Wr0hE3lF7ZWusUM3aGZrxEWCVGeeLwbMBpv1BQOnmEg==}
engines: {node: '>=22.12.0 || >=20.19.0 <21.0.0', npm: '>=10'}
'@replit/codemirror-indentation-markers@6.5.3':
@@ -6295,8 +6295,8 @@ packages:
resolution: {integrity: sha512-zJAaP9zxTcvTHRlejau3ZOY4V7SRpiByf3/dxx2uyKxxor19tpmpV2QRsTKikckwhaPmr2dVpxxMr7jOCYVp5g==}
engines: {node: '>=6.0.0'}
axios@1.13.1:
resolution: {integrity: sha512-hU4EGxxt+j7TQijx1oYdAjw4xuIp1wRQSsbMFwSthCWeBQur1eF+qJ5iQ5sN3Tw8YRzQNKb8jszgBdMDVqwJcw==}
axios@1.13.2:
resolution: {integrity: sha512-VPk9ebNqPcy5lRGuSlKx752IlDatOjT9paPlm8A7yOuW2Fbvp4X3JznJtT4f0GzGLLiWE9W8onz51SqLYwzGaA==}
b4a@1.6.7:
resolution: {integrity: sha512-OnAYlL5b7LEkALw87fUVafQw5rVR9RjwGd4KUwNQ6DrrNmaVaUCgLipfVlzrPQ4tWOR9P0IXGNOx50jYCCdSJg==}
@@ -12945,8 +12945,8 @@ packages:
engines: {node: '>=14.0.0'}
hasBin: true
sax@1.4.2:
resolution: {integrity: sha512-FySGAa0RGcFiN6zfrO9JvK1r7TB59xuzCcTHOBXBNoKgDejlOQCR2KL/FGk3/iDlsqyYg1ELZpOmlg09B01Czw==}
sax@1.4.3:
resolution: {integrity: sha512-yqYn1JhPczigF94DMS+shiDMjDowYO6y9+wB/4WgO0Y19jWYk0lQ4tuG5KI7kj4FTp1wxPj5IFfcrz/s1c3jjQ==}
saxes@5.0.1:
resolution: {integrity: sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==}
@@ -15611,6 +15611,8 @@ snapshots:
'@ckeditor/ckeditor5-core': 47.1.0
'@ckeditor/ckeditor5-upload': 47.1.0
ckeditor5: 47.1.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-ai@47.1.0(bufferutil@4.0.9)(utf-8-validate@6.0.5)':
dependencies:
@@ -15757,8 +15759,6 @@ snapshots:
'@ckeditor/ckeditor5-core': 47.1.0
'@ckeditor/ckeditor5-utils': 47.1.0
ckeditor5: 47.1.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-code-block@47.1.0(patch_hash=2361d8caad7d6b5bddacc3a3b4aa37dbfba260b1c1b22a450413a79c1bb1ce95)':
dependencies:
@@ -15820,6 +15820,8 @@ snapshots:
'@ckeditor/ckeditor5-utils': 47.1.0
'@ckeditor/ckeditor5-watchdog': 47.1.0
es-toolkit: 1.39.5
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-dev-build-tools@43.1.0(@swc/helpers@0.5.17)(tslib@2.8.1)(typescript@5.9.3)':
dependencies:
@@ -15984,8 +15986,6 @@ snapshots:
'@ckeditor/ckeditor5-utils': 47.1.0
ckeditor5: 47.1.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
es-toolkit: 1.39.5
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-editor-classic@47.1.0':
dependencies:
@@ -15995,6 +15995,8 @@ snapshots:
'@ckeditor/ckeditor5-utils': 47.1.0
ckeditor5: 47.1.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
es-toolkit: 1.39.5
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-editor-decoupled@47.1.0':
dependencies:
@@ -16004,6 +16006,8 @@ snapshots:
'@ckeditor/ckeditor5-utils': 47.1.0
ckeditor5: 47.1.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
es-toolkit: 1.39.5
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-editor-inline@47.1.0':
dependencies:
@@ -16013,8 +16017,6 @@ snapshots:
'@ckeditor/ckeditor5-utils': 47.1.0
ckeditor5: 47.1.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
es-toolkit: 1.39.5
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-editor-multi-root@47.1.0':
dependencies:
@@ -16121,6 +16123,8 @@ snapshots:
'@ckeditor/ckeditor5-utils': 47.1.0
ckeditor5: 47.1.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
es-toolkit: 1.39.5
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-font@47.1.0':
dependencies:
@@ -16184,6 +16188,8 @@ snapshots:
'@ckeditor/ckeditor5-utils': 47.1.0
'@ckeditor/ckeditor5-widget': 47.1.0
ckeditor5: 47.1.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-html-embed@47.1.0':
dependencies:
@@ -16474,6 +16480,8 @@ snapshots:
'@ckeditor/ckeditor5-paste-from-office': 47.1.0
'@ckeditor/ckeditor5-utils': 47.1.0
ckeditor5: 47.1.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-paste-from-office@47.1.0':
dependencies:
@@ -16481,6 +16489,8 @@ snapshots:
'@ckeditor/ckeditor5-core': 47.1.0
'@ckeditor/ckeditor5-engine': 47.1.0
ckeditor5: 47.1.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-real-time-collaboration@47.1.0(bufferutil@4.0.9)(utf-8-validate@6.0.5)':
dependencies:
@@ -16522,6 +16532,8 @@ snapshots:
'@ckeditor/ckeditor5-ui': 47.1.0
'@ckeditor/ckeditor5-utils': 47.1.0
ckeditor5: 47.1.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-revision-history@47.1.0':
dependencies:
@@ -16599,6 +16611,8 @@ snapshots:
'@ckeditor/ckeditor5-ui': 47.1.0
'@ckeditor/ckeditor5-utils': 47.1.0
ckeditor5: 47.1.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-special-characters@47.1.0':
dependencies:
@@ -16608,6 +16622,8 @@ snapshots:
'@ckeditor/ckeditor5-ui': 47.1.0
'@ckeditor/ckeditor5-utils': 47.1.0
ckeditor5: 47.1.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-style@47.1.0':
dependencies:
@@ -16710,6 +16726,8 @@ snapshots:
'@ckeditor/ckeditor5-icons': 47.1.0
'@ckeditor/ckeditor5-ui': 47.1.0
'@ckeditor/ckeditor5-utils': 47.1.0
transitivePeerDependencies:
- supports-color
'@ckeditor/ckeditor5-upload@47.1.0':
dependencies:
@@ -17797,7 +17815,7 @@ snapshots:
'@file-type/xml@0.4.3':
dependencies:
sax: 1.4.2
sax: 1.4.3
strtok3: 10.2.2
'@floating-ui/core@1.6.9':
@@ -19324,14 +19342,14 @@ snapshots:
require-from-string: 2.0.2
uri-js-replace: 1.0.1
'@redocly/cli@2.10.0(@opentelemetry/api@1.9.0)(ajv@8.17.1)(bufferutil@4.0.9)(core-js@3.46.0)(encoding@0.1.13)(utf-8-validate@6.0.5)':
'@redocly/cli@2.11.0(@opentelemetry/api@1.9.0)(ajv@8.17.1)(bufferutil@4.0.9)(core-js@3.46.0)(encoding@0.1.13)(utf-8-validate@6.0.5)':
dependencies:
'@opentelemetry/exporter-trace-otlp-http': 0.202.0(@opentelemetry/api@1.9.0)
'@opentelemetry/resources': 2.0.1(@opentelemetry/api@1.9.0)
'@opentelemetry/sdk-trace-node': 2.0.1(@opentelemetry/api@1.9.0)
'@opentelemetry/semantic-conventions': 1.34.0
'@redocly/openapi-core': 2.10.0(ajv@8.17.1)
'@redocly/respect-core': 2.10.0(ajv@8.17.1)
'@redocly/openapi-core': 2.11.0(ajv@8.17.1)
'@redocly/respect-core': 2.11.0(ajv@8.17.1)
abort-controller: 3.0.0
chokidar: 3.6.0
colorette: 1.4.0
@@ -19364,7 +19382,7 @@ snapshots:
'@redocly/config@0.22.2': {}
'@redocly/config@0.36.2':
'@redocly/config@0.37.0':
dependencies:
json-schema-to-ts: 2.7.2
@@ -19382,10 +19400,10 @@ snapshots:
transitivePeerDependencies:
- supports-color
'@redocly/openapi-core@2.10.0(ajv@8.17.1)':
'@redocly/openapi-core@2.11.0(ajv@8.17.1)':
dependencies:
'@redocly/ajv': 8.11.3
'@redocly/config': 0.36.2
'@redocly/config': 0.37.0
ajv-formats: 2.1.1(ajv@8.17.1)
colorette: 1.4.0
js-levenshtein: 1.1.6
@@ -19396,12 +19414,12 @@ snapshots:
transitivePeerDependencies:
- ajv
'@redocly/respect-core@2.10.0(ajv@8.17.1)':
'@redocly/respect-core@2.11.0(ajv@8.17.1)':
dependencies:
'@faker-js/faker': 7.6.0
'@noble/hashes': 1.8.0
'@redocly/ajv': 8.11.2
'@redocly/openapi-core': 2.10.0(ajv@8.17.1)
'@redocly/openapi-core': 2.11.0(ajv@8.17.1)
better-ajv-errors: 1.2.0(ajv@8.17.1)
colorette: 2.0.20
json-pointer: 0.6.2
@@ -21822,7 +21840,7 @@ snapshots:
await-to-js@3.0.0: {}
axios@1.13.1(debug@4.4.3):
axios@1.13.2(debug@4.4.3):
dependencies:
follow-redirects: 1.15.9(debug@4.4.3)
form-data: 4.0.4
@@ -27548,7 +27566,7 @@ snapshots:
needle@3.3.1:
dependencies:
iconv-lite: 0.6.3
sax: 1.4.2
sax: 1.4.3
optional: true
negotiator@0.6.3: {}
@@ -27573,7 +27591,7 @@ snapshots:
node-api-version@0.2.1:
dependencies:
semver: 7.7.2
semver: 7.7.3
node-domexception@1.0.0: {}
@@ -27611,7 +27629,7 @@ snapshots:
make-fetch-happen: 14.0.3
nopt: 8.1.0
proc-log: 5.0.0
semver: 7.7.2
semver: 7.7.3
tar: 7.4.3
tinyglobby: 0.2.15
which: 5.0.0
@@ -29987,7 +30005,7 @@ snapshots:
'@parcel/watcher': 2.5.1
optional: true
sax@1.4.2: {}
sax@1.4.3: {}
saxes@5.0.1:
dependencies:
@@ -30983,7 +31001,7 @@ snapshots:
css-what: 6.2.2
csso: 5.0.5
picocolors: 1.1.1
sax: 1.4.2
sax: 1.4.3
swagger-jsdoc@6.2.8(openapi-types@12.1.3):
dependencies:
@@ -32328,12 +32346,12 @@ snapshots:
xml2js@0.5.0:
dependencies:
sax: 1.4.2
sax: 1.4.3
xmlbuilder: 11.0.1
xml2js@0.6.2:
dependencies:
sax: 1.4.2
sax: 1.4.3
xmlbuilder: 11.0.1
xmlbuilder@11.0.1: {}