docs(help): document keyboard shortcuts for note tree

This commit is contained in:
Elian Doran 2025-07-11 18:50:56 +03:00
parent b259558f0f
commit 2a4fe21a39
No known key found for this signature in database
313 changed files with 8374 additions and 12658 deletions

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 KiB

View File

@ -0,0 +1,22 @@
<p>Currently, we support the following providers:</p>
<ul>
<li><a class="reference-link" href="#root/_help_7EdTxPADv95W">Ollama</a>
</li>
<li><a class="reference-link" href="#root/_help_ZavFigBX9AwP">OpenAI</a>
</li>
<li><a class="reference-link" href="#root/_help_e0lkirXEiSNc">Anthropic</a>
</li>
<li>Voyage AI</li>
</ul>
<p>To set your preferred chat model, you'll want to enter the provider's
name here:</p>
<figure class="image image_resized" style="width:88.38%;">
<img style="aspect-ratio:1884/1267;" src="AI Provider Information_im.png"
width="1884" height="1267">
</figure>
<p>And to set your preferred embedding provider:</p>
<figure class="image image_resized"
style="width:93.47%;">
<img style="aspect-ratio:1907/1002;" src="1_AI Provider Information_im.png"
width="1907" height="1002">
</figure>

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

View File

@ -0,0 +1,45 @@
<p><a href="https://ollama.com/">Ollama</a> can be installed in a variety
of ways, and even runs <a href="https://hub.docker.com/r/ollama/ollama">within a Docker container</a>.
Ollama will be noticeably quicker when running on a GPU (Nvidia, AMD, Intel),
but it can run on CPU and RAM. To install Ollama without any other prerequisites,
you can follow their <a href="https://ollama.com/download">installer</a>:</p>
<figure
class="image image_resized" style="width:50.49%;">
<img style="aspect-ratio:785/498;" src="3_Installing Ollama_image.png"
width="785" height="498">
</figure>
<figure class="image image_resized" style="width:40.54%;">
<img style="aspect-ratio:467/100;" src="Installing Ollama_image.png" width="467"
height="100">
</figure>
<figure class="image image_resized" style="width:55.73%;">
<img style="aspect-ratio:1296/1011;" src="1_Installing Ollama_image.png"
width="1296" height="1011">
</figure>
<p>After their installer completes, if you're on Windows, you should see
an entry in the start menu to run it:</p>
<figure class="image image_resized"
style="width:66.12%;">
<img style="aspect-ratio:1161/480;" src="2_Installing Ollama_image.png"
width="1161" height="480">
</figure>
<p>Also, you should have access to the <code>ollama</code> CLI via Powershell
or CMD:</p>
<figure class="image image_resized" style="width:86.09%;">
<img style="aspect-ratio:1730/924;" src="5_Installing Ollama_image.png"
width="1730" height="924">
</figure>
<p>After Ollama is installed, you can go ahead and <code>pull</code> the models
you want to use and run. Here's a command to pull my favorite tool-compatible
model and embedding model as of April 2025:</p><pre><code class="language-text-x-trilium-auto">ollama pull llama3.1:8b
ollama pull mxbai-embed-large</code></pre>
<p>Also, you can make sure it's running by going to <a href="http://localhost:11434">http://localhost:11434</a> and
you should get the following response (port 11434 being the “normal” Ollama
port):</p>
<figure class="image">
<img style="aspect-ratio:585/202;" src="4_Installing Ollama_image.png"
width="585" height="202">
</figure>
<p>Now that you have Ollama up and running, have a few models pulled, you're
ready to go to go ahead and start using Ollama as both a chat provider,
and embedding provider!</p>

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 KiB

View File

@ -0,0 +1,161 @@
<figure class="image image_resized" style="width:63.68%;">
<img style="aspect-ratio:1363/1364;" src="Introduction_image.png" width="1363"
height="1364">
<figcaption>An example chat with an LLM</figcaption>
</figure>
<p>The AI / LLM features within Trilium Notes are designed to allow you to
interact with your Notes in a variety of ways, using as many of the major
providers as we can support.&nbsp;</p>
<p>In addition to being able to send chats to LLM providers such as OpenAI,
Anthropic, and Ollama - we also support agentic tool calling, and embeddings.</p>
<p>The quickest way to get started is to navigate to the “AI/LLM” settings:</p>
<figure
class="image image_resized" style="width:74.04%;">
<img style="aspect-ratio:1916/1906;" src="5_Introduction_image.png" width="1916"
height="1906">
</figure>
<p>Enable the feature:</p>
<figure class="image image_resized" style="width:82.82%;">
<img style="aspect-ratio:1911/997;" src="1_Introduction_image.png" width="1911"
height="997">
</figure>
<h2>Embeddings</h2>
<p><strong>Embeddings</strong> are important as it allows us to have an compact
AI “summary” (it's not human readable text) of each of your Notes, that
we can then perform mathematical functions on (such as cosine similarity)
to smartly figure out which Notes to send as context to the LLM when you're
chatting, among other useful functions.</p>
<p>You will then need to set up the AI “provider” that you wish to use to
create the embeddings for your Notes. Currently OpenAI, Voyage AI, and
Ollama are supported providers for embedding generation.</p>
<p>In the following example, we're going to use our self-hosted Ollama instance
to create the embeddings for our Notes. You can see additional documentation
about installing your own Ollama locally in&nbsp;<a class="reference-link"
href="#root/_help_vvUCN7FDkq7G">Installing Ollama</a>.</p>
<p>To see what embedding models Ollama has available, you can check out
<a
href="https://ollama.com/search?c=embedding">this search</a>on their website, and then <code>pull</code> whichever one
you want to try out. As of 4/15/25, my personal favorite is <code>mxbai-embed-large</code>.</p>
<p>First, we'll need to select the Ollama provider from the tabs of providers,
then we will enter in the Base URL for our Ollama. Since our Ollama is
running on our local machine, our Base URL is <code>http://localhost:11434</code>.
We will then hit the “refresh” button to have it fetch our models:</p>
<figure
class="image image_resized" style="width:82.28%;">
<img style="aspect-ratio:1912/1075;" src="4_Introduction_image.png" width="1912"
height="1075">
</figure>
<p>When selecting the dropdown for the “Embedding Model”, embedding models
should be at the top of the list, separated by regular chat models with
a horizontal line, as seen below:</p>
<figure class="image image_resized"
style="width:61.73%;">
<img style="aspect-ratio:1232/959;" src="8_Introduction_image.png" width="1232"
height="959">
</figure>
<p>After selecting an embedding model, embeddings should automatically begin
to be generated by checking the embedding statistics at the top of the
“AI/LLM” settings panel:</p>
<figure class="image image_resized" style="width:67.06%;">
<img style="aspect-ratio:1333/499;" src="7_Introduction_image.png" width="1333"
height="499">
</figure>
<p>If you don't see any embeddings being created, you will want to scroll
to the bottom of the settings, and hit “Recreate All Embeddings”:</p>
<figure
class="image image_resized" style="width:65.69%;">
<img style="aspect-ratio:1337/1490;" src="3_Introduction_image.png" width="1337"
height="1490">
</figure>
<p>Creating the embeddings will take some time, and will be regenerated when
a Note is created, updated, or deleted (removed).</p>
<p>If for some reason you choose to change your embedding provider, or the
model used, you'll need to recreate all embeddings.</p>
<h2>Tools</h2>
<p>Tools are essentially functions that we provide to the various LLM providers,
and then LLMs can respond in a specific format that tells us what tool
function and parameters they would like to invoke. We then execute these
tools, and provide it as additional context in the Chat conversation.&nbsp;</p>
<p>These are the tools that currently exist, and will certainly be updated
to be more effectively (and even more to be added!):</p>
<ul>
<li><code>search_notes</code>
<ul>
<li>Semantic search</li>
</ul>
</li>
<li><code>keyword_search</code>
<ul>
<li>Keyword-based search</li>
</ul>
</li>
<li><code>attribute_search</code>
<ul>
<li>Attribute-specific search</li>
</ul>
</li>
<li><code>search_suggestion</code>
<ul>
<li>Search syntax helper</li>
</ul>
</li>
<li><code>read_note</code>
<ul>
<li>Read note content (helps the LLM read Notes)</li>
</ul>
</li>
<li><code>create_note</code>
<ul>
<li>Create a Note</li>
</ul>
</li>
<li><code>update_note</code>
<ul>
<li>Update a Note</li>
</ul>
</li>
<li><code>manage_attributes</code>
<ul>
<li>Manage attributes on a Note</li>
</ul>
</li>
<li><code>manage_relationships</code>
<ul>
<li>Manage the various relationships between Notes</li>
</ul>
</li>
<li><code>extract_content</code>
<ul>
<li>Used to smartly extract content from a Note</li>
</ul>
</li>
<li><code>calendar_integration</code>
<ul>
<li>Used to find date notes, create date notes, get the daily note, etc.</li>
</ul>
</li>
</ul>
<p>When Tools are executed within your Chat, you'll see output like the following:</p>
<figure
class="image image_resized" style="width:66.88%;">
<img style="aspect-ratio:1372/1591;" src="6_Introduction_image.png" width="1372"
height="1591">
</figure>
<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%;">
<img style="aspect-ratio:1378/539;" src="2_Introduction_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_Introduction_image.png" width="1765"
height="1287">
</figure>

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 548 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

View File

@ -0,0 +1,17 @@
<p>Trilium offers advanced functionality through <a href="#root/_help_CdNpE2pqjmI6">Scripts</a> and
<a
href="#root/_help_OFXdgB2nNk1F">Promoted Attributes</a>. To illustrate these features, we've prepared
several showcases available in the <a href="#root/_help_wX4HbRucYSDD">demo notes</a>:</p>
<ul>
<li><a href="#root/_help_iRwzGnHPzonm">Relation Map</a>
</li>
<li><a href="#root/_help_l0tKav7yLHGF">Day Notes</a>
</li>
<li><a href="#root/_help_R7abl2fc6Mxi">Weight Tracker</a>
</li>
<li><a href="#root/_help_xYjQUYhpbUEW">Task Manager</a>
</li>
</ul>
<p>It's important to note that these examples are not natively supported
by Trilium out of the box; instead, they demonstrate what you can build
within Trilium.</p>

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View File

@ -0,0 +1,152 @@
<p>A common pattern in note-taking is that a lot of notes will be centered
around a certain date - e.g. you have some tasks which needs to be done
on a certain date, you have meeting minutes from a certain date, you have
your thoughts etc. and it all revolves around a date on which they occurred.
For this reason, it makes sense to create a certain "day workspace" which
will centralize all those notes relevant for a certain date.</p>
<p>For this, Trilium provides a concept of "day note". Trilium semi-automatically
generates a single note for each day. Under this note you can save all
those relevant notes.</p>
<p>Select an existing day note, and the menubar contains a calendar widget.
Select any day to create a note for that day.&nbsp;</p>
<p>
<img src="1_Day Notes_image.png">
</p>
<p>This pattern works well also because of <a href="#root/_help_IakOLONlIfGI">Cloning Notes</a> functionality
- note can appear in multiple places in the note tree, so besides appearing
under day note, it can also be categorized into other notes.</p>
<h2>Demo</h2>
<p>
<img src="Day Notes_image.png">
</p>
<p>You can see the structure of day notes appearing under "Journal" note
- there's a note for the whole year 2025, under it, you have "03 - March"
which then contains "09 - Monday". This is our "day note" which contains
some text in its content and also has some child notes (some of them are
from <a href="#root/_help_xYjQUYhpbUEW">Task manager</a>).</p>
<p>You can also notice how this day note has <a href="#root/_help_OFXdgB2nNk1F">promoted attribute</a> "weight"
where you can track your daily weight. This data is then used in <a href="#root/_help_R7abl2fc6Mxi">Weight tracker</a>.</p>
<h2>Week Note and Quarter Note</h2>
<p>Week and quarter notes are disabled by default, since it might be too
much for some people. To enable them, you need to set <code>#enableWeekNote</code> and <code>#enableQuarterNote</code> attributes
on the root calendar note, which is identified by <code>#calendarRoot</code> label.
Week note is affected by the first week of year option. Be careful when
you already have some week notes created, it will not automatically change
the existing week notes and might lead to some duplicates.</p>
<h2>Templates</h2>
<p>Trilium provides <a href="#root/_help_KC1HB96bqqHX">template</a> functionality,
and it could be used together with day notes.</p>
<p>You can define one of the following relations on the root of the journal
(identified by <code>#calendarRoot</code> label):</p>
<ul>
<li>yearTemplate</li>
<li>quarterTemplate (if <code>#enableQuarterNote</code> is set)</li>
<li>monthTemplate</li>
<li>weekTemplate (if <code>#enableWeekNote</code> is set)</li>
<li>dateTemplate</li>
</ul>
<p>All of these are relations. When Trilium creates a new note for year or
month or date, it will take a look at the root and attach a corresponding <code>~template</code> relation
to the newly created role. Using this, you can e.g. create your daily template
with e.g. checkboxes for daily routine etc.</p>
<h3>Migrate from old template usage</h3>
<p>If you have been using Journal prior to version v0.93.0, the previous
template pattern likely used was <code>~child:template=</code>.
<br>To transition to the new system:</p>
<ol>
<li>Set up the new template pattern in the Calendar root note.</li>
<li>Use <a href="#root/_help_ivYnonVFBxbQ">Bulk Actions</a> to remove <code>child:template</code> and <code>child:child:template</code> from
all notes under the Journal (calendar root).</li>
<li>Ensure that all old template patterns are fully removed to prevent conflicts
with the new setup.</li>
</ol>
<h2>Naming pattern</h2>
<p>You can customize the title of generated journal notes by defining a <code>#datePattern</code>, <code>#weekPattern</code>, <code>#monthPattern</code>, <code>#quarterPattern</code> and <code>#yearPattern</code> attribute
on a root calendar note (identified by <code>#calendarRoot</code> label).
The naming pattern replacements follow a level-up compatibility - each
level can use replacements from itself and all levels above it. For example, <code>#monthPattern</code> can
use month, quarter and year replacements, while <code>#weekPattern</code> can
use week, month, quarter and year replacements. But it is not possible
to use week replacements in <code>#monthPattern</code>.</p>
<h3>Date pattern</h3>
<p>It's possible to customize the title of generated date notes by defining
a <code>#datePattern</code> attribute on a root calendar note (identified
by <code>#calendarRoot</code> label). Following are possible values:</p>
<ul>
<li><code>{isoDate}</code> results in an ISO 8061 formatted date (e.g. "2025-03-09"
for March 9, 2025)</li>
<li><code>{dateNumber}</code> results in a number like <code>9</code> for the
9th day of the month, <code>11</code> for the 11th day of the month</li>
<li><code>{dateNumberPadded}</code> results in a number like <code>09</code> for
the 9th day of the month, <code>11</code> for the 11th day of the month</li>
<li><code>{ordinal}</code> is replaced with the ordinal date (e.g. 1st, 2nd,
3rd) etc.</li>
<li><code>{weekDay}</code> results in the full day name (e.g. <code>Monday</code>)</li>
<li><code>{weekDay3}</code> is replaced with the first 3 letters of the day,
e.g. Mon, Tue, etc.</li>
<li><code>{weekDay2}</code> is replaced with the first 2 letters of the day,
e.g. Mo, Tu, etc.</li>
</ul>
<p>The default is <code>{dateNumberPadded} - {weekDay}</code>
</p>
<h3>Week pattern</h3>
<p>It is also possible to customize the title of generated week notes through
the <code>#weekPattern</code> attribute on the root calendar note. The options
are:</p>
<ul>
<li><code>{weekNumber}</code> results in a number like <code>9</code> for the
9th week of the year, <code>11</code> for the 11th week of the year</li>
<li><code>{weekNumberPadded}</code> results in a number like <code>09</code> for
the 9th week of the year, <code>11</code> for the 11th week of the year</li>
<li><code>{shortWeek}</code> results in a short week string like <code>W9</code> for
the 9th week of the year, <code>W11</code> for the 11th week of the year</li>
<li><code>{shortWeek3}</code> results in a short week string like <code>W09</code> for
the 9th week of the year, <code>W11</code> for the 11th week of the year</li>
</ul>
<p>The default is <code>Week {weekNumber}</code>
</p>
<h3>Month pattern</h3>
<p>It is also possible to customize the title of generated month notes through
the <code>#monthPattern</code> attribute on the root calendar note. The options
are:</p>
<ul>
<li><code>{isoMonth}</code> results in an ISO 8061 formatted month (e.g. "2025-03"
for March 2025)</li>
<li><code>{monthNumber}</code> results in a number like <code>9</code> for September,
and <code>11</code> for November</li>
<li><code>{monthNumberPadded}</code> results in a number like <code>09</code> for
September, and <code>11</code> for November</li>
<li><code>{month}</code> results in the full month name (e.g. <code>September</code> or <code>October</code>)</li>
<li><code>{shortMonth3}</code> is replaced with the first 3 letters of the
month, e.g. Jan, Feb, etc.</li>
<li><code>{shortMonth4}</code> is replaced with the first 4 letters of the
month, e.g. Sept, Octo, etc.</li>
</ul>
<p>The default is <code>{monthNumberPadded} - {month}</code>
</p>
<h3>Quarter pattern</h3>
<p>It is also possible to customize the title of generated quarter notes
through the <code>#quarterPattern</code> attribute on the root calendar note.
The options are:</p>
<ul>
<li><code>{quarterNumber}</code> results in a number like <code>1</code> for
the 1st quarter of the year</li>
<li><code>{shortQuarter}</code> results in a short quarter string like <code>Q1</code> for
the 1st quarter of the year</li>
</ul>
<p>The default is <code>Quarter {quarterNumber}</code>
</p>
<h3>Year pattern</h3>
<p>It is also possible to customize the title of generated year notes through
the <code>#yearPattern</code> attribute on the root calendar note. The options
are:</p>
<ul>
<li><code>{year}</code> results in the full year (e.g. <code>2025</code>)</li>
</ul>
<p>The default is <code>{year}</code>
</p>
<h2>Implementation</h2>
<p>Trilium has some special support for day notes in the form of <a href="https://triliumnext.github.io/Notes/backend_api/BackendScriptApi.html">backend Script API</a> -
see e.g. getDayNote() function.</p>
<p>Day (and year, month) notes are created with a label - e.g. <code>#dateNote="2025-03-09"</code> this
can then be used by other scripts to add new notes to day note etc.</p>

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

View File

@ -0,0 +1,65 @@
<p>Task Manager is a <a href="#root/_help_OFXdgB2nNk1F">promoted attributes</a> and
<a
href="#root/_help_CdNpE2pqjmI6">scripts</a>showcase present in the <a href="#root/_help_wX4HbRucYSDD">demo notes</a>.</p>
<h2>Demo</h2>
<p>
<img src="Task Manager_task-manager.png">
</p>
<p>Task Manager manages outstanding (TODO) tasks and finished tasks (non-empty
doneDate attribute). Outstanding tasks are further categorized by location
and arbitrary tags - whenever you change tag attribute in the task note,
this task is then automatically moved to appropriate location.</p>
<p>Task Manager also integrates with <a href="#root/_help_l0tKav7yLHGF">day notes</a> -
notes are <a href="#root/_help_IakOLONlIfGI">cloned</a> into day note to
both todoDate note and doneDate note (with <a href="#root/_help_kBrnXNG3Hplm">prefix</a> of
either "TODO" or "DONE").</p>
<h2>Implementation</h2>
<p>New tasks are created in the TODO note which has <code>~child:template</code>
<a
href="#root/_help_zEY4DaJG4YT5">relation</a>(see <a href="#root/_help_bwZpz2ajCEwO">attribute inheritance</a>)
pointing to the task template.</p>
<h3>Attributes</h3>
<p>Task template defines several <a href="#root/_help_OFXdgB2nNk1F">promoted attributes</a> -
todoDate, doneDate, tags, location. Importantly it also defines <code>~runOnAttributeChange</code> relation
- <a href="#root/_help_GPERMystNGTB">event</a> handler which is run on attribute
change. This <a href="#root/_help_CdNpE2pqjmI6">script</a> handles when e.g.
we fill out the doneDate attribute - meaning the task is done and should
be moved to "Done" note and removed from TODO, locations and tags.</p>
<h3>New task button</h3>
<p>There's also "button" note which contains simple script which adds a button
to create new note (task) in the TODO note.</p><pre><code class="language-text-x-trilium-auto">api.addButtonToToolbar({
title: 'New task',
icon: 'check',
shortcut: 'alt+n',
action: async () =&gt; {
// creating notes is backend (server) responsibility so we need to pass
// the control there
const taskNoteId = await api.runOnBackend(async () =&gt; {
const todoRootNote = await api.getNoteWithLabel('taskTodoRoot');
const {note} = await api.createNote(todoRootNote.noteId, 'new task', '');
return note.noteId;
});
// we got an ID of newly created note and we want to immediatelly display it
await api.activateNewNote(taskNoteId);
}
});</code></pre>
<h3>CSS</h3>
<p>In the demo screenshot above you may notice that TODO tasks are in red
color and DONE tasks are green.</p>
<p>This is done by having this CSS <a href="#root/_help_6f9hih2hXXZk">code note</a> which
defines extra CSS classes:</p><pre><code class="language-text-x-trilium-auto">span.fancytree-node.todo .fancytree-title {
color: red !important;
}
span.fancytree-node.done .fancytree-title {
color: green !important;
}</code></pre>
<p>This <a href="#root/_help_6f9hih2hXXZk">code note</a> has <code>#appCss</code>
<a
href="#root/_help_zEY4DaJG4YT5">label</a>which is recognized by Trilium on startup and loaded as CSS into
the application.</p>
<p>Second part of this functionality is based in event handler described
above which assigns <code>#cssClass</code> label to the task to either "done"
or "todo" based on the task status.</p>

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 KiB

View File

@ -0,0 +1,73 @@
<p>
<img src="Weight Tracker_image.png">
</p>
<p>The <code>Weight Tracker</code> is a <a href="#root/_help_GLks18SNjxmC">Script API</a> showcase
present in the <a href="#root/_help_wX4HbRucYSDD">demo notes</a>.</p>
<p>By adding <code>weight</code> as a <a href="#root/_help_OFXdgB2nNk1F">promoted attribute</a> in
the <a href="#root/_help_KC1HB96bqqHX">template</a> from which <a href="#root/_help_l0tKav7yLHGF">day notes</a> are
created, you can aggregate the data and plot weight change over time.</p>
<h2>Implementation</h2>
<p>The <code>Weight Tracker</code> note in the screenshot above is of the type <code>Render Note</code>.
That type of note doesn't have any useful content itself. Instead it is
a placeholder where a <a href="#root/_help_CdNpE2pqjmI6">script</a> can render
its output.</p>
<p>Scripts for <code>Render Notes</code> are defined in a <a href="#root/_help_zEY4DaJG4YT5">relation</a> called <code>~renderNote</code>.
In this example, it's the <code>Weight Tracker</code>'s child <code>Implementation</code>.
The Implementation consists of two <a href="#root/_help_6f9hih2hXXZk">code notes</a> that
contain some HTML and JavaScript respectively, which load all the notes
with a <code>weight</code> attribute and display their values in a chart.</p>
<p>To actually render the chart, we're using a third party library called
<a
href="https://www.chartjs.org/">chart.js</a>which is imported as an attachment, since it's not built into
Trilium.</p>
<h3>Code</h3>
<p>Here's the content of the script which is placed in a <a href="#root/_help_6f9hih2hXXZk">code note</a> of
type <code>JS Frontend</code>:</p><pre><code class="language-text-x-trilium-auto">async function getChartData() {
const days = await api.runOnBackend(async () =&gt; {
const notes = api.getNotesWithLabel('weight');
const days = [];
for (const note of notes) {
const date = note.getLabelValue('dateNote');
const weight = parseFloat(note.getLabelValue('weight'));
if (date &amp;&amp; weight) {
days.push({ date, weight });
}
}
days.sort((a, b) =&gt; a.date &gt; b.date ? 1 : -1);
return days;
});
const datasets = [
{
label: "Weight (kg)",
backgroundColor: 'red',
borderColor: 'red',
data: days.map(day =&gt; day.weight),
fill: false,
spanGaps: true,
datalabels: {
display: false
}
}
];
return {
datasets: datasets,
labels: days.map(day =&gt; day.date)
};
}
const ctx = $("#canvas")[0].getContext("2d");
new chartjs.Chart(ctx, {
type: 'line',
data: await getChartData()
});</code></pre>
<h2>How to remove the Weight Tracker button from the top bar</h2>
<p>In the link map of the <code>Weight Tracker</code>, there is a note called <code>Button</code>.
Open it and delete or comment out its contents. The <code>Weight Tracker</code> button
will disappear after you restart Trilium.</p>

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

View File

@ -0,0 +1,44 @@
<figure class="image">
<img style="aspect-ratio:1071/146;" src="Attributes_image.png" width="1071"
height="146">
</figure>
<p>In Trilium, attributes are key-value pairs assigned to notes, providing
additional metadata or functionality. There are two primary types of attributes:</p>
<ol>
<li>
<p><a class="reference-link" href="#root/_help_HI6GBBIduIgv">Labels</a>&nbsp;can
be used for a variety of purposes, such as storing metadata or configuring
the behaviour of notes. Labels are also searchable, enhancing note retrieval.</p>
<p>For more information, including predefined labels, see&nbsp;<a class="reference-link"
href="#root/_help_HI6GBBIduIgv">Labels</a>.</p>
</li>
<li>
<p><a class="reference-link" href="#root/_help_Cq5X6iKQop6R">Relations</a>&nbsp;define
connections between notes, similar to links. These can be used for metadata
and scripting purposes.</p>
<p>For more information, including a list of predefined relations, see&nbsp;
<a
class="reference-link" href="#root/_help_Cq5X6iKQop6R">Relations</a>.</p>
</li>
</ol>
<p>These attributes play a crucial role in organizing, categorising, and
enhancing the functionality of notes.</p>
<h2>Viewing the list of attributes</h2>
<p>Both the labels and relations for the current note are displayed in the <em>Owned Attributes</em> section
of the&nbsp;<a class="reference-link" href="#root/_help_BlN9DFI679QC">Ribbon</a>,
where they can be viewed and edited. Inherited attributes are displayed
in the <em>Inherited Attributes</em> section of the ribbon, where they can
only be viewed.</p>
<p>In the list of attributes, labels are prefixed with the <code>#</code> character
whereas relations are prefixed with the <code>~</code> character.</p>
<h2>Multiplicity</h2>
<p>Attributes in Trilium can be "multi-valued", meaning multiple attributes
with the same name can co-exist.</p>
<h2>Attribute Definitions and Promoted Attributes</h2>
<p>Special labels create "label/attribute" definitions, enhancing the organization
and management of attributes. For more details, see&nbsp;<a class="reference-link"
href="#root/_help_OFXdgB2nNk1F">Promoted Attributes</a>.</p>
<h2>Attribute Inheritance</h2>
<p>Trilium supports attribute inheritance, allowing child notes to inherit
attributes from their parents. For more information, see&nbsp;<a class="reference-link"
href="#root/_help_bwZpz2ajCEwO">Attribute Inheritance</a>.</p>

View File

@ -0,0 +1,50 @@
<p>Inheritance refers to the process of having a <a href="#root/_help_HI6GBBIduIgv">label</a> or
a <a href="#root/_help_Cq5X6iKQop6R">relation</a> shared across multiple
notes, generally in parent-child relations (or anywhere if using templates).</p>
<h2>Standard Inheritance</h2>
<p>In Trilium, attributes can be automatically inherited by child notes if
they have the <code>isInheritable</code> flag set to <code>true</code>. This
means the attribute (a key-value pair) is applied to the note and all its
descendants.</p>
<p>To make an attribute inheritable, simply use the visual editor for&nbsp;
<a
class="reference-link" href="#root/_help_HI6GBBIduIgv">Labels</a>&nbsp;or&nbsp;<a class="reference-link" href="#root/_help_Cq5X6iKQop6R">Relations</a>.
Alternatively, the attribute can be manually defined where <code>#myLabel=value</code> becomes <code>#myLabel(inheritable)=value</code> when
inheritable.</p>
<p>As an example, the <code>archived</code> label can be set to be inheritable,
allowing you to hide a whole subtree of notes from searches and other dialogs
by applying this label at the top level.</p>
<p>Standard inheritance forces all the notes that are children (and sub-children)
of a note to have that particular label or relation. If there is a need
to have some notes not inherit one of the labels, then <em>copying inheritance</em> or <em>template inheritance</em> needs
to be used instead.</p>
<h2>Copying Inheritance</h2>
<p>Copying inheritance differs from standard inheritance by using a <code>child:</code> prefix
in the attribute name. This prefix causes new child notes to automatically
receive specific attributes from the parent note. These attributes are
independent of the parent and will persist even if the note is moved elsewhere.</p>
<p>If a parent note has the label <code>#child:exampleAttribute</code>, all
newly created child notes (one level deep) will inherit the <code>#exampleAttribute</code> label.
This can be useful for setting default properties for notes in a specific
section.</p>
<p>Similarly, for relations use <code>~child:myRelation</code>.</p>
<p>Due to the way it's designed, copying inheritance cannot be used to cascade
infinitely within a hierarchy. For that use case, consider using either
standard inheritance or templates.</p>
<h3>Chained inheritance</h3>
<p>It is possible to define labels across multiple levels of depth. For example, <code>#child:child:child:foo</code> applied
to a root note would create:</p>
<ul>
<li><code>#child:child:foo</code> on the first-level children.</li>
<li><code>#child:foo</code> on the second-level children.</li>
<li><code>#foo</code> on the third-level children.</li>
</ul>
<p>Similarly, use <code>~child:child:child:foo</code> if dealing with relations.</p>
<p>Do note that same as simple copying inheritance, the changes will not
apply retroactively to existing notes in the hierarchy, it will only apply
to the newly created notes.</p>
<h2>Template Inheritance</h2>
<p>Attributes can also be inherited from&nbsp;<a class="reference-link" href="#root/_help_KC1HB96bqqHX">Templates</a>.
When a new note is created using a template, it inherits the attributes
defined in that template. This is particularly useful for maintaining consistency
across notes that follow a similar structure or function.</p>

View File

@ -0,0 +1,385 @@
<p>A label is an <a href="#root/_help_zEY4DaJG4YT5">attribute</a> of a note
which has a name and optionally a value.</p>
<h2>Common use cases</h2>
<ul>
<li><strong>Metadata for personal use</strong>: Assign labels with optional
values for categorization, such as <code>#year=1999</code>, <code>#genre="sci-fi"</code>,
or <code>#author="Neal Stephenson"</code>. This can be combined with&nbsp;
<a
class="reference-link" href="#root/_help_OFXdgB2nNk1F">Promoted Attributes</a>&nbsp;to make their display more user-friendly.</li>
<li><strong>Configuration</strong>: Labels can configure advanced features
or settings (see reference below).</li>
<li><strong>Scripts and Plugins</strong>: Used to tag notes with special metadata,
such as the "weight" attribute in the&nbsp;<a class="reference-link" href="#root/_help_R7abl2fc6Mxi">Weight Tracker</a>.</li>
</ul>
<h2>Creating a label using the visual editor</h2>
<ol>
<li>Go to the <em>Owned Attributes</em> section in the&nbsp;<a class="reference-link"
href="#root/_help_BlN9DFI679QC">Ribbon</a>.</li>
<li>Press the + button (<em>Add new attribute</em>) to the right.</li>
<li>Select <em>Add new label</em> for the relation.</li>
</ol>
<aside class="admonition tip">
<p>If you prefer keyboard shortcuts, press <kbd>Alt</kbd>+<kbd>L</kbd> while
focused on a note or in the <em>Owned Attributes</em> section to display
the visual editor.</p>
</aside>
<p>While in the visual editor:</p>
<ul>
<li>Set the desired name</li>
<li>Optionally, set the value of the label. Labels can exist without a value.</li>
<li>Check <em>Inheritable</em> if the label should be inherited by the child
notes as well. See&nbsp;<a class="reference-link" href="#root/_help_bwZpz2ajCEwO">Attribute Inheritance</a>&nbsp;for
more information.</li>
</ul>
<h2>Creating a label manually</h2>
<p>In the <em>Owned Attributes</em> section in the&nbsp;<a class="reference-link"
href="#root/_help_BlN9DFI679QC">Ribbon</a>:</p>
<ul>
<li>To create a label called <code>myLabel</code> with no value, simply type <code>#myLabel</code>.</li>
<li>To create a label called <code>myLabel</code> with a value <code>value</code>,
simply type <code>#myLabel=value</code>.</li>
<li>If the value contains spaces, then the text must be quoted: <code>#myLabel="Hello world"</code>.</li>
<li>If the string contains quotes (regardless of whether it has spaces), then
the text must be quoted with apostrophes instead: <code>#myLabel='Hello "world"'</code>.</li>
<li>To create an inheritable label called <code>myLabel</code>, simply write <code>#myLabel(inheritable)</code> for
no value or <code>#myLabel(inheritable)=value</code> if there is a value.</li>
</ul>
<h2>Predefined labels</h2>
<p>This is a list of labels that Trilium natively supports.</p>
<aside class="admonition tip">
<p>Some labels presented here end with a <code>*</code>. That means that there
are multiple labels with the same prefix, consult the specific page linked
in the description of that label for more information.</p>
</aside>
<figure class="table" style="width:100%;">
<table class="ck-table-resized">
<colgroup>
<col style="width:33.82%;">
<col style="width:66.18%;">
</colgroup>
<thead>
<tr>
<th>Label</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>disableVersioning</code>
</td>
<td>Disables automatic creation of&nbsp;<a class="reference-link" href="#root/_help_vZWERwf8U3nx">Note Revisions</a>&nbsp;for
a particular note. Useful for e.g. large, but unimportant notes - e.g.
large JS libraries used for scripting.</td>
</tr>
<tr>
<td><code>versioningLimit</code>
</td>
<td>Limits the maximum number of&nbsp;<a class="reference-link" href="#root/_help_vZWERwf8U3nx">Note Revisions</a>&nbsp;for
a particular note, overriding the global settings.</td>
</tr>
<tr>
<td><code>calendarRoot</code>
</td>
<td>Marks the note which should be used as root for&nbsp;<a class="reference-link"
href="#root/_help_l0tKav7yLHGF">Day Notes</a>. Only one should be marked
as such.</td>
</tr>
<tr>
<td><code>archived</code>
</td>
<td>Hides notes from default search results and dialogs. Archived notes can
optionally be hidden in the&nbsp;<a class="reference-link" href="#root/_help_oPVyFC7WL2Lp">Note Tree</a>.</td>
</tr>
<tr>
<td><code>excludeFromExport</code>
</td>
<td>Excludes this note and its children when exporting.</td>
</tr>
<tr>
<td><code>run</code>, <code>runOnInstance</code>, <code>runAtHour</code>
</td>
<td>See&nbsp;<a class="reference-link" href="#root/_help_GPERMystNGTB">Events</a>.</td>
</tr>
<tr>
<td><code>disableInclusion</code>
</td>
<td>Scripts with this label won't be included into parent script execution.</td>
</tr>
<tr>
<td><code>sorted</code>
</td>
<td>
<p>Keeps child notes sorted by title alphabetically.</p>
<p>When given a value, it will sort by the value of another label instead.
If one of the child notes doesn't have the specified label, the title will
be used for them instead.</p>
</td>
</tr>
<tr>
<td><code>sortDirection</code>
</td>
<td>
<p>If <code>sorted</code> is applied, specifies the direction of the sort:</p>
<ul>
<li><code>ASC</code>, ascending (default)</li>
<li><code>DESC</code>, descending</li>
</ul>
</td>
</tr>
<tr>
<td><code>sortFoldersFirst</code>
</td>
<td>If <code>sorted</code> is applied, folders (notes with children) will be
sorted as a group at the top, and the rest will be sorted.</td>
</tr>
<tr>
<td><code>top</code>
</td>
<td>If <code>sorted</code> is applied to the parent note, keeps given note on
top in its parent.</td>
</tr>
<tr>
<td><code>hidePromotedAttributes</code>
</td>
<td>Hide&nbsp;<a class="reference-link" href="#root/_help_OFXdgB2nNk1F">Promoted Attributes</a>&nbsp;on
this note. Generally useful when defining inherited attributes, but the
parent note doesn't need them.</td>
</tr>
<tr>
<td><code>readOnly</code>
</td>
<td>Marks a note to be always be <a href="#root/_help_CoFPLs3dRlXc">read-only</a>,
if it's a supported note (text, code, mermaid).</td>
</tr>
<tr>
<td><code>autoReadOnlyDisabled</code>
</td>
<td>Disables automatic <a href="#root/_help_CoFPLs3dRlXc">read-only mode</a> for
the given note.</td>
</tr>
<tr>
<td><code>appCss</code>
</td>
<td>Marks CSS notes which are loaded into the Trilium application and can
thus be used to modify Trilium's looks. See&nbsp;<a class="reference-link"
href="#root/_help_AlhDUqhENtH7">Custom app-wide CSS</a>&nbsp;for more info.</td>
</tr>
<tr>
<td><code>appTheme</code>
</td>
<td>Marks CSS notes which are full Trilium themes and are thus available in
Trilium options. See&nbsp;<a class="reference-link" href="#root/_help_pKK96zzmvBGf">Theme development</a>&nbsp;for
more information.</td>
</tr>
<tr>
<td><code>appThemeBase</code>
</td>
<td>Set to <code>next</code>, <code>next-light</code>, or <code>next-dark</code> to
use the corresponding TriliumNext theme (auto, light or dark) as the base
for a custom theme, instead of the legacy one. See&nbsp;<a class="reference-link"
href="#root/_help_WFGzWeUK6arS">Customize the Next theme</a>&nbsp;for more
information.</td>
</tr>
<tr>
<td><code>cssClass</code>
</td>
<td>Value of this label is then added as CSS class to the node representing
given note in the&nbsp;<a class="reference-link" href="#root/_help_oPVyFC7WL2Lp">Note Tree</a>.
This can be useful for advanced theming. Can be used in template notes.</td>
</tr>
<tr>
<td><code>iconClass</code>
</td>
<td>value of this label is added as a CSS class to the icon on the tree which
can help visually distinguish the notes in the tree. Example might be bx
bx-home - icons are taken from boxicons. Can be used in template notes.</td>
</tr>
<tr>
<td><code>pageSize</code>
</td>
<td>Specifies the number of items per page in&nbsp;<a class="reference-link"
href="#root/_help_0ESUbbAxVnoK">Note List</a>.</td>
</tr>
<tr>
<td><code>customRequestHandler</code>
</td>
<td>See&nbsp;<a class="reference-link" href="#root/_help_J5Ex1ZrMbyJ6">Custom Request Handler</a>.</td>
</tr>
<tr>
<td><code>customResourceProvider</code>
</td>
<td>See&nbsp;<a class="reference-link" href="#root/_help_d3fAXQ2diepH">Custom Resource Providers</a>.</td>
</tr>
<tr>
<td><code>widget</code>
</td>
<td>Marks this note as a custom widget which will be added to the Trilium
component tree. See&nbsp;<a class="reference-link" href="#root/_help_MgibgPcfeuGz">Custom Widgets</a>&nbsp;for
more information.</td>
</tr>
<tr>
<td><code>searchHome</code>
</td>
<td>New search notes will be created as children of this note (see&nbsp;
<a
class="reference-link" href="#root/_help_m523cpzocqaD">Saved Search</a>).</td>
</tr>
<tr>
<td><code>workspace</code> and related attributes</td>
<td>See&nbsp;<a class="reference-link" href="#root/_help_9sRHySam5fXb">Workspaces</a>.</td>
</tr>
<tr>
<td><code>inbox</code>
</td>
<td>default inbox location for new notes - when you create a note using <em>new note</em> button
in the sidebar, notes will be created as child notes in the note marked
as with <code>#inbox</code> label.</td>
</tr>
<tr>
<td><code>sqlConsoleHome</code>
</td>
<td>Default location of&nbsp;<a class="reference-link" href="#root/_hidden/_help/_help_tC7s2alapj8V/_help_wX4HbRucYSDD/_help_oyIAJ9PvvwHX/_help__help_YKWqdJhzi2VY">SQL Console</a>&nbsp;notes</td>
</tr>
<tr>
<td><code>bookmarked</code>
</td>
<td>Indicates this note is a <a href="#root/_help_u3YFHC9tQlpm">bookmark</a>.</td>
</tr>
<tr>
<td><code>bookmarkFolder</code>
</td>
<td>Note with this label will appear in bookmarks as folder (allowing access
to its children). See&nbsp;<a class="reference-link" href="#root/_help_u3YFHC9tQlpm">Bookmarks</a>&nbsp;for
more information.</td>
</tr>
<tr>
<td><code>share*</code>
</td>
<td>See the attribute reference in&nbsp;<a class="reference-link" href="#root/_help_R9pX4DGra2Vt">Sharing</a>.</td>
</tr>
<tr>
<td><code>displayRelations</code>, <code>hideRelations</code>
</td>
<td>Comma delimited names of relations which should be displayed/hidden in
a&nbsp;<a class="reference-link" href="#root/_help_iRwzGnHPzonm">Relation Map</a>&nbsp;(both
the note type and the&nbsp;<a class="reference-link" href="#root/_help_BCkXAVs63Ttv">Note Map (Link map, Tree map)</a>&nbsp;general
functionality).</td>
</tr>
<tr>
<td><code>titleTemplate</code>
</td>
<td>
<p>Default title of notes created as children of this note. This value is
evaluated as a JavaScript string and thus can be enriched with dynamic
content via the injected <code>now</code> and <code>parentNote</code> variables.</p>
<p>Examples:</p>
<ul>
<li><code><span class="math-tex">\({parentNote.getLabel('authorName')}'s literary works</span></code>
</li>
<li><code>Log for \){now.format('YYYY-MM-DD HH:mm:ss')}</code>
</li>
<li>to mirror the parent's template.</li>
</ul>
<p>See&nbsp;<a class="reference-link" href="#root/_help_47ZrP6FNuoG8">Default Note Title</a>&nbsp;for
more info.</p>
</td>
</tr>
<tr>
<td><code>template</code>
</td>
<td>This note will appear in the selection of available template when creating
new note. See&nbsp;<a class="reference-link" href="#root/_help_KC1HB96bqqHX">Templates</a>&nbsp;for
more information.</td>
</tr>
<tr>
<td><code>toc</code>
</td>
<td>Controls the display of the&nbsp;<a class="reference-link" href="#root/_help_BFvAtE74rbP6">Table of contents</a>&nbsp;for
a given note. <code>#toc</code> or <code>#toc=show</code> to always display
the table of contents, <code>#toc=false</code> to always hide it.</td>
</tr>
<tr>
<td><code>color</code>
</td>
<td>defines color of the note in note tree, links etc. Use any valid CSS color
value like 'red' or #a13d5f</td>
</tr>
<tr>
<td><code>keyboardShortcut</code>
</td>
<td>Defines a keyboard shortcut which will immediately jump to this note.
Example: 'ctrl+alt+e'. Requires frontend reload for the change to take
effect.</td>
</tr>
<tr>
<td><code>keepCurrentHoisting</code>
</td>
<td>Opening this link won't change hoisting even if the note is not displayable
in the current hoisted subtree.</td>
</tr>
<tr>
<td><code>executeButton</code>
</td>
<td>Title of the button which will execute the current code note</td>
</tr>
<tr>
<td><code>executeDescription</code>
</td>
<td>Longer description of the current code note displayed together with the
execute button</td>
</tr>
<tr>
<td><code>excludeFromNoteMap</code>
</td>
<td>Notes with this label will be hidden from the&nbsp;<a class="reference-link"
href="#root/_help_bdUJEHsAPYQR">Note Map</a>.</td>
</tr>
<tr>
<td><code>newNotesOnTop</code>
</td>
<td>New notes will be created at the top of the parent note, not on the bottom.</td>
</tr>
<tr>
<td><code>hideHighlightWidget</code>
</td>
<td>Hides the&nbsp;<a class="reference-link" href="#root/_help_AxshuNRegLAv">Highlights list</a>&nbsp;widget</td>
</tr>
<tr>
<td><code>hideChildrenOverview</code>
</td>
<td>Hides the&nbsp;<a class="reference-link" href="#root/_help_0ESUbbAxVnoK">Note List</a>&nbsp;for
that particular note.</td>
</tr>
<tr>
<td><code>printLandscape</code>
</td>
<td>When exporting to PDF, changes the orientation of the page to landscape
instead of portrait.</td>
</tr>
<tr>
<td><code>printPageSize</code>
</td>
<td>When exporting to PDF, changes the size of the page. Supported values: <code>A0</code>, <code>A1</code>, <code>A2</code>, <code>A3</code>, <code>A4</code>, <code>A5</code>, <code>A6</code>, <code>Legal</code>, <code>Letter</code>, <code>Tabloid</code>, <code>Ledger</code>.</td>
</tr>
<tr>
<td><code>geolocation</code>
</td>
<td>Indicates the latitude and longitude of a note, to be displayed in a&nbsp;
<a
class="reference-link" href="#root/_help_81SGnPGMk7Xc">Geo Map</a>.</td>
</tr>
<tr>
<td><code>calendar:*</code>
</td>
<td>Defines specific options for the&nbsp;<a class="reference-link" href="#root/_help_xWbu3jpNWapp">Calendar View</a>.</td>
</tr>
<tr>
<td><code>viewType</code>
</td>
<td>Sets the view of child notes (e.g. grid or list). See&nbsp;<a class="reference-link"
href="#root/_help_0ESUbbAxVnoK">Note List</a>&nbsp;for more information.</td>
</tr>
</tbody>
</table>
</figure>

View File

@ -0,0 +1,49 @@
<p>Promoted attributes are <a href="#root/_help_zEY4DaJG4YT5">attributes</a> which
are considered important and thus are "promoted" onto the main note UI.
See example below:</p>
<p>
<img src="Promoted Attributes_promot.png">
</p>
<p>You can see the note having kind of form with several fields. Each of
these is just regular attribute, the only difference is that they appear
on the note itself.</p>
<p>Attributes can be pretty useful since they allow for querying and script
automation etc. but they are also inconveniently hidden. This allows you
to select few of the important ones and push them to the front of the user.</p>
<p>Now, how do we make attribute to appear on the UI?</p>
<h2>Attribute definition</h2>
<p>Attribute is always name-value pair where both name and value are strings.</p>
<p><em>Attribute definition</em> specifies how should this value be interpreted
- is it just string, or is it a date? Should we allow multiple values or
note? And importantly, should we <em>promote</em> the attribute or not?</p>
<p>
<img src="Promoted Attributes_image.png">
</p>
<p>You can notice tag attribute definition. These "definition" attributes
define how the "value" attributes should behave.</p>
<p>So there's one attribute for value and one for definition. But notice
how definition attribute is <a href="#root/_help_bwZpz2ajCEwO">Inheritable</a>,
meaning that it's also applied to all descendant note. So in a way, this
definition is used for the whole subtree while "value" attributes are applied
only for this note.</p>
<h3>Inverse relation</h3>
<p>Some relations always occur in pairs - my favorite example is on the family.
If you have a note representing husband and note representing wife, then
there might be a relation between those two of <code>isPartnerOf</code>.
This is bidirectional relationship - meaning that if a relation is pointing
from husband to wife then there should be always another relation pointing
from wife to husband.</p>
<p>Another example is with parent - child relationship. Again these always
occur in pairs, but in this case it's not exact same relation - the one
going from parent to child might be called <code>isParentOf</code> and the
other one going from child to parent might be called <code>isChildOf</code>.</p>
<p>Relation definition allows you to specify such "inverse relation" - for
the relation you just define you specify which is the inverse relation.
Note that in the second example we should have two relation definitions
- one for <code>isParentOf</code> which defines <code>isChildOf</code> as inverse
relation and then second relation definition for <code>isChildOf</code> which
defines <code>isParentOf</code> as inverse relation.</p>
<p>What this does internally is that whenever we save a relation which has
defined inverse relation, we check that this inverse relation exists on
the relation target note. Similarly, when we delete relation, we also delete
inverse relation on the target note.</p>

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

View File

@ -0,0 +1,139 @@
<p>A relation is similar to a <a href="#root/_help_HI6GBBIduIgv">label</a>,
but instead of having a text value it refers to another note.</p>
<h2>Common use cases</h2>
<ul>
<li><strong>Metadata Relationships for personal use</strong>: For example,
linking a book note to an author note.
<br>This can be combined with&nbsp;<a class="reference-link" href="#root/_help_OFXdgB2nNk1F">Promoted Attributes</a>&nbsp;to
make their display more user-friendly.</li>
<li><strong>Configuration</strong>: For configuring some notes such as&nbsp;
<a
class="reference-link" href="#root/_help_HcABDtFCkbFN">Render Note</a>, or configuring&nbsp;<a class="reference-link" href="#root/_help_R9pX4DGra2Vt">Sharing</a>&nbsp;or&nbsp;
<a
class="reference-link" href="#root/_help_KC1HB96bqqHX">Templates</a>&nbsp;(see the list below).</li>
<li><strong>Scripting</strong>: Attaching scripts to events or conditions
related to the note.</li>
</ul>
<h2>Creating a relation using the visual editor</h2>
<ol>
<li>Go to the <em>Owned Attributes</em> section in the&nbsp;<a class="reference-link"
href="#root/_help_BlN9DFI679QC">Ribbon</a>.</li>
<li>Press the + button (<em>Add new attribute</em>) to the right.</li>
<li>Select <em>Add new relation</em> for the relation.</li>
</ol>
<aside class="admonition tip">
<p>If you prefer keyboard shortcuts, press <kbd>Alt</kbd>+<kbd>L</kbd> while
focused on a note or in the <em>Owned Attributes</em> section to display
the visual editor.</p>
</aside>
<p>While in the visual editor:</p>
<ul>
<li>Set the desired name</li>
<li>Set the Target note (the note to point to). Unlike labels, relations cannot
exist with a target note.</li>
<li>Check <em>Inheritable</em> if the label should be inherited by the child
notes as well. See&nbsp;<a class="reference-link" href="#root/_help_bwZpz2ajCEwO">Attribute Inheritance</a>&nbsp;for
more information.</li>
</ul>
<h2>Creating a relation manually</h2>
<p>In the <em>Owned Attributes</em> section in the&nbsp;<a class="reference-link"
href="#root/_help_BlN9DFI679QC">Ribbon</a>:</p>
<ul>
<li>To create a relation called <code>myRelation</code>:
<ul>
<li>First type <code>~myRelation=@</code>.</li>
<li>After this, an autocompletion box should appear.</li>
<li>Type the title of the note to point to and press <kbd>Enter</kbd> to confirm
(or click the desired note).</li>
<li>Alternatively copy a note from the&nbsp;<a class="reference-link" href="#root/_help_oPVyFC7WL2Lp">Note Tree</a>&nbsp;and
paste it after the <code>=</code> sign (without the <code>@</code>, in this
case).</li>
</ul>
</li>
<li>To create an inheritable relation, follow the same steps as previously
described but instead of <code>~myRelation</code> write <code>~myRelation(inheritable)</code>.</li>
</ul>
<h2>Predefined relations</h2>
<p>These relations are supported and used internally by Trilium.</p>
<aside
class="admonition tip">
<p>Some relations presented here end with a <code>*</code>. That means that
there are multiple relations with the same prefix, consult the specific
page linked in the description of that relation for more information.</p>
</aside>
<figure class="table" style="width:100%;">
<table class="ck-table-resized">
<colgroup>
<col style="width:33.95%;">
<col style="width:66.05%;">
</colgroup>
<thead>
<tr>
<th>Label</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>runOn*</code>
</td>
<td>See&nbsp;<a class="reference-link" href="#root/_help_GPERMystNGTB">Events</a>
</td>
</tr>
<tr>
<td><code>template</code>
</td>
<td>note's attributes will be inherited even without a parent-child relationship,
note's content and subtree will be added to instance notes if empty. See
documentation for details.</td>
</tr>
<tr>
<td><code>inherit</code>
</td>
<td>note's attributes will be inherited even without a parent-child relationship.
See&nbsp;<a class="reference-link" href="#root/_help_KC1HB96bqqHX">Templates</a>&nbsp;for
a similar concept. See&nbsp;<a class="reference-link" href="#root/_help_bwZpz2ajCEwO">Attribute Inheritance</a>&nbsp;in
the documentation.</td>
</tr>
<tr>
<td><code>renderNote</code>
</td>
<td>notes of type&nbsp;<a class="reference-link" href="#root/_help_HcABDtFCkbFN">Render Note</a>&nbsp;will
be rendered using a code note (HTML or script) and it is necessary to point
using this relation to which note should be rendered</td>
</tr>
<tr>
<td><code>widget_relation</code>
</td>
<td>target of this relation will be executed and rendered as a widget in the
sidebar</td>
</tr>
<tr>
<td><code>shareCss</code>
</td>
<td>CSS note which will be injected into the share page. CSS note must be
in the shared sub-tree as well. Consider using <code>share_hidden_from_tree</code> and <code>share_omit_default_css</code> as
well.</td>
</tr>
<tr>
<td><code>shareJs</code>
</td>
<td>JavaScript note which will be injected into the share page. JS note must
be in the shared sub-tree as well. Consider using <code>share_hidden_from_tree</code>.</td>
</tr>
<tr>
<td><code>shareTemplate</code>
</td>
<td>Embedded JavaScript note that will be used as the template for displaying
the shared note. Falls back to the default template. Consider using <code>share_hidden_from_tree</code>.</td>
</tr>
<tr>
<td><code>shareFavicon</code>
</td>
<td>Favicon note to be set in the shared page. Typically you want to set it
to share root and make it inheritable. Favicon note must be in the shared
sub-tree as well. Consider using <code>share_hidden_from_tree</code>.</td>
</tr>
</tbody>
</table>
</figure>

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -0,0 +1,169 @@
<figure class="image">
<img style="aspect-ratio:1425/654;" src="Bulk Actions_image.png" width="1425"
height="654">
</figure>
<p>The <em>Bulk Actions</em> dialog makes it easy to apply changes to multiple
notes at once, ranging from simple actions such as adding or removing a
label to being executing custom scripts.</p>
<h2>Interaction</h2>
<ul>
<li>The first step is to select the notes in the&nbsp;<a class="reference-link"
href="#root/_help_oPVyFC7WL2Lp">Note Tree</a>. It's possible to apply bulk
actions to:
<ul>
<li>A single note (and potentially its child notes) simply by clicking on
it (with a left click or a right click).</li>
<li>Multiple notes. See&nbsp;<a class="reference-link" href="#root/_help_yTjUdsOi4CIE">Multiple selection</a>&nbsp;on
how to do so.</li>
</ul>
</li>
<li>Right click in the&nbsp;<a class="reference-link" href="#root/_help_oPVyFC7WL2Lp">Note Tree</a>&nbsp;and
select <em>Advanced</em><em>Apply bulk actions</em>.</li>
<li>By default, only the selected notes will be affected. To also include
all the descendants of the notes, check <em>Include descendants of the selected notes</em>.
The number of affected notes at the top of the dialog will update to reflect
the change.</li>
<li>Click on which action to apply from the <em>Available actions</em> section.
A detailed description of each is available in the next section.
<ul>
<li>For each action selected, the <em>Chosen actions</em> section will update
to reveal the entry. Each action will have its own configuration.</li>
<li>To remove an action, simply press the X button to the right of it.</li>
<li>It is possible to apply multiple actions of the same type, such as adding
multiple types.</li>
</ul>
</li>
<li>When all the actions are defined, press <em>Execute bulk actions</em> to
trigger all of them at once.</li>
<li>For convenience, the last bulk action configuration is saved for further
use and will be restored when entering the dialog again.</li>
</ul>
<h2>Actions</h2>
<h3>Labels</h3>
<p>These actions operate the&nbsp;<a class="reference-link" href="#root/_help_HI6GBBIduIgv">Labels</a>&nbsp;of
a note:</p>
<ul>
<li><strong>Add label</strong>
<ul>
<li>For each note, if it doesn't already have a <a href="#root/_help_HI6GBBIduIgv">label</a> of
the given name, it will create it. Keep the <em>New value</em> field empty
to create a label without a value, or complete it to assign a value.</li>
<li>If a note already has this label, its value will be updated.</li>
</ul>
</li>
<li><strong>Update label value</strong>
<ul>
<li>For each note, if it has a <a href="#root/_help_HI6GBBIduIgv">label</a> of
the given name, it will change its value to the specified one. Leave <em>New value</em> field
empty to create a label without a value.</li>
<li>Notes without the label will not be affected.</li>
</ul>
</li>
<li><em><strong>Rename label</strong></em>
<ul>
<li>For each note, if it has a <a href="#root/_help_HI6GBBIduIgv">label</a> of
the given name, it will be renamed/replaced with a label of the new name.
The value of the label (if present) will be kept intact.</li>
<li>Notes without the label will not be affected.</li>
</ul>
</li>
<li><strong>Delete label</strong>
<ul>
<li>For each note, if it has a label of a given name, it will be deleted (regardless
of whether it has a value or not).</li>
<li>Notes without the label will not be affected.</li>
</ul>
</li>
</ul>
<h3>Relations</h3>
<p>These actions operate the&nbsp;<a class="reference-link" href="#root/_help_Cq5X6iKQop6R">Relations</a>&nbsp;of
a note:</p>
<ul>
<li><strong>Add relation</strong>
<ul>
<li>For each note, it will create a relation pointing to the given note.</li>
<li>Notes without this relation will not be affected.</li>
</ul>
</li>
<li><strong>Update relation target</strong>
<ul>
<li>For each note, it will modify a relation to point to the newly given note.</li>
<li>Notes without this relation will not be affected.</li>
</ul>
</li>
<li><strong>Rename relation</strong>
<ul>
<li>For each note, if it has a relation of the given name, it will be renamed/replaced
with a relation of the new name. The target note of the relation will be
kept intact.</li>
<li>Notes without this relation will not be affected.</li>
</ul>
</li>
<li><strong>Delete relation</strong>
<ul>
<li>For each note, if it has a relation of the given name, it will be deleted.</li>
<li>Notes without this relation will not be affected.</li>
</ul>
</li>
</ul>
<h3>Notes</h3>
<ul>
<li><strong>Rename note</strong>
<ul>
<li>For each note, it will change the title of the note to the given one.</li>
<li>As a more advanced use case, the note can be a “template string” which
allows for dynamic values with access to the note information via&nbsp;
<a
class="reference-link" href="#root/_help_habiZ3HU8Kw8">FNote</a>, for example:
<ul>
<li><code>NEW: ${note.title}</code> will prefix all notes with <code>NEW:</code> .</li>
<li><code>${note.dateCreatedObj.format('MM-DD:')}: ${note.title}</code> will
prefix the note titles with each note's creation date (in month-day format).</li>
</ul>
</li>
</ul>
</li>
<li><strong>Move note</strong>
<ul>
<li>For each note, it will be moved to the specified parent note.</li>
<li>As an alternative for less complex situations, the notes can be moved
directly from within the&nbsp;<a class="reference-link" href="#root/_help_oPVyFC7WL2Lp">Note Tree</a>&nbsp;via
cut → paste or via the contextual menu.</li>
</ul>
</li>
<li><strong>Delete note</strong>
<ul>
<li>For each note, it will be deleted.</li>
<li>As an alternative for less complex situations, the notes can be removed
directly from within the&nbsp;<a class="reference-link" href="#root/_help_oPVyFC7WL2Lp">Note Tree</a>&nbsp;by
selecting them and pressing <kbd>Delete</kbd>.</li>
</ul>
</li>
<li><strong>Delete note revisions</strong>
<ul>
<li>This will delete all the&nbsp;<a class="reference-link" href="#root/_help_vZWERwf8U3nx">Note Revisions</a>&nbsp;of
the notes.</li>
</ul>
</li>
</ul>
<h3>Others</h3>
<ul>
<li><strong>Execute script</strong>
<ul>
<li>For more complex scenarios, it is possible to type in a JavaScript expression
in order to apply the necessary changes.</li>
<li>Examples:
<ul>
<li>
<p>To apply a suffix (<code>- suffix</code> in this example), to the note
title:</p><pre><code class="language-application-javascript-env-backend">note.title = note.title + " - suffix";</code></pre>
</li>
<li>
<p>To alter attributes of a note based on another attribute, such as setting
the <code>#shareAlias</code> label to the title of the note:</p><pre><code class="language-application-javascript-env-backend">note.setLabel("shareAlias", note.title)</code></pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

View File

@ -0,0 +1,27 @@
<p>Trilium supports configuration via a file named <code>config.ini</code> and
environment variables. Please review the file named <a href="https://github.com/TriliumNext/Notes/blob/develop/apps/server/src/assets/config-sample.ini">config-sample.ini</a> in
the <a href="https://github.com/TriliumNext/Notes">Notes</a> repository to
see what values are supported.</p>
<p>You can provide the same values via environment variables instead of the <code>config.ini</code> file,
and these environment variables use the following format:</p>
<ol>
<li>Environment variables should be prefixed with <code>TRILIUM_</code> and
use underscores to represent the INI section structure.</li>
<li>The format is: <code>TRILIUM_&lt;SECTION&gt;_&lt;KEY&gt;=&lt;VALUE&gt;</code>
</li>
<li>The environment variables will override any matching values from config.ini</li>
</ol>
<p>For example, if you have this in your config.ini:</p><pre><code class="language-text-x-trilium-auto">[Network]
host=localhost
port=8080</code></pre>
<p>You can override these values using environment variables:</p><pre><code class="language-text-x-trilium-auto">TRILIUM_NETWORK_HOST=0.0.0.0
TRILIUM_NETWORK_PORT=9000</code></pre>
<p>The code will:</p>
<ol>
<li>First load the <code>config.ini</code> file as before</li>
<li>Then scan all environment variables for ones starting with <code>TRILIUM_</code>
</li>
<li>Parse these variables into section/key pairs</li>
<li>Merge them with the config from the file, with environment variables taking
precedence</li>
</ol>

View File

@ -0,0 +1,46 @@
<p>By default, Trilium cannot be accessed in web browsers by requests coming
from other domains/origins than Trilium itself.&nbsp;</p>
<p>However, it is possible to manually configure <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS">Cross-Origin Resource Sharing (CORS)</a> since
Trilium v0.93.0 using environment variables or <code>config.ini</code>,
as follows:</p>
<figure class="table" style="width:100%;">
<table class="ck-table-resized">
<colgroup>
<col style="width:26.93%;">
<col style="width:32.46%;">
<col style="width:40.61%;">
</colgroup>
<thead>
<tr>
<th>CORS Header</th>
<th>Corresponding option in <code>config.ini</code>
</th>
<th>Corresponding option in environment variables in the <code>Network</code> section</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>Access-Control-Allow-Origin</code>
</td>
<td><code>TRILIUM_NETWORK_CORS_ALLOW_ORIGIN</code>
</td>
<td><code>corsAllowOrigin</code>&nbsp;</td>
</tr>
<tr>
<td><code>Access-Control-Allow-Methods</code>
</td>
<td><code>TRILIUM_NETWORK_CORS_ALLOW_METHODS</code>
</td>
<td><code>corsAllowMethods</code>&nbsp;</td>
</tr>
<tr>
<td><code>Access-Control-Allow-Headers</code>
</td>
<td><code>TRILIUM_NETWORK_CORS_ALLOW_HEADERS</code>
</td>
<td><code>corsAllowHeaders</code>
</td>
</tr>
</tbody>
</table>
</figure>

View File

@ -0,0 +1,17 @@
<p>A Trilium instance represents a server. If&nbsp;<a class="reference-link"
href="#root/_help_cbkrhQjrkKrh">Synchronization</a>&nbsp;is set up, since
multiple servers are involved (the one from the desktop client and the
one the synchronisation is set up with), sometimes it can be useful to
distinguish the instance you are running on.</p>
<h2>Setting the instance name</h2>
<p>To set up a name for the instance, modify the <code>config.ini</code>:</p><pre><code class="language-text-x-trilium-auto">[General]
instanceName=Hello</code></pre>
<h2>Distinguishing the instance on back-end</h2>
<p>Use <code>api.getInstanceName()</code> to obtain the instance name of the
current server, as specified in the config file or in environment variables.</p>
<h2>Limiting script runs based on instance</h2>
<p>For a script that is run periodically or on a certain event, it's possible
to limit it to certain instances without having to change the code. Just
add <code>runOnInstance</code> and set as the value the instance name where
the script should run. To run on multiple named instances, simply add the
label multiple times.</p>

View File

@ -0,0 +1,75 @@
<p>Trilium provides a mechanism for <a href="#root/_help_CdNpE2pqjmI6">scripts</a> to
open a public REST endpoint. This opens a way for various integrations
with other services - a simple example would be creating new note from
Slack by issuing a slash command (e.g. <code>/trilium buy milk</code>).</p>
<h2>Create note from outside Trilium</h2>
<p>Let's take a look at an example. The goal is to provide a REST endpoint
to which we can send title and content and Trilium will create a note.</p>
<p>We'll start with creating a JavaScript backend <a href="#root/_help_6f9hih2hXXZk">code note</a> containing:</p><pre><code class="language-text-x-trilium-auto">const {req, res} = api;
const {secret, title, content} = req.body;
if (req.method == 'POST' &amp;&amp; secret === 'secret-password') {
// notes must be saved somewhere in the tree hierarchy specified by a parent note.
// This is defined by a relation from this code note to the "target" parent note
// alternetively you can just use constant noteId for simplicity (get that from "Note Info" dialog of the desired parent note)
const targetParentNoteId = api.currentNote.getRelationValue('targetNote');
const {note} = api.createTextNote(targetParentNoteId, title, content);
const notePojo = note.getPojo();
res.status(201).json(notePojo);
}
else {
res.send(400);
}</code></pre>
<p>This script note has also following two attributes:</p>
<ul>
<li>label <code>#customRequestHandler</code> with value <code>create-note</code>
</li>
<li>relation <code>~targetNote</code> pointing to a note where new notes should
be saved</li>
</ul>
<h3>Explanation</h3>
<p>Let's test this by using an HTTP client to send a request:</p><pre><code class="language-text-x-trilium-auto">POST http://my.trilium.org/custom/create-note
Content-Type: application/json
{
"secret": "secret-password",
"title": "hello",
"content": "world"
}+++++++++++++++++++++++++++++++++++++++++++++++</code></pre>
<p>Notice the <code>/custom</code> part in the request path - Trilium considers
any request with this prefix as "custom" and tries to find a matching handler
by looking at all notes which have <code>customRequestHandler</code> <a href="#root/_help_zEY4DaJG4YT5">label</a>.
Value of this label then contains a regular expression which will match
the request path (in our case trivial regex "create-note").</p>
<p>Trilium will then find our code note created above and execute it. <code>api.req</code>, <code>api.res</code> are
set to <a href="https://expressjs.com/en/api.html#req">request</a> and
<a
href="https://expressjs.com/en/api.html#res">response</a>objects from which we can get details of the request and also
respond.</p>
<p>In the code note we check the request method and then use trivial authentication
- keep in mind that these endpoints are by default totally unauthenticated,
and you need to take care of this yourself.</p>
<p>Once we pass these checks we will just create the desired note using
<a
href="#root/_help_GLks18SNjxmC">Script API</a>.</p>
<h2>Custom resource provider</h2>
<p>Another common use case is that you want to just expose a file note -
in such case you create label <code>customResourceProvider</code> (value
is again path regex).</p>
<p>For more information, see&nbsp;<a href="#root/_help_d3fAXQ2diepH">Custom Resource Providers</a>.</p>
<h2>Advanced concepts</h2>
<p><code>api.req</code> and <code>api.res</code> are Express.js objects - you
can always look into its <a href="https://expressjs.com/en/api.html">documentation</a> for
details.</p>
<h3>Parameters</h3>
<p>REST request paths often contain parameters in the URL, e.g.:</p><pre><code class="language-text-x-trilium-auto">http://my.trilium.org/custom/notes/123</code></pre>
<p>The last part is dynamic so the matching of the URL must also be dynamic
- for this reason the matching is done with regular expressions. Following <code>customRequestHandler</code> value
would match it:</p><pre><code class="language-text-x-trilium-auto">notes/([0-9]+)</code></pre>
<p>Additionally, this also defines a matching group with the use of parenthesis
which then makes it easier to extract the value. The matched groups are
available in <code>api.pathParams</code>:</p><pre><code class="language-text-x-trilium-auto">const noteId = api.pathParams[0];</code></pre>
<p>Often you also need query params (as in e.g. <code>http://my.trilium.org/custom/notes?noteId=123</code>),
you can get those with standard express <code>req.query.noteId</code>.</p>

View File

@ -0,0 +1,36 @@
<p>A custom resource provider allows any file imported into Trilium (images,
fonts, stylesheets) to be publicly accessible via a URL.</p>
<p>A potential use case for this is to add embed a custom font alongside
a theme.</p>
<h2>Steps for creating a custom resource provider</h2>
<ol>
<li>Import a file such as an image or a font into Trilium by drag &amp; drop.</li>
<li>Select the file and go to the <em>Owned Attributes</em> section.</li>
<li>Add the label <code>#customResourceProvider=hello</code>.</li>
<li>To test if it is working, use a browser to navigate to <code>&lt;protocol&gt;://&lt;host&gt;/custom/hello</code> (where <code>&lt;protocol&gt;</code> is
either <code>http</code> or <code>https</code> based on your setup, and <code>&lt;host&gt;</code> is
the host or IP to your Trilium server instance). If you are running the
TriliumNext application without a server, use <code>http://localhost:37840</code> as
the base URL.</li>
<li>If everything went well, at the previous step the browser should have
downloaded the file uploaded in the first step.</li>
</ol>
<p>Instead of <code>hello</code>, the name can be:</p>
<ul>
<li>A path, such as <code>fonts/Roboto.ttf</code>, which would be accessible
via <code>&lt;host&gt;/custom/fonts/Roboto.ttf</code>.</li>
<li>As a more advanced use case, a regular expression to match multiple routes,
such as <code>hello/.*</code> which will be accessible via <code>/custom/hello/1</code>, <code>/custom/hello/2</code>, <code>/custom/hello/world</code>,
etc.</li>
</ul>
<h2>Using it in a theme</h2>
<p>For example, if you have a custom font to be imported by the theme, first
upload a font file into Trilium and assign it the <code>#customResourceProvider=fonts/myfont.ttf</code> attribute.</p>
<p>Then modify the theme CSS to point to:</p><pre><code class="language-text-css">@font-face {
font-family: customFont;
src: url("/custom/fonts/myfont.ttf");
}
div {
font-family: customFont;
}</code></pre>

View File

@ -0,0 +1,27 @@
<p>Your Trilium data is stored in a <a href="https://www.sqlite.org">SQLite</a> database
which contains all notes, tree structure, metadata, and most of the configuration.
The database file is named <code>document.db</code> and is stored in the
application's default&nbsp;<a href="#root/_help_tAassRL4RSQL">Data directory</a>.</p>
<h2>Demo Notes</h2>
<p>When first starting Trilium, it will provide a set of notes to showcase
various features of the application.</p>
<p>For more information see&nbsp;<a class="reference-link" href="#root/_help_6tZeKvSHEUiB">Demo Notes</a>.</p>
<h2>Manually Modifying the Database</h2>
<p>Trilium provides a lot of flexibility, and with it, opportunities for
advanced users to tweak it. If you need to explore or modify the database
directly, you can use a tool such as <a href="https://sqlitebrowser.org/">SQLite Browser</a> to
work directly on the database file.</p>
<p>See&nbsp;<a href="#root/_help_oyIAJ9PvvwHX">Manually altering the database</a>&nbsp;for
more information.</p>
<h2>How to Reset the Database</h2>
<p>If you are experimenting with Trilium and want to return it to its original
state, you can do that by deleting the current database. When you restart
the application, it will generate a new database containing the original
demo notes.</p>
<p>To delete the database, simply go to the <a href="#root/_help_tAassRL4RSQL">data directory</a> and
delete the <code>document.db</code> file (and any other files starting with <code>document.db</code>).</p>
<p>If you do not need to preserve any configurations that might be stored
in the <code>config.ini</code> file, you can just delete all of the <a href="#root/_help_tAassRL4RSQL">data directory's</a> contents
to fully restore the application to its original state. You can also review
the <a href="#root/_help_Gzjqa934BdH4">configuration</a> file to provide
all <code>config.ini</code> values as environment variables instead.</p>

View File

@ -0,0 +1,30 @@
<p>When you run Trilium for the first time, it will generate a new database
containing demo notes. These notes showcase its many features, such as:</p>
<ul>
<li><a class="reference-link" href="#root/_help_iRwzGnHPzonm">Relation Map</a>
</li>
<li><a class="reference-link" href="#root/_help_l0tKav7yLHGF">Day Notes</a>
</li>
<li><a class="reference-link" href="#root/_help_R7abl2fc6Mxi">Weight Tracker</a>
</li>
<li><a class="reference-link" href="#root/_help_xYjQUYhpbUEW">Task Manager</a>
</li>
<li><a class="reference-link" href="#root/_help_Wy267RK4M69c">Themes</a>
</li>
</ul>
<h3>Restoring Demo Notes</h3>
<p>There are some cases in which you may want to restore the original demo
notes. For example, if you experimented with some of the more advanced
features and want to see the original reference, or if you simply want
to explore the latest version of the demo notes, which might showcase new
features.</p>
<p>You can easily restore the demo notes by using Trilium's built-in import
feature by importing them:</p>
<ul>
<li>Download <a href="https://github.com/TriliumNext/Notes/raw/develop/db/demo.zip">this .zip archive</a> with
the latest version of the demo notes</li>
<li>Right click on any note in your tree under which you would like the demo
notes to be imported</li>
<li>Click "Import into note"</li>
<li>Select the .zip archive to import it</li>
</ul>

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

View File

@ -0,0 +1,36 @@
<p>There are some situations where modifying the SQLite database that Trilium
uses is desirable.</p>
<p>If you are doing any advanced development or troubleshooting where you
manually modify the database, you might want to consider creating backups
of your <code>document.db</code> file.</p>
<h2>Modifying it internally using the SQL Console</h2>
<p>The SQL Console is Trilium's built-in database editor.</p>
<p>See&nbsp;<a class="reference-link" href="#root/_help_YKWqdJhzi2VY">SQL Console</a>.</p>
<h2>Externally modifying the database</h2>
<p>Sometimes the SQL Console cannot be used (for example if the application
cannot start).</p>
<p>When making external modifications, consider closing the desktop application.
If modifying the server database, then stop the service or Docker container.</p>
<h3>Using DB Browser for SQLite</h3>
<p>DB Browser for SQLite is a cross-platform editor that can be used to alter
the database using a graphical user interface.</p>
<p>To do so:</p>
<ol>
<li>In the main menu, select File → Open database… and navigate to the database
in the&nbsp;<a href="#root/_help_tAassRL4RSQL">Data directory</a>.</li>
<li>Select the <em>Execute SQL</em> tab.</li>
<li>Type in the desired SQL statement.</li>
<li>Press the "Play" button in the toolbar underneath the "Execute SQL" tab
(or F5 key).</li>
<li>Press "Write Changes" in the main toolbar.</li>
<li>Close the application or close the database.</li>
</ol>
<p>
<img src="Manually altering the data.png">
</p>
<h3>Using the SQLite CLI</h3>
<p>First, start the SQLite 3 CLI by specifying the path to the database:</p><pre><code class="language-text-x-trilium-auto">sqlite3 ~/.local/share/trilium-data/document.db</code></pre>
<ul>
<li>In the prompt simply type the statement and make sure it ends with a <code>;</code> character.</li>
<li>To exit, simply type <code>.quit</code> and enter.</li>
</ul>

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 B

View File

@ -0,0 +1,36 @@
<p>The SQL Console is Trilium's built-in database editor.</p>
<p>It can be accessed by going to the <a href="#root/_help_Vc8PjrjAGuOp">global menu</a>
Advanced → Open SQL Console.</p>
<p>
<img src="SQL Console_image.png">
</p>
<h3>Interaction</h3>
<ul>
<li>
<p>Hovering the mouse over one of the tables listed at the top of the document
will show the columns and their data type.</p>
</li>
<li>
<p>Only one SQL statement can be run at once.</p>
</li>
<li>
<p>To run the statement, press the
<img src="3_SQL Console_image.png">icon.</p>
</li>
<li>
<p>For queries that return a result, the data will displayed in a table.</p>
<p>
<img src="1_SQL Console_image.png">
</p>
</li>
</ul>
<h3>Saved SQL console</h3>
<p>SQL queries or commands can be saved into a dedicated note.</p>
<p>To do so, simply write the query and press the
<img src="2_SQL Console_image.png">button. Once saved, the note will appear in&nbsp;<a href="#root/_help_l0tKav7yLHGF">Day Notes</a>.</p>
<ul>
<li>The SQL expression will not be displayed by default, but it can still
be viewed by going to the note context menu and selecting <em>Note source</em>.</li>
<li>The expression cannot be modified. If needed, recreate it by copying the
statement back into the SQL console and then saving it again.</li>
</ul>

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

View File

@ -0,0 +1,54 @@
<p>When a new note is created, its name is by default "new note". In some
cases, it can be desirable to have a different or even a dynamic default
note title.</p>
<p>For this use case, Trilium (since v0.52) supports <code>#titleTemplate</code>
<a
href="#root/_help_zEY4DaJG4YT5">label</a>. You can create such a label for a given note, assign it a value,
and this value will be used as a default title when creating child notes.
As with other labels, you can make it inheritable to apply recursively,
and you can even place it on the root note to have it applied globally
everywhere.</p>
<p>As an example use case, imagine you collect books you've read in a given
year like this:</p>
<ul>
<li>2022 Books
<ul>
<li>Neal Stephenson: Anathem, 2008</li>
<li>Franz Kafka: Die Verwandlung, 1915</li>
</ul>
</li>
</ul>
<p>Now, to the parent note "2022 Books" you can assign label <code>#titleTemplate="[Author name]: [Book title], [Publication year]"</code>.</p>
<p>And all children of "2022 Books" will be created with initial title "[Author
name]: [Book title], [Publication year]". There's no artificial intelligence
here, the idea is to just prompt you to manually fill in the pieces of
information into the note title by yourself.</p>
<h2>Dynamic value</h2>
<p>The value of <code>#titleTemplate</code> is evaluated at the point of note's
creation as a JavaScript string, which means it can be enriched with the
help of JS string interpolation with dynamic data.</p>
<p>Second variable injected is <code>parentNote</code> which gives access to
the parent <a href="#root/_help_habiZ3HU8Kw8"><code>FNote</code></a>.</p>
<p>See also&nbsp;<a class="reference-link" href="#root/_help_KC1HB96bqqHX">Templates</a>&nbsp;which
provides similar capabilities, including default note's content.</p>
<h3>Examples</h3>
<ul>
<li>Imagine you collect server outage incidents and write some notes. It looks
like this:
<ul>
<li>Incidents
<ul>
<li>2022-05-09: System crash</li>
<li>2022-05-15: Backup delay</li>
</ul>
</li>
<li>You can automatize the date assignment by assigning a label <code>#titleTemplate="${now.format('YYYY-MM-DD')}: "</code> to
the parent note "Incidents". Whenever a new child note is created, the
title template is evaluated with the injected <a href="https://day.js.org/docs/en/display/format">now</a> object.</li>
</ul>
</li>
<li>To use a parent's attribute in the title of new notes: <code>#titleTemplate="${parentNote.getLabelValue('authorName')}'s literary works"</code>
</li>
<li>To mirror the parent's note title: <code>${parentNote.title}</code>
</li>
</ul>

View File

@ -0,0 +1,49 @@
<p>ETAPI is Trilium's public/external REST API. It is available since Trilium
v0.50.</p>
<p>The documentation is in OpenAPI format, available <a href="https://github.com/TriliumNext/Notes/blob/master/src/etapi/etapi.openapi.yaml">here</a>.</p>
<h2>API clients</h2>
<p>As an alternative to calling the API directly, there are client libraries
to simplify this</p>
<ul>
<li><a href="https://github.com/Nriver/trilium-py">trilium-py</a>, you can
use Python to communicate with Trilium.</li>
</ul>
<h2>Obtaining a token</h2>
<p>All operations with the REST API have to be authenticated using a token.
You can get this token either from Options -&gt; ETAPI or programmatically
using the <code>/auth/login</code> REST call (see the <a href="https://github.com/TriliumNext/Notes/blob/master/src/etapi/etapi.openapi.yaml">spec</a>).</p>
<h2>Authentication</h2>
<h3>Via the <code>Authorization</code> header</h3><pre><code class="language-text-x-trilium-auto">GET https://myserver.com/etapi/app-info
Authorization: ETAPITOKEN</code></pre>
<p>where <code>ETAPITOKEN</code> is the token obtained in the previous step.</p>
<p>For compatibility with various tools, it's also possible to specify the
value of the <code>Authorization</code> header in the format <code>Bearer ETAPITOKEN</code> (since
0.93.0).</p>
<h3>Basic authentication</h3>
<p>Since v0.56 you can also use basic auth format:</p><pre><code class="language-text-x-trilium-auto">GET https://myserver.com/etapi/app-info
Authorization: Basic BATOKEN</code></pre>
<ul>
<li>Where <code>BATOKEN = BASE64(username + ':' + password)</code> - this is
a standard Basic Auth serialization</li>
<li>Where <code>username</code> is "etapi"</li>
<li>And <code>password</code> is the generated ETAPI token described above.</li>
</ul>
<p>Basic Auth is meant to be used with tools which support only basic auth.</p>
<h2>Interaction using Bash scripts</h2>
<p>It is possible to write simple Bash scripts to interact with Trilium.
As an example, here's how to obtain the HTML content of a note:</p><pre><code class="language-text-x-trilium-auto">#!/usr/bin/env bash
# Configuration
TOKEN=z1vA4fkGxjOR_ZXLrZeqHEFOv65yV3882iFCRtNIK9k9iWrHliITNSLQ=
SERVER=http://localhost:8080
# Download a note by ID
NOTE_ID="i6ra4ZshJhgN"
curl "$SERVER/etapi/notes/$NOTE_ID/content" -H "Authorization: $TOKEN" </code></pre>
<p>Make sure to replace the values of:</p>
<ul>
<li><code>TOKEN</code> with your ETAPI token.</li>
<li><code>SERVER</code> with the correct protocol, host name and port to your
Trilium instance.</li>
<li><code>NOTE_ID</code> with an existing note ID to download.</li>
</ul>

View File

@ -0,0 +1,182 @@
<figure class="image image-style-align-right">
<img style="aspect-ratio:263/445;" src="Hidden Notes_image.png" width="263"
height="445">
</figure>
<p>For easy extensibility, a lot of features in Trilium make use of actual
notes to store information as opposed to having them stored in a separate
location in the database. This allows some functions such as&nbsp;<a class="reference-link"
href="#root/_help_zEY4DaJG4YT5">Attributes</a>,&nbsp;<a class="reference-link"
href="#root/_help_Cq5X6iKQop6R">Relations</a>&nbsp;or even&nbsp;<a class="reference-link"
href="#root/_help_eIg8jdvaoNNd">Search</a>&nbsp;and&nbsp;<a class="reference-link"
href="#root/_help_QEAPj01N5f7w">Links</a>&nbsp;to be able to operate on
them.</p>
<p>As the name suggests, these notes are hidden to the user by default to
prevent cluttering the note tree and to prevent them from being accidentally
deleted.</p>
<p>The hidden notes are stored in the user's&nbsp;<a class="reference-link"
href="#root/_help_wX4HbRucYSDD">Database</a>&nbsp;just like normal notes,
but they have a unique&nbsp;<a class="reference-link" href="#root/_help_m1lbrzyKDaRB">Note ID</a>&nbsp;which
allows them to be distinguished from the normal ones.</p>
<h2>Accessing the hidden note tree</h2>
<p>From the&nbsp;<a class="reference-link" href="#root/_help_x3i7MxGccDuM">Global menu</a>,
select <em>Advanced</em><em>Show Hidden Subtree</em>.</p>
<h2>Contents of the hidden note tree</h2>
<p>Here is a brief summary of all the notes within the hidden tree:</p>
<figure
class="table" style="width:100%;">
<table class="ck-table-resized">
<colgroup>
<col style="width:19.93%;">
<col style="width:80.07%;">
</colgroup>
<thead>
<tr>
<th>Note</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="reference-link" href="#root/_hidden/_help__globalNoteMap">Note Map</a>
</td>
<td>
<p>This note is actually opened when the&nbsp;<a class="reference-link" href="#root/_help_bdUJEHsAPYQR">Note Map</a>&nbsp;feature
that is accessed from the&nbsp;<a class="reference-link" href="#root/_help_xYmIYSP6wE3F">Launch Bar</a>.</p>
<p>It is possible to create any child notes in it without any additional
meaning. For example, it can be used to store a list of note maps which
can be linked to from other notes or <a href="#root/_help_u3YFHC9tQlpm">bookmarked</a>.</p>
</td>
</tr>
<tr>
<td><a class="reference-link" href="#root/_hidden/_help__sqlConsole">SQL Console History</a>
</td>
<td>
<p>When SQL queries or commands are executed in the&nbsp;<a class="reference-link"
href="#root/_help_YKWqdJhzi2VY">SQL Console</a>, they are stored here,
grouped by month. Only the query is stored and not the results.</p>
<p>This section can be accessed without going to the hidden tree by simply
going to the&nbsp;<a class="reference-link" href="#root/_help_x3i7MxGccDuM">Global menu</a>&nbsp;and
selecting Advanced → Open SQL Console History.</p>
<p>Notes can be added as children of this tree, but it's generally not recommended
to do so to not interfere with the normal history process.</p>
</td>
</tr>
<tr>
<td><a class="reference-link" href="#root/_hidden/_help__search">Search History</a>
</td>
<td>
<p>Whenever a search is executed from the full&nbsp;<a class="reference-link"
href="#root/_help_eIg8jdvaoNNd">Search</a>, the query will be stored here,
grouped by month. Only the search parameters are stored and not the results
themselves.</p>
<p>This section can be accessed without going to the hidden tree by simply
going to the&nbsp;<a class="reference-link" href="#root/_help_x3i7MxGccDuM">Global menu</a>&nbsp;and
selecting Advanced → Open Search History.</p>
<p>Notes can be added as children of this tree, but it's generally not recommended
to do so to not interfere with the normal history process.</p>
</td>
</tr>
<tr>
<td><a class="reference-link" href="#root/_hidden/_help__bulkAction">Bulk Action</a>
</td>
<td>
<p>This section is used for&nbsp;<a class="reference-link" href="#root/_help_ivYnonVFBxbQ">Bulk Actions</a>.
The last configuration for bulk actions will be stored as part of this
note, each action in its own <code>action</code> label.</p>
<p>Notes can be added as children of this tree, but there won't be any benefit
in doing so.</p>
</td>
</tr>
<tr>
<td><a class="reference-link" href="#root/_hidden/_help__backendLog">Backend Log</a>
</td>
<td>
<p>This note corresponds to the backend log feature (see&nbsp;<a class="reference-link"
href="#root/_help_qzNzp9LYQyPT">Error logs</a>).</p>
<p>This item can be accessed without going to the hidden try by going to
the&nbsp;<a class="reference-link" href="#root/_help_x3i7MxGccDuM">Global menu</a>&nbsp;and
selecting Advanced → Show backend log.</p>
</td>
</tr>
<tr>
<td><a class="reference-link" href="#root/_hidden/_help__userHidden">User Hidden</a>
</td>
<td>This section can be used by <a href="#root/_help_CdNpE2pqjmI6">scripts</a> to
create their own notes that should not be directly visible to the user.
The note can be identified by scripts by its unique ID: <code>_userHidden</code>
</td>
</tr>
<tr>
<td><a class="reference-link" href="#root/_hidden/_help__lbTplRoot">Launch Bar Templates</a>
</td>
<td>
<p>This section contains the templates for the creation of launchers in the&nbsp;
<a
class="reference-link" href="#root/_help_xYmIYSP6wE3F">Launch Bar</a>. It is not possible to create child notes here.</p>
<p>Theoretically some of the notes here can be customized, but there's not
much benefit to be had in doing so.</p>
</td>
</tr>
<tr>
<td><a class="reference-link" href="#root/_hidden/_help__share">Shared Notes</a>
</td>
<td>
<p>This tree lists all of the notes that are <a href="#root/_help_R9pX4DGra2Vt">shared</a> publicly.
It can be useful to track down which notes are shared regardless of their
position in the note tree.</p>
<p>This section can be accessed without going to the hidden tree simply by
going to the&nbsp;<a class="reference-link" href="#root/_help_x3i7MxGccDuM">Global menu</a>&nbsp;and
selecting <em>Show Shared Notes Subtree</em>.</p>
<p>Sub-notes cannot be created here.</p>
</td>
</tr>
<tr>
<td><a class="reference-link" href="#root/_hidden/_help__lbRoot">Launch Bar</a>
</td>
<td>
<p>The tree contains both available and displayed items of the&nbsp;<a class="reference-link"
href="#root/_help_xYmIYSP6wE3F">Launch Bar</a>.</p>
<p>This section can be accessed without going to the hidden tree by:</p>
<ul>
<li>Going to the&nbsp;<a class="reference-link" href="#root/_help_x3i7MxGccDuM">Global menu</a>&nbsp;and
selecting <em>Configure Launchbar</em>.</li>
<li>Right-clicking an empty space on the&nbsp;<a class="reference-link" href="#root/_help_xYmIYSP6wE3F">Launch Bar</a>&nbsp;and
selecting <em>Configure Launchbar</em>.</li>
</ul>
<p>Sub-notes cannot be created here.</p>
</td>
</tr>
<tr>
<td><a class="reference-link" href="#root/_hidden/_help__options">Options</a>
</td>
<td>
<p>This section stores the list of&nbsp;<a class="reference-link" href="#root/_help_4TIF1oA4VQRO">Options</a>.</p>
<p>This section can be accessed without going to the hidden tree by:</p>
<ul>
<li>Going to the&nbsp;<a class="reference-link" href="#root/_help_x3i7MxGccDuM">Global menu</a>&nbsp;and
selecting <em>Options</em>.</li>
<li>Pressing the dedicated Options icon in the&nbsp;<a class="reference-link"
href="#root/_help_xYmIYSP6wE3F">Launch Bar</a>.</li>
</ul>
</td>
</tr>
<tr>
<td><a class="reference-link" href="#root/_hidden/_help__lbMobileRoot">Mobile Launch Bar</a>
</td>
<td>
<p>This is very similar to the <em>Launch Bar</em>, but is dedicated for the
mobile UI only.</p>
<p>Accessing it outside the <em>Launch Bar</em> is the same as the Launch Bar,
but needs to be done so from the mobile interface.</p>
</td>
</tr>
<tr>
<td><a class="reference-link" href="#root/_hidden/_help__help">User Guide</a>
</td>
<td>This is where the note structure for the User Guide is actually stored.
Only the metadata is stored, as the help itself is present as actual files
in the application directory.</td>
</tr>
</tbody>
</table>
</figure>

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

View File

@ -0,0 +1,99 @@
<p>The Trilium Metrics API provides comprehensive monitoring data about your
Trilium instance, designed for external monitoring systems like Prometheus.</p>
<h2><strong>Endpoint</strong></h2>
<ul>
<li><strong>URL</strong>: <code>/etapi/metrics</code>
</li>
<li><strong>Method</strong>: <code>GET</code>
</li>
<li><strong>Authentication</strong>: ETAPI token required</li>
<li><strong>Default Format</strong>: Prometheus text format</li>
</ul>
<h2><strong>Authentication</strong></h2>
<p>You need an ETAPI token to access the metrics endpoint. Get one by:</p><pre><code class="language-text-x-trilium-auto"># Get an ETAPI token
curl -X POST http://localhost:8080/etapi/auth/login \
-H "Content-Type: application/json" \
-d '{"password": "your_password"}'
</code></pre>
<h2><strong>Usage</strong></h2>
<h3><strong>Prometheus Format (Default)</strong></h3><pre><code class="language-text-x-trilium-auto">curl -H "Authorization: YOUR_ETAPI_TOKEN" \
http://localhost:8080/etapi/metrics
</code></pre>
<p>Returns metrics in Prometheus text format:</p><pre><code class="language-text-x-trilium-auto"># HELP trilium_info Trilium instance information
# TYPE trilium_info gauge
trilium_info{version="0.91.6",db_version="231",node_version="v18.17.0"} 1 1701432000
# HELP trilium_notes_total Total number of notes including deleted
# TYPE trilium_notes_total gauge
trilium_notes_total 1234 1701432000
</code></pre>
<h3><strong>JSON Format</strong></h3><pre><code class="language-text-x-trilium-auto">curl -H "Authorization: YOUR_ETAPI_TOKEN" \
"http://localhost:8080/etapi/metrics?format=json"
</code></pre>
<p>Returns detailed metrics in JSON format for debugging or custom integrations.</p>
<h2><strong>Available Metrics</strong></h2>
<h3><strong>Instance Information</strong></h3>
<ul>
<li><code>trilium_info</code> - Version and build information with labels</li>
</ul>
<h3><strong>Database Metrics</strong></h3>
<ul>
<li><code>trilium_notes_total</code> - Total notes (including deleted)</li>
<li><code>trilium_notes_deleted</code> - Number of deleted notes</li>
<li><code>trilium_notes_active</code> - Number of active notes</li>
<li><code>trilium_notes_protected</code> - Number of protected notes</li>
<li><code>trilium_attachments_total</code> - Total attachments</li>
<li><code>trilium_attachments_active</code> - Active attachments</li>
<li><code>trilium_revisions_total</code> - Total note revisions</li>
<li><code>trilium_branches_total</code> - Active branches</li>
<li><code>trilium_attributes_total</code> - Active attributes</li>
<li><code>trilium_blobs_total</code> - Total blob records</li>
<li><code>trilium_etapi_tokens_total</code> - Active ETAPI tokens</li>
<li><code>trilium_embeddings_total</code> - Note embeddings (if available)</li>
</ul>
<h3><strong>Categorized Metrics</strong></h3>
<ul>
<li><code>trilium_notes_by_type{type="text|code|image|file"}</code> - Notes
by type</li>
<li><code>trilium_attachments_by_type{mime_type="..."}</code> - Attachments
by MIME type</li>
</ul>
<h3><strong>Statistics</strong></h3>
<ul>
<li><code>trilium_database_size_bytes</code> - Database size in bytes</li>
<li><code>trilium_oldest_note_timestamp</code> - Timestamp of oldest note</li>
<li><code>trilium_newest_note_timestamp</code> - Timestamp of newest note</li>
<li><code>trilium_last_modified_timestamp</code> - Last modification timestamp</li>
</ul>
<h2><strong>Prometheus Configuration</strong></h2>
<p>Add to your <code>prometheus.yml</code>:</p><pre><code class="language-text-x-trilium-auto">scrape_configs:
- job_name: 'trilium'
static_configs:
- targets: ['localhost:8080']
metrics_path: '/etapi/metrics'
bearer_token: 'YOUR_ETAPI_TOKEN'
scrape_interval: 30s
</code></pre>
<h2><strong>Error Responses</strong></h2>
<ul>
<li><code>400</code> - Invalid format parameter</li>
<li><code>401</code> - Missing or invalid ETAPI token</li>
<li><code>500</code> - Internal server error</li>
</ul>
<h2><strong>Grafana Dashboard</strong></h2>
<figure class="image">
<img style="aspect-ratio:2594/1568;" src="1_Metrics_image.png" width="2594"
height="1568">
</figure>
<p>You can also use the Grafana Dashboard that has been created for TriliumNext
- just take the JSON from&nbsp;<a class="reference-link" href="#root/_help_bOP3TB56fL1V">grafana-dashboard.json</a>&nbsp;and
then import the dashboard, following these screenshots:</p>
<figure class="image">
<img style="aspect-ratio:1881/282;" src="2_Metrics_image.png" width="1881"
height="282">
</figure>
<p>Then paste the JSON, and hit load:</p>
<figure class="image">
<img style="aspect-ratio:1055/830;" src="Metrics_image.png" width="1055"
height="830">
</figure>

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

View File

@ -0,0 +1,26 @@
<p>Whereas some applications use file names to uniquely identify notes, Trilium
uses the concept of Note ID.</p>
<p>Generally, the Note ID is a 12-character long alphanumeric sequence (including
both lower and upper case letter) that is randomly generated for each new
note.</p>
<h2>How does the import/export affect the note IDs</h2>
<p>When notes are exported, their note ID is kept in the metadata of the
export. However when they are imported back in, a new note ID is generated
for all the notes. This also includes other entities that are part of the
import/export process such as&nbsp;<a class="reference-link" href="#root/_help_0vhv7lsOLy82">Attachments</a>.</p>
<h2>Note collisions</h2>
<p>Since the Note ID is a fixed-width randomly generated number, due to the
<a
href="https://en.wikipedia.org/wiki/Pigeonhole_principle">pigeonhole principle</a>, there is a possibility that a newly created
note will have the same ID as an existing note.</p>
<p>Since the note ID is alphanumeric and the length is 12 we have&nbsp;
<span
class="math-tex">\(62^{12}\)</span>&nbsp;unique IDs. However since we are generating them
randomly, we can use a collision calculator such as the one for <a href="https://alex7kom.github.io/nano-nanoid-cc/?alphabet=0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&amp;size=12&amp;speed=1000&amp;speedUnit=hour">Nano ID</a> to
determine that we'd need to create 1000 notes per hour every hour for 9
centuries in order to have at least 1% probability of a note collision.</p>
<p>As such, Trilium does not take any explicit action against potential note
collisions, similar to other software that makes uses of unique hashes
such as <a href="https://stackoverflow.com/questions/10434326/hash-collision-in-git">Git</a>.
If one would theoretically occur, what would most likely happen is that
the existing note will be replaced by the new one.</p>

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

View File

@ -0,0 +1,30 @@
<p>Note map is a visualisation of connections between notes.</p>
<p>This provides an insight into a structure ("web") of notes.</p>
<p>There are two types of note map:</p>
<ul>
<li>Link Map, which shows relations between notes.</li>
<li>Note Map, which shows the hierarchical tree structure.</li>
</ul>
<h2>Link Map</h2>
<p>Shows <a href="#root/_help_zEY4DaJG4YT5">relations</a> between notes:</p>
<p>
<img src="1_Note Map (Link map, Tree m.png">
</p>
<h2>Tree Map</h2>
<p>Shows hierarchical map of notes:</p>
<p>
<img src="Note Map (Link map, Tree m.png">
</p>
<h2>Dedicated note type</h2>
<p>Apart from the note map feature which can be accessed from any note, it
is also possible to create a dedicated note which will display the relations
in full screen. See&nbsp;<a href="#root/_help_bdUJEHsAPYQR">Note Map</a>&nbsp;for
more information.</p>
<h2>See also</h2>
<p><a href="#root/_help_iRwzGnHPzonm">Relation map</a> is a similar concept,
with some differences:</p>
<ul>
<li>note map is automatically generated while relation map must be created
manually</li>
<li>relation map is a type of note while a link map is just virtual visualization</li>
</ul>

View File

@ -0,0 +1,68 @@
<h2>Understanding the source code of the different notes</h2>
<p>Internally, the structure of the content of each note is different based
on the&nbsp;<a class="reference-link" href="#root/_help_KSZ04uQ2D1St">Note Types</a>.</p>
<p>For example:</p>
<ul>
<li><a class="reference-link" href="#root/_help_iPIMuisry3hd">Text</a>&nbsp;notes&nbsp;are
represented internally as HTML, using the&nbsp;<a class="reference-link"
href="#root/_help_MI26XDLSAlCD">CKEditor</a>&nbsp;representation. Note
that due to the custom plugins, some HTML elements are specific to Trilium
only, for example the admonitions.</li>
<li><a class="reference-link" href="#root/_help_6f9hih2hXXZk">Code</a>&nbsp;notes&nbsp;are
plain text and are represented internally as-is.</li>
<li><a class="reference-link" href="#root/_help_81SGnPGMk7Xc">Geo Map</a>&nbsp;notes
contain only minimal information (viewport, zoom) as a JSON.</li>
<li><a class="reference-link" href="#root/_help_grjYqerjn243">Canvas</a>&nbsp;notes
are represented as JSON, with Trilium's own information alongside with&nbsp;
<a
class="reference-link" href="#root/_help_H0mM1lTxF9JI">Excalidraw</a>'s internal JSON representation format.</li>
<li><a class="reference-link" href="#root/_help_gBbsAeiuUxI5">Mind Map</a>&nbsp;notes
are represented as JSON, with the internal format of&nbsp;<a class="reference-link"
href="#root/_help_N4IDkixaDG9C">MindElixir</a>.</li>
</ul>
<p>Note that some information is also stored as&nbsp;<a class="reference-link"
href="#root/_help_0vhv7lsOLy82">Attachments</a>. For example&nbsp;<a class="reference-link"
href="#root/_help_grjYqerjn243">Canvas</a>&nbsp;notes use the attachments
feature to store the custom libraries, and alongside with&nbsp;<a class="reference-link"
href="#root/_help_gBbsAeiuUxI5">Mind Map</a>&nbsp;and other similar note
types it stores an SVG representation of the content for use in other features
such as including in other notes, shared notes, etc.</p>
<p>Here's part of the HTML representation of this note, as it's stored in
the database (but prettified).</p><pre><code class="language-text-x-trilium-auto">&lt;h2&gt;
Understanding the source code of the different notes
&lt;/h2&gt;
&lt;p&gt;
Internally, the structure of the content of each note is different based on the&amp;nbsp;
&lt;a class="reference-link" href="#root/_help_KSZ04uQ2D1St"&gt;
Note Types
&lt;/a&gt;
.
&lt;/p&gt;</code></pre>
<h2>Viewing the source code</h2>
<p>It is possible to view the source code of a note by pressing the contextual
menu in&nbsp;<a class="reference-link" href="#root/_help_8YBEPzcpUgxw">Note buttons</a>&nbsp;and
selecting <em>Note source</em>.</p>
<p>
<img src="Note source_image.png">
</p>
<p>The source code will be displayed in a new tab.</p>
<p>For some note types, such as text notes, the source code is also formatted
in order to be more easily readable.</p>
<h2>Modifying the source code</h2>
<p>It is possible to modify the source code of a note directly, however not
via the <em>Note source</em> functionality.&nbsp;</p>
<p>To do so:</p>
<ol>
<li>Change the note type from the real note type (e.g. Canvas, Geo Type) to
Code (plain text) or the corresponding format such as JSON or HTML.</li>
<li>Confirm the warning about changing the note type.</li>
<li>The source code will appear, make the necessary modifications.</li>
<li>Change the note type back to the real note type.</li>
</ol>
<aside class="admonition warning">
<p>Depending on the changes made, there is a risk that the note will not
render properly. It's best to save a revision before making any big changes.</p>
<p>If the note does not render properly, modify the source code again or
revert to a prior revision. Since the error handling for unexpected changes
might not always be perfect, it be required to refresh the application.</p>
</aside>

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -0,0 +1,350 @@
<p>Trilium allows you to share selected notes as <strong>publicly accessible</strong> read-only
documents. This feature is particularly useful for publishing content directly
from your Trilium notes, making it accessible to others online.</p>
<figure
class="image">
<img style="aspect-ratio:1144/660;" src="Sharing_image.png" width="1144"
height="660">
</figure>
<h2>Features, interaction and limitations</h2>
<ul>
<li>Searching by note title.</li>
<li>Automatic dark/light mode based on the user's browser settings.</li>
<li>Mobile-friendly layout, with sidebar.</li>
<li>Collapsible tree with the same note icons as the application.</li>
<li>Customizable logo.</li>
<li>Toggle button for dark/light mode, which also stores the user preferences.</li>
<li>Quick navigation buttons (previous and next note).</li>
<li>Displaying the date of the last update of the note.</li>
</ul>
<h3>By note type</h3>
<figure class="table" style="width:100%;">
<table class="ck-table-resized">
<colgroup>
<col style="width:19.92%;">
<col style="width:41.66%;">
<col style="width:38.42%;">
</colgroup>
<thead>
<tr>
<th>&nbsp;</th>
<th>Supported features</th>
<th>Limitations</th>
</tr>
</thead>
<tbody>
<tr>
<th><a class="reference-link" href="#root/_help_iPIMuisry3hd">Text</a>
</th>
<td>
<ul>
<li>Table of contents.</li>
<li>Syntax highlight of code blocks, provided a language is selected (does
not work if “Auto-detected” is enabled).</li>
<li>Rendering for math equations.</li>
</ul>
</td>
<td>
<ul>
<li>Including notes is not supported.</li>
<li>Inline Mermaid diagrams are not rendered.</li>
</ul>
</td>
</tr>
<tr>
<th><a class="reference-link" href="#root/_help_6f9hih2hXXZk">Code</a>
</th>
<td>
<ul>
<li>Basic support (displaying the contents of the note in a monospace font).</li>
</ul>
</td>
<td>
<ul>
<li>No syntax highlight.</li>
</ul>
</td>
</tr>
<tr>
<th><a class="reference-link" href="#root/_help_m523cpzocqaD">Saved Search</a>
</th>
<td>Not supported.</td>
</tr>
<tr>
<th><a class="reference-link" href="#root/_help_iRwzGnHPzonm">Relation Map</a>
</th>
<td>Not supported.</td>
</tr>
<tr>
<th><a class="reference-link" href="#root/_help_bdUJEHsAPYQR">Note Map</a>
</th>
<td>Not supported.</td>
</tr>
<tr>
<th><a class="reference-link" href="#root/_help_HcABDtFCkbFN">Render Note</a>
</th>
<td>Not supported.</td>
</tr>
<tr>
<th><a class="reference-link" href="#root/_help_GTwFsgaA0lCt">Book</a>
</th>
<td>
<ul>
<li>The child notes are displayed in a fixed format.&nbsp;</li>
</ul>
</td>
<td>
<ul>
<li>More advanced view types such as the calendar view are not supported.</li>
</ul>
</td>
</tr>
<tr>
<th><a class="reference-link" href="#root/_help_s1aBHPd79XYj">Mermaid Diagrams</a>
</th>
<td>
<ul>
<li>The diagram is displayed as a vector image.</li>
</ul>
</td>
<td>
<ul>
<li>No further interaction supported.</li>
</ul>
</td>
</tr>
<tr>
<th><a class="reference-link" href="#root/_help_grjYqerjn243">Canvas</a>
</th>
<td>
<ul>
<li>The diagram is displayed as a vector image.</li>
</ul>
</td>
<td>
<ul>
<li>No further interaction supported.</li>
</ul>
</td>
</tr>
<tr>
<th><a class="reference-link" href="#root/_help_1vHRoWCEjj0L">Web View</a>
</th>
<td>Not supported.</td>
</tr>
<tr>
<th><a class="reference-link" href="#root/_help_gBbsAeiuUxI5">Mind Map</a>
</th>
<td>The diagram is displayed as a vector image.</td>
<td>
<ul>
<li>No further interaction supported.</li>
</ul>
</td>
</tr>
<tr>
<th><a class="reference-link" href="#root/_help_81SGnPGMk7Xc">Geo Map</a>
</th>
<td>Not supported.</td>
</tr>
<tr>
<th><a class="reference-link" href="#root/_help_W8vYD3Q1zjCR">File</a>
</th>
<td>Basic interaction (downloading the file).</td>
<td>
<ul>
<li>No further interaction supported.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</figure>
<p>While the sharing feature is powerful, it has some limitations:</p>
<ul>
<li><strong>Code Notes</strong>: No syntax highlighting.</li>
<li><strong>Static Note Tree</strong>
</li>
<li><strong>Protected Notes</strong>: Cannot be shared.</li>
<li><strong>Include Notes</strong>: Not supported.</li>
</ul>
<p>Some of these limitations may be addressed in future updates.</p>
<h2>Prerequisites</h2>
<p>To use the sharing feature, you must have a&nbsp;<a class="reference-link"
href="#root/_help_WOcw2SLH6tbX">Server Installation</a>&nbsp;of Trilium.
This is necessary because the notes will be hosted from the server.</p>
<h2>How to Share a Note</h2>
<ol>
<li>
<p><strong>Enable Sharing</strong>: To share a note, toggle the <code>Shared</code> switch
within the note's interface. Once sharing is enabled, an URL will appear,
which you can click to access the shared note.</p>
<p>
<img src="Sharing_share-single-note.png" alt="Share Note">
</p>
</li>
<li>
<p><strong>Access the Shared Note</strong>: The link provided will open the
note in your browser. If your server is not configured with a public IP,
the URL will refer to <code>localhost (127.0.0.1)</code>.</p>
</li>
</ol>
<h2>Sharing a Note Subtree</h2>
<p>When you share a note, you actually share the entire subtree of notes
beneath it. If the note has child notes, they will also be included in
the shared content. For example, sharing the "Formatting" subtree will
display a page with basic navigation for exploring all the notes within
that subtree.</p>
<h2>Viewing All Shared Notes</h2>
<p>You can view a list of all shared notes by clicking on "Show Shared Notes
Subtree." This allows you to manage and navigate through all the notes
you have made public.</p>
<h2>Security Considerations</h2>
<p>Shared notes are published on the open internet and can be accessed by
anyone with the URL. The URL's randomness does not provide security, so
it is crucial not to share sensitive information through this feature.</p>
<h3>Password Protection</h3>
<p>To protect shared notes with a username and password, you can use the <code>#shareCredentials</code> attribute.
Add this label to the note with the format <code>#shareCredentials="username:password"</code>.
To protect an entire subtree, make sure the label is <a href="#root/_help_bwZpz2ajCEwO">inheritable</a>.</p>
<h2>Advanced Sharing Options</h2>
<h3>Customizing the Appearance of Shared Notes</h3>
<p>The default design should be a good starting point, but you can customize
it using your own CSS:</p>
<ul>
<li><strong>Custom CSS</strong>: Link a CSS&nbsp;<a class="reference-link"
href="#root/_help_6f9hih2hXXZk">Code</a>&nbsp;note to the shared page by
adding a <code>~shareCss</code> relation to the note. If you want this style
to apply to the entire subtree, make the label inheritable. You can hide
the CSS code note from the tree navigation by adding the <code>#shareHiddenFromTree</code> label.</li>
<li><strong>Omitting Default CSS</strong>: For extensive styling changes,
use the <code>#shareOmitDefaultCss</code> label to avoid conflicts with Trilium's
<a
href="#root/_help_Wy267RK4M69c">default stylesheet</a>.</li>
</ul>
<h3>Adding JavaScript</h3>
<p>You can inject custom JavaScript into the shared note using the <code>~shareJs</code> relation.
This allows you to access note attributes or traverse the note tree using
the <code>fetchNote()</code> API, which retrieves note data based on its
ID.</p>
<p>Example:</p><pre><code class="language-application-javascript-env-backend">const currentNote = await fetchNote();
const parentNote = await fetchNote(currentNote.parentNoteIds[0]);
for (const attr of parentNote.attributes) {
console.log(attr.type, attr.name, attr.value);
}</code></pre>
<h3>Creating Human-Readable URL Aliases</h3>
<p>Shared notes typically have URLs like <code>http://domain.tld/share/knvU8aJy4dJ7</code>,
where the last part is the note's ID. You can make these URLs more user-friendly
by adding the <code>#shareAlias</code> label to individual notes (e.g., <code>#shareAlias=highlighting</code>).
This will change the URL to <code>http://domain.tld/share/highlighting</code>.</p>
<p><strong>Important</strong>:</p>
<ol>
<li>Ensure that aliases are unique.</li>
<li>Using slashes (<code>/</code>) within aliases to create subpaths is not
supported.</li>
</ol>
<h3>Viewing and Managing Shared Notes</h3>
<p>All shared notes are grouped under an automatically managed "Shared Notes"
section. From here, you can view, share, or unshare notes by moving or
cloning them within this section.</p>
<p>
<img src="Sharing_shared-list.png" alt="Shared Notes List">
</p>
<h3>Setting a Custom Favicon</h3>
<p>To customize the favicon for your shared pages, create a relation <code>~shareFavicon</code> pointing
to a file note containing the favicon (e.g., in <code>.ico</code> format).</p>
<h3>Sharing a Note as the Root</h3>
<p>You can designate a specific note or folder as the root of your shared
content by adding the <code>#shareRoot</code> label. This note will be linked
when visiting <code>[http://domain.tld/share](http://domain/share)</code>,
making it easier to use Trilium as a fully-fledged website. Consider combining
this with the <code>#shareIndex</code> label, which will display a list of
all shared notes.</p>
<h2>Attribute reference</h2>
<figure class="table">
<table>
<thead>
<tr>
<th>Attribute</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>shareHiddenFromTree</code>
</td>
<td>this note is hidden from left navigation tree, but still accessible with
its URL</td>
</tr>
<tr>
<td><code>shareExternalLink</code>
</td>
<td>note will act as a link to an external website in the share tree</td>
</tr>
<tr>
<td><code>shareAlias</code>
</td>
<td>define an alias using which the note will be available under <code>https://your_trilium_host/share/[your_alias]</code>
</td>
</tr>
<tr>
<td><code>shareOmitDefaultCss</code>
</td>
<td>default share page CSS will be omitted. Use when you make extensive styling
changes.</td>
</tr>
<tr>
<td><code>shareRoot</code>
</td>
<td>marks note which is served on /share root.</td>
</tr>
<tr>
<td><code>shareDescription</code>
</td>
<td>define text to be added to the HTML meta tag for description</td>
</tr>
<tr>
<td><code>shareRaw</code>
</td>
<td>Note will be served in its raw format, without HTML wrapper. See also&nbsp;
<a
class="reference-link" href="#root/_help_Qjt68inQ2bRj">Serving directly the content of a note</a>&nbsp;for an alternative method
without setting an attribute.</td>
</tr>
<tr>
<td><code>shareDisallowRobotIndexing</code>
</td>
<td>
<p>Indicates to web crawlers that the page should not be indexed of this
note by:</p>
<ul>
<li>Setting the <code>X-Robots-Tag: noindex</code> HTTP header.</li>
<li>Setting the <code>noindex, follow</code> meta tag.</li>
</ul>
</td>
</tr>
<tr>
<td><code>shareCredentials</code>
</td>
<td>require credentials to access this shared note. Value is expected to be
in format <code>username:password</code>. Don't forget to make this inheritable
to apply to child-notes/images.</td>
</tr>
<tr>
<td><code>shareIndex</code>
</td>
<td>Note with this label will list all roots of shared notes.</td>
</tr>
</tbody>
</table>
</figure>
<h2>Credits</h2>
<p>Since v0.95.0, a new theme was introduced (and enabled by default) which
greatly improves the visual aspect of the Share feature, as well as its
functionality (such as mobile support, dark/light mode, collapsible tree,
etc.). This theme is an adaptation of the <a href="https://github.com/zerebos/trilium.rocks">Trilium Rocks!</a> by
<a
href="https://github.com/zerebos">zerebos</a>.</p>

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

@ -0,0 +1,37 @@
<p>When accessing a shared note, Trilium will render it as a web page. Sometimes
it's desirable to serve the content directly so that it can be used in
a script or downloaded by the user.</p>
<figure class="table">
<table>
<thead>
<tr>
<th>A note displayed as a web page (HTML)</th>
<th>A note displayed as a raw format</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<figure class="image">
<img style="aspect-ratio:738/275;" src="1_Serving directly the conte.png"
width="738" height="275">
</figure>
</td>
<td>
<img src="Serving directly the conte.png">
</td>
</tr>
</tbody>
</table>
</figure>
<h2>By adding an attribute to the note</h2>
<p>Simply add the <code>#shareRaw</code> attribute and the note will always
be rendered <em>raw</em> when accessed from the share URL.</p>
<h2>By altering the URL</h2>
<p>Append <code>?raw</code> to the URL to display a note in its raw format
regardless of whether the <code>#shareRaw</code> attribute is added on the
note.</p>
<p>
<img src="Serving directly the conte.png">
</p>

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

View File

@ -0,0 +1,7 @@
<p>One core aspect of Trilium that allows it to have support for multiple&nbsp;
<a
href="#root/_help_KSZ04uQ2D1St">Note Types</a>&nbsp;is the fact that it makes use of various off-the-shelf
or reusable libraries.</p>
<p>The sub-pages showcase some of the technologies used, for a better understanding
of how Trilium works but also to credit the developers of that particular
technology.</p>

View File

@ -0,0 +1,45 @@
<h2>Editor core</h2>
<p>The CKEditor is the WYSIWYG (standing for What You See Is What You Get)
editor behind&nbsp;<a href="#root/_help_iPIMuisry3hd">Text</a>&nbsp;notes.</p>
<p>Their website is <a href="https://ckeditor.com/">ckeditor.com</a>.</p>
<p>CKEditor by itself is a commercial product, but the core is open-source.
As described in <a href="https://ckeditor.com/docs/ckeditor5/latest/features/index.html">its documentation</a>,
the editor supports quite a large number of features. Do note that not
all the features are enabled in Trilium.</p>
<h2>Premium features</h2>
<p>Some features are marked as premium in the CKEditor feature set. This
means that they cannot be used without a license.</p>
<p>Trilium cannot benefit from any of these premium features as they require
a commercial license, however we are in discussions with the CKEditor team
to allow us to use a subset of these premium features such as <a href="https://ckeditor.com/docs/ckeditor5/latest/features/slash-commands.html">Slash commands</a>.</p>
<h2>Plugins</h2>
<p>The CKEditor ecosystem is quite extensible, in the sense that custom plugins
can be written to extend the functionality of the editor beyond its original
scope.</p>
<p>Trilium makes use of such features:</p>
<ul>
<li>The math feature is added by a version of <a href="https://github.com/isaul32/ckeditor5-math">isaul32/ckeditor5-math: Math feature for CKEditor 5.</a> modified
by us to fit our needs.</li>
<li>We also make use of modified upstream plugins such as <a href="https://github.com/ckeditor/ckeditor5-mermaid">ckeditor/ckeditor5-mermaid</a> to
allow inline Mermaid code.</li>
<li><a href="https://github.com/mlewand/ckeditor5-keyboard-marker">mlewand/ckeditor5-keyboard-marker: Plugin adds support for the keyboard input element (<code>&lt;kbd&gt;</code>) to CKEditor 5.</a>
</li>
<li>A modified version of <a href="https://github.com/ThomasAitken/ckeditor5-footnotes">ThomasAitken/ckeditor5-footnotes: Footnotes plugin for CKEditor5</a> to
allow footnotes.</li>
</ul>
<p>Apart from that, Trilium also has its own set of specific plugins such
as:</p>
<ul>
<li><a class="reference-link" href="#root/_help_2x0ZAX9ePtzV">Cut to subnote</a>
</li>
<li><a class="reference-link" href="#root/_help_nBAXQFj20hS1">Include Note</a>
</li>
<li>Mentions, for linking pages.</li>
<li><a class="reference-link" href="#root/_help_Oau6X9rCuegd">Markdown</a>
</li>
<li><a href="#root/_help_QEAPj01N5f7w">Reference links</a>
</li>
<li><a href="#root/_help_NwBbFdNZ9h7O">Admonitions</a>, we ended up creating
our own plugin but <a href="https://github.com/aarkue/ckeditor5-admonition">aarkue/ckeditor5-admonition</a> was
a good inspiration (including the toolbar icon).</li>
</ul>

View File

@ -0,0 +1,5 @@
<p><a href="https://excalidraw.com/">Excalidraw</a> is the technology behind
the&nbsp;<a href="#root/_help_grjYqerjn243">Canvas</a>&nbsp;notes. The
source code of the library is available on <a href="https://github.com/excalidraw/excalidraw">GitHub</a>.</p>
<p>We are using an unmodified version of it, so it shares the same <a href="https://github.com/excalidraw/excalidraw/issues">issues</a> as
the original.</p>

View File

@ -0,0 +1,8 @@
<p>Leaflet is the library behind&nbsp;<a href="#root/_help_81SGnPGMk7Xc">Geo map</a>&nbsp;notes.</p>
<h2>Plugins</h2>
<p>Leaflet is also highly customizable via external plugins.</p>
<p>Currently we use:</p>
<ul>
<li><a href="https://github.com/mpetazzoni/leaflet-gpx">mpetazzoni/leaflet-gpx: A GPX track plugin for Leaflet.js</a>
</li>
</ul>

View File

@ -0,0 +1,9 @@
<p>MindElixir is the library we are using for the&nbsp;<a href="#root/_help_gBbsAeiuUxI5">Mind Map</a>&nbsp;note
types.</p>
<p>The main library is available on <a href="https://github.com/SSShooter/mind-elixir-core/issues">GitHub as mind-elixir-core</a>.</p>
<p>The library is embedded as-is without additional modifications.</p>
<p>Issues with its functionality should generally be reported <a href="https://github.com/ssshooter/mind-elixir-core">upstream</a>.</p>
<h2>Plugins</h2>
<p>MindElixir supports plugins, and one such plugin we are making use of
is <a href="https://github.com/SSShooter/node-menu">SSShooter/node-menu: A node menu plugin of mind-elixir</a>,
which allows editing the fonts, colors, links of nodes.</p>

View File

@ -0,0 +1,66 @@
<p>A template in Trilium serves as a predefined structure for other notes,
referred to as instance notes. Assigning a template to a note brings three
main effects:</p>
<ol>
<li><strong>Attribute Inheritance</strong>: All attributes from the template
note are <a href="#root/_help_bwZpz2ajCEwO">inherited</a> by the instance
notes. Even attributes with <code>#isInheritable=false</code> are inherited
by the instance notes, although only inheritable attributes are further
inherited by the children of the instance notes.</li>
<li><strong>Content Duplication</strong>: The content of the template note
is copied to the instance note, provided the instance note is empty at
the time of template assignment.</li>
<li><strong>Child Note Duplication</strong>: All child notes of the template
are deep-duplicated to the instance note.</li>
</ol>
<h2>Example</h2>
<p>A typical example would be a "Book" template note, which might include:</p>
<ul>
<li><strong>Promoted Attributes</strong>: Such as publication year, author,
etc. (see <a href="#root/_help_OFXdgB2nNk1F">promoted attributes</a>).</li>
<li><strong>Outline</strong>: An outline for a book review, including sections
like themes, conclusion, etc.</li>
<li><strong>Child Notes</strong>: Additional notes for highlights, summary,
etc.</li>
</ul>
<p>
<img src="Templates_template.png" alt="Template Example">
</p>
<h2>Instance Note</h2>
<p>An instance note is a note related to a template note. This relationship
means the instance note's content is initialized from the template, and
all attributes from the template are inherited.</p>
<p>To create an instance note through the UI:</p>
<p>
<img src="Templates_template-create-.png" alt="show child note templates">
</p>
<p>For the template to appear in the menu, the template note must have the <code>#template</code> label.
Do not confuse this with the <code>~template</code> relation, which links
the instance note to the template note. If you use <a href="#root/_help_9sRHySam5fXb">workspaces</a>,
you can also mark templates with <code>#workspaceTemplate</code> to display
them only in the workspace.</p>
<p>Templates can also be added or changed after note creation by creating
a <code>~template</code> relation pointing to the desired template note.&nbsp;</p>
<p>To specify a template for child notes, you can use a <code>~child:template</code> relation
pointing to the appropriate template note. There is no limit to the depth
of the hierarchy — you can use <code>~child:child:template</code>, <code>~child:child:child:template</code>,
and so on.</p>
<aside class="admonition important">
<p>Changing the template hierarchy after the parent note is created will
not retroactively apply to newly created child notes.
<br>For example, if you initially use <code>~child:template</code> and later
switch to <code>~child:child:template</code>, it will not automatically
apply the new template to the grandchild notes. Only the structure present
at the time of note creation is considered.</p>
</aside>
<h2>Additional Notes</h2>
<p>From a visual perspective, templates can define <code>#iconClass</code> and <code>#cssClass</code> attributes,
allowing all instance notes (e.g., books) to display a specific icon and
CSS style.</p>
<p>Explore the concept further in the <a href="#root/_help_wX4HbRucYSDD">demo notes</a>,
including examples like the <a href="#root/_help_iRwzGnHPzonm">Relation Map</a>,
<a
href="#root/_help_xYjQUYhpbUEW">Task Manager</a>, and <a href="#root/_help_l0tKav7yLHGF">Day Notes</a>.</p>
<p>Additionally, see <a href="#root/_help_47ZrP6FNuoG8">default note title</a> for
creating title templates. Note templates and title templates can be combined
by creating a <code>#titleTemplate</code> for a template note.</p>

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

View File

@ -0,0 +1,16 @@
<p>Trilium can import ENEX files which are used by Evernote for backup/export.
One ENEX file represents content (notes and resources) of one notebook.</p>
<h2>Export ENEX from Evernote</h2>
<p>To export ENEX file, you need to have a <em>legacy</em> desktop version
of Evernote (i.e. not web/mobile). Right click on notebook and select export
and follow the wizard.</p>
<h2>Import ENEX in Trilium</h2>
<p>Once you have ENEX file, you can import it to Trilium. Right click on
some note (to which you want to import the file), click on "Import" and
select the ENEX file.</p>
<p>After importing the ENEX file, go over the imported notes and resources
to be sure the import went well, and you didn't lose any data.</p>
<h2>Limitations</h2>
<p>All resources (except for images) are created as note's attachments.</p>
<p>HTML inside ENEX files is not exactly valid so some formatting maybe broken
or lost. You can report major problems into <a href="https://github.com/TriliumNext/Notes/issues">Trilium issue tracker</a>.</p>

View File

@ -0,0 +1,46 @@
<p>Trilium supports Markdown for both import and export, while trying to
keep compatibility as high as possible.</p>
<h2>Import</h2>
<h3>Clipboard import</h3>
<p>If you want to import just a chunk of markdown from clipboard, you can
do it from editor block menu:</p>
<p>
<img src="Markdown_markdown-inline-i.gif">
</p>
<h3>File import</h3>
<p>You can also import Markdown files from files:</p>
<ul>
<li>single markdown file (with .md extension)</li>
<li>whole tree of markdown files (packaged into <a href="https://en.wikipedia.org/wiki/Tar_(computing)">.zip</a> archive)
<ul>
<li>Markdown files need to be packaged into ZIP archive because browser can't
read directories, only single files.</li>
<li>You can use e.g. <a href="https://www.7-zip.org">7-zip</a> to package directory
of markdown files into the ZIP file</li>
</ul>
</li>
</ul>
<p>[[gifs/markdown-file-import.gif]]</p>
<p>
<img src="Markdown_markdown-file-imp.gif">
</p>
<h2>Export</h2>
<h3>Subtree export</h3>
<p>You can export whole subtree to ZIP archive which will have directory
structured modelled after subtree structure:</p>
<p>
<img src="Markdown_markdown-export-s.gif">
</p>
<h3>Single note export</h3>
<p>If you want to export just single note without its subtree, you can do
it from Note actions menu:</p>
<p>
<img src="Markdown_markdown-export-n.gif">
</p>
<h3>Exporting protected notes</h3>
<p>If you want to export protected notes, enter a protected session first!
This will export the notes in an unencrypted form, so if you reimport into
Trilium, make sure to re-protect these notes.</p>
<h2>Supported syntax</h2>
<p>See the dedicated page:&nbsp;<a class="reference-link" href="#root/_help_rJ9grSgoExl9">Supported syntax</a>
</p>

View File

@ -0,0 +1,54 @@
<p><a href="https://github.github.com/gfm/">GitHub-Flavored Markdown</a> is
the main syntax that Trilium is following.</p>
<h2>Images</h2>
<p>When exporting, images are usually kept in the basic Markdown syntax but
will use the HTML syntax if the image has a custom width. Figures are always
embedded as HTML.</p>
<h2>Tables</h2>
<p>Simple tables are supported with the Markdown syntax. If the table is
too complex or contains elements that would render as HTML, the table is
also rendered as HTML.</p>
<h2>Links</h2>
<p>Standard Markdown links are supported.</p>
<p>Trilium internal links (that mirror a note's title and display its icon)
are embedded as HTML in order to preserve the information on import.</p>
<h2>Math equations</h2>
<p>Both inline and display equations are supported, using the <code>$</code> and <code>$$</code> syntaxes.</p>
<h2>Admonitions</h2>
<p>The Markdown syntax for admonitions as supported by Trilium is the one
that GitHub uses, which is as follows:</p><pre><code class="language-text-x-trilium-auto">&gt; [!NOTE]
&gt; This is a note.
&gt; [!TIP]
&gt; This is a tip.
&gt; [!IMPORTANT]
&gt; This is a very important information.
&gt; [!CAUTION]
&gt; This is a caution.</code></pre>
<p>There are currently no plans of supporting alternative admonition syntaxes
such as <code>!!! note</code>.</p>
<h2>Wikilinks</h2>
<p>Basic support for wikilinks has been added in v0.96.0:</p>
<ul>
<li><code>[[foo/bar]]</code> will look for the <code>bar.md</code> file in the <code>foo</code> directory
and turn it into an internal link.</li>
<li><code>![[foo/baz.png]]</code> will look for the <code>baz.png</code> file
in the <code>foo</code> directory and turn it into an image.</li>
</ul>
<p>This feature is import-only, which means that it will turn wikilinks into
Trilium-compatible syntax, but it will not export Trilium Notes into Markdown
files with this syntax.</p>
<aside class="admonition important">
<p>The path to pages in wikilinks is resolved relatively to the <em>import root</em> and
not the current directory of the note. This is to be inline with other
platforms that use wikilinks such as SilverBullet.</p>
<p>The root path of the import is determined as follows:</p>
<ul>
<li>If there is a single directory within the archive at root level, then
that directory is considered the root.</li>
<li>If there are multiple files &amp; directories at root level, then the
archive root (containing all of these items) is considered the root.</li>
</ul>
</aside>

Binary file not shown.

After

Width:  |  Height:  |  Size: 332 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 714 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 KiB

View File

@ -0,0 +1,79 @@
<p><strong>This page describes a method to migrate via EverNote Legacy, but this app is no longer available/working.</strong>
</p>
<h2>Prep Onenote notes for best compatibility</h2>
<ul>
<li>Remove Onenote Tags and replace with Emoji if possible (Onenote Tags will
get imported into trilium as an image which clutters the Trilium tree somewhat)</li>
<li>Make sure to use Onenote headings where applicable (These will be carried
over correctly into Trilium)</li>
<li>Remove extra whitespace in Onenote (Whitespace seems to be more noticible
in Trilium, so removing it now will make it look nicer in trilium)</li>
<li>If possible, try to avoid very long Onenote pages. Trilium works best
with shorter concise pages with any number of sub or (sub-sub...) pages.</li>
<li>Make sure numbered lists don't have unusual spaces between items in the
list (Sometimes the numbered list will start at 1 again in Trilum if there
is an extra space in the list in OneNote).</li>
</ul>
<h2>Migration Procedure</h2>
<h3>Import into Evernote from OneNote:</h3>
<ul>
<li>Install <a href="https://web.archive.org/web/20230327110646/https://help.evernote.com/hc/en-us/articles/360052560314">Evernote Legacy</a>.
Current versions of Evernote do not have this functionality. (Requires
Evernote account, but import works without internet connection - be sure
to NOT sync notes to Evernote!).</li>
<li>In evernote navigate to File &gt; Import &gt; Onenote &gt; Notebook &gt;
Section &gt; OK</li>
</ul>
<p>If exporting all sections at a time, they will not be grouped in folders
- they will all be added to a single folder, but the order will be kept,
so you can re-group into folders after importing to Trilium</p>
<h3>Export from Evernote</h3>
<ul>
<li>Right click on the created notebook in Evernote and choose "Export Notes…"</li>
<li>Use the default export format of .enex</li>
</ul>
<h3>Cleanup enex file (optional)</h3>
<ul>
<li>
<p>If the Onenote header (that is at the top of each Onenote page) is not
desired, you can use the following regex to remove them in a text editor
like VsCode:</p>
<p>Find (using regex): <code>.&lt;div.*&gt;&lt;h1</code> Replace with: <code>&lt;h1</code>
</p>
</li>
</ul>
<h3>Import into Trilium</h3>
<ul>
<li>In Trilium, right click on the root node and choose Import (all default
options should be fine).</li>
<li>Select the .enex file exported from Evernote</li>
<li>Be patient. Large .enex files may take a few minutes to process</li>
<li>Repeat import for each .enex file</li>
</ul>
<h2>Other importing notes:</h2>
<ul>
<li>Centered text in Onenote will be left-justified after importing into Trilium</li>
<li>Internal onenote links will obviously be broken, but the link still exists
so you can do a search in Trilium to find all onenote:// links and then
re-link to the proper Trilium page (there is no way to link to a paragraph
in trilium, so it's good to keep trilium pages short so links point to
a small chunk of information instead of a massive note)</li>
<li>Text colors, highlights, and formatting generally carries over well</li>
<li>Revision history will be lost, but any new revisions will be tracked in
Trilium</li>
<li>The structure of notes are not maintained exactly, so if you had sub-notes
in Onenote, you may have to re-arrange the notes accordingly (This is easy
since the order of the notes is preserved).</li>
<li>Evernote tags are created for each "section" in OneNote and these tags
are carried over to Trilium as attributes
<ul>
<li>If the tags are not desired, you can turn them off in the Evernote export
options.</li>
</ul>
</li>
<li>If the "Created with OneNote" text is not desired, do a find/replace in
the enex files before importing to Trilium</li>
<li>Some links will be disabled (not clickable) when importing from enex.</li>
<li>Files, screenshots, and attachments are all preserved (This is the only
one-note export option that seems to preserve all of these).</li>
</ul>

View File

@ -0,0 +1,126 @@
<p>These are user-created themes which were made publicly available:</p>
<h2>Legacy Themes</h2>
<p>These themes may or may not be compatible with the latest versions of
TriliumNext and are based on the original/legacy theme.</p>
<figure class="table">
<table>
<thead>
<tr>
<th>Theme</th>
<th>Author</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="https://github.com/tobealive/trilium-midnight-theme">Midnight</a>
</td>
<td><a href="https://github.com/tobealive">tobealive</a>
</td>
</tr>
<tr>
<td><a href="https://github.com/tobealive/trilum-eote-theme">EOTE</a>
</td>
<td><a href="https://github.com/tobealive">tobealive</a>
</td>
</tr>
<tr>
<td><a href="https://github.com/Abourass/TriliumThemes">Trilium Themes</a>
</td>
<td><a href="https://github.com/Abourass">Abourass</a>
</td>
</tr>
<tr>
<td><a href="https://github.com/ZMonk91/Material-Dark-Trilium">MaterialDark</a>
</td>
<td><a href="https://github.com/ZMonk91">ZMonk91</a>
</td>
</tr>
<tr>
<td><a href="https://github.com/jaroet/trilium-theme-lightslategray">lightslategray</a>
</td>
<td><a href="https://github.com/jaroet">jaroet</a>
</td>
</tr>
<tr>
<td><a href="https://github.com/raphwriter/trilium-theme-melon">melon-4</a>
</td>
<td><a href="https://github.com/raphwriter">raphwriter</a>
</td>
</tr>
<tr>
<td><a href="https://github.com/Engr-AllanG/trilium-themes">Neon_Dark</a>
</td>
<td><a href="https://github.com/Engr-AllanG">Engr-AllanG</a>
</td>
</tr>
<tr>
<td><a href="https://github.com/Engr-AllanG/trilium-themes">Coder_Dark</a>
</td>
<td><a href="https://github.com/Engr-AllanG">Engr-AllanG</a>
</td>
</tr>
<tr>
<td><a href="https://github.com/idelem/trilium-theme-velvet">velvet</a>
</td>
<td><a href="https://github.com/idelem">idelem</a>
</td>
</tr>
<tr>
<td><a href="https://github.com/SADAVA/trilium-notes-theme-dark-plus">Dark Plus</a>
</td>
<td><a href="https://github.com/SADAVA">SADAVA</a>
</td>
</tr>
<tr>
<td><a href="https://github.com/WKSu/trilium-solarized-theme">Solarized</a>
</td>
<td><a href="https://github.com/WKSu">WKSu</a>
</td>
</tr>
<tr>
<td><a href="https://github.com/en3r0/Trilium-Nord-Theme">Nord</a>
</td>
<td><a href="https://github.com/en3r0">en3r0</a>
</td>
</tr>
<tr>
<td><a href="https://github.com/AllanZyne/trilium-bear-theme">Bear Note Light</a>
</td>
<td><a href="https://github.com/AllanZyne">AllanZyne</a>
</td>
</tr>
<tr>
<td><a href="https://github.com/AllanZyne/trilium-bear-theme">Bear Note Dark</a>
</td>
<td><a href="https://github.com/AllanZyne">AllanZyne</a>
</td>
</tr>
<tr>
<td><a href="https://github.com/Sebiann/miku-hatsune-trilium-theme">Miku Hatsune</a>
</td>
<td><a href="https://github.com/Sebiann">Sebiann</a>
</td>
</tr>
<tr>
<td><a href="https://github.com/cwilliams5/Midnight-Trilium-Dark-Mode">Midnight</a>
</td>
<td><a href="https://github.com/cwilliams5">cwilliams5</a>
</td>
</tr>
<tr>
<td><a href="https://github.com/SiriusXT/trilium-theme-blue">Blue</a> (light)</td>
<td><a href="https://github.com/SiriusXT">SiriusXT</a>
</td>
</tr>
<tr>
<td><a href="https://github.com/SiriusXT/trilium-theme-blue">Blue</a> (dark)</td>
<td><a href="https://github.com/SiriusXT">SiriusXT</a>
</td>
</tr>
</tbody>
</table>
</figure>
<aside class="admonition tip">
<p>If you would like to add your theme to this gallery, write a new post
in <a href="https://github.com/TriliumNext/Notes/discussions/categories/show-and-tell">👐 Show and tell</a>.</p>
</aside>

Some files were not shown because too many files have changed in this diff Show More