Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
docs: fix
Adorian Doran9d432e1a4480
diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/ETAPI (REST API).html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/ETAPI (REST API).htmlindex 3a3c2fdf84..8454c5f4e7 100644--- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/ETAPI (REST API).html+++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/ETAPI (REST API).html@@ -53,4 +53,24 @@ curl "$SERVER/etapi/notes/$NOTE_ID/content" -H "Authorization: $TOKEN" </code></a directory called <code>out</code>, simply replace the last statement inthe script with:</p><pre><code class="language-text-x-trilium-auto">curl -H "Authorization: $TOKEN" \-X GET "$SERVER/etapi/notes/$NOTE_ID/export" \- --output "out/$NOTE_ID.zip"</code></pre>\ No newline at end of file+ --output "out/$NOTE_ID.zip"</code></pre>+<h2>Uploading binary content</h2>+<p>A JSON request body can only carry text, so the <code>content</code> field+ of <code>POST /etapi/attachments</code> stores exactly the string it receives.+ To upload an image, a PDF or any other binary file, send the raw bytes+ to the content endpoint with the <code>application/octet-stream</code> content+ type. The same applies to the content of a note (<code>PUT /etapi/notes/{noteId}/content</code>).</p>+<p>To attach a file to a note, create the attachment without content, then+ upload the file to it:</p><pre><code class="language-text-x-trilium-auto">ATTACHMENT_ID=$(curl -s -X POST "$SERVER/etapi/attachments" \+ -H "Authorization: $TOKEN" \+ -H "Content-Type: application/json" \+ -d "{\"ownerId\": \"$NOTE_ID\", \"role\": \"file\", \"mime\": \"application/pdf\", \"title\": \"report.pdf\", \"position\": 10}" \+ | jq -r .attachmentId)++curl -X PUT "$SERVER/etapi/attachments/$ATTACHMENT_ID/content" \+ -H "Authorization: $TOKEN" \+ -H "Content-Type: application/octet-stream" \+ --data-binary @report.pdf</code></pre>+<p>Use <code>--data-binary</code> rather than <code>-d</code>, which strips+ line breaks from the file. For an image, set <code>role</code> to <code>image</code> and <code>mime</code> to+ the image's type, such as <code>image/png</code>.</p>\ No newline at end of filediff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/Notes/Printing & Exporting as PDF.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/Notes/Printing & Exporting as PDF.htmlindex 50931fe8f9..8b724fa0e2 100644--- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/Notes/Printing & Exporting as PDF.html+++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/Notes/Printing & Exporting as PDF.html@@ -116,9 +116,9 @@href="#root/_help_4TIF1oA4VQRO">Options</a> and assigning a key combinationfor:</p><ul>- <li class="ck-list-marker-italic"><em>Print Active Note</em>+ <li><em>Print Active Note</em></li>- <li class="ck-list-marker-italic"><em>Export Active Note as PDF</em>+ <li><em>Export Active Note as PDF</em></li></ul><h2>Constraints & limitations</h2>diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Collections/Kanban Board.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Collections/Kanban Board.htmlindex 3559cb59ad..4023843a2f 100644--- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Collections/Kanban Board.html+++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Collections/Kanban Board.html@@ -1,8 +1,12 @@<p>The Board view lets you arrange subnotes as cards on a Kanban board.</p>+<h2>Creating a Kanban board</h2>+<p>Right-click an existing note in the <a class="reference-link" href="#root/_help_oPVyFC7WL2Lp">Note Tree</a>,select <strong>Insert child note</strong>, and look for <strong>Kanban Board</strong>.</p>+<h2>How it works</h2>+<p>When you first create a collection of the <em>Board</em> type, a few subnotesare created, each with a <code>#status</code> label set. The board then groupseach note by the value of its status attribute.</p>@@ -10,15 +14,21 @@nested notes will be displayed. However, unlike the <a class="reference-link"href="#root/_help_2FvYrpmOXm29">Table</a>, the notes are not displayedhierarchically.</p>+<h2>Working with columns</h2>++<h3>Creating columns</h3>+<p>You can create a new column by pressing the <span class="tn-icon bx bx-plus"></span><strong>Add column</strong> buttonlocated after the last column.</p><p>Enter the new name (which must not match another column), optionally selectan icon by pressing the circle at the start of the text box, and then pressthe (+) button or <kbd>Enter</kbd>. Click or tap outside the text box, orpress <kbd>Esc</kbd>, to dismiss it.</p>+<h3>Reordering columns</h3>+<p>The order of the columns can be changed at any time. There are severalways to do this:</p><ul>@@ -40,14 +50,20 @@<li><strong>Using the column menu:</strong> Open the column menu and use the <spanclass="tn-icon bx bx-horizontal-left"></span> <strong>Move column</strong> submenu.</li></ul>+<h3>Renaming and recoloring columns</h3>+<p>To change the name of a column, open the column menu and select <spanclass="tn-icon bx bx-edit-alt"></span> <strong>Rename column</strong>, orpress <kbd>F2</kbd> while the column header is selected.</p><p>From the same menu, you can tint the column with a different color byusing the color palette at the bottom of the menu.</p>+<h3>Collapsing and expanding columns</h3>++<h4>Collapsing</h4>+<p>A column can be collapsed (minimized) to occupy less space on the screenand make the board look less cluttered. This is particularly useful forcolumns that are not frequently used, or when you want to focus on only@@ -76,7 +92,9 @@moving the selected cards up or down, or to another column.</li></ul><p>Collapsed columns can still be reordered, and their menus remain available.</p>+<h4>Expanding</h4>+<p>You can restore a collapsed column so that its content is visible againin the following ways:</p><ul>@@ -87,19 +105,25 @@<li><strong>Using the keyboard:</strong> Move the focus to the collapsed column,and then press <kbd>Space</kbd>.</li></ul>+<h4>Keeping a column collapsed</h4>+<p>By default, once a column is expanded, it remains expanded. However, youcan configure a column to collapse again after you finish working withit. To activate this behavior, open the column menu and check <spanclass="tn-icon bx bx-lock-alt"></span> <strong>Keep the column collapsed</strong>.</p><p>A column configured to remain collapsed will expand like any other collapsedcolumn, but only temporarily, until another column is focused.</p>+<h4>Collapsing and expanding all columns</h4>+<p>You can expand or collapse all columns at once by using the <spanclass="tn-icon bx bx-collapse-alt"></span> (collapse) and <span class="tn-icon bx bx-expand-alt"></span> (expand)buttons. On the desktop, these buttons are located at the bottom of thescreen; on the mobile interface, they are in the header.</p>+<h3>Sorting cards within a column</h3>+<p>By default, the cards in a column are sorted manually by moving them upand down. You can also keep them sorted automatically, using customizablecriteria for each column. To customize the sorting options, open the <strong>column menu</strong> → <strong>Sort</strong>.@@ -129,7 +153,9 @@sorting. When you switch back to manual sorting, the cards will be in thesame order in which you arranged them.</p></aside>+<h4>How card attributes are sorted</h4>+<p>When cards are sorted by an attribute, they are ordered according to thefollowing rules:</p><figure class="table table-style-align-center">@@ -180,7 +206,9 @@end of the column, regardless of whether the sort order is ascending ordescending. If an attribute holds more than one value, only the first valueis used for sorting.</p>+<h4>Configuring the default sorting options</h4>+<p>Every new column uses the <strong>Board's default</strong> sorting option,which is initially set to manual sorting on new boards. However, the defaultcan be changed to any other sorting criterion and direction. To configure@@ -201,7 +229,9 @@Using the <code>#sortColumnsDescending</code> label will switch to descendingorder.</p></aside>+<h3>Setting a limit</h3>+<p>For each column, you can limit the number of cards it contains (also knownas a WIP limit). Once the limit is exceeded, the column displays a visualwarning to indicate that it is over its limit.</p>@@ -218,7 +248,9 @@Trilium works: cards are regular notes, and the attributes used to groupthem into columns can be set from anywhere in the app, outside the boardcontrol. As a result, enforcing the limit would not be consistent.</p>+<h3>Archiving a column</h3>+<p>If you want to hide a column from the board without deleting it, you canarchive it by opening the <strong>column menu</strong> → <span class="tn-icon bx bx-archive-in"></span> <strong>Archive column</strong>.Archiving a column does not set the archived flag (see <a class="reference-link"@@ -228,7 +260,9 @@toggle <span class="tn-icon bx bx-archive-in"></span> <strong>Show archived notes</strong>.Archived columns will appear faded. To restore one, open its column menuand select <span class="tn-icon bx bx-archive-out"></span> <strong>Unarchive column</strong>.</p>+<h3>Deleting a column</h3>+<p>You can delete a column by opening the <strong>column menu</strong> → <spanclass="tn-icon bx bx-trash"></span> <strong>Delete column</strong>, or bypressing <kbd>Delete</kbd> when a column header is focused, and then confirming.@@ -240,7 +274,9 @@class="tn-icon bx bx-trash"></span> <strong>Remove inbox column</strong>,and <kbd>Delete</kbd> on its header hides the inbox without changing anycard.</p>+<h3>The inbox column</h3>+<p>The inbox column is a special column containing cards that are not assignedto another column. It is particularly useful when you switch an existingcollection containing child notes to a board collection. The inbox column@@ -259,7 +295,9 @@<p>Optionally, the inbox column can also list nested notes from the boardcollection's subtree. To enable this, open the <strong>column menu</strong> andcheck <span class="tn-icon bx bx-subdirectory-right"></span> <strong>Include nested notes</strong>.</p>+<h3>Changing the width of columns</h3>+<p>There are three predefined widths for board columns: narrow (default),medium, and wide. To change the width, open the <strong>Note menu</strong> → <strong>Board properties</strong> → <strong>Column width</strong> (underthe <strong>General</strong> section). This option applies to every column@@ -275,8 +313,13 @@--board-column-width-medium: 325px;--board-column-width-wide: 400px;}</code></pre>++<h2>Working with cards</h2>++<h3>Creating a new card</h3>+<p>To create a new card, press the <span class="tn-icon bx bx-plus"></span><strong>New card</strong> buttonlocated at the bottom of each column. To create a new card above or belowa specific card, right-click or hold that card, and then select <span@@ -299,7 +342,9 @@When using keyboard shortcuts, focus the column header and press <kbd>Enter</kbd> tocreate a new card at the start of the column, or <kbd>Shift</kbd> + <kbd>Enter</kbd> tocreate one at the end.</p>+<h3>Adding an existing note as a card</h3>+<p>Any note in your knowledge base can be represented as a card on a board.To add an existing note to your board, create a new card but do not entera title. Instead, press the <span class="tn-icon bx bx-folder-open"></span> button.@@ -316,13 +361,16 @@to their titles, content, and attributes on the board are reflected intheir original locations as well. Learn more about cloned notes.</p></aside>+<h3>Selecting multiple cards</h3>+<p>When working with a board, you may need to perform operations on multiplecards at once, such as moving them to another column, setting attributesor colors, deleting them, or archiving them.</p><p>You can select multiple cards in the following ways:</p><ul><li class="ck-list-marker-bold"><strong>Using a mouse and keyboard:</strong>+<ul><li>To add a card to the selection, hold <kbd>Ctrl</kbd> and click the card.Repeat this for other cards until all the desired cards are selected. Clicking@@ -334,6 +382,7 @@</ul></li><li class="ck-list-marker-bold"><strong>On mobile:</strong>+<ol><li>To enter selection mode, tap the <span class="tn-icon bx bx-select-multiple"></span> buttonat the top of the screen. A selection toolbar will appear in the header,@@ -341,11 +390,12 @@<li>Tap the cards you want to select. If you tap a selected card again, itwill be deselected. To select all cards in a column, press the <spanclass="tn-icon bx bx-list-check"></span> button on the selection toolbar.- To clear the selection, press the <span class="tn-icon mdi mdi-close"></span> button.</li>+ To clear the selection, press the <span class="tn-icon bx bx-x"></span> button.</li><li>Use the side toolbar to apply actions to the selected cards.</li></ol></li><li class="ck-list-marker-bold"><strong>Using only the keyboard:</strong>+<ul><li>To add the currently focused card to the selection, press <kbd>Ctrl</kbd> + <kbd>Space</kbd>.Repeat this for the other cards you want to select. Pressing <kbd>Ctrl</kbd> + <kbd>Space</kbd> again@@ -357,10 +407,14 @@</ul></li></ul>+<h3>Moving cards between columns</h3>+<p>To move one or more cards to another column, use one of the followingmethods:</p>+<h4>Using touch or a mouse</h4>+<p>Touch and hold the card, or click and hold it with the mouse, and thendrag it to the desired column. If the column uses manual sorting, you canalso position the card relative to the other cards.</p>@@ -375,13 +429,16 @@<asideclass="admonition tip"><p><strong>You can quickly drop a card at the start or end of a column.</strong>+</p><p>Drop the card above the column while the “Drop as the first card” hintis displayed to make it the first card in that column. Alternatively, dropit below the column while the “Drop as the last card” hint is displayedto make it the last card.</p></aside>+<h4>Using the keyboard</h4>+<p>You can also use keyboard shortcuts to move the selected card or cardsbetween columns:</p><ul>@@ -390,11 +447,15 @@ class="admonition tip"><li><kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Right</kbd>: Move to the last column.</li><li><kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Left</kbd>: Move to the first column.</li></ul>+<h4>Using the context menu</h4>+<p>To quickly move a card to another column, open the card's context menuand select the destination column. The menu lists the first seven columns;on a wider board, the remaining ones are grouped under <strong>More…</strong>.</p>+<h3>Reordering cards within a column</h3>+<p>Cards within a column can be freely reordered unless the column uses asorting option other than manual. To reposition a card, drag it as describedin the <strong>Moving cards between columns</strong> section and drop it@@ -409,7 +470,9 @@ class="admonition tip"></ul><p>If multiple cards are selected, the keyboard shortcuts work only if theselection consists of a continuous sequence of cards.</p>+<h3>Editing a card</h3>+<p>Every card on a board is a regular note. To edit the note associated witha card, click or tap the card, or press <kbd>Space</kbd> when the card isselected. The note will open in a Quick Edit dialog, where you can modify@@ -440,7 +503,9 @@ class="admonition tip">to its title, icon, or color on the board will apply in those locationsas well, not only on the board.</p></aside>+<h3>Archiving a card</h3>+<p>A card can be hidden from the board without deleting it by using the <spanclass="tn-icon bx bx-archive-in"></span> <strong>Archive note</strong> commandfrom the card's context menu.</p>@@ -455,13 +520,17 @@ class="admonition warning">in those locations as well. Read more about <a class="reference-link"href="#root/_help_MKmLg5x6xkor">Archived Notes</a>.</p></aside>+<h3>Deleting a card</h3>+<p>You can remove one or more cards from the board and delete their associatednotes by using the <span class="tn-icon bx bx-trash"></span> <strong>Delete note…</strong> commandfrom the card's context menu, or by pressing <kbd>Shift</kbd> + <kbd>Delete</kbd>.On mobile, hold the card until the side toolbar appears, and then tap the <spanclass="tn-icon bx bx-trash"></span> button.</p>+<h4>Removing a card from the board without deleting the note</h4>+<p>To remove a card from the board's columns while keeping its note, openthe card's context menu and select <span class="tn-icon bx bx-task-x"></span> <strong>Remove from board</strong>,or press <kbd>Delete</kbd>. On mobile, hold the card until the side toolbar@@ -473,14 +542,18 @@ class="admonition warning"><aside class="admonition note"><p>Under the hood, removing a card simply unsets the note's grouping attribute.</p></aside>+<h3>Working with custom card attributes</h3>+<p>By default, the face of a card displays a minimal set of information:the title, icon, and color. In some cases, this may not provide enoughuseful information at a glance. You can extend the card to display extrainformation, called card attributes, such as a due date, priority, completionstatus, or any other information you need. Card attributes use the sameprinciples as <a class="reference-link" href="#root/_help_OFXdgB2nNk1F">Promoted Attributes</a>.</p>+<h4>Creating a new attribute</h4>+<p>To create a new attribute, follow these steps:</p><ol><li>Go to <strong>Note menu</strong> → <strong>Board properties</strong>, find@@ -528,12 +601,16 @@ class="admonition warning"></tbody></table></figure>+<h4>Modifying the values of custom attributes</h4>+<p>To set the value of a custom attribute, click or tap the card, and thenenter or select the desired value in the dialog header.</p><p>For attributes of the “select” or “boolean” type, you can quickly changethe value by using the card's context menu under the <strong>Attributes</strong> section.</p>+<h4>Reordering, hiding, redefining, and deleting custom attributes</h4>+<p>Go to <strong>Note menu</strong> → <strong>Board properties</strong>. Underthe <strong>Card attributes</strong> section, you can:</p><ul>@@ -548,7 +625,9 @@ class="admonition warning"><li>Press the <span class="tn-icon bx bx-trash"></span> button to deletethe attribute and all its values from every note in the board collection.</li></ul>+<h3>Managing card templates</h3>+<p>When you create a new card, Trilium offers four templates by default: <strong>Text</strong>, <strong>Markdown</strong>, <strong>Canvas</strong>,and <strong>Spreadsheet</strong>. You can customize this list to includeother note types or custom templates with predefined placeholder content@@ -576,7 +655,9 @@ class="admonition warning">a new card. You can move the most frequently used templates to the topfor faster access.</li></ul>+<h3>Grouping cards</h3>+<p>On a board, cards are grouped into columns. The column to which a cardbelongs is determined by the value of the <strong>grouping attribute</strong>,which is a regular attribute of the card's note.</p>@@ -590,7 +671,9 @@ class="admonition note">is inheritable and promoted. Each select option becomes a column, and eachnew column created on the board extends the list of options.</p></aside>+<h4>Creating a new grouping attribute</h4>+<p>To quickly create a new grouping attribute:</p><ol><li>Open the <span class="tn-icon bx bx-category-alt"></span> <strong>Group by</strong> dropdown@@ -606,7 +689,9 @@ class="admonition note">create it in <strong>Board properties</strong>. Make sure you set the attributetype to “select”.</p></aside>+<h4>Switching the grouping attribute</h4>+<p>Switching the grouping attribute lets you view your cards by priority,category, or any other custom grouping attribute. You can switch the groupingattribute at any time by using the <span class="tn-icon bx bx-category-alt"></span> <strong>Group by</strong> dropdown@@ -619,11 +704,15 @@ class="admonition warning">notes in one view will also reorder them in other views that use a differentgrouping attribute.</p></aside>+<h4>Deleting a grouping attribute</h4>+<p>To delete a grouping attribute, go to <strong>Note menu</strong> → <strong>Board properties</strong>,find the attribute under the <strong>Card attributes</strong> section, andpress the corresponding <span class="tn-icon bx bx-trash"></span> button.</p>+<h4>Grouping by relations</h4>+<p>A more advanced use case is grouping by <a href="#root/_help_Cq5X6iKQop6R">Relations</a>.</p><p>In this mode:</p><ul>@@ -638,7 +727,7 @@ class="admonition warning"><p>Using relations instead of labels has several benefits:</p><ul><li>The status or grouping of notes is visible outside the Kanban board, for- example, on the <a class="reference-link" href="#root/_help_bdUJEHsAPYQR">[missing note]</a>.</li>+ example, on the <a class="reference-link" href="#root/_help_bdUJEHsAPYQR">Note Map</a>.</li><li>A column takes its title and icon from the target note, so renaming thatnote anywhere in the tree renames the column.</li></ul>@@ -650,11 +739,14 @@ class="admonition warning"><li>Set <code>#board:groupBy</code> to the name of a relation, <strong>including the</strong> <code>~</code> <strong>prefix</strong> (forexample, <code>~status</code>).</li><li>- <p>Optionally, use <a class="reference-link" href="#root/_help_OFXdgB2nNk1F">[missing note]</a> to+ <p>Optionally, use <a class="reference-link" href="#root/_help_OFXdgB2nNk1F">Promoted Attributes</a> tomake changing the status within the note easier:</p><pre><code class="language-text-x-trilium-auto">#relation:status(inheritable)="promoted,alias=Status,single"</code></pre>+</li></ol>+<h2>Searching and filtering the board</h2>+<p>You can search for cards using the search box at the top of the board.Enter your keywords, and then press the <span class="tn-icon bx bx-search"></span> buttonin the search field or press <kbd>Enter</kbd>. Only cards whose titles,@@ -662,19 +754,26 @@ class="admonition warning">without results will be temporarily collapsed to make room for the matchingcards. Press the <span class="tn-icon bx bx-x"></span> button in thesearch field to clear the search and display all cards again.</p>+<h3>Advanced filtering</h3>+<p>If you need to refine the view to display only cards matching specificcriteria beyond a regular text search, you can use Trilium's search querysyntax. Here are some example queries:</p><p>Display only cards whose <strong>Priority</strong> attribute is set to “Low”:</p><pre><code class="language-text-x-trilium-auto">#priority=Low</code></pre>+<p>Display only cards whose <strong>Issue Category</strong> is set to “Software”and whose <strong>Site</strong> is set to either “Office” or “Factory”:</p><pre><code class="language-text-x-trilium-auto">#issueCategory="Software" AND (#site="Office" OR #site="Factory")</code></pre>+<p>Display only cards with a <strong>Due Date</strong> in the next seven daysthat are not yet marked as <strong>Done</strong>:</p><pre><code class="language-text-x-trilium-auto">#dueDate >= TODAY AND #dueDate <= TODAY+7 AND #!done</code></pre>+<p>The filter persists even after you close the tab. When you reopen thecollection, the filter remains active until you clear the search queryby using the <span class="tn-icon bx bx-x"></span> button.</p>+<h2>Linking to a column or a card</h2>+<p>You can create a link that opens the board and points out a specific columnor card. Open the <strong>column menu</strong> or the card’s context menu,select <span class="tn-icon bx bx-copy"></span> <strong>Copy reference</strong>,diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Text/Insert buttons.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Text/Insert buttons.htmlindex 43ca48c34b..e28cf27695 100644--- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Text/Insert buttons.html+++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Text/Insert buttons.html@@ -49,18 +49,10 @@ src="1_Insert buttons_plus.png" width="272" height="187"></figure><h2>Horizontal ruler</h2><p>This feature will display a horizontal line, generally useful to separate-<<<<<<< HEAD- different sections of the text. To do so, press the- <img src="5_Insert buttons_image.png"- width="18" height="16">button in the <a class="reference-link" href="#root/_help_nRhnJkTT8cPs">Formatting toolbar</a>.</p>-<img-src="3_Insert buttons_image.png" width="502" height="95">-=======different sections of the text. To do so, press the <span class="tn-icon cke cke-horizontal-line"></span> buttonin the <a class="reference-link" href="#root/_help_nRhnJkTT8cPs">Formatting toolbar</a>.</p><imgsrc="1_Insert buttons_image.png" width="502" height="95">->>>>>>> b0069685a3479d62e9d1a1165cf05df724affcc9<p>Alternatively, it's possible to insert a horizontal ruler by typing <code>---</code>.</p><h2>Page break</h2><figure class="image image-style-align-right">diff --git a/docs/User Guide/!!!meta.json b/docs/User Guide/!!!meta.jsonindex b4bdd9ef2f..de316f2469 100644--- a/docs/User Guide/!!!meta.json+++ b/docs/User Guide/!!!meta.json@@ -7679,32 +7679,7 @@],"format": "markdown","dataFileName": "Kanban Board.md",- "attachments": [- {- "attachmentId": "3ze7RpkjIWdW",- "title": "image.png",- "role": "image",- "mime": "image/png",- "position": 10,- "dataFileName": "Kanban Board_image.png"- },- {- "attachmentId": "IrIeh59VGjHq",- "title": "image.png",- "role": "image",- "mime": "image/png",- "position": 10,- "dataFileName": "1_Kanban Board_image.png"- },- {- "attachmentId": "usSSa0WI6dDK",- "title": "image.png",- "role": "image",- "mime": "image/png",- "position": 10,- "dataFileName": "2_Kanban Board_image.png"- }- ]+ "attachments": []},{"isClone": false,diff --git a/docs/User Guide/User Guide/AI.md b/docs/User Guide/User Guide/AI.mdnew file mode 100644index 0000000000..115970c62d--- /dev/null+++ b/docs/User Guide/User Guide/AI.md@@ -0,0 +1,193 @@+# AI+Trilium can connect to a large language model and use it as an assistant that works directly on your notes: ask questions about the note you're reading, have it draft or restructure content, or get it to write scripts and widgets for you.++The integration is off by default and does nothing until you enable it and configure a provider; Trilium ships no model of its own. The provider you pick decides how your notes travel: a cloud API billed per use, a subscription you already pay for, or a model running on your own hardware, in which case nothing leaves the machine. See <a class="reference-link" href="AI/Providers.md">Providers</a> for what each involves, and <a class="reference-link" href="AI/Privacy.md">Privacy</a> for exactly what gets sent.++Once enabled, the assistant is available as:++* As a dedicated note type, it can read and modify notes through tools, which you can switch off per conversation if you would rather it only saw what you type.+* A panel in the right sidebar, which acts similarly to the dedicated note type but it also has optional access to the current note.+* An <a class="reference-link" href="Note%20Types/Text/In-editor%20AI%20assistant.md">In-editor AI assistant</a> which comes with builtin actions that operate over selected text (such as proof-reading, summarizing), as well as <a class="reference-link" href="Note%20Types/Text/In-editor%20AI%20assistant/Custom%20AI%20quick%20actions.md">Custom AI quick actions</a>.++## Feature highlights++* Chat-based interface with live streaming of the messages.+* Provides the AI context with the note currently being looked at.+* Tools to alter note content, create new notes, etc.+* Statistics regarding context window use and pricing per message.+* Attachments for multi-modal chat (images, text files, PDFs).+* Optional MCP to allow external chat tools (e.g. Claude Code) to operate on notes within Trilium.++## Sample use-cases++* Create any type of <a class="reference-link" href="Scripting/Frontend%20Basics/Custom%20Widgets.md">Custom Widgets</a>.+* Easily create a <a class="reference-link" href="Note%20Types/Render%20Note.md">Render Note</a>, e.g. _Create for me a render note which allows me to play tic-tac-toe. Make sure to use Preact instead of the legacy jQuery._+* Create widgets for a <a class="reference-link" href="Collections/Dashboard.md">Dashboard</a>, such as a calculator, a stopwatch, a pomodoro timer.++> [!NOTE]+> Claude Sonnet is known to produce very good frontend or backend scripts with little guidance, as the AI has been instructed in how to produce them.++## LLM Providers++Trilium supports four different types of providers:++* **Cloud providers**+ Pay-per use with an API key which is billed separately from any subscription you might already have+ * Anthropic (Claude)+ * OpenAI (GPT)+ * Google (Gemini)+ * DeepSeek+* **Subscription-based**+ Reuses an existing subscription instead of paying per use.+ * Currently only Claude Code is supported.+* **Local or self-hosted LLM solutions**+ * Ollama+ * LM Studio.+* **Custom OpenAI compatible endpoints**+ For other providers that are not directly supported by Trilium, either local or hosted (e.g. OpenRouter, Groq, Mistral).++For more information about each provider, see <a class="reference-link" href="AI/Providers.md">Providers</a>. See the dedicated <a class="reference-link" href="AI/Privacy.md">Privacy</a> to better understand what data is sent to providers.++## Enabling the AI integration++To enable the AI integration, simply go to <a class="reference-link" href="Basic%20Concepts%20and%20Features/UI%20Elements/Options.md">Options</a> → _AI / LLM_ and press the toggle in the top-right of the dialog and configure a provider.++## Creating a new chat++There are two different chat interfaces:++* One in the sidebar.+* A dedicated note type.++### The sidebar interface++### The dedicated note type++The dedicated chat note is similar to the sidebar interface, but it makes longer conversations more comfortable to read.++Unlike the sidebar, the AI will not be aware of the current note it's in.++### Templates++Chat notes can be set as <a class="reference-link" href="Advanced%20Usage/Templates.md">Templates</a> to make them easily reusable. The entire conversation history is kept, allowing a basic form of specialization for the LLM with the existing chat acting like a system prompt.++### Model selection++When a provider is configured in <a class="reference-link" href="Basic%20Concepts%20and%20Features/UI%20Elements/Options.md">Options</a>, the next step is to select the models that will be available for the chat.++The models are retrieved dynamically from the provider, only when the model selection list is visible. To alter the list of models, simply press the Edit button in the model selection box.++Pricing information is displayed for known models. The pricing information (price per million tokens) is embedded in the application (using a subset of LiteLLM's data) and is updated with new versions of Trilium. Local providers are considered free, whereas custom endpoint providers don't offer any pricing information.++## Features++### Web search++The AI can optionally search the web to find more information about a specific topic.++This feature is on by default but it can easily be disabled by clicking on the model selector at the bottom of the chat and unchecking _Web search_.++> [!NOTE]+> Currently only the search native to the LLM provider is supported. External search providers such as Exa, Tavily & SearXNG are not yet supported.++### Note access (tools)++Tools allow the agentic AI to understand and operate on notes directly within your Trilium instance.++This feature is on by default but it can easily be disabled by clicking on the model selector at the bottom of the chat and unchecking _Note access_.++Here are a few tools that Trilium provides for the LLM:++* At note level:+ * Search for notes+ * Get the metadata or content of a note.+ * Edit a note+ * There are multiple mechanism for the LLM to edit a note: completely by re-writing it, find/replace of a text sequence or append.+ * Whenever the AI makes a change, a [revision](Basic%20Concepts%20and%20Features/Notes/Note%20Revisions.md) is saved to be able to revert any unwanted changes.+ * Create a new note+ * Rename or delete a note.+* At attribute level:+ * Get the full list of attributes, or a specific attribute.+ * Set the value of an attribute.+ * Delete an attribute.+* At tree level:+ * Get the direct children of a note.+ * Get the entire subtree of a note.+ * Move or clone a note somewhere else.+* For <a class="reference-link" href="Basic%20Concepts%20and%20Features/Notes/Attachments.md">Attachments</a>:+ * Get metadata for an attachment.+ * Get the content of an attachment.+* Skills (see the dedicated section).++> [!WARNING]+> Currently there is **no permission management** implemented for note tools, meaning that the LLM could potentially remove existing notes or clutter the tree with notes. Generally most actions are easily reversible (deleting the notes, restoring deleted notes, reverting modifications to a note), but there are some that are harder to revert (e.g. setting an attribute because there is no attribute history).++> [!NOTE]+> Gemini has a special case in which _Note access_ and _Web search_ can't be both enabled at the same time.++### Attachments++Since Trilium v0.140.0, <a class="reference-link" href="Basic%20Concepts%20and%20Features/Notes/Attachments.md">Attachments</a> allow for multi-modal chat:++* Raster image (sent as vision input, except for SVGs) with the following supported formats: PNG, JPEG, GIF, WebP.+* PDFs, sent natively to the provider (supported by Anthropic, OpenAI and Google).+* SVG images (sent as raw HTML).+* Text files.++To upload an attachment:++* Press the dedicated _Attach_ button (paperclip icon) underneath the text box.+* Paste an image directly from clipboard using Ctrl+V.++Once one or more attachments are uploaded, they will appear directly above the text box:++* Images have a small thumbnail for easy identifications.+* Every attachment can be deleted by pressing their corresponding X button.++When an attachment is present, the LLM is instructed to consider the attachment with priority, even if it has access to the current note.++> [!NOTE]+> Currently Trilium doesn't pre-process the attachments (e.g. via <a class="reference-link" href="Advanced%20Usage/Text%20Extraction%20(OCR).md">Text Extraction (OCR)</a>) before sending them to the LLM provider.++### Mentions++Mentions are a way to insert references to notes other than the current note, using the same mechanism as <a class="reference-link" href="Note%20Types/Text/Links/Internal%20(reference)%20links.md">Internal (reference) links</a>. To refer to another note, simply type @ followed by the name of the note to reference.++This feature is mostly helpful when note tools are enabled, otherwise the LLM will have no way to access the given note.++### Skills++Skills in Trilium are specialized instruction sets that help the AI be more productive by understanding how Trilium.++These skills are not loaded by default to avoid an increased consumption of tokens, but the AI can load them on-demand if _Note tools_ are enabled.++The following skills are built-in:++* Search syntax: understands the full syntax of <a class="reference-link" href="Basic%20Concepts%20and%20Features/Navigation/Search.md">Search</a>.+* Backend scripting: to be able to write proper <a class="reference-link" href="Scripting/Backend%20scripts.md">Backend scripts</a>.+* Frontend scripting: to be able to write proper [front-end scripts](Scripting/Frontend%20Basics.md) (basic scripts, widgets, <a class="reference-link" href="Note%20Types/Render%20Note.md">Render Note</a>).++When _Note tools_ are enabled the skills will automatically be made available to the AI, so no user interaction is required.++> [!NOTE]+> Custom skills are currently not supported but they are planned.++### MCP++Trilium comes with a built-in MCP server which allows you to use an external agent such as Claude Code have access to your database. See the dedicated <a class="reference-link" href="AI/MCP.md">MCP</a> page for more details.++## History++### Removal in v0.102.0++Starting with version v0.102.0, AI/LLM integration has been removed from the Trilium Notes core.++While a significant amount of effort went into developing this feature, maintaining and supporting it long-term proved to be unsustainable.++When upgrading to v0.102.0, your Chat notes will be preserved, but instead of the dedicated chat window they will be turned to a normal <a class="reference-link" href="Note%20Types/Code.md">Code</a> note, revealing the underlying JSON of the conversation.++### Reintroduction in v0.103.0++Given the recent advancements of the AI scene, we decided to give the LLM integration another try. v0.103.0 introduces a completely new chat system.++One of the key changes that lead to the reimplementation is that now we are using a library ([Vercel AI](https://github.com/vercel/ai)) to manage the inner mechanism and the differences between LLM providers instead of having to implement it on our own.\ No newline at end of filediff --git a/docs/User Guide/User Guide/AI/MCP.md b/docs/User Guide/User Guide/AI/MCP.mdnew file mode 100644index 0000000000..ed48981f19--- /dev/null+++ b/docs/User Guide/User Guide/AI/MCP.md@@ -0,0 +1,29 @@+# MCP+[Model Context Protocol](https://en.wikipedia.org/wiki/Model_Context_Protocol) allows external chat applications such as Claude Code to have access to the Trilium database.++## Built-in MCP++v0.103.0 comes with a built-in MCP server that is not active by default. To activate it, go to <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Options.md">Options</a> → AI/LLM and toggle the _MCP server_ option.++Once the MCP is active, simply add the MCP server to your AI assistant. The URL to use is displayed in the _Endpoint_ _URL_ information underneath the MCP toggle.++Only the HTTP transport is supported, the `stdio` method is not supported. If that is a blocker, consider using a third-party alternative listed below.++The tools exposed to the MCP are the same tools that are supported by the internal chat (see the _Note access_ section).++### Authentication++To protect your notes from unauthorized access, the MCP server requires authentication. Generally MCP servers need to support OAuth for authentication, but Trilium uses a simpler mechanism using Bearer tokens.++To configure authentication, first create an <a class="reference-link" href="../Advanced%20Usage/ETAPI%20(REST%20API).md">ETAPI (REST API)</a> token by going to <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Options.md">Options</a> → _ETAPI_. Then follow the instructions in <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Options.md">Options</a> → _AI / LLM_, by looking at the _How to connect an assistant_ section under MCP.++## Third-party alternatives++The following are alternatives to Trilium's built-in MCP feature. Since Trilium's AI implementation is still experimental, its tooling might not be as mature as external tools.++* [perfectra1n/triliumnext-mcp](https://github.com/perfectra1n/triliumnext-mcp)+* [tan-yong-sheng/triliumnext-mcp](https://github.com/tan-yong-sheng/triliumnext-mcp)+* [eliassoares/trilium-fastmcp](https://github.com/eliassoares/trilium-fastmcp)++> [!IMPORTANT]+> These solutions are third-party and thus not endorsed or supported directly by the Trilium Notes team. Please address questions and issues on their corresponding repository instead.\ No newline at end of filediff --git a/docs/User Guide/User Guide/AI/Privacy.md b/docs/User Guide/User Guide/AI/Privacy.mdnew file mode 100644index 0000000000..0022c215e9--- /dev/null+++ b/docs/User Guide/User Guide/AI/Privacy.md@@ -0,0 +1,73 @@+# Privacy+Trilium sends nothing to an AI provider until you send a message. Enabling the integration, adding a provider or opening a chat transmits nothing on its own, the one exception is that listing a provider's models sends your API key to that provider, so the list can be fetched.++Once you send a message or run the <a class="reference-link" href="../Note%20Types/Text/In-editor%20AI%20assistant.md">In-editor AI assistant</a>, what leaves your machine depends on the provider you chose and on which context options are enabled.++## Where your notes go++| Provider type | Destination |+| --- | --- |+| Cloud providers | The provider's servers (Anthropic, OpenAI, Google, DeepSeek) |+| Subscription-based | The provider's servers, via Claude Code running locally |+| Local / self-hosted | Nothing leaves the machine running the model |+| Custom endpoint | Wherever it was pointed, which may be your own hardware or a hosted service |++This is the reason the provider list is grouped this way, and why Trilium pre-selects nothing: the choice of where your note content is sent is made explicitly by you, before anything is sent.++> [!NOTE]+> The <a class="reference-link" href="../Note%20Types/Text/In-editor%20AI%20assistant.md">In-editor AI assistant</a> has a model selection of its own, so it may be answered by a different provider than the one in the chat. The row at the bottom of the assistant's menu always names the one being used.++## What is actually sent++* **Always, with every message**+ * The conversation itself: your messages and the assistant's replies, including earlier turns+ * Trilium's system prompt describing how to format answers and use tools.+* **The current note, only when note context is enabled.**+ * In the sidebar chat this is the file icon at the bottom; the dedicated chat note type never sends a current note.+ * What travels is a metadata block: the note's ID, title, type, creation and modification dates, its parent IDs, the titles of up to 20 children, up to 20 attributes, and a preview of the content.+ * Notes above a size threshold send a size hint instead of the text, and the model must call a tool to read further.+* **Any note the model asks for, when note access is enabled.**+ * Tools let the model search your tree and read notes, attributes and attachments beyond the current one.+ * It decides what to fetch; there is no per-note permission system, so the reachable scope is your whole tree.+* **Attachments and mentions**, when you add them: images, PDFs and text files are sent to the provider, and an `@` mention makes that note fetchable.+* **Your search query**, when web search is enabled, the model's search terms reach the provider's own search infrastructure.++## The in-editor AI assistant++A run of the <a class="reference-link" href="../Note%20Types/Text/In-editor%20AI%20assistant.md">In-editor AI assistant</a> sends a different set than a chat message. For quick actions, it sends it the moment you pick an action, there is no send button to reconsider at. For the free-form _Ask AI_, there is a dedicated send button and model selector.++* **The passage you selected**, or the paragraph the cursor is in when you pick a quick action without selecting anything.+* **Up to 1500 characters of the note on each side of that passage**, as plain text. The assistant is told this is context only and must not be rewritten, but it is sent regardless of whether you selected it: a run on a single sentence still transmits the paragraphs around it.+* **Where the note sits**: its title and the titles of its parents, as a breadcrumb.+* **Trilium's writing-assistant instructions**, which describe the formatting it may produce.+* **Earlier turns of the same exchange**, once you follow up on a response.++No note metadata block is sent, web search is never enabled, and the assistant has no note tools so it can read nothing beyond the text listed above.++## Protected notes++While your [protected session](../Basic%20Concepts%20and%20Features/Notes/Protected%20Notes.md) is locked, protected notes send neither title nor content. **While it is unlocked they are treated like any other note,** a note the model reads through a tool is sent to the provider in full. If you keep sensitive material in protected notes, be aware that unlocking them removes that boundary for the duration of the session.++The same applies to the <a class="reference-link" href="../Note%20Types/Text/In-editor%20AI%20assistant.md">In-editor AI assistant</a>: it works on whatever is open in the editor, so running it inside an unlocked protected note sends that note's text like any other.++## What you control++* **Which provider**: the single decision that determines whether anything leaves your machine at all.+* **Note access**: turn tools off from the model selector at the bottom of the chat, and the model can read nothing beyond what you type.+* **The current note:** the file icon in the sidebar chat.+* **Web search:** also in the model selector.+* **The editor assistant**: it has no per-run toggles. What you control is whether you run it, what you select before you do and which model answers.++With note access and note context both off, the provider receives only the words you typed.++## Keeping everything local++Adding an Ollama or LM Studio provider keeps every message on the machine running the model, and Trilium marks their models as free because no metered API is involved. The trade-off is quality and hardware: a small local model may fail at tool calls that a cloud model handles, so a local setup that misbehaves is worth benchmarking against a cloud provider before reporting it as a bug.++## Telemetry & security++Trilium itself collects no telemetry from the AI integration.++Your API key is stored in your database, sent only to the provider it belongs to, and is write-only through the options API so that a malevolent <a class="reference-link" href="../Scripting.md">Scripting</a> cannot access it. If you have backend or SQL console access enabled, a malevolent script **could potentially exfiltrate your API keys**.++The built-in MCP server is off by default. When enabled, every request must carry an ETAPI token, which grants the same full read and write access to your notes as the REST API; treat one like a password. On desktop it is reachable only from `localhost` unless you turn on <a class="reference-link" href="../Installation%20%26%20Setup/Desktop%20Installation/Network%20Access.md">Network Access</a>.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Advanced Usage/1_Metrics_image.png b/docs/User Guide/User Guide/Advanced Usage/1_Metrics_image.pngnew file mode 100644index 0000000000..683789547dBinary files /dev/null and b/docs/User Guide/User Guide/Advanced Usage/1_Metrics_image.png differdiff --git a/docs/User Guide/User Guide/Advanced Usage/1_Note Map (Link map, Tree map)_image.png b/docs/User Guide/User Guide/Advanced Usage/1_Note Map (Link map, Tree map)_image.pngnew file mode 100644index 0000000000..6e43f0ae8bBinary files /dev/null and b/docs/User Guide/User Guide/Advanced Usage/1_Note Map (Link map, Tree map)_image.png differdiff --git a/docs/User Guide/User Guide/Advanced Usage/2_Metrics_image.png b/docs/User Guide/User Guide/Advanced Usage/2_Metrics_image.pngnew file mode 100644index 0000000000..08181d9862Binary files /dev/null and b/docs/User Guide/User Guide/Advanced Usage/2_Metrics_image.png differdiff --git a/docs/User Guide/User Guide/Advanced Usage/Advanced Showcases.md b/docs/User Guide/User Guide/Advanced Usage/Advanced Showcases.mdnew file mode 100644index 0000000000..36c14ff954--- /dev/null+++ b/docs/User Guide/User Guide/Advanced Usage/Advanced Showcases.md@@ -0,0 +1,9 @@+# Advanced Showcases+Trilium offers advanced functionality through [Scripts](../Scripting.md) and [Promoted Attributes](Attributes/Promoted%20Attributes.md). To illustrate these features, we've prepared several showcases available in the [demo notes](Database.md):++* [Relation Map](../Note%20Types/Relation%20Map.md)+* [Day Notes](Advanced%20Showcases/Day%20Notes.md)+* [Weight Tracker](Advanced%20Showcases/Weight%20Tracker.md)+* [Task Manager](Advanced%20Showcases/Task%20Manager.md)++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.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Advanced Usage/Advanced Showcases/1_Day Notes_image.png b/docs/User Guide/User Guide/Advanced Usage/Advanced Showcases/1_Day Notes_image.pngnew file mode 100644index 0000000000..9e03a2375dBinary files /dev/null and b/docs/User Guide/User Guide/Advanced Usage/Advanced Showcases/1_Day Notes_image.png differdiff --git a/docs/User Guide/User Guide/Advanced Usage/Advanced Showcases/Day Notes.md b/docs/User Guide/User Guide/Advanced Usage/Advanced Showcases/Day Notes.mdnew file mode 100644index 0000000000..798a857d2c--- /dev/null+++ b/docs/User Guide/User Guide/Advanced Usage/Advanced Showcases/Day Notes.md@@ -0,0 +1,110 @@+# Day Notes+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.++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.++Select an existing day note, and the menubar contains a calendar widget. Select any day to create a note for that day.++++This pattern works well also because of [Cloning Notes](../../Basic%20Concepts%20and%20Features/Notes/Cloning%20Notes.md) 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.++## Demo++++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 [Task manager](Task%20Manager.md)).++You can also notice how this day note has [promoted attribute](../Attributes/Promoted%20Attributes.md) "weight" where you can track your daily weight. This data is then used in [Weight tracker](Weight%20Tracker.md).++## Week Note and Quarter Note++Week and quarter notes are disabled by default, since it might be too much for some people. To enable them, you need to set `#enableWeekNote` and `#enableQuarterNote` attributes on the root calendar note, which is identified by `#calendarRoot` 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.++## Templates++Trilium provides [template](../Templates.md) functionality, and it could be used together with day notes.++You can define one of the following relations on the root of the journal (identified by `#calendarRoot` label):++* yearTemplate+* quarterTemplate (if `#enableQuarterNote` is set)+* monthTemplate+* weekTemplate (if `#enableWeekNote` is set)+* dateTemplate++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 `~template` relation to the newly created role. Using this, you can e.g. create your daily template with e.g. checkboxes for daily routine etc.++### Migrate from old template usage++If you have been using Journal prior to version v0.93.0, the previous template pattern likely used was `~child:template=`.+To transition to the new system:++1. Set up the new template pattern in the Calendar root note.+2. Use [Bulk Actions](../Bulk%20Actions.md) to remove `child:template` and `child:child:template` from all notes under the Journal (calendar root).+3. Ensure that all old template patterns are fully removed to prevent conflicts with the new setup.++## Naming pattern++You can customize the title of generated journal notes by defining a `#datePattern`, `#weekPattern`, `#monthPattern`, `#quarterPattern` and `#yearPattern` attribute on a root calendar note (identified by `#calendarRoot` label). The naming pattern replacements follow a level-up compatibility - each level can use replacements from itself and all levels above it. For example, `#monthPattern` can use month, quarter and year replacements, while `#weekPattern` can use week, month, quarter and year replacements. But it is not possible to use week replacements in `#monthPattern`.++### Date pattern++It's possible to customize the title of generated date notes by defining a `#datePattern` attribute on a root calendar note (identified by `#calendarRoot` label). Following are possible values:++* `{isoDate}` results in an ISO 8061 formatted date (e.g. "2025-03-09" for March 9, 2025)+* `{dateNumber}` results in a number like `9` for the 9th day of the month, `11` for the 11th day of the month+* `{dateNumberPadded}` results in a number like `09` for the 9th day of the month, `11` for the 11th day of the month+* `{ordinal}` is replaced with the ordinal date (e.g. 1st, 2nd, 3rd) etc.+* `{weekDay}` results in the full day name (e.g. `Monday`)+* `{weekDay3}` is replaced with the first 3 letters of the day, e.g. Mon, Tue, etc.+* `{weekDay2}` is replaced with the first 2 letters of the day, e.g. Mo, Tu, etc.++The default is `{dateNumberPadded} - {weekDay}`++### Week pattern++It is also possible to customize the title of generated week notes through the `#weekPattern` attribute on the root calendar note. The options are:++* `{weekNumber}` results in a number like `9` for the 9th week of the year, `11` for the 11th week of the year+* `{weekNumberPadded}` results in a number like `09` for the 9th week of the year, `11` for the 11th week of the year+* `{shortWeek}` results in a short week string like `W9` for the 9th week of the year, `W11` for the 11th week of the year+* `{shortWeek3}` results in a short week string like `W09` for the 9th week of the year, `W11` for the 11th week of the year++The default is `Week {weekNumber}`++### Month pattern++It is also possible to customize the title of generated month notes through the `#monthPattern` attribute on the root calendar note. The options are:++* `{isoMonth}` results in an ISO 8061 formatted month (e.g. "2025-03" for March 2025)+* `{monthNumber}` results in a number like `9` for September, and `11` for November+* `{monthNumberPadded}` results in a number like `09` for September, and `11` for November+* `{month}` results in the full month name (e.g. `September` or `October`)+* `{shortMonth3}` is replaced with the first 3 letters of the month, e.g. Jan, Feb, etc.+* `{shortMonth4}` is replaced with the first 4 letters of the month, e.g. Sept, Octo, etc.++The default is `{monthNumberPadded} - {month}`++### Quarter pattern++It is also possible to customize the title of generated quarter notes through the `#quarterPattern` attribute on the root calendar note. The options are:++* `{quarterNumber}` results in a number like `1` for the 1st quarter of the year+* `{shortQuarter}` results in a short quarter string like `Q1` for the 1st quarter of the year++The default is `Quarter {quarterNumber}`++### Year pattern++It is also possible to customize the title of generated year notes through the `#yearPattern` attribute on the root calendar note. The options are:++* `{year}` results in the full year (e.g. `2025`)++The default is `{year}`++## Implementation++Trilium has some special support for day notes in the form of [backend Script API](https://triliumnext.github.io/Notes/backend_api/BackendScriptApi.html) - see e.g. getDayNote() function.++Day (and year, month) notes are created with a label - e.g. `#dateNote="2025-03-09"` this can then be used by other scripts to add new notes to day note etc.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Advanced Usage/Advanced Showcases/Day Notes_image.png b/docs/User Guide/User Guide/Advanced Usage/Advanced Showcases/Day Notes_image.pngnew file mode 100644index 0000000000..fd89503ef0Binary files /dev/null and b/docs/User Guide/User Guide/Advanced Usage/Advanced Showcases/Day Notes_image.png differdiff --git a/docs/User Guide/User Guide/Advanced Usage/Advanced Showcases/Task Manager.md b/docs/User Guide/User Guide/Advanced Usage/Advanced Showcases/Task Manager.mdnew file mode 100644index 0000000000..e67054e8c1--- /dev/null+++ b/docs/User Guide/User Guide/Advanced Usage/Advanced Showcases/Task Manager.md@@ -0,0 +1,63 @@+# Task Manager+Task Manager is a [promoted attributes](../Attributes/Promoted%20Attributes.md) and [scripts](../../Scripting.md)showcase present in the [demo notes](../Database.md).++## Demo++++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.++Task Manager also integrates with [day notes](Day%20Notes.md) - notes are [cloned](../../Basic%20Concepts%20and%20Features/Notes/Cloning%20Notes.md) into day note to both todoDate note and doneDate note (with [prefix](../../Basic%20Concepts%20and%20Features/Navigation/Tree%20Concepts.md) of either "TODO" or "DONE").++## Implementation++New tasks are created in the TODO note which has `~child:template` [relation](../Attributes.md)(see [attribute inheritance](../Attributes/Attribute%20Inheritance.md)) pointing to the task template.++### Attributes++Task template defines several [promoted attributes](../Attributes/Promoted%20Attributes.md) - todoDate, doneDate, tags, location. Importantly it also defines `~runOnAttributeChange` relation - [event](../../Scripting/Backend%20scripts/Backend%20Events.md) handler which is run on attribute change. This [script](../../Scripting.md) 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.++### New task button++There's also "button" note which contains simple script which adds a button to create new note (task) in the TODO note.++```+api.addButtonToToolbar({+ title: 'New task',+ icon: 'check',+ shortcut: 'alt+n',+ action: async () => {+ // creating notes is backend (server) responsibility so we need to pass+ // the control there+ const taskNoteId = await api.runOnBackend(async () => {+ 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);+ }+});+```++### CSS++In the demo screenshot above you may notice that TODO tasks are in red color and DONE tasks are green.++This is done by having this CSS [code note](../../Note%20Types/Code.md) which defines extra CSS classes:++```+span.fancytree-node.todo .fancytree-title {+ color: red !important;+}++span.fancytree-node.done .fancytree-title {+ color: green !important;+}+```++This [code note](../../Note%20Types/Code.md) has `#appCss` [label](../Attributes.md)which is recognized by Trilium on startup and loaded as CSS into the application.++Second part of this functionality is based in event handler described above which assigns `#cssClass` label to the task to either "done" or "todo" based on the task status.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Advanced Usage/Advanced Showcases/Task Manager_task-manager.png b/docs/User Guide/User Guide/Advanced Usage/Advanced Showcases/Task Manager_task-manager.pngnew file mode 100644index 0000000000..f2c5c9f8c8Binary files /dev/null and b/docs/User Guide/User Guide/Advanced Usage/Advanced Showcases/Task Manager_task-manager.png differdiff --git a/docs/User Guide/User Guide/Advanced Usage/Advanced Showcases/Weight Tracker.md b/docs/User Guide/User Guide/Advanced Usage/Advanced Showcases/Weight Tracker.mdnew file mode 100644index 0000000000..5b9198ec28--- /dev/null+++ b/docs/User Guide/User Guide/Advanced Usage/Advanced Showcases/Weight Tracker.md@@ -0,0 +1,70 @@+# Weight Tracker+++The `Weight Tracker` is a [Script API](../../Scripting/Script%20API.md) showcase present in the [demo notes](../Database.md).++By adding `weight` as a [promoted attribute](../Attributes/Promoted%20Attributes.md) in the [template](../Templates.md) from which [day notes](Day%20Notes.md) are created, you can aggregate the data and plot weight change over time.++## Implementation++The `Weight Tracker` note in the screenshot above is of the type `Render Note`. That type of note doesn't have any useful content itself. Instead it is a placeholder where a [script](../../Scripting.md) can render its output.++Scripts for `Render Notes` are defined in a [relation](../Attributes.md) called `~renderNote`. In this example, it's the `Weight Tracker`'s child `Implementation`. The Implementation consists of two [code notes](../../Note%20Types/Code.md) that contain some HTML and JavaScript respectively, which load all the notes with a `weight` attribute and display their values in a chart.++To actually render the chart, we're using a third party library called [chart.js](https://www.chartjs.org/)which is imported as an attachment, since it's not built into Trilium.++### Code++Here's the content of the script which is placed in a [code note](../../Note%20Types/Code.md) of type `JS Frontend`:++```+async function getChartData() {+ const days = await api.runOnBackend(async () => {+ 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 && weight) {+ days.push({ date, weight });+ }+ }++ days.sort((a, b) => a.date > b.date ? 1 : -1);++ return days;+ });++ const datasets = [+ {+ label: "Weight (kg)",+ backgroundColor: 'red',+ borderColor: 'red',+ data: days.map(day => day.weight),+ fill: false,+ spanGaps: true,+ datalabels: {+ display: false+ }+ }+ ];++ return {+ datasets: datasets,+ labels: days.map(day => day.date)+ };+}++const ctx = $("#canvas")[0].getContext("2d");++new chartjs.Chart(ctx, {+ type: 'line',+ data: await getChartData()+});+```++## How to remove the Weight Tracker button from the top bar++In the link map of the `Weight Tracker`, there is a note called `Button`. Open it and delete or comment out its contents. The `Weight Tracker` button will disappear after you restart Trilium.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Advanced Usage/Advanced Showcases/Weight Tracker_image.png b/docs/User Guide/User Guide/Advanced Usage/Advanced Showcases/Weight Tracker_image.pngnew file mode 100644index 0000000000..0167e759baBinary files /dev/null and b/docs/User Guide/User Guide/Advanced Usage/Advanced Showcases/Weight Tracker_image.png differdiff --git a/docs/User Guide/User Guide/Advanced Usage/Attributes.md b/docs/User Guide/User Guide/Advanced Usage/Attributes.mdnew file mode 100644index 0000000000..22ca0c33f9--- /dev/null+++ b/docs/User Guide/User Guide/Advanced Usage/Attributes.md@@ -0,0 +1,42 @@+# Attributes+<figure class="image"><img style="aspect-ratio:1071/146;" src="Attributes_image.png" width="1071" height="146"></figure>++In Trilium, attributes are key-value pairs assigned to notes, providing additional metadata or functionality. There are two primary types of attributes:++1. <a class="reference-link" href="Attributes/Labels.md">Labels</a> can be used for a variety of purposes, such as storing metadata or configuring the behavior of notes. Labels are also searchable, enhancing note retrieval.++ For more information, including predefined labels, see <a class="reference-link" href="Attributes/Labels.md">Labels</a>.+2. <a class="reference-link" href="Attributes/Relations.md">Relations</a> define connections between notes, similar to links. These can be used for metadata and scripting purposes.++ For more information, including a list of predefined relations, see <a class="reference-link" href="Attributes/Relations.md">Relations</a>.++These attributes play a crucial role in organizing, categorizing, and enhancing the functionality of notes.++## Types of attributes++Conceptually there are two types of attributes (applying to both labels and relations):++1. **System attributes**+ As the name suggest, these attributes have a special meaning since they are interpreted by Trilium. For example the `color` attribute will change the color of the note as displayed in the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.md">Note Tree</a> and links, and `iconClass` will change the icon of a note.+2. **User-defined attributes**+ These are free-form labels or relations that can be used by the user. They can be used purely for categorization purposes (especially if combined with <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Navigation/Search.md">Search</a>), or they can be given meaning through the use of <a class="reference-link" href="../Scripting.md">Scripting</a>.++In practice, Trilium makes no direct distinction of whether an attribute is a system one or a user-defined one. A label or relation is considered a system attribute if it matches one of the built-in names (e.g. like the aforementioned `iconClass`). Keep this in mind when creating <a class="reference-link" href="Attributes/Promoted%20Attributes.md">Promoted Attributes</a> in order not to accidentally alter a system attribute (unless intended).++## Viewing the list of attributes++Both the labels and relations for the current note are displayed in the _Owned Attributes_ section of the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Ribbon.md">Ribbon</a>, where they can be viewed and edited. Inherited attributes are displayed in the _Inherited Attributes_ section of the ribbon, where they can only be viewed.++In the list of attributes, labels are prefixed with the `#` character whereas relations are prefixed with the `~` character.++## Attribute Definitions and Promoted Attributes++<a class="reference-link" href="Attributes/Promoted%20Attributes.md">Promoted Attributes</a> create a form-like editing experience for attributes, which makes it easy to enhancing the organization and management of attributes++## Multiplicity++Attributes in Trilium can be "multi-valued", meaning multiple attributes with the same name can co-exist. This can be combined with <a class="reference-link" href="Attributes/Promoted%20Attributes.md">Promoted Attributes</a> to easily add them.++## Attribute Inheritance++Trilium supports attribute inheritance, allowing child notes to inherit attributes from their parents. For more information, see <a class="reference-link" href="Attributes/Attribute%20Inheritance.md">Attribute Inheritance</a>.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Advanced Usage/Attributes/1_Promoted Attributes_image.png b/docs/User Guide/User Guide/Advanced Usage/Attributes/1_Promoted Attributes_image.pngnew file mode 100644index 0000000000..c7510ca73bBinary files /dev/null and b/docs/User Guide/User Guide/Advanced Usage/Attributes/1_Promoted Attributes_image.png differdiff --git a/docs/User Guide/User Guide/Advanced Usage/Attributes/2_Promoted Attributes_image.png b/docs/User Guide/User Guide/Advanced Usage/Attributes/2_Promoted Attributes_image.pngnew file mode 100644index 0000000000..73d6b7e168Binary files /dev/null and b/docs/User Guide/User Guide/Advanced Usage/Attributes/2_Promoted Attributes_image.png differdiff --git a/docs/User Guide/User Guide/Advanced Usage/Attributes/3_Promoted Attributes_image.png b/docs/User Guide/User Guide/Advanced Usage/Attributes/3_Promoted Attributes_image.pngnew file mode 100644index 0000000000..f71526395dBinary files /dev/null and b/docs/User Guide/User Guide/Advanced Usage/Attributes/3_Promoted Attributes_image.png differdiff --git a/docs/User Guide/User Guide/Advanced Usage/Attributes/Attribute Inheritance.md b/docs/User Guide/User Guide/Advanced Usage/Attributes/Attribute Inheritance.mdnew file mode 100644index 0000000000..005e9d1c16--- /dev/null+++ b/docs/User Guide/User Guide/Advanced Usage/Attributes/Attribute Inheritance.md@@ -0,0 +1,38 @@+# Attribute Inheritance+Inheritance refers to the process of having a [label](Labels.md) or a [relation](Relations.md) shared across multiple notes, generally in parent-child relations (or anywhere if using templates).++## Standard Inheritance++In Trilium, attributes can be automatically inherited by child notes if they have the `isInheritable` flag set to `true`. This means the attribute (a key-value pair) is applied to the note and all its descendants.++To make an attribute inheritable, simply use the visual editor for <a class="reference-link" href="Labels.md">Labels</a> or <a class="reference-link" href="Relations.md">Relations</a>. Alternatively, the attribute can be manually defined where `#myLabel=value` becomes `#myLabel(inheritable)=value` when inheritable.++As an example, the `archived` 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.++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 _copying inheritance_ or _template inheritance_ needs to be used instead.++## Copying Inheritance++Copying inheritance differs from standard inheritance by using a `child:` 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.++If a parent note has the label `#child:exampleAttribute`, all newly created child notes (one level deep) will inherit the `#exampleAttribute` label. This can be useful for setting default properties for notes in a specific section.++Similarly, for relations use `~child:myRelation`.++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.++### Chained inheritance++It is possible to define labels across multiple levels of depth. For example, `#child:child:child:foo` applied to a root note would create:++* `#child:child:foo` on the first-level children.+* `#child:foo` on the second-level children.+* `#foo` on the third-level children.++Similarly, use `~child:child:child:foo` if dealing with relations.++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.++## Template Inheritance++Attributes can also be inherited from <a class="reference-link" href="../Templates.md">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.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Advanced Usage/Attributes/Labels.md b/docs/User Guide/User Guide/Advanced Usage/Attributes/Labels.mdnew file mode 100644index 0000000000..84e28ecc8f--- /dev/null+++ b/docs/User Guide/User Guide/Advanced Usage/Attributes/Labels.md@@ -0,0 +1,103 @@+# Labels+A label is an [attribute](../Attributes.md) of a note which has a name and optionally a value.++## Common use cases++* **Metadata for personal use**: Assign labels with optional values for categorization, such as `#year=1999`, `#genre="sci-fi"`, or `#author="Neal Stephenson"`. This can be combined with <a class="reference-link" href="Promoted%20Attributes.md">Promoted Attributes</a> to make their display more user-friendly.+* **Configuration**: Labels can configure advanced features or settings (see reference below).+* **Scripts and Plugins**: Used to tag notes with special metadata, such as the "weight" attribute in the <a class="reference-link" href="../Advanced%20Showcases/Weight%20Tracker.md">Weight Tracker</a>.++## Creating a label using the visual editor++1. Go to the _Owned Attributes_ section in the <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Ribbon.md">Ribbon</a>.+2. Press the + button (_Add new attribute_) to the right.+3. Select _Add new label_ for the relation.++> [!TIP]+> If you prefer keyboard shortcuts, press Alt+L while focused on a note or in the _Owned Attributes_ section to display the visual editor.++While in the visual editor:++* Set the desired name+* Optionally, set the value of the label. Labels can exist without a value.+* Check _Inheritable_ if the label should be inherited by the child notes as well. See <a class="reference-link" href="Attribute%20Inheritance.md">Attribute Inheritance</a> for more information.++## Creating a label manually++In the _Owned Attributes_ section in the <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Ribbon.md">Ribbon</a>:++* To create a label called `myLabel` with no value, simply type `#myLabel`.+* To create a label called `myLabel` with a value `value`, simply type `#myLabel=value`.+* If the value contains spaces, then the text must be quoted: `#myLabel="Hello world"`.+* If the string contains quotes (regardless of whether it has spaces), then the text must be quoted with apostrophes instead: `#myLabel='Hello "world"'`.+* To create an inheritable label called `myLabel`, simply write `#myLabel(inheritable)` for no value or `#myLabel(inheritable)=value` if there is a value.++## Predefined labels++This is a list of labels that Trilium natively supports.++> [!TIP]+> Some labels presented here end with a `*`. 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.++| Label | Description |+| --- | --- |+| `disableVersioning` | Disables automatic creation of <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/Notes/Note%20Revisions.md">Note Revisions</a> for a particular note. Useful for e.g. large, but unimportant notes - e.g. large JS libraries used for scripting. |+| `versioningLimit` | Limits the maximum number of <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/Notes/Note%20Revisions.md">Note Revisions</a> for a particular note, overriding the global settings. |+| `calendarRoot` | Marks the note which should be used as root for <a class="reference-link" href="../Advanced%20Showcases/Day%20Notes.md">Day Notes</a>. Only one should be marked as such. |+| `archived` | Hides notes from default search results and dialogs. Archived notes can optionally be hidden in the <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.md">Note Tree</a>. |+| `excludeFromExport` | Excludes this note and its children when exporting. |+| `run`, `runOnInstance`, `runAtHour` | See <a class="reference-link" href="../../Scripting/Backend%20scripts/Backend%20Events.md">Backend Events</a>. |+| `disableInclusion` | Scripts with this label won't be included into parent script execution. |+| `sorted`, `sortDirection`, `sortFoldersFirst`, `sortNatural`, `sortLocale`, `top`, `bottom` | Manages automatic/permanent sorting. See <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/Notes/Sorting%20Notes.md">Sorting Notes</a>. |+| `hidePromotedAttributes` | Hide <a class="reference-link" href="Promoted%20Attributes.md">Promoted Attributes</a> on this note. Generally useful when defining inherited attributes, but the parent note doesn't need them. |+| `readOnly` | Marks a note to always be [read-only](../../Basic%20Concepts%20and%20Features/Notes/Read-Only%20Notes.md), if it's a supported note (text, code, mermaid). |+| `autoReadOnlyDisabled` | Disables automatic [read-only mode](../../Basic%20Concepts%20and%20Features/Notes/Read-Only%20Notes.md) for the given note. |+| `appCss` | Marks CSS notes which are loaded into the Trilium application and can thus be used to modify Trilium's looks. See <a class="reference-link" href="../../Theme%20development/Custom%20app-wide%20CSS.md">Custom app-wide CSS</a> for more info. |+| `appTheme` | Marks CSS notes which are full Trilium themes and are thus available in Trilium options. See <a class="reference-link" href="../../Theme%20development">Theme development</a> for more information. |+| `appThemeBase` | Set to `next`, `next-light`, or `next-dark` to use the corresponding TriliumNext theme (auto, light or dark) as the base for a custom theme, instead of the legacy one. See <a class="reference-link" href="../../Theme%20development/Customize%20the%20Next%20theme.md">Customize the Next theme</a> for more information. |+| `customFont` | Marks a font as selectable in the Options → Appearance font selection. See <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/Themes/Personalizing%20the%20font.md">Personalizing the font</a>. |+| `cssClass` | Value of this label is then added as CSS class to the node representing given note in the <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.md">Note Tree</a>. This can be useful for advanced theming. Can be used in template notes. |+| `iconClass` | 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. |+| `pageSize` | Specifies the number of items per page in <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/Notes/Note%20List.md">Note List</a>. |+| `customRequestHandler` | See <a class="reference-link" href="../Custom%20Request%20Handler.md">Custom Request Handler</a>. |+| `customResourceProvider` | See <a class="reference-link" href="../Custom%20Resource%20Providers.md">Custom Resource Providers</a>. |+| `widget` | Marks this note as a custom widget which will be added to the Trilium component tree. See <a class="reference-link" href="../../Scripting/Frontend%20Basics/Custom%20Widgets.md">Custom Widgets</a> for more information. |+| `searchHome` | New search notes will be created as children of this note (see <a class="reference-link" href="../../Note%20Types/Saved%20Search.md">Saved Search</a>). |+| `workspace` and related attributes | See <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/Navigation/Workspaces.md">Workspaces</a>. |+| `inbox` | Default inbox location for new notes. See <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/Notes/Note%20Inbox.md">Note Inbox</a> for more information. |+| `sqlConsoleHome` | Default location of <a class="reference-link" href="../Database/Manually%20altering%20the%20database/SQL%20Console.md">SQL Console</a> saved queries. |+| `bookmarked` | Indicates this note is a [bookmark](../../Basic%20Concepts%20and%20Features/Navigation/Bookmarks.md). |+| `bookmarkFolder` | Note with this label will appear in bookmarks as folder (allowing access to its children). See <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/Navigation/Bookmarks.md">Bookmarks</a> for more information. |+| `share*` | See the attribute reference in <a class="reference-link" href="../Sharing.md">Sharing</a>. |+| `displayRelations`, `hideRelations` | Comma delimited names of relations which should be displayed/hidden in a <a class="reference-link" href="../../Note%20Types/Relation%20Map.md">Relation Map</a> (both the note type and the <a class="reference-link" href="../Note%20Map%20(Link%20map%2C%20Tree%20map).md">Note Map (Link map, Tree map)</a> general functionality). |+| `titleTemplate` | 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 `now` and `parentNote` variables. <br> <br>See <a class="reference-link" href="../Default%20Note%20Title.md">Default Note Title</a> for more info. |+| `template` | This note will appear in the selection of available template when creating new note. See <a class="reference-link" href="../Templates.md">Templates</a> for more information. |+| `toc` | Controls the display of the <a class="reference-link" href="../../Note%20Types/Text/Table%20of%20contents.md">Table of contents</a> for a given note. `#toc` or `#toc=show` to always display the table of contents, `#toc=false` to always hide it. |+| `color` | defines color of the note in note tree, links etc. Use any valid CSS color value like 'red' or #a13d5f <br>Note: this color may be automatically adjusted when displayed to ensure sufficient contrast with the background. |+| `keyboardShortcut` | Defines a keyboard shortcut which will immediately jump to this note. Example: 'ctrl+alt+e'. Requires frontend reload for the change to take effect. |+| `keepCurrentHoisting` | Opening this link won't change hoisting even if the note is not displayable in the current hoisted subtree. |+| `executeButton` | Title of the button which will execute the current code note |+| `executeDescription` | Longer description of the current code note displayed together with the execute button |+| `excludeFromNoteMap` | Notes with this label will be hidden from the <a class="reference-link" href="../../Note%20Types/Note%20Map.md">Note Map</a>. |+| `newNotesOnTop` | New notes will be created at the top of the parent note, not on the bottom. |+| `hideHighlightWidget` | Hides the <a class="reference-link" href="../../Note%20Types/Text/Highlights%20list.md">Highlights list</a> widget |+| `hideChildrenOverview` | Hides the <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/Notes/Note%20List.md">Note List</a> for that particular note. |+| `subtreeHidden` | Hides all child notes of this note from the tree, displaying a badge with the count of hidden children. Children remain accessible via search or direct links. |+| `printLandscape` | When exporting to PDF, changes the orientation of the page to landscape instead of portrait. |+| `printPageSize` | When exporting to PDF, changes the size of the page. Supported values: `A0`, `A1`, `A2`, `A3`, `A4`, `A5`, `A6`, `Legal`, `Letter`, `Tabloid`, `Ledger`. |+| `printScale`, `printMargins` | Additional printing options, generally configured through the <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/Notes/Printing%20%26%20Exporting%20as%20PDF.md">Printing & Exporting as PDF</a> dialog. |+| `geolocation` | Indicates the latitude and longitude of a note, to be displayed in a <a class="reference-link" href="../../Collections/Geo%20Map.md">Geo Map</a>. |+| `geoShape` | Indicates the coordinates for the points of a [shapec](../../Collections/Geo%20Map/Drawing%20shapes.md) drawn on the <a class="reference-link" href="../../Collections/Geo%20Map.md">Geo Map</a> (e.g. area, rectangle, circle). |+| `map:*` | Defines specific options for the <a class="reference-link" href="../../Collections/Geo%20Map.md">Geo Map</a>. |+| `calendar:*` | Defines specific options for the <a class="reference-link" href="../../Collections/Calendar.md">Calendar</a>. |+| `viewType` | Sets the view of child notes (e.g. grid or list). See <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/Notes/Note%20List.md">Note List</a> for more information. |+| `webViewSrc` | Defines the URL of the <a class="reference-link" href="../../Note%20Types/Web%20View.md">Web View</a>. |+| `tabWidth`, `indentWithTabs`, `wrapLines` | Per-note Code editor settings: indentation width, indent with tabs vs. spaces, and word wrapping. See <a class="reference-link" href="../../Note%20Types/Code.md">Code</a>. |+| `datePattern`, `weekPattern`, `monthPattern`, `quarterPattern`, `yearPattern` | Customizes the title naming pattern of day / week / month / quarter / year notes. See <a class="reference-link" href="../Advanced%20Showcases/Day%20Notes.md">Day Notes</a>. |+| `enableWeekNote`, `enableQuarterNote` | Enables optional week and quarter notes in the calendar hierarchy; set on the calendar root. See <a class="reference-link" href="../Advanced%20Showcases/Day%20Notes.md">Day Notes</a>. |+| `fullContentWidth` | Expands the note to the full editor width, ignoring the configured content width (useful for wide tables). See <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Content%20width.md">Content width</a>. |+| `iconPack` | Identifies a custom icon pack by its prefix. See <a class="reference-link" href="../../Theme%20development/Creating%20an%20icon%20pack.md">Creating an icon pack</a>. |+| `clipperInbox` | Overrides the default location where the Web Clipper saves clippings (defaults to the day note). See <a class="reference-link" href="../../Installation%20%26%20Setup/Web%20Clipper.md">Web Clipper</a>. |+| `similarNotesWidgetDisabled` | Disables the <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/Navigation/Similar%20Notes.md">Similar Notes</a> ribbon tab (old layout only) |+| `docName` , `docUrl` | Used internally for the in-app help. |+| `aiQuickAction` | Defines a custom prompt to be used for the <a class="reference-link" href="../../Note%20Types/Text/In-editor%20AI%20assistant.md">In-editor AI assistant</a>'s quick actions. |\ No newline at end of filediff --git a/docs/User Guide/User Guide/Advanced Usage/Attributes/Promoted Attributes.md b/docs/User Guide/User Guide/Advanced Usage/Attributes/Promoted Attributes.mdnew file mode 100644index 0000000000..6e3d9d1bb0--- /dev/null+++ b/docs/User Guide/User Guide/Advanced Usage/Attributes/Promoted Attributes.md@@ -0,0 +1,106 @@+# Promoted Attributes+<figure class="image image_resized" style="width:61.4%;"><img style="aspect-ratio:938/368;" src="Promoted Attributes_image.png" width="938" height="368"></figure>++Promoted attributes are [attributes](../Attributes.md) which are displayed prominently in the UI which allow them to be easily viewed and edited.++One way of seeing promoted attributes is as a kind of form with several fields. Each field is just regular attribute, the only difference is that they appear on the note itself.++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.++## Attribute definition++<figure class="image image-style-align-right image_resized" style="width:50%;"><img style="aspect-ratio:885/742;" src="2_Promoted Attributes_image.png" width="885" height="742"></figure>++In order to have promoted attributes, there needs to be a way to define them.++Technically, attributes are only name-value pairs where both name and value are strings.++The _Attribute definition_ specifies how should this value be interpreted:++* Is it just string, or is it a date?+* Should we allow multiple values or note?+* Should we _promote_ the attribute or not?++## Types of attributes++Attribute definitions have a dedicated type field which will change how the value will be edited in the promoted attributes section.++The following types are supported:++* _Text_, the default option which allows any type of text to be edited, similar to normal labels that don't have a type associated.+* _Multi-line text_, similar to a normal text field, but rendered in a bigger text box that also supports writing on multiple lines.+* _Number_, will display as a number input field with up/down arrows.+ * Optionally a _precision_ which sets how many decimals the value steps by and is displayed with.+* _Boolean_, which renders as a checkbox for a true/false value.+* _Select,_ which provides a list of user-defined options when editing.+ * The list is not fixed, meaning that new options can be easily added from the promoted attribute.+ * Renaming an option does not change the existing values since the value is stored as text. Consider a [bulk rename](../Bulk%20Actions.md).+ * The items do not have a custom color or icon. This is intentional as selects are meant to be light-weight. For a more customizable option, consider using <a class="reference-link" href="Relations.md">Relations</a> instead which use notes as items and those notes can be colorized and also carry an icon.+* _Date,_ which provides a date picker.+* _Date & Time,_ which provides a date & time picker.+* _Time,_ which provides a time picker.+* _URL,_ which provides a button to open the web address in a new window.+* _Email_, which provides a button to quickly send an email to that address using your operating system's default app.+* _Phone_, which provides a button to quickly call that number using your operating system's default app.+* _Color_, which provides a color picker and a way to remove the value.+* _Relation_, which points to another note and uses <a class="reference-link" href="Relations.md">Relations</a> instead of <a class="reference-link" href="Labels.md">Labels</a>.++> [!NOTE]+> For label-based attributes, these types are not enforced by the attribute system, meaning that changing the type afterwards does not guarantee that the values in it correspond to the type (e.g. turning a text into a number).++## Creating a new promoted attribute definition++To create a new promoted attribute:++1. Go to a note.+2. Go to _Owned Attributes_ in the <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Ribbon.md">Ribbon</a>.+3. Press the + button.+4. Select either _Add new label definition_ or _Add new relation definition_.+5. Select the name which will be name of the label or relation that will be created when the promoted attribute is edited.+6. Ensure _Promoted_ is checked in order to display it at the top of notes.+7. Optionally, choose an _Alias_ which will be displayed next to the promoted attribute instead of the attribute name. Generally it's best to choose a “user-friendly” name since it can contain spaces and other characters which are not supported as attribute names.+8. Check _Inheritable_ to apply it to this note and all its descendants. To keep it only for the current note, un-check it.+9. Press “Save & Close” to apply the changes.++## How attribute definitions actually work++When a new promoted attribute definition is created, it creates a corresponding label prefixed with either `label` or `relation`, depending on the definition type:++```+#label:myColor(inheritable)="promoted,alias=Color,multi,color"+```++The only purpose of the attribute definition is to set up a template. If the attribute was marked as promoted, then it's also displayed to the user for easy editing.++| | |+| --- | --- |+| <figure class="image"><img style="aspect-ratio:495/157;" src="1_Promoted Attributes_image.png" width="495" height="157"></figure> | Notice how the promoted attribute definition only creates a “Due date” box above the text content. |+| <figure class="image"><img style="aspect-ratio:663/160;" src="3_Promoted Attributes_image.png" width="663" height="160"></figure> | Once a value is set by the user, a new label (or relation, depending on the type) is created. The name of the attribute matches one set when creating the promoted attribute. |++So there's one attribute for value and one for definition. But notice how an definition attribute can be made [Inheritable](Attribute%20Inheritance.md), meaning that it's also applied to all descendant notes. In this case, the definition used for the whole sub-tree while "value" attributes are for each not individually.++## Using system attributes++It's possible to create promoted attributes out of system attributes, to be able to easily alter them.++Here are a few practical examples:++* <a class="reference-link" href="../../Collections.md">Collections</a> already make use of this practice, for example:+ * Calendars add “Start Date”, “End Date”, “Start Time” and “End Time” as promoted attributes. These map to system attributes such as `startDate` which are then interpreted by the calendar view.+ * <a class="reference-link" href="../../Collections/Presentation.md">Presentation</a> adds a “Background” promoted attribute for each of the slide to easily be able to customize.+* The Trilium documentation (which is edited in Trilium) uses a promoted attribute to be able to easily edit the `#shareAlias` (see <a class="reference-link" href="../Sharing.md">Sharing</a>) in order to form clean URLs.+* If you always edit a particular system attribute such as `#color`, simply create a promoted attribute for it to make it easier.++### Inverse relation++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 `isPartnerOf`. 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.++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 `isParentOf` and the other one going from child to parent might be called `isChildOf`.++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 `isParentOf` which defines `isChildOf` as inverse relation and then second relation definition for `isChildOf` which defines `isParentOf` as inverse relation.++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.++## See also++* The <a class="reference-link" href="../../Collections/Table.md">Table</a> collection makes heavy use of promoted attributes to define the columns of the table, since they already carry the type information. When made inheritable, it's also easy to change those fields when the child notes are opened.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Advanced Usage/Attributes/Promoted Attributes_image.png b/docs/User Guide/User Guide/Advanced Usage/Attributes/Promoted Attributes_image.pngnew file mode 100644index 0000000000..148f98b8afBinary files /dev/null and b/docs/User Guide/User Guide/Advanced Usage/Attributes/Promoted Attributes_image.png differdiff --git a/docs/User Guide/User Guide/Advanced Usage/Attributes/Relations.md b/docs/User Guide/User Guide/Advanced Usage/Attributes/Relations.mdnew file mode 100644index 0000000000..80fa841a92--- /dev/null+++ b/docs/User Guide/User Guide/Advanced Usage/Attributes/Relations.md@@ -0,0 +1,53 @@+# Relations+A relation is similar to a [label](Labels.md), but instead of having a text value it refers to another note.++## Common use cases++* **Metadata Relationships for personal use**: For example, linking a book note to an author note.+ This can be combined with <a class="reference-link" href="Promoted%20Attributes.md">Promoted Attributes</a> to make their display more user-friendly.+* **Configuration**: For configuring some notes such as <a class="reference-link" href="../../Note%20Types/Render%20Note.md">Render Note</a>, or configuring <a class="reference-link" href="../Sharing.md">Sharing</a> or <a class="reference-link" href="../Templates.md">Templates</a> (see the list below).+* **Scripting**: Attaching scripts to events or conditions related to the note.++## Creating a relation using the visual editor++1. Go to the _Owned Attributes_ section in the <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Ribbon.md">Ribbon</a>.+2. Press the + button (_Add new attribute_) to the right.+3. Select _Add new relation_ for the relation.++> [!TIP]+> If you prefer keyboard shortcuts, press <kbd>Alt</kbd>+<kbd>L</kbd> while focused on a note or in the _Owned Attributes_ section to display the visual editor.++While in the visual editor:++* Set the desired name+* Set the Target note (the note to point to). Unlike labels, relations cannot exist with a target note.+* Check _Inheritable_ if the label should be inherited by the child notes as well. See <a class="reference-link" href="Attribute%20Inheritance.md">Attribute Inheritance</a> for more information.++## Creating a relation manually++In the _Owned Attributes_ section in the <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Ribbon.md">Ribbon</a>:++* To create a relation called `myRelation`:+ * First type `~myRelation=@` .+ * After this, an autocompletion box should appear.+ * Type the title of the note to point to and press <kbd>Enter</kbd> to confirm (or click the desired note).+ * Alternatively copy a note from the <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.md">Note Tree</a> and paste it after the `=` sign (without the `@` , in this case).+* To create an inheritable relation, follow the same steps as previously described but instead of `~myRelation` write `~myRelation(inheritable)`.++## Predefined relations++These relations are supported and used internally by Trilium.++| Label | Description |+| --- | --- |+| `runOn*` | See <a class="reference-link" href="../../Scripting/Backend%20scripts/Backend%20Events.md">Events</a> |+| `template` | 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. |+| `template:newNoteDefaultParent` | set on a template note, points to the note under which notes created from the template are placed when no other location is picked; when set several times, the note is cloned into every target. See <a class="reference-link" href="../Templates.md">Templates</a>. |+| `inherit` | note's attributes will be inherited even without a parent-child relationship. See <a class="reference-link" href="../Templates.md">Templates</a> for a similar concept. See <a class="reference-link" href="Attribute%20Inheritance.md">Attribute Inheritance</a> in the documentation. |+| `renderNote` | notes of type <a class="reference-link" href="../../Note%20Types/Render%20Note.md">Render Note</a> 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 |+| `widget` | Used in the context of custom <a class="reference-link" href="../../Scripting/Frontend%20Basics/Launch%20Bar%20Widgets.md">Launch Bar Widgets</a>, to refer to the widget that will be rendered. |+| `shareCss` | CSS note which will be injected into the share page. CSS note must be in the shared sub-tree as well. Consider using `shareHiddenFromTree` and `shareOmitDefaultCss` as well. |+| `shareJs` | JavaScript note which will be injected into the share page. JS note must be in the shared sub-tree as well. Consider using `shareHiddenFromTree`. |+| `shareHtml` | HTML note which will be injected into the share page at locations specified by the `shareHtmlLocation` label. HTML note must be in the shared sub-tree as well. Consider using `shareHiddenFromTree`. |+| `shareTemplate` | Embedded JavaScript note that will be used as the template for displaying the shared note. Falls back to the default template. Consider using `shareHiddenFromTree`. |+| `shareFavicon` | 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 `shareHiddenFromTree`. |\ No newline at end of filediff --git a/docs/User Guide/User Guide/Advanced Usage/Attributes_image.png b/docs/User Guide/User Guide/Advanced Usage/Attributes_image.pngnew file mode 100644index 0000000000..f0d2a63c2dBinary files /dev/null and b/docs/User Guide/User Guide/Advanced Usage/Attributes_image.png differdiff --git a/docs/User Guide/User Guide/Advanced Usage/Bulk Actions.md b/docs/User Guide/User Guide/Advanced Usage/Bulk Actions.mdnew file mode 100644index 0000000000..8b7f1ad327--- /dev/null+++ b/docs/User Guide/User Guide/Advanced Usage/Bulk Actions.md@@ -0,0 +1,93 @@+# Bulk Actions+<figure class="image"><img style="aspect-ratio:1425/644;" src="Bulk Actions_image.png" width="1425" height="644"></figure>++The _Bulk Actions_ 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.++## Interaction++* The first step is to select the notes in the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.md">Note Tree</a>. It's possible to apply bulk actions to:+ * A single note (and potentially its child notes) simply by clicking on it (with a left click or a right click).+ * Multiple notes. See <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree/Multiple%20selection.md">Multiple selection</a> on how to do so.+* Right click in the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.md">Note Tree</a> and select _Advanced_ → _Apply bulk actions_.+* By default, only the selected notes will be affected. To also include all the descendants of the notes, check _Include descendants of the selected notes_. The number of affected notes at the top of the dialog will update to reflect the change.+* Click on which action to apply from the _Available actions_ section. A detailed description of each is available in the next section.+ * For each action selected, the _Chosen actions_ section will update to reveal the entry. Each action will have its own configuration.+ * To remove an action, simply press the X button to the right of it.+ * It is possible to apply multiple actions of the same type, such as adding multiple types.+* When all the actions are defined, press _Execute bulk actions_ to trigger all of them at once.+* For convenience, the last bulk action configuration is saved for further use and will be restored when entering the dialog again.++## Actions++### Labels++These actions operate the <a class="reference-link" href="Attributes/Labels.md">Labels</a> of a note:++* **Add label**+ * For each note, if it doesn't already have a [label](Attributes/Labels.md) of the given name, it will create it. Keep the _New value_ field empty to create a label without a value, or complete it to assign a value.+ * If a note already has this label, its value will be updated.+* **Update label value**+ * For each note, if it has a [label](Attributes/Labels.md) of the given name, it will change its value to the specified one. Leave _New value_ field empty to create a label without a value.+ * Notes without the label will not be affected.+* _**Rename label**_+ * For each note, if it has a [label](Attributes/Labels.md) 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.+ * Notes without the label will not be affected.+* **Delete label**+ * 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).+ * Notes without the label will not be affected.++### Relations++These actions operate the <a class="reference-link" href="Attributes/Relations.md">Relations</a> of a note:++* **Add relation**+ * For each note, it will create a relation pointing to the given note.+ * Notes without this relation will not be affected.+* **Update relation target**+ * For each note, it will modify a relation to point to the newly given note.+ * Notes without this relation will not be affected.+* **Rename relation**+ * 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.+ * Notes without this relation will not be affected.+* **Delete relation**+ * For each note, if it has a relation of the given name, it will be deleted.+ * Notes without this relation will not be affected.++### Notes++* **Rename note**+ * For each note, it will change the title of the note to the given one.+ * 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 <a class="reference-link" href="../Scripting/Script%20API/Frontend%20API/FNote.dat">FNote</a>, for example:+ * `NEW: ${note.title}` will prefix all notes with `NEW:` .+ * `${note.dateCreatedObj.format('MM-DD:')}: ${note.title}` will prefix the note titles with each note's creation date (in month-day format).+* **Move note**+ * For each note, it will be moved to the specified parent note.+ * As an alternative for less complex situations, the notes can be moved directly from within the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.md">Note Tree</a> via cut → paste or via the contextual menu.+* **Convert note**+ * This allows a note to be converted from one type to another:+ * **Text Notes → Markdown Notes** — each <a class="reference-link" href="../Note%20Types/Text.md">Text</a> note is converted to a <a class="reference-link" href="../Note%20Types/Markdown.md">Markdown</a> note. Since Markdown does not support all the formatting capabilities of Text Notes, some formatting may be lost and some unsupported elements may even be dropped.+ * **Markdown Notes → Text Notes** — each <a class="reference-link" href="../Note%20Types/Markdown.md">Markdown</a> note is converted to a <a class="reference-link" href="../Note%20Types/Text.md">Text</a> Note.+ * For each converted note, a revision is saved automatically, allowing you to restore the original or recover any missing elements from it.+* **Save revision**+ * Automatically creates a revision of each note. Optionally, a name can be assigned to this revision. See <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Notes/Note%20Revisions.md">Note Revisions</a>.+* **Delete note**+ * For each note, it will be deleted.+ * As an alternative for less complex situations, the notes can be removed directly from within the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.md">Note Tree</a> by selecting them and pressing <kbd>Delete</kbd>.+* **Delete note revisions**+ * This will delete all the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Notes/Note%20Revisions.md">Note Revisions</a> of the notes.++### Others++* **Execute script**+ * For more complex scenarios, it is possible to type in a JavaScript expression in order to apply the necessary changes.+ * Examples:+ * To apply a suffix (`- suffix` in this example), to the note title:++ ```javascript+ note.title = note.title + " - suffix";+ ```+ * To alter attributes of a note based on another attribute, such as setting the `#shareAlias` label to the title of the note:++ ```javascript+ note.setLabel("shareAlias", note.title)+ ```\ No newline at end of filediff --git a/docs/User Guide/User Guide/Advanced Usage/Bulk Actions_image.png b/docs/User Guide/User Guide/Advanced Usage/Bulk Actions_image.pngnew file mode 100644index 0000000000..83af14fc2cBinary files /dev/null and b/docs/User Guide/User Guide/Advanced Usage/Bulk Actions_image.png differdiff --git a/docs/User Guide/User Guide/Advanced Usage/Configuration (config.ini or environment variables).md b/docs/User Guide/User Guide/Advanced Usage/Configuration (config.ini or environment variables).mdnew file mode 100644index 0000000000..3c2b493727--- /dev/null+++ b/docs/User Guide/User Guide/Advanced Usage/Configuration (config.ini or environment variables).md@@ -0,0 +1,170 @@+# Configuration (config.ini or environment variables)+Trilium supports configuration via a file named `config.ini` and environment variables. This document provides a comprehensive reference for all configuration options.++## Location of the configuration file++The configuration file is not located in the same directory as the application. Instead, the `config.ini` is located in the <a class="reference-link" href="../Installation%20%26%20Setup/Data%20directory.md">Data directory</a>. As such, the configuration file is only available after starting the application and creating a database.++## Configuration Precedence++Configuration values are loaded in the following order of precedence (highest to lowest):++1. **Environment variables** (checked first)+2. **config.ini file values**+3. **Default values**++## Environment Variable Patterns++Trilium supports multiple environment variable patterns for flexibility. The primary pattern is: `TRILIUM_[SECTION]_[KEY]`++Where:++* `SECTION` is the INI section name in UPPERCASE+* `KEY` is the camelCase configuration key converted to UPPERCASE (e.g., `instanceName` → `INSTANCENAME`)++Additionally, shorter aliases are available for common configurations (see Alternative Variables section below).++## Environment Variable Reference++### General Section++| Environment Variable | Type | Default | Description |+| --- | --- | --- | --- |+| `TRILIUM_GENERAL_INSTANCENAME` | string | "" | Instance name for API identification |+| `TRILIUM_GENERAL_NOAUTHENTICATION` | boolean | false | Disable authentication (server only) |+| `TRILIUM_GENERAL_NOBACKUP` | boolean | false | Disable automatic backups |+| `TRILIUM_GENERAL_NODESKTOPICON` | boolean | false | Disable desktop icon creation |+| `TRILIUM_GENERAL_READONLY` | boolean | false | Enable read-only mode |++### Network Section++| Environment Variable | Type | Default | Description |+| --- | --- | --- | --- |+| `TRILIUM_NETWORK_HOST` | string | "0.0.0.0" | Server host binding |+| `TRILIUM_NETWORK_PORT` | string | "8080" | Server port |+| `TRILIUM_NETWORK_HTTPS` | boolean | false | Enable HTTPS |+| `TRILIUM_NETWORK_CERTPATH` | string | "" | SSL certificate path |+| `TRILIUM_NETWORK_KEYPATH` | string | "" | SSL key path |+| `TRILIUM_NETWORK_TRUSTEDREVERSEPROXY` | boolean/string | false | Reverse proxy trust settings |+| `TRILIUM_NETWORK_CORSALLOWORIGIN` | string | "" | CORS allowed origins |+| `TRILIUM_NETWORK_CORSALLOWMETHODS` | string | "" | CORS allowed methods |+| `TRILIUM_NETWORK_CORSALLOWHEADERS` | string | "" | CORS allowed headers |+| `TRILIUM_NETWORK_CORSRESOURCEPOLICY` | string | same-origin | CORS Resource Policy allows same-origin/same-site/cross-origin as values, will error if not |++### Session Section++| Environment Variable | Type | Default | Description |+| --- | --- | --- | --- |+| `TRILIUM_SESSION_COOKIEMAXAGE` | integer | 1814400 | Session cookie max age in seconds (21 days) |++### Sync Section++| Environment Variable | Type | Default | Description |+| --- | --- | --- | --- |+| `TRILIUM_SYNC_SYNCSERVERHOST` | string | "" | Sync server host URL |+| `TRILIUM_SYNC_SYNCSERVERTIMEOUT` | string | "120000" | Sync server timeout in milliseconds |+| `TRILIUM_SYNC_SYNCPROXY` | string | "" | Sync proxy URL |++### MultiFactorAuthentication Section++See <a class="reference-link" href="../Installation%20%26%20Setup/Server%20Installation/Signing%20in%20with%20OpenID%20Connect.md">Signing in with OpenID Connect</a>.++### Logging Section++| Environment Variable | Type | Default | Description |+| --- | --- | --- | --- |+| `TRILIUM_LOGGING_RETENTIONDAYS` | integer | 90 | Number of days to retain log files |++### Development Section++| Environment Variable | Type | Default | Description |+| --- | --- | --- | --- |+| `TRILIUM_MANUAL_DB_MIGRATION` | boolean | false | If `true`, the application will not start if automatic database migrations are pending and would modify the database schema. |++## Alternative Environment Variables++The following alternative environment variable names are also supported and work identically to their longer counterparts:++### Network CORS Variables++* `TRILIUM_NETWORK_CORS_ALLOW_ORIGIN` (alternative to `TRILIUM_NETWORK_CORSALLOWORIGIN`)+* `TRILIUM_NETWORK_CORS_ALLOW_METHODS` (alternative to `TRILIUM_NETWORK_CORSALLOWMETHODS`)+* `TRILIUM_NETWORK_CORS_ALLOW_HEADERS` (alternative to `TRILIUM_NETWORK_CORSALLOWHEADERS`)+* `TRILIUM_NETWORK_CORS_RESOURCE_POLICY` (alternative to `TRILIUM_NETWORK_CORSRESOURCEPOLICY`)++### Sync Variables++* `TRILIUM_SYNC_SERVER_HOST` (alternative to `TRILIUM_SYNC_SYNCSERVERHOST`)+* `TRILIUM_SYNC_SERVER_TIMEOUT` (alternative to `TRILIUM_SYNC_SYNCSERVERTIMEOUT`)+* `TRILIUM_SYNC_SERVER_PROXY` (alternative to `TRILIUM_SYNC_SYNCPROXY`)++### OAuth/MFA Variables++* `TRILIUM_OAUTH_BASE_URL` (alternative to `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHBASEURL`)+* `TRILIUM_OAUTH_CLIENT_ID` (alternative to `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHCLIENTID`)+* `TRILIUM_OAUTH_CLIENT_SECRET` (alternative to `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHCLIENTSECRET`)+* `TRILIUM_OAUTH_ISSUER_BASE_URL` (alternative to `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHISSUERBASEURL`)+* `TRILIUM_OAUTH_ISSUER_NAME` (alternative to `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHISSUERNAME`)+* `TRILIUM_OAUTH_ISSUER_ICON` (alternative to `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHISSUERICON`)+* `TRILIUM_OAUTH_HTTP_TIMEOUT` (alternative to `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHHTTPTIMEOUT`)+* `TRILIUM_OAUTH_SCOPE` (alternative to `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHSCOPE`)++### Logging Variables++* `TRILIUM_LOGGING_RETENTION_DAYS` (alternative to `TRILIUM_LOGGING_RETENTIONDAYS`)++## Boolean Values++Boolean environment variables accept the following values:++* **True**: `"true"`, `"1"`, `1`+* **False**: `"false"`, `"0"`, `0`+* Any other value defaults to `false`++## Using Environment Variables++Both naming patterns are fully supported and can be used interchangeably:++* The longer format follows the section/key pattern for consistency with the INI file structure+* The shorter alternatives provide convenience for common configurations+* You can use whichever format you prefer - both are equally valid++## Examples++### Docker Compose Example++```yaml+services:+ trilium:+ image: triliumnext/trilium+ environment:+ # Using full format+ TRILIUM_GENERAL_INSTANCENAME: "My Trilium Instance"+ TRILIUM_NETWORK_PORT: "8080"+ TRILIUM_NETWORK_CORSALLOWORIGIN: "https://myapp.com"+ TRILIUM_SYNC_SYNCSERVERHOST: "https://sync.example.com"+ TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHBASEURL: "https://auth.example.com"++ # Or using shorter alternatives (equally valid)+ # TRILIUM_NETWORK_CORS_ALLOW_ORIGIN: "https://myapp.com"+ # TRILIUM_SYNC_SERVER_HOST: "https://sync.example.com"+ # TRILIUM_OAUTH_BASE_URL: "https://auth.example.com"+```++### Shell Export Example++```+# Using either format+export TRILIUM_GENERAL_NOAUTHENTICATION=false+export TRILIUM_NETWORK_HTTPS=true+export TRILIUM_NETWORK_CERTPATH=/path/to/cert.pem+export TRILIUM_NETWORK_KEYPATH=/path/to/key.pem+export TRILIUM_LOGGING_RETENTIONDAYS=30++# Start Trilium+npm start+```++## config.ini Reference++For the complete list of configuration options and their INI file format, please review the [config-sample.ini](https://github.com/TriliumNext/Trilium/blob/main/apps/server/src/assets/config-sample.ini) file in the Trilium repository\ No newline at end of filediff --git a/docs/User Guide/User Guide/Advanced Usage/Configuration (config.ini or environment variables)/Cross-Origin Resource Sharing (CORS).md b/docs/User Guide/User Guide/Advanced Usage/Configuration (config.ini or environment variables)/Cross-Origin Resource Sharing (CORS).mdnew file mode 100644index 0000000000..5951e98fa5--- /dev/null+++ b/docs/User Guide/User Guide/Advanced Usage/Configuration (config.ini or environment variables)/Cross-Origin Resource Sharing (CORS).md@@ -0,0 +1,10 @@+# Cross-Origin Resource Sharing (CORS)+By default, Trilium cannot be accessed in web browsers by requests coming from other domains/origins than Trilium itself.++However, it is possible to manually configure [Cross-Origin Resource Sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS) since Trilium v0.93.0 using environment variables or `config.ini`, as follows:++| CORS Header | Corresponding environment variable | Corresponding option in `config.ini` variables in the `Network` section |+| --- | --- | --- |+| `Access-Control-Allow-Origin` | `TRILIUM_NETWORK_CORS_ALLOW_ORIGIN` | `corsAllowOrigin` |+| `Access-Control-Allow-Methods` | `TRILIUM_NETWORK_CORS_ALLOW_METHODS` | `corsAllowMethods` |+| `Access-Control-Allow-Headers` | `TRILIUM_NETWORK_CORS_ALLOW_HEADERS` | `corsAllowHeaders` |\ No newline at end of filediff --git a/docs/User Guide/User Guide/Advanced Usage/Configuration (config.ini or environment variables)/Trilium instance.md b/docs/User Guide/User Guide/Advanced Usage/Configuration (config.ini or environment variables)/Trilium instance.mdnew file mode 100644index 0000000000..07be641453--- /dev/null+++ b/docs/User Guide/User Guide/Advanced Usage/Configuration (config.ini or environment variables)/Trilium instance.md@@ -0,0 +1,19 @@+# Trilium instance+A Trilium instance represents a server. If <a class="reference-link" href="../../Installation%20%26%20Setup/Synchronization.md">Synchronization</a> 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.++## Setting the instance name++To set up a name for the instance, modify the `config.ini`:++```+[General]+instanceName=Hello+```++## Distinguishing the instance on back-end++Use `api.getInstanceName()` to obtain the instance name of the current server, as specified in the config file or in environment variables.++## Limiting script runs based on instance++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 `runOnInstance` 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.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Advanced Usage/Custom Request Handler.md b/docs/User Guide/User Guide/Advanced Usage/Custom Request Handler.mdnew file mode 100644index 0000000000..6d2c1e7340--- /dev/null+++ b/docs/User Guide/User Guide/Advanced Usage/Custom Request Handler.md@@ -0,0 +1,88 @@+# Custom Request Handler+Trilium provides a mechanism for [scripts](../Scripting.md) 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. `/trilium buy milk`).++## Create note from outside Trilium++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.++We'll start with creating a JavaScript backend [code note](../Note%20Types/Code.md) containing:++```+const {req, res} = api;+const {secret, title, content} = req.body;++if (req.method == 'POST' && 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+ // alternatively 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);+}+```++This script note has also following two attributes:++* label `#customRequestHandler` with value `create-note`+* relation `~targetNote` pointing to a note where new notes should be saved++### Explanation++Let's test this by using an HTTP client to send a request:++```+POST http://your-trilium-server/custom/create-note+Content-Type: application/json++{+ "secret": "secret-password",+ "title": "hello",+ "content": "world"+}++++++++++++++++++++++++++++++++++++++++++++++++```++Notice the `/custom` 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 `customRequestHandler` [label](Attributes.md). Value of this label then contains a regular expression which will match the request path (in our case trivial regex "create-note").++Trilium will then find our code note created above and execute it. `api.req`, `api.res` are set to [request](https://expressjs.com/en/api.html#req) and [response](https://expressjs.com/en/api.html#res)objects from which we can get details of the request and also respond.++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.++Once we pass these checks we will just create the desired note using [Script API](../Scripting/Script%20API.md).++## Custom resource provider++Another common use case is that you want to just expose a file note - in such case you create label `customResourceProvider` (value is again path regex).++For more information, see [Custom Resource Providers](Custom%20Resource%20Providers.md).++## Advanced concepts++`api.req` and `api.res` are Express.js objects - you can always look into its [documentation](https://expressjs.com/en/api.html) for details.++### Parameters++REST request paths often contain parameters in the URL, e.g.:++```+http://your-trilium-server/custom/notes/123+```++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 `customRequestHandler` value would match it:++```+notes/([0-9]+)+```++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 `api.pathParams`:++```+const noteId = api.pathParams[0];+```++Often you also need query params (as in e.g. `http://your-trilium-server/custom/notes?noteId=123`), you can get those with standard express `req.query.noteId`.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Advanced Usage/Custom Resource Providers.md b/docs/User Guide/User Guide/Advanced Usage/Custom Resource Providers.mdnew file mode 100644index 0000000000..3b8de17440--- /dev/null+++ b/docs/User Guide/User Guide/Advanced Usage/Custom Resource Providers.md@@ -0,0 +1,34 @@+# Custom Resource Providers+A custom resource provider allows any file imported into Trilium (images, fonts, stylesheets) to be publicly accessible via a URL.++A potential use case for this is to add embed a custom font alongside a theme.++## Steps for creating a custom resource provider++1. Import a file such as an image or a font into Trilium by drag & drop.+2. Select the file and go to the _Owned Attributes_ section.+3. Add the label `#customResourceProvider=hello`.+4. To test if it is working, use a browser to navigate to `<protocol>://<host>/custom/hello` (where `<protocol>` is either `http` or `https` based on your setup, and `<host>` is the host or IP to your Trilium server instance). If you are running the TriliumNext application without a server, use `http://localhost:37840` as the base URL.+5. If everything went well, at the previous step the browser should have downloaded the file uploaded in the first step.++Instead of `hello`, the name can be:++* A path, such as `fonts/Roboto.ttf`, which would be accessible via `<host>/custom/fonts/Roboto.ttf`.+* As a more advanced use case, a regular expression to match multiple routes, such as `hello/.*` which will be accessible via `/custom/hello/1`, `/custom/hello/2`, `/custom/hello/world`, etc.++## Using it in a theme++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 `#customResourceProvider=fonts/myfont.ttf` attribute.++Then modify the theme CSS to point to:++```css+@font-face {+ font-family: customFont;+ src: url("/custom/fonts/myfont.ttf");+}++div {+ font-family: customFont;+}+```\ No newline at end of filediff --git a/docs/User Guide/User Guide/Advanced Usage/Customizing to-do task states.md b/docs/User Guide/User Guide/Advanced Usage/Customizing to-do task states.mdnew file mode 100644index 0000000000..077d9766fc--- /dev/null+++ b/docs/User Guide/User Guide/Advanced Usage/Customizing to-do task states.md@@ -0,0 +1,42 @@+# Customizing to-do task states+Trilium features customizable to-do list task states. To customize them, go to **"Options"** → **"Text Notes"** → **"Related Settings"** → **"Custom checkbox states for to-do lists"**. Alternatively, right-click a checkbox in an editable text note and click the pencil icon.++> [!WARNING]+> Changes take effect only after restarting the application.++## Creating a new task state++Click the plus icon next to Task States in the left-side pane, then define the task details as described in the next section.++## Editing a task state++Selecting any state other than "None" and "Done" (which cannot be modified) from the side pane reveals the following editable fields:++* **Icon** (required): The symbol shown inside the checkbox. You can pick an icon just as you would for any regular note, including from custom icon packs.+* **Title** (required): The name of the task state shown in the UI. For example: "Doing", "Postponed".+* **Identifier** (required): A short name for the state, using only letters, digits, "`-`" and "`_`". It is stored as metadata in the note's markup and used to identify the task state. Two task states cannot share the same identifier.+ Prefix the identifiers of your custom task states with an underscore "`_`" or a hyphen "`-`" to avoid clashes with task states that may be introduced in future versions of Trilium.+* **Markdown symbol**: A single character used to represent the state in Markdown syntax. For example, "`#`" creates a task state that can be applied in Markdown using " `- [#]` ". Make sure no other task state uses the same symbol.+* **Counts as completed**: If checked, the task is treated as completed.+* **Color**: The color of the checkbox. Its lightness and saturation are adjusted automatically to match the current color scheme or theme.+* **Hidden from toolbar**: The state is not listed in the UI. This is useful when you want existing notes to keep rendering the state correctly but no longer need to apply it yourself.++> [!NOTE]+> The task definition details are validated at startup. If errors are found, a toast provides the details and the affected task definition is ignored.++## Reordering task states++To change the order in which task states appear in the UI and when cycling through them with the keyboard, simply reorder the states in the side pane (or tree panel, if it's the case).++## Deleting task states++Any task state other than "None" and "Done" can be deleted.++Once deleted, to-do items using that state will no longer display the custom checkbox. They fall back to either a "None" or "Done" state, depending on the state's "Counts as completed" setting. The identifier and title remain stored in the note until you set the checkbox to a new state.++## Transferring notes with custom task states between Trilium database instances++Exporting notes to another Trilium database instance preserves the task states of to-do items, but does not include the custom task definitions. As a result, the destination instance won't know how to render the checkbox unless you recreate the task state there with the same identifier and Markdown symbol.++> [!NOTE]+> This is a known limitation of the current version. If there is enough interest in the community for transferring notes between Trilium database instances more easily, the Trilium team may consider a better state definition mechanism.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Advanced Usage/Database.md b/docs/User Guide/User Guide/Advanced Usage/Database.mdnew file mode 100644index 0000000000..072fe0cee0--- /dev/null+++ b/docs/User Guide/User Guide/Advanced Usage/Database.md@@ -0,0 +1,37 @@+# Database+Your Trilium data is stored in a [SQLite](https://www.sqlite.org) database which contains all notes, tree structure, metadata, and most of the configuration. The database file is named `document.db` and is stored in the application's default [Data directory](../Installation%20%26%20Setup/Data%20directory.md).++## Demo Notes++When first starting Trilium, it will provide a set of notes to showcase various features of the application.++For more information see <a class="reference-link" href="Database/Demo%20Notes.md">Demo Notes</a>.++## Manually Modifying the Database++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 [SQLite Browser](https://sqlitebrowser.org/) to work directly on the database file.++See [Manually altering the database](Database/Manually%20altering%20the%20database.md) for more information.++## How to Reset the Database++If you want to start again and:++* Create and switch to a new blank knowledge base+* Use a different knowledge base synced from a server or desktop application+* Restore a backup++You can navigate to **Settings → Database** and click the **Start over** button. You'll be prompted to restart the application, with the option to back up your current database before proceeding.++> [!IMPORTANT]+> For the web client, Trilium cannot restart automatically. You'll need to manually restart the server/container and then reload the web application.++After restarting, the setup screen will appear. You can choose to back up your existing database, then proceed with the setup menu as if it's a new installation. The existing database will only be overwritten after selecting to create a new database, sync with a server, or restore from a backup.++### The Legacy Method++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.++To delete the database, simply go to the [data directory](../Installation%20%26%20Setup/Data%20directory.md) and delete the `document.db` file (and any other files starting with `document.db`).++If you do not need to preserve any configurations that might be stored in the `config.ini` file, you can just delete all of the [data directory's](../Installation%20%26%20Setup/Data%20directory.md) contents to fully restore the application to its original state. You can also review the [configuration](Configuration%20\(config.ini%20or%20environment%20variables\).md) file to provide all `config.ini` values as environment variables instead.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Advanced Usage/Database/Demo Notes.md b/docs/User Guide/User Guide/Advanced Usage/Database/Demo Notes.mdnew file mode 100644index 0000000000..df8af0f6f3--- /dev/null+++ b/docs/User Guide/User Guide/Advanced Usage/Database/Demo Notes.md@@ -0,0 +1,19 @@+# Demo Notes+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:++* <a class="reference-link" href="../../Note%20Types/Relation%20Map.md">Relation Map</a>+* <a class="reference-link" href="../Advanced%20Showcases/Day%20Notes.md">Day Notes</a>+* <a class="reference-link" href="../Advanced%20Showcases/Weight%20Tracker.md">Weight Tracker</a>+* <a class="reference-link" href="../Advanced%20Showcases/Task%20Manager.md">Task Manager</a>+* <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/Themes.md">Themes</a>++### Restoring Demo Notes++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.++You can easily restore the demo notes by using Trilium's built-in import feature by importing them:++* Download [the .zip archive](https://github.com/TriliumNext/Trilium/raw/refs/heads/main/apps/server/src/assets/db/demo.zip) with the latest version of the demo notes+* Right click on any note in your tree under which you would like the demo notes to be imported+* Click "Import into note"+* Select the .zip archive to import it\ No newline at end of filediff --git a/docs/User Guide/User Guide/Advanced Usage/Database/Manually altering the database.md b/docs/User Guide/User Guide/Advanced Usage/Database/Manually altering the database.mdnew file mode 100644index 0000000000..70841499cd--- /dev/null+++ b/docs/User Guide/User Guide/Advanced Usage/Database/Manually altering the database.md@@ -0,0 +1,42 @@+# Manually altering the database+There are some situations where modifying the SQLite database that Trilium uses is desirable.++If you are doing any advanced development or troubleshooting where you manually modify the database, you might want to consider creating backups of your `document.db` file.++## Modifying it internally using the SQL Console++The SQL Console is Trilium's built-in database editor.++See <a class="reference-link" href="Manually%20altering%20the%20database/SQL%20Console.md">SQL Console</a>.++## Externally modifying the database++Sometimes the SQL Console cannot be used (for example if the application cannot start).++When making external modifications, consider closing the desktop application. If modifying the server database, then stop the service or Docker container.++### Using DB Browser for SQLite++DB Browser for SQLite is a cross-platform editor that can be used to alter the database using a graphical user interface.++To do so:++1. In the main menu, select File → Open database… and navigate to the database in the [Data directory](../../Installation%20%26%20Setup/Data%20directory.md).+2. Select the _Execute SQL_ tab.+3. Type in the desired SQL statement.+4. Press the "Play" button in the toolbar underneath the "Execute SQL" tab (or F5 key).+5. Press "Write Changes" in the main toolbar.+6. Close the application or close the database.++++### Using the SQLite CLI++First, start the SQLite 3 CLI by specifying the path to the database:++```+sqlite3 ~/.local/share/trilium-data/document.db+```++* In the prompt simply type the statement and make sure it ends with a `;` character.+* To exit, simply type `.quit` and enter.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Advanced Usage/Database/Manually altering the database/SQL Console_image.png b/docs/User Guide/User Guide/Advanced Usage/Database/Manually altering the database/SQL Console_image.pngnew file mode 100644index 0000000000..32a91fc2f3Binary files /dev/null and b/docs/User Guide/User Guide/Advanced Usage/Database/Manually altering the database/SQL Console_image.png differdiff --git a/docs/User Guide/User Guide/Advanced Usage/Database/Manually altering the database_image.png b/docs/User Guide/User Guide/Advanced Usage/Database/Manually altering the database_image.pngnew file mode 100644index 0000000000..469899ebc0Binary files /dev/null and b/docs/User Guide/User Guide/Advanced Usage/Database/Manually altering the database_image.png differdiff --git a/docs/User Guide/User Guide/Advanced Usage/Default Note Title.md b/docs/User Guide/User Guide/Advanced Usage/Default Note Title.mdnew file mode 100644index 0000000000..3ee4676721--- /dev/null+++ b/docs/User Guide/User Guide/Advanced Usage/Default Note Title.md@@ -0,0 +1,32 @@+# Default Note Title+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.++For this use case, Trilium (since v0.52) supports `#titleTemplate` [label](Attributes.md). 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.++As an example use case, imagine you collect books you've read in a given year like this:++* 2022 Books+ * Neal Stephenson: Anathem, 2008+ * Franz Kafka: Die Verwandlung, 1915++Now, to the parent note "2022 Books" you can assign label `#titleTemplate="[Author name]: [Book title], [Publication year]"`.++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.++## Dynamic value++The value of `#titleTemplate` 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.++Second variable injected is `parentNote` which gives access to the parent [`FNote`](../Scripting/Script%20API/Frontend%20API/FNote.dat).++See also <a class="reference-link" href="Templates.md">Templates</a> which provides similar capabilities, including default note's content.++### Examples++* Imagine you collect server outage incidents and write some notes. It looks like this:+ * Incidents+ * 2022-05-09: System crash+ * 2022-05-15: Backup delay+ * You can automatize the date assignment by assigning a label `#titleTemplate="${now.format('YYYY-MM-DD')}: "` to the parent note "Incidents". Whenever a new child note is created, the title template is evaluated with the injected [now](https://day.js.org/docs/en/display/format) object.+* To use a parent's attribute in the title of new notes: `#titleTemplate="${parentNote.getLabelValue('authorName')}'s literary works"`+* To mirror the parent's note title: `${parentNote.title}`\ No newline at end of filediff --git a/docs/User Guide/User Guide/Advanced Usage/ETAPI (REST API).md b/docs/User Guide/User Guide/Advanced Usage/ETAPI (REST API).mdnew file mode 100644index 0000000000..869d7984dd--- /dev/null+++ b/docs/User Guide/User Guide/Advanced Usage/ETAPI (REST API).md@@ -0,0 +1,94 @@+# ETAPI (REST API)+> [!TIP]+> For a quick start, consult the <a class="reference-link" href="ETAPI%20(REST%20API)/API%20Reference.dat">API Reference</a>.++ETAPI is Trilium's public/external REST API. It is available since Trilium v0.50.++## API clients++As an alternative to calling the API directly, there are client libraries to simplify this++* [trilium-py](https://github.com/Nriver/trilium-py), you can use Python to communicate with Trilium.++## Obtaining a token++All operations with the REST API have to be authenticated using a token. You can get this token either from Options -> ETAPI or programmatically using the `/auth/login` REST call (see the [spec](https://github.com/TriliumNext/Trilium/blob/master/src/etapi/etapi.openapi.yaml)).++## Authentication++### Via the `Authorization` header++```+GET https://myserver.com/etapi/app-info+Authorization: ETAPITOKEN+```++where `ETAPITOKEN` is the token obtained in the previous step.++For compatibility with various tools, it's also possible to specify the value of the `Authorization` header in the format `Bearer ETAPITOKEN` (since 0.93.0).++### Basic authentication++Since v0.56 you can also use basic auth format:++```+GET https://myserver.com/etapi/app-info+Authorization: Basic BATOKEN+```++* Where `BATOKEN = BASE64(username + ':' + password)` - this is a standard Basic Auth serialization+* Where `username` is "etapi"+* And `password` is the generated ETAPI token described above.++Basic Auth is meant to be used with tools which support only basic auth.++## Interaction using Bash scripts++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:++```+#!/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"+```++Make sure to replace the values of:++* `TOKEN` with your ETAPI token.+* `SERVER` with the correct protocol, host name and port to your Trilium instance.+* `NOTE_ID` with an existing note ID to download.++As another example, to obtain a .zip export of a note and place it in a directory called `out`, simply replace the last statement in the script with:++```+curl -H "Authorization: $TOKEN" \+ -X GET "$SERVER/etapi/notes/$NOTE_ID/export" \+ --output "out/$NOTE_ID.zip"+```++## Uploading binary content++A JSON request body can only carry text, so the `content` field of `POST /etapi/attachments` stores exactly the string it receives. To upload an image, a PDF or any other binary file, send the raw bytes to the content endpoint with the `application/octet-stream` content type. The same applies to the content of a note (`PUT /etapi/notes/{noteId}/content`).++To attach a file to a note, create the attachment without content, then upload the file to it:++```+ATTACHMENT_ID=$(curl -s -X POST "$SERVER/etapi/attachments" \+ -H "Authorization: $TOKEN" \+ -H "Content-Type: application/json" \+ -d "{\"ownerId\": \"$NOTE_ID\", \"role\": \"file\", \"mime\": \"application/pdf\", \"title\": \"report.pdf\", \"position\": 10}" \+ | jq -r .attachmentId)++curl -X PUT "$SERVER/etapi/attachments/$ATTACHMENT_ID/content" \+ -H "Authorization: $TOKEN" \+ -H "Content-Type: application/octet-stream" \+ --data-binary @report.pdf+```++Use `--data-binary` rather than `-d`, which strips line breaks from the file. For an image, set `role` to `image` and `mime` to the image's type, such as `image/png`.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Advanced Usage/ETAPI (REST API)/API Reference.dat b/docs/User Guide/User Guide/Advanced Usage/ETAPI (REST API)/API Reference.datnew file mode 100644index 0000000000..e69de29bb2diff --git a/docs/User Guide/User Guide/Advanced Usage/Hidden Notes.md b/docs/User Guide/User Guide/Advanced Usage/Hidden Notes.mdnew file mode 100644index 0000000000..cf723299eb--- /dev/null+++ b/docs/User Guide/User Guide/Advanced Usage/Hidden Notes.md@@ -0,0 +1,79 @@+# Hidden Notes+<figure class="image image-style-align-right"><img style="aspect-ratio:263/445;" src="Hidden Notes_image.png" width="263" height="445"></figure>++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 <a class="reference-link" href="Attributes.md">Attributes</a>, <a class="reference-link" href="Attributes/Relations.md">Relations</a> or even <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Navigation/Search.md">Search</a> and <a class="reference-link" href="../Note%20Types/Text/Links.md">Links</a> to be able to operate on them.++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.++The hidden notes are stored in the user's <a class="reference-link" href="Database.md">Database</a> just like normal notes, but they have a unique <a class="reference-link" href="Note%20ID.md">Note ID</a> which allows them to be distinguished from the normal ones.++## Accessing the hidden note tree++From the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Global%20menu.md">Global menu</a>, select _Advanced_ → _Show Hidden Subtree_.++## Contents of the hidden note tree++Here is a brief summary of all the notes within the hidden tree:++<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/_globalNoteMap">Note Map</a></td>+ <td><p>This note is actually opened when the <a class="reference-link" href="../Note%20Types/Note%20Map.md">Note Map</a> feature that is accessed from the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Launch%20Bar.md">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="../Basic%20Concepts%20and%20Features/Navigation/Bookmarks.md">bookmarked</a>.</p></td>+ </tr>+ <tr>+ <td><a class="reference-link" href="#root/_hidden/_sqlConsole">SQL Console History</a></td>+ <td><p>When SQL queries or commands are executed in the <a class="reference-link" href="Database/Manually%20altering%20the%20database/SQL%20Console.md">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 <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Global%20menu.md">Global menu</a> 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/_search">Search History</a></td>+ <td><p>Whenever a search is executed from the full <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Navigation/Search.md">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 <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Global%20menu.md">Global menu</a> 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/_bulkAction">Bulk Action</a></td>+ <td><p>This section is used for <a class="reference-link" href="Bulk%20Actions.md">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/_backendLog">Backend Log</a></td>+ <td><p>This note corresponds to the backend log feature (see <a class="reference-link" href="../Troubleshooting/Error%20logs.md">Error logs</a>).</p><p>This item can be accessed without going to the hidden try by going to the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Global%20menu.md">Global menu</a> and selecting Advanced → Show backend log.</p></td>+ </tr>+ <tr>+ <td><a class="reference-link" href="#root/_hidden/_userHidden">User Hidden</a></td>+ <td>This section can be used by <a href="../Scripting.md">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/_lbTplRoot">Launch Bar Templates</a></td>+ <td><p>This section contains the templates for the creation of launchers in the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Launch%20Bar.md">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/_share">Shared Notes</a></td>+ <td><p>This tree lists all of the notes that are <a href="Sharing.md">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 <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Global%20menu.md">Global menu</a> 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/_lbRoot">Launch Bar</a></td>+ <td><p>The tree contains both available and displayed items of the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Launch%20Bar.md">Launch Bar</a>.</p><p>This section can be accessed without going to the hidden tree by:</p><ul><li>Going to the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Global%20menu.md">Global menu</a> and selecting <em>Configure Launchbar</em>.</li><li>Right-clicking an empty space on the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Launch%20Bar.md">Launch Bar</a> 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/_options">Options</a></td>+ <td><p>This section stores the list of <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Options.md">Options</a>.</p><p>This section can be accessed without going to the hidden tree by:</p><ul><li>Going to the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Global%20menu.md">Global menu</a> and selecting <em>Options</em>.</li><li>Pressing the dedicated Options icon in the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Launch%20Bar.md">Launch Bar</a>.</li></ul></td>+ </tr>+ <tr>+ <td><a class="reference-link" href="#root/_hidden/_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">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>\ No newline at end of filediff --git a/docs/User Guide/User Guide/Advanced Usage/Hidden Notes_image.png b/docs/User Guide/User Guide/Advanced Usage/Hidden Notes_image.pngnew file mode 100644index 0000000000..eb59b57b13Binary files /dev/null and b/docs/User Guide/User Guide/Advanced Usage/Hidden Notes_image.png differdiff --git a/docs/User Guide/User Guide/Advanced Usage/Internal API/API Reference.dat b/docs/User Guide/User Guide/Advanced Usage/Internal API/API Reference.datnew file mode 100644index 0000000000..e69de29bb2diff --git a/docs/User Guide/User Guide/Advanced Usage/Metrics.md b/docs/User Guide/User Guide/Advanced Usage/Metrics.mdnew file mode 100644index 0000000000..ef0c7b3b58--- /dev/null+++ b/docs/User Guide/User Guide/Advanced Usage/Metrics.md@@ -0,0 +1,120 @@+# Metrics+The Trilium Metrics API provides comprehensive monitoring data about your Trilium instance, designed for external monitoring systems like Prometheus.++## **Endpoint**++* **URL**: `/etapi/metrics`+* **Method**: `GET`+* **Authentication**: ETAPI token required+* **Default Format**: Prometheus text format++## **Authentication**++You need an ETAPI token to access the metrics endpoint. Get one by:++```+# Get an ETAPI token+curl -X POST http://localhost:8080/etapi/auth/login \+ -H "Content-Type: application/json" \+ -d '{"password": "your_password"}'++```++## **Usage**++### **Prometheus Format (Default)**++```+curl -H "Authorization: YOUR_ETAPI_TOKEN" \+ http://localhost:8080/etapi/metrics++```++Returns metrics in Prometheus text format:++```+# 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++```++### **JSON Format**++```+curl -H "Authorization: YOUR_ETAPI_TOKEN" \+ "http://localhost:8080/etapi/metrics?format=json"++```++Returns detailed metrics in JSON format for debugging or custom integrations.++## **Available Metrics**++### **Instance Information**++* `trilium_info` - Version and build information with labels++### **Database Metrics**++* `trilium_notes_total` - Total notes (including deleted)+* `trilium_notes_deleted` - Number of deleted notes+* `trilium_notes_active` - Number of active notes+* `trilium_notes_protected` - Number of protected notes+* `trilium_attachments_total` - Total attachments+* `trilium_attachments_active` - Active attachments+* `trilium_revisions_total` - Total note revisions+* `trilium_branches_total` - Active branches+* `trilium_attributes_total` - Active attributes+* `trilium_blobs_total` - Total blob records+* `trilium_etapi_tokens_total` - Active ETAPI tokens+* `trilium_embeddings_total` - Note embeddings (if available)++### **Categorized Metrics**++* `trilium_notes_by_type{type="text|code|image|file"}` - Notes by type+* `trilium_attachments_by_type{mime_type="..."}` - Attachments by MIME type++### **Statistics**++* `trilium_database_size_bytes` - Database size in bytes+* `trilium_oldest_note_timestamp` - Timestamp of oldest note+* `trilium_newest_note_timestamp` - Timestamp of newest note+* `trilium_last_modified_timestamp` - Last modification timestamp++## **Prometheus Configuration**++Add to your `prometheus.yml`:++```+scrape_configs:+ - job_name: 'trilium'+ static_configs:+ - targets: ['localhost:8080']+ metrics_path: '/etapi/metrics'+ bearer_token: 'YOUR_ETAPI_TOKEN'+ scrape_interval: 30s++```++## **Error Responses**++* `400` - Invalid format parameter+* `401` - Missing or invalid ETAPI token+* `500` - Internal server error++## **Grafana Dashboard**++<figure class="image"><img style="aspect-ratio:2594/1568;" src="1_Metrics_image.png" width="2594" height="1568"></figure>++You can also use the Grafana Dashboard that has been created for TriliumNext - just take the JSON from <a class="reference-link" href="Metrics/grafana-dashboard.json">grafana-dashboard.json</a> and then import the dashboard, following these screenshots:++<figure class="image"><img style="aspect-ratio:1881/282;" src="2_Metrics_image.png" width="1881" height="282"></figure>++Then paste the JSON, and hit load:++<figure class="image"><img style="aspect-ratio:1055/830;" src="Metrics_image.png" width="1055" height="830"></figure>\ No newline at end of filediff --git a/docs/User Guide/User Guide/Advanced Usage/Metrics/grafana-dashboard.json b/docs/User Guide/User Guide/Advanced Usage/Metrics/grafana-dashboard.jsonnew file mode 100644index 0000000000..2e1e4511ef--- /dev/null+++ b/docs/User Guide/User Guide/Advanced Usage/Metrics/grafana-dashboard.json@@ -0,0 +1,1335 @@+{+ "annotations": {+ "list": [+ {+ "builtIn": 1,+ "datasource": {+ "type": "grafana",+ "uid": "-- Grafana --"+ },+ "enable": true,+ "hide": true,+ "iconColor": "rgba(0, 211, 255, 1)",+ "name": "Annotations & Alerts",+ "type": "dashboard"+ }+ ]+ },+ "editable": true,+ "fiscalYearStartMonth": 0,+ "graphTooltip": 1,+ "id": 549,+ "links": [],+ "panels": [+ {+ "collapsed": false,+ "gridPos": {+ "h": 1,+ "w": 24,+ "x": 0,+ "y": 0+ },+ "id": 100,+ "panels": [],+ "title": "🏠 Trilium Overview",+ "type": "row"+ },+ {+ "datasource": {+ "uid": "${datasource}"+ },+ "description": "Current Trilium version and build information",+ "fieldConfig": {+ "defaults": {+ "color": {+ "mode": "thresholds"+ },+ "custom": {+ "align": "auto",+ "cellOptions": {+ "type": "auto"+ },+ "filterable": false,+ "inspect": false+ },+ "mappings": [],+ "thresholds": {+ "mode": "absolute",+ "steps": [+ {+ "color": "green"+ }+ ]+ }+ },+ "overrides": []+ },+ "gridPos": {+ "h": 6,+ "w": 12,+ "x": 0,+ "y": 1+ },+ "id": 101,+ "options": {+ "cellHeight": "sm",+ "footer": {+ "countRows": false,+ "fields": "",+ "reducer": [+ "sum"+ ],+ "show": false+ },+ "showHeader": true+ },+ "pluginVersion": "12.0.1",+ "targets": [+ {+ "datasource": {+ "uid": "${datasource}"+ },+ "expr": "trilium_info{job=~'$job',instance=~'$instance'}",+ "format": "table",+ "instant": true,+ "refId": "A"+ }+ ],+ "title": "📋 Instance Information",+ "transformations": [+ {+ "id": "organize",+ "options": {+ "excludeByName": {+ "Time": true,+ "Value": true,+ "__name__": true,+ "instance": true,+ "job": true+ },+ "indexByName": {},+ "renameByName": {+ "build_date": "Build Date",+ "build_revision": "Git Revision",+ "db_version": "DB Version",+ "node_version": "Node.js",+ "sync_version": "Sync Version",+ "version": "Version"+ }+ }+ }+ ],+ "type": "table"+ },+ {+ "datasource": {+ "uid": "${datasource}"+ },+ "description": "Database file size in human-readable format",+ "fieldConfig": {+ "defaults": {+ "color": {+ "mode": "thresholds"+ },+ "mappings": [],+ "thresholds": {+ "mode": "absolute",+ "steps": [+ {+ "color": "green"+ },+ {+ "color": "yellow",+ "value": 500000000+ },+ {+ "color": "red",+ "value": 1000000000+ }+ ]+ },+ "unit": "decbytes"+ },+ "overrides": []+ },+ "gridPos": {+ "h": 6,+ "w": 6,+ "x": 12,+ "y": 1+ },+ "id": 102,+ "options": {+ "colorMode": "background",+ "graphMode": "area",+ "justifyMode": "center",+ "orientation": "auto",+ "percentChangeColorMode": "standard",+ "reduceOptions": {+ "calcs": [+ "lastNotNull"+ ],+ "fields": "",+ "values": false+ },+ "showPercentChange": false,+ "textMode": "auto",+ "wideLayout": true+ },+ "pluginVersion": "12.0.1",+ "targets": [+ {+ "datasource": {+ "uid": "${datasource}"+ },+ "expr": "trilium_database_size_bytes{job=~'$job',instance=~'$instance'}",+ "refId": "A"+ }+ ],+ "title": "💾 Database Size",+ "type": "stat"+ },+ {+ "datasource": {+ "uid": "${datasource}"+ },+ "description": "Total active notes in your Trilium instance",+ "fieldConfig": {+ "defaults": {+ "color": {+ "mode": "thresholds"+ },+ "mappings": [],+ "thresholds": {+ "mode": "absolute",+ "steps": [+ {+ "color": "green"+ },+ {+ "color": "yellow",+ "value": 1000+ },+ {+ "color": "red",+ "value": 5000+ }+ ]+ },+ "unit": "short"+ },+ "overrides": []+ },+ "gridPos": {+ "h": 6,+ "w": 6,+ "x": 18,+ "y": 1+ },+ "id": 103,+ "options": {+ "colorMode": "background",+ "graphMode": "area",+ "justifyMode": "center",+ "orientation": "auto",+ "percentChangeColorMode": "standard",+ "reduceOptions": {+ "calcs": [+ "lastNotNull"+ ],+ "fields": "",+ "values": false+ },+ "showPercentChange": false,+ "textMode": "auto",+ "wideLayout": true+ },+ "pluginVersion": "12.0.1",+ "targets": [+ {+ "datasource": {+ "uid": "${datasource}"+ },+ "expr": "trilium_notes_active{job=~'$job',instance=~'$instance'}",+ "refId": "A"+ }+ ],+ "title": "📝 Active Notes",+ "type": "stat"+ },+ {+ "collapsed": false,+ "gridPos": {+ "h": 1,+ "w": 24,+ "x": 0,+ "y": 7+ },+ "id": 200,+ "panels": [],+ "title": "📊 Key Metrics",+ "type": "row"+ },+ {+ "datasource": {+ "uid": "${datasource}"+ },+ "description": "Total notes including deleted ones",+ "fieldConfig": {+ "defaults": {+ "color": {+ "mode": "palette-classic"+ },+ "custom": {+ "hideFrom": {+ "legend": false,+ "tooltip": false,+ "viz": false+ }+ },+ "mappings": [],+ "unit": "short"+ },+ "overrides": []+ },+ "gridPos": {+ "h": 8,+ "w": 6,+ "x": 0,+ "y": 8+ },+ "id": 201,+ "options": {+ "legend": {+ "displayMode": "list",+ "placement": "bottom",+ "showLegend": true,+ "values": []+ },+ "pieType": "pie",+ "reduceOptions": {+ "calcs": [+ "lastNotNull"+ ],+ "fields": "",+ "values": false+ },+ "tooltip": {+ "hideZeros": false,+ "mode": "single",+ "sort": "none"+ }+ },+ "pluginVersion": "12.0.1",+ "targets": [+ {+ "datasource": {+ "uid": "${datasource}"+ },+ "expr": "trilium_notes_active{job=~'$job',instance=~'$instance'}",+ "legendFormat": "Active Notes",+ "refId": "A"+ },+ {+ "datasource": {+ "uid": "${datasource}"+ },+ "expr": "trilium_notes_deleted{job=~'$job',instance=~'$instance'}",+ "legendFormat": "Deleted Notes",+ "refId": "B"+ },+ {+ "datasource": {+ "uid": "${datasource}"+ },+ "expr": "trilium_notes_protected{job=~'$job',instance=~'$instance'}",+ "legendFormat": "Protected Notes",+ "refId": "C"+ }+ ],+ "title": "📝 Notes Distribution",+ "type": "piechart"+ },+ {+ "datasource": {+ "uid": "${datasource}"+ },+ "description": "Breakdown of attachments by MIME type",+ "fieldConfig": {+ "defaults": {+ "color": {+ "mode": "palette-classic"+ },+ "custom": {+ "hideFrom": {+ "legend": false,+ "tooltip": false,+ "viz": false+ }+ },+ "mappings": [],+ "unit": "short"+ },+ "overrides": []+ },+ "gridPos": {+ "h": 8,+ "w": 6,+ "x": 6,+ "y": 8+ },+ "id": 202,+ "options": {+ "legend": {+ "displayMode": "list",+ "placement": "bottom",+ "showLegend": true,+ "values": []+ },+ "pieType": "donut",+ "reduceOptions": {+ "calcs": [+ "lastNotNull"+ ],+ "fields": "",+ "values": false+ },+ "tooltip": {+ "hideZeros": false,+ "mode": "single",+ "sort": "none"+ }+ },+ "pluginVersion": "12.0.1",+ "targets": [+ {+ "datasource": {+ "uid": "${datasource}"+ },+ "expr": "trilium_attachments_by_type{job=~'$job',instance=~'$instance'}",+ "legendFormat": "{{mime_type}}",+ "refId": "A"+ }+ ],+ "title": "🖼️ Attachments by Type",+ "type": "piechart"+ },+ {+ "datasource": {+ "uid": "${datasource}"+ },+ "description": "Distribution of notes by their content type",+ "fieldConfig": {+ "defaults": {+ "color": {+ "mode": "palette-classic"+ },+ "custom": {+ "hideFrom": {+ "legend": false,+ "tooltip": false,+ "viz": false+ }+ },+ "mappings": [],+ "unit": "short"+ },+ "overrides": []+ },+ "gridPos": {+ "h": 8,+ "w": 12,+ "x": 12,+ "y": 8+ },+ "id": 203,+ "options": {+ "legend": {+ "displayMode": "table",+ "placement": "right",+ "showLegend": true,+ "values": [+ "value",+ "percent"+ ]+ },+ "pieType": "donut",+ "reduceOptions": {+ "calcs": [+ "lastNotNull"+ ],+ "fields": "",+ "values": false+ },+ "tooltip": {+ "hideZeros": false,+ "mode": "single",+ "sort": "none"+ }+ },+ "pluginVersion": "12.0.1",+ "targets": [+ {+ "datasource": {+ "uid": "${datasource}"+ },+ "expr": "trilium_notes_by_type{job=~'$job',instance=~'$instance'}",+ "legendFormat": "{{type}}",+ "refId": "A"+ }+ ],+ "title": "📄 Notes by Content Type",+ "type": "piechart"+ },+ {+ "collapsed": false,+ "gridPos": {+ "h": 1,+ "w": 24,+ "x": 0,+ "y": 16+ },+ "id": 300,+ "panels": [],+ "title": "📈 Trends & Time Series",+ "type": "row"+ },+ {+ "datasource": {+ "uid": "${datasource}"+ },+ "description": "Growth of notes over time",+ "fieldConfig": {+ "defaults": {+ "color": {+ "mode": "palette-classic"+ },+ "custom": {+ "axisBorderShow": false,+ "axisCenteredZero": false,+ "axisColorMode": "text",+ "axisLabel": "",+ "axisPlacement": "auto",+ "barAlignment": 0,+ "barWidthFactor": 0.6,+ "drawStyle": "line",+ "fillOpacity": 20,+ "gradientMode": "hue",+ "hideFrom": {+ "legend": false,+ "tooltip": false,+ "viz": false+ },+ "insertNulls": false,+ "lineInterpolation": "smooth",+ "lineWidth": 3,+ "pointSize": 8,+ "scaleDistribution": {+ "type": "linear"+ },+ "showPoints": "auto",+ "spanNulls": false,+ "stacking": {+ "group": "A",+ "mode": "none"+ },+ "thresholdsStyle": {+ "mode": "off"+ }+ },+ "mappings": [],+ "thresholds": {+ "mode": "absolute",+ "steps": [+ {+ "color": "green"+ }+ ]+ },+ "unit": "short"+ },+ "overrides": [+ {+ "matcher": {+ "id": "byName",+ "options": "Active Notes"+ },+ "properties": [+ {+ "id": "color",+ "value": {+ "fixedColor": "blue",+ "mode": "fixed"+ }+ }+ ]+ },+ {+ "matcher": {+ "id": "byName",+ "options": "Total Notes"+ },+ "properties": [+ {+ "id": "color",+ "value": {+ "fixedColor": "green",+ "mode": "fixed"+ }+ }+ ]+ }+ ]+ },+ "gridPos": {+ "h": 8,+ "w": 12,+ "x": 0,+ "y": 17+ },+ "id": 301,+ "options": {+ "legend": {+ "calcs": [+ "last",+ "max"+ ],+ "displayMode": "table",+ "placement": "bottom",+ "showLegend": true+ },+ "tooltip": {+ "hideZeros": false,+ "mode": "multi",+ "sort": "desc"+ }+ },+ "pluginVersion": "12.0.1",+ "targets": [+ {+ "datasource": {+ "uid": "${datasource}"+ },+ "expr": "trilium_notes_active{job=~'$job',instance=~'$instance'}",+ "legendFormat": "Active Notes",+ "refId": "A"+ },+ {+ "datasource": {+ "uid": "${datasource}"+ },+ "expr": "trilium_notes_total{job=~'$job',instance=~'$instance'}",+ "legendFormat": "Total Notes",+ "refId": "B"+ }+ ],+ "title": "📈 Notes Growth Over Time",+ "type": "timeseries"+ },+ {+ "datasource": {+ "uid": "${datasource}"+ },+ "description": "Attachment storage trends",+ "fieldConfig": {+ "defaults": {+ "color": {+ "mode": "palette-classic"+ },+ "custom": {+ "axisBorderShow": false,+ "axisCenteredZero": false,+ "axisColorMode": "text",+ "axisLabel": "",+ "axisPlacement": "auto",+ "barAlignment": 0,+ "barWidthFactor": 0.6,+ "drawStyle": "line",+ "fillOpacity": 20,+ "gradientMode": "hue",+ "hideFrom": {+ "legend": false,+ "tooltip": false,+ "viz": false+ },+ "insertNulls": false,+ "lineInterpolation": "smooth",+ "lineWidth": 3,+ "pointSize": 8,+ "scaleDistribution": {+ "type": "linear"+ },+ "showPoints": "auto",+ "spanNulls": false,+ "stacking": {+ "group": "A",+ "mode": "none"+ },+ "thresholdsStyle": {+ "mode": "off"+ }+ },+ "mappings": [],+ "thresholds": {+ "mode": "absolute",+ "steps": [+ {+ "color": "green"+ }+ ]+ },+ "unit": "short"+ },+ "overrides": [+ {+ "matcher": {+ "id": "byName",+ "options": "Active Attachments"+ },+ "properties": [+ {+ "id": "color",+ "value": {+ "fixedColor": "purple",+ "mode": "fixed"+ }+ }+ ]+ },+ {+ "matcher": {+ "id": "byName",+ "options": "Total Attachments"+ },+ "properties": [+ {+ "id": "color",+ "value": {+ "fixedColor": "orange",+ "mode": "fixed"+ }+ }+ ]+ }+ ]+ },+ "gridPos": {+ "h": 8,+ "w": 12,+ "x": 12,+ "y": 17+ },+ "id": 302,+ "options": {+ "legend": {+ "calcs": [+ "last",+ "max"+ ],+ "displayMode": "table",+ "placement": "bottom",+ "showLegend": true+ },+ "tooltip": {+ "hideZeros": false,+ "mode": "multi",+ "sort": "desc"+ }+ },+ "pluginVersion": "12.0.1",+ "targets": [+ {+ "datasource": {+ "uid": "${datasource}"+ },+ "expr": "trilium_attachments_active{job=~'$job',instance=~'$instance'}",+ "legendFormat": "Active Attachments",+ "refId": "A"+ },+ {+ "datasource": {+ "uid": "${datasource}"+ },+ "expr": "trilium_attachments_total{job=~'$job',instance=~'$instance'}",+ "legendFormat": "Total Attachments",+ "refId": "B"+ }+ ],+ "title": "📎 Attachments Growth Over Time",+ "type": "timeseries"+ },+ {+ "collapsed": false,+ "gridPos": {+ "h": 1,+ "w": 24,+ "x": 0,+ "y": 25+ },+ "id": 400,+ "panels": [],+ "title": "🔧 Advanced Metrics",+ "type": "row"+ },+ {+ "datasource": {+ "uid": "${datasource}"+ },+ "description": "Number of branches connecting notes",+ "fieldConfig": {+ "defaults": {+ "color": {+ "mode": "thresholds"+ },+ "mappings": [],+ "thresholds": {+ "mode": "absolute",+ "steps": [+ {+ "color": "green"+ }+ ]+ },+ "unit": "short"+ },+ "overrides": []+ },+ "gridPos": {+ "h": 4,+ "w": 6,+ "x": 0,+ "y": 26+ },+ "id": 401,+ "options": {+ "colorMode": "value",+ "graphMode": "none",+ "justifyMode": "center",+ "orientation": "auto",+ "percentChangeColorMode": "standard",+ "reduceOptions": {+ "calcs": [+ "lastNotNull"+ ],+ "fields": "",+ "values": false+ },+ "showPercentChange": false,+ "textMode": "auto",+ "wideLayout": true+ },+ "pluginVersion": "12.0.1",+ "targets": [+ {+ "datasource": {+ "uid": "${datasource}"+ },+ "expr": "trilium_branches_total{job=~'$job',instance=~'$instance'}",+ "refId": "A"+ }+ ],+ "title": "🌳 Total Branches",+ "type": "stat"+ },+ {+ "datasource": {+ "uid": "${datasource}"+ },+ "description": "Number of note attributes",+ "fieldConfig": {+ "defaults": {+ "color": {+ "mode": "thresholds"+ },+ "mappings": [],+ "thresholds": {+ "mode": "absolute",+ "steps": [+ {+ "color": "green"+ }+ ]+ },+ "unit": "short"+ },+ "overrides": []+ },+ "gridPos": {+ "h": 4,+ "w": 6,+ "x": 6,+ "y": 26+ },+ "id": 402,+ "options": {+ "colorMode": "value",+ "graphMode": "none",+ "justifyMode": "center",+ "orientation": "auto",+ "percentChangeColorMode": "standard",+ "reduceOptions": {+ "calcs": [+ "lastNotNull"+ ],+ "fields": "",+ "values": false+ },+ "showPercentChange": false,+ "textMode": "auto",+ "wideLayout": true+ },+ "pluginVersion": "12.0.1",+ "targets": [+ {+ "datasource": {+ "uid": "${datasource}"+ },+ "expr": "trilium_attributes_total{job=~'$job',instance=~'$instance'}",+ "refId": "A"+ }+ ],+ "title": "🏷️ Attributes",+ "type": "stat"+ },+ {+ "datasource": {+ "uid": "${datasource}"+ },+ "description": "Number of note revisions",+ "fieldConfig": {+ "defaults": {+ "color": {+ "mode": "thresholds"+ },+ "mappings": [],+ "thresholds": {+ "mode": "absolute",+ "steps": [+ {+ "color": "green"+ }+ ]+ },+ "unit": "short"+ },+ "overrides": []+ },+ "gridPos": {+ "h": 4,+ "w": 6,+ "x": 12,+ "y": 26+ },+ "id": 403,+ "options": {+ "colorMode": "value",+ "graphMode": "none",+ "justifyMode": "center",+ "orientation": "auto",+ "percentChangeColorMode": "standard",+ "reduceOptions": {+ "calcs": [+ "lastNotNull"+ ],+ "fields": "",+ "values": false+ },+ "showPercentChange": false,+ "textMode": "auto",+ "wideLayout": true+ },+ "pluginVersion": "12.0.1",+ "targets": [+ {+ "datasource": {+ "uid": "${datasource}"+ },+ "expr": "trilium_revisions_total{job=~'$job',instance=~'$instance'}",+ "refId": "A"+ }+ ],+ "title": "🔄 Revisions",+ "type": "stat"+ },+ {+ "datasource": {+ "uid": "${datasource}"+ },+ "description": "Number of ETAPI tokens",+ "fieldConfig": {+ "defaults": {+ "color": {+ "mode": "thresholds"+ },+ "mappings": [],+ "thresholds": {+ "mode": "absolute",+ "steps": [+ {+ "color": "green"+ }+ ]+ },+ "unit": "short"+ },+ "overrides": []+ },+ "gridPos": {+ "h": 4,+ "w": 6,+ "x": 18,+ "y": 26+ },+ "id": 404,+ "options": {+ "colorMode": "value",+ "graphMode": "none",+ "justifyMode": "center",+ "orientation": "auto",+ "percentChangeColorMode": "standard",+ "reduceOptions": {+ "calcs": [+ "lastNotNull"+ ],+ "fields": "",+ "values": false+ },+ "showPercentChange": false,+ "textMode": "auto",+ "wideLayout": true+ },+ "pluginVersion": "12.0.1",+ "targets": [+ {+ "datasource": {+ "uid": "${datasource}"+ },+ "expr": "trilium_etapi_tokens_total{job=~'$job',instance=~'$instance'}",+ "refId": "A"+ }+ ],+ "title": "🔑 API Tokens",+ "type": "stat"+ },+ {+ "datasource": {+ "uid": "${datasource}"+ },+ "description": "Various storage and system metrics",+ "fieldConfig": {+ "defaults": {+ "color": {+ "mode": "palette-classic"+ },+ "custom": {+ "axisBorderShow": false,+ "axisCenteredZero": false,+ "axisColorMode": "text",+ "axisLabel": "",+ "axisPlacement": "auto",+ "barAlignment": 0,+ "barWidthFactor": 0.6,+ "drawStyle": "line",+ "fillOpacity": 10,+ "gradientMode": "none",+ "hideFrom": {+ "legend": false,+ "tooltip": false,+ "viz": false+ },+ "insertNulls": false,+ "lineInterpolation": "linear",+ "lineWidth": 2,+ "pointSize": 5,+ "scaleDistribution": {+ "type": "linear"+ },+ "showPoints": "auto",+ "spanNulls": false,+ "stacking": {+ "group": "A",+ "mode": "none"+ },+ "thresholdsStyle": {+ "mode": "off"+ }+ },+ "mappings": [],+ "thresholds": {+ "mode": "absolute",+ "steps": [+ {+ "color": "green"+ }+ ]+ },+ "unit": "short"+ },+ "overrides": [+ {+ "matcher": {+ "id": "byName",+ "options": "Recent Notes"+ },+ "properties": [+ {+ "id": "color",+ "value": {+ "fixedColor": "yellow",+ "mode": "fixed"+ }+ }+ ]+ }+ ]+ },+ "gridPos": {+ "h": 8,+ "w": 12,+ "x": 0,+ "y": 30+ },+ "id": 405,+ "options": {+ "legend": {+ "calcs": [+ "last"+ ],+ "displayMode": "table",+ "placement": "bottom",+ "showLegend": true+ },+ "tooltip": {+ "hideZeros": false,+ "mode": "multi",+ "sort": "desc"+ }+ },+ "pluginVersion": "12.0.1",+ "targets": [+ {+ "datasource": {+ "uid": "${datasource}"+ },+ "expr": "trilium_blobs_total{job=~'$job',instance=~'$instance'}",+ "legendFormat": "Blob Records",+ "refId": "A"+ },+ {+ "datasource": {+ "uid": "${datasource}"+ },+ "expr": "trilium_recent_notes_total{job=~'$job',instance=~'$instance'}",+ "legendFormat": "Recent Notes",+ "refId": "B"+ },+ {+ "datasource": {+ "uid": "${datasource}"+ },+ "expr": "trilium_embeddings_total{job=~'$job',instance=~'$instance'}",+ "legendFormat": "Embeddings",+ "refId": "C"+ },+ {+ "datasource": {+ "uid": "${datasource}"+ },+ "expr": "trilium_embedding_providers_total{job=~'$job',instance=~'$instance'}",+ "legendFormat": "Embedding Providers",+ "refId": "D"+ }+ ],+ "title": "📊 Storage & System Metrics",+ "type": "timeseries"+ },+ {+ "datasource": {+ "uid": "${datasource}"+ },+ "description": "Timeline showing when content was created and last modified",+ "fieldConfig": {+ "defaults": {+ "color": {+ "mode": "palette-classic"+ },+ "custom": {+ "axisBorderShow": false,+ "axisCenteredZero": false,+ "axisColorMode": "text",+ "axisLabel": "",+ "axisPlacement": "auto",+ "barAlignment": 0,+ "barWidthFactor": 0.6,+ "drawStyle": "points",+ "fillOpacity": 0,+ "gradientMode": "none",+ "hideFrom": {+ "legend": false,+ "tooltip": false,+ "viz": false+ },+ "insertNulls": false,+ "lineInterpolation": "linear",+ "lineWidth": 1,+ "pointSize": 8,+ "scaleDistribution": {+ "type": "linear"+ },+ "showPoints": "always",+ "spanNulls": false,+ "stacking": {+ "group": "A",+ "mode": "none"+ },+ "thresholdsStyle": {+ "mode": "off"+ }+ },+ "mappings": [],+ "thresholds": {+ "mode": "absolute",+ "steps": [+ {+ "color": "green"+ }+ ]+ },+ "unit": "dateTimeAsIso"+ },+ "overrides": []+ },+ "gridPos": {+ "h": 8,+ "w": 12,+ "x": 12,+ "y": 30+ },+ "id": 406,+ "options": {+ "legend": {+ "calcs": [],+ "displayMode": "list",+ "placement": "bottom",+ "showLegend": true+ },+ "tooltip": {+ "hideZeros": false,+ "mode": "single",+ "sort": "none"+ }+ },+ "pluginVersion": "12.0.1",+ "targets": [+ {+ "datasource": {+ "uid": "${datasource}"+ },+ "expr": "trilium_oldest_note_timestamp{job=~'$job',instance=~'$instance'} * 1000",+ "legendFormat": "Oldest Note",+ "refId": "A"+ },+ {+ "datasource": {+ "uid": "${datasource}"+ },+ "expr": "trilium_newest_note_timestamp{job=~'$job',instance=~'$instance'} * 1000",+ "legendFormat": "Newest Note",+ "refId": "B"+ },+ {+ "datasource": {+ "uid": "${datasource}"+ },+ "expr": "trilium_last_modified_timestamp{job=~'$job',instance=~'$instance'} * 1000",+ "legendFormat": "Last Modified",+ "refId": "C"+ }+ ],+ "title": "⏰ Content Timeline",+ "type": "timeseries"+ }+ ],+ "preload": false,+ "refresh": "1m",+ "schemaVersion": 41,+ "tags": [+ "trilium",+ "notes",+ "monitoring",+ "enhanced"+ ],+ "templating": {+ "list": [+ {+ "current": {+ "text": "myprom",+ "value": "PA04845DA3A4B088E"+ },+ "includeAll": false,+ "label": "Datasource",+ "name": "datasource",+ "options": [],+ "query": "prometheus",+ "refresh": 1,+ "regex": "//",+ "type": "datasource"+ },+ {+ "allValue": ".*",+ "current": {+ "text": "All",+ "value": "$__all"+ },+ "datasource": {+ "UID": "",+ "type": ""+ },+ "includeAll": true,+ "label": "Job",+ "multi": true,+ "name": "job",+ "options": [],+ "query": "query_result(up)",+ "refresh": 1,+ "regex": "/job=\"([^\"]+)\"/",+ "sort": 1,+ "type": "query"+ },+ {+ "allValue": ".*",+ "current": {+ "text": [+ "All"+ ],+ "value": [+ "$__all"+ ]+ },+ "datasource": {+ "type": "prometheus",+ "uid": "${datasource}"+ },+ "includeAll": true,+ "label": "Instance",+ "multi": true,+ "name": "instance",+ "options": [],+ "query": "trilium_database_size_bytes",+ "refresh": 1,+ "regex": "/instance=\"([^\"]+)\"/",+ "sort": 1,+ "type": "query"+ }+ ]+ },+ "time": {+ "from": "now-1h",+ "to": "now"+ },+ "timepicker": {},+ "timezone": "browser",+ "title": "TriliumNext Dashboard",+ "uid": "06993f9b-a477-4723-bf18-47743393b382",+ "version": 5+}\ No newline at end of filediff --git a/docs/User Guide/User Guide/Advanced Usage/Metrics_image.png b/docs/User Guide/User Guide/Advanced Usage/Metrics_image.pngnew file mode 100644index 0000000000..ae68ddd02aBinary files /dev/null and b/docs/User Guide/User Guide/Advanced Usage/Metrics_image.png differdiff --git a/docs/User Guide/User Guide/Advanced Usage/Nightly release.md b/docs/User Guide/User Guide/Advanced Usage/Nightly release.mdnew file mode 100644index 0000000000..3ef005cd57--- /dev/null+++ b/docs/User Guide/User Guide/Advanced Usage/Nightly release.md@@ -0,0 +1,64 @@+# Nightly release+Nightly releases are versions built every day, containing the latest improvements and bugfixes, directly from the main development branch. These versions are generally useful in preparation for a release, to ensure that there are no significant bugs that need to be addressed first, or they can be used to confirm whether a particular bug is fixed or feature is well implemented.++## Regarding the stability++Despite being on a development branch, generally the main branch is pretty stable since PRs are tested before they are merged. If you notice any issues, feel free to report them either via a ticket or via the Matrix.++## Downloading the nightly release manually++Go to [github.com/TriliumNext/Trilium/releases/tag/nightly](https://github.com/TriliumNext/Trilium/releases/tag/nightly) and look for the artifacts starting with `TriliumNotes-main`. Choose the appropriate one for your platform (e.g. `windows-x64.zip`).++Depending on your use case, you can either test the portable version or even use the installer.++> [!NOTE]+> If you choose the installable version (e.g. the .exe on Windows), it will replace your stable installation.++> [!IMPORTANT]+> By default, the nightly uses the same database as the production version. Generally you could easily downgrade if needed. However, if there are changes to the database or sync version, it will not be possible to downgrade without having to restore from a backup.++## Automatically download and install the latest nightly++This is pretty useful if you are a beta tester that wants to periodically update their version:++## On Ubuntu (Bash)++```sh+#!/usr/bin/env bash++name=TriliumNotes-linux-x64-nightly.deb+rm -f $name*+wget https://github.com/TriliumNext/Trilium/releases/download/nightly/$name+sudo apt-get install ./$name+rm $name+```++## On Windows (PowerShell)++```powershell+if ($env:PROCESSOR_ARCHITECTURE -eq "ARM64") {+ $arch = "arm64";+} else {+ $arch = "x64";+}++$exeUrl = "https://github.com/TriliumNext/Trilium/releases/download/nightly/TriliumNotes-main-windows-$($arch).exe";+Write-Host "Downloading $($exeUrl)"++# Generate a unique path in the temp dir+$guid = [guid]::NewGuid().ToString()+$destination = Join-Path -Path $env:TEMP -ChildPath "$guid.exe"++try {+ $ProgressPreference = 'SilentlyContinue'+ Invoke-WebRequest -Uri $exeUrl -OutFile $destination+ $process = Start-Process -FilePath $destination+} catch {+ Write-Error "An error occurred: $_"+} finally {+ # Clean up+ if (Test-Path $destination) {+ Remove-Item -Path $destination -Force+ }+}+```\ No newline at end of filediff --git a/docs/User Guide/User Guide/Advanced Usage/Note ID.md b/docs/User Guide/User Guide/Advanced Usage/Note ID.mdnew file mode 100644index 0000000000..9fd0bd4cff--- /dev/null+++ b/docs/User Guide/User Guide/Advanced Usage/Note ID.md@@ -0,0 +1,16 @@+# Note ID+Whereas some applications use file names to uniquely identify notes, Trilium uses the concept of Note ID.++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.++## How does the import/export affect the note IDs++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 <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Notes/Attachments.md">Attachments</a>.++## Note collisions++Since the Note ID is a fixed-width randomly generated number, due to the [pigeonhole principle](https://en.wikipedia.org/wiki/Pigeonhole_principle), there is a possibility that a newly created note will have the same ID as an existing note.++Since the note ID is alphanumeric and the length is 12 we have $62^{12}$ unique IDs. However since we are generating them randomly, we can use a collision calculator such as the one for [Nano ID](https://alex7kom.github.io/nano-nanoid-cc/?alphabet=0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&size=12&speed=1000&speedUnit=hour) 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.++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 [Git](https://stackoverflow.com/questions/10434326/hash-collision-in-git). If one would theoretically occur, what would most likely happen is that the existing note will be replaced by the new one.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Advanced Usage/Note Map (Link map, Tree map).md b/docs/User Guide/User Guide/Advanced Usage/Note Map (Link map, Tree map).mdnew file mode 100644index 0000000000..06e0ff5e6c--- /dev/null+++ b/docs/User Guide/User Guide/Advanced Usage/Note Map (Link map, Tree map).md@@ -0,0 +1,60 @@+# Note Map (Link map, Tree map)+Note map is a visualization of connections between notes. This provides an insight into a structure ("web") of notes.++There are two types of note map:++* Link Map, which shows relations between notes.+* Note Map, which shows the hierarchical tree structure.++## Accessing the note map++The note map comes into multiple flavors:++* To access the note map for the current note:+ * On the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/New%20Layout.md">New Layout</a>, the note map is available in the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Right%20Sidebar/Connections%20tab.md">Connections tab</a> in the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Right%20Sidebar.md">Right Sidebar</a>.+ * On the old layout, the note map is a tab in the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Ribbon.md">Ribbon</a>.+* To display a full-screen note map, there is a [dedicated note type](../Note%20Types/Note%20Map.md) with the same name.+* To view the global note map (of all the notes in the knowledge base), there is a dedicated _Note map_ button in the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Launch%20Bar.md">Launch Bar</a>.++## Terminology and structure++* Each note is represented as a _node_ in the graph, with the title displayed underneath.+ * When the map is zoomed out, the title can still be viewed by hovering over the node.+ * The [icon and color](../Basic%20Concepts%20and%20Features/Notes/Note%20Icons%20%26%20Colors.md) of the note are respected.+* The root node is the reference point for which the relations and hierarchical structure are displayed.+ * When accessing the note map through the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Ribbon.md">Ribbon</a> or the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Right%20Sidebar.md">Right Sidebar</a> (new layout), the root node is the current note.+ * When using a dedicated <a class="reference-link" href="../Note%20Types/Note%20Map.md">Note Map</a> note, the root note can be either the parent note, the currently [hoisted](../Basic%20Concepts%20and%20Features/Navigation/Note%20Hoisting.md) note or a specific note. See the note type documentation for more information.++## Interaction++* Nodes can be dragged around, but they will return to their original position once released.+ * To have the notes remain in the same position as they were dragged, press the _Fix nodes_ button. The position of the notes is not saved, so it will return to normal once you navigate to another note or restart the application.+* When hovering over a node, the adjacent relations and nodes are highlighted.+* The distance between nodes can be adjusted via the slider in the bottom-left. Similarly, this value is not saved.+* <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Notes/Archived%20Notes.md">Archived Notes</a> are generally ignored by the note map in order to reduce clutter. There is one exception: if the root note is also archived, then all archived notes are displayed too.++## Link Map++<img src="Note Map (Link map, Tree map)_image.png" width="1425" height="1093">++The link map is a visualization of links and <a class="reference-link" href="Attributes/Relations.md">Relations</a> incoming to and outgoing from a particular note.++The map indicates the following types of relations:++* <a class="reference-link" href="../Note%20Types/Text/Links/Internal%20(reference)%20links.md">Internal (reference) links</a> between notes.+* <a class="reference-link" href="Attributes/Relations.md">Relations</a>++The link map will also show unlinked notes that are part of the hierarchy as a cloud of unconnected dots. On the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/New%20Layout.md">New Layout</a>, the sidebar deliberately omits this in order to save some space, but they will be revealed once the map is maximized.++## Tree Map++Shows hierarchical map of notes:++<figure class="image"><img style="aspect-ratio:1420/1490;" src="1_Note Map (Link map, Tree map)_image.png" width="1420" height="1490"></figure>++## See also++* 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 <a class="reference-link" href="../Note%20Types/Note%20Map.md">Note Map</a> for more information.+* <a class="reference-link" href="../Note%20Types/Relation%20Map.md">Relation Map</a> is a similar concept, with some differences:+ * note map is automatically generated while relation map must be created manually+ * relation map is a type of note while a link map is just virtual visualization\ No newline at end of filediff --git a/docs/User Guide/User Guide/Advanced Usage/Note Map (Link map, Tree map)_image.png b/docs/User Guide/User Guide/Advanced Usage/Note Map (Link map, Tree map)_image.pngnew file mode 100644index 0000000000..60579c57daBinary files /dev/null and b/docs/User Guide/User Guide/Advanced Usage/Note Map (Link map, Tree map)_image.png differdiff --git a/docs/User Guide/User Guide/Advanced Usage/Note source.md b/docs/User Guide/User Guide/Advanced Usage/Note source.mdnew file mode 100644index 0000000000..b62296b433--- /dev/null+++ b/docs/User Guide/User Guide/Advanced Usage/Note source.md@@ -0,0 +1,55 @@+# Note source+## Understanding the source code of the different notes++Internally, the structure of the content of each note is different based on the <a class="reference-link" href="../Note%20Types.md">Note Types</a>.++For example:++* <a class="reference-link" href="../Note%20Types/Text.md">Text</a> notes are represented internally as HTML, using the <a class="reference-link" href="Technologies%20used/CKEditor.md">CKEditor</a> representation. Note that due to the custom plugins, some HTML elements are specific to Trilium only, for example the admonitions.+* <a class="reference-link" href="../Note%20Types/Code.md">Code</a> notes are plain text and are represented internally as-is.+* <a class="reference-link" href="../Collections/Geo%20Map.md">Geo Map</a> notes contain only minimal information (viewport, zoom) as a JSON.+* <a class="reference-link" href="../Note%20Types/Canvas.md">Canvas</a> notes are represented as JSON, with Trilium's own information alongside with [Excalidraw](Technologies%20used.md)'s internal JSON representation format.+* <a class="reference-link" href="../Note%20Types/Mind%20Map.md">Mind Map</a> notes are represented as JSON, with the internal format of [MindElixir](Technologies%20used.md).++Note that some information is also stored as <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Notes/Attachments.md">Attachments</a>. For example <a class="reference-link" href="../Note%20Types/Canvas.md">Canvas</a> notes use the attachments feature to store the custom libraries, and alongside with <a class="reference-link" href="../Note%20Types/Mind%20Map.md">Mind Map</a> 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.++Here's part of the HTML representation of this note, as it's stored in the database (but prettified).++```+<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 + <a class="reference-link" href="../Note%20Types.md">+ Note Types+ </a>+ .+</p>+```++## Viewing the source code++It is possible to view the source code of a note by pressing the contextual menu in <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20buttons.md">Note buttons</a> and selecting _Note source_.++++The source code will be displayed in a new tab.++For some note types, such as text notes and JSON notes, the source code is also formatted in order to be more easily readable.++## Modifying the source code++It is possible to modify the source code of a note directly, however not via the _Note source_ functionality.++To do so:++1. 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.+2. Confirm the warning about changing the note type.+3. The source code will appear, make the necessary modifications.+4. Change the note type back to the real note type.++> [!WARNING]+> 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.+>+> 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.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Advanced Usage/Note source_image.png b/docs/User Guide/User Guide/Advanced Usage/Note source_image.pngnew file mode 100644index 0000000000..71f0ddf4aeBinary files /dev/null and b/docs/User Guide/User Guide/Advanced Usage/Note source_image.png differdiff --git a/docs/User Guide/User Guide/Advanced Usage/Read-only database.md b/docs/User Guide/User Guide/Advanced Usage/Read-only database.mdnew file mode 100644index 0000000000..3152c7129b--- /dev/null+++ b/docs/User Guide/User Guide/Advanced Usage/Read-only database.md@@ -0,0 +1,32 @@+# Read-only database+> [!WARNING]+> This functionality is still in preview, expect possible issues or even the feature disappearing completely.+> Feel free to [report](../Troubleshooting/Reporting%20issues.md) any issues you might have.++The read-only database is an alternative to <a class="reference-link" href="Sharing.md">Sharing</a> notes. Although the share functionality works pretty well to publish pages to the Internet in a wiki, blog-like format it does not offer the full functionality behind Trilium (such as the advanced <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Navigation/Search.md">Search</a> or the interactivity behind <a class="reference-link" href="../Collections.md">Collections</a> or the various <a class="reference-link" href="../Note%20Types.md">Note Types</a>).++When the database is in read-only mode, the Trilium application can be used as normal, but editing is disabled and changes are made in-memory only.++## What it does++* All notes are read-only, without the possibility of editing them.+* Features that would normally alter the database such as the list of recent notes are disabled.++## Limitations++* Some features might “slip through” and still end up creating a note, for example.+ * However, the database is still read-only, so all modifications will be reset if the server is restarted.+ * Whenever this occurs, `ERROR: read-only DB ignored` will be shown in the logs.++## Setting a database as read-only++First, make sure the database is initialized (e.g. the first set up is complete). Then modify the [config.ini](Configuration%20\(config.ini%20or%20environment%20variables\).md) by looking for the `[General]` section and adding a new `readOnly` field:++```+[General]+readOnly=true+```++If your server is already running, restart it to apply the changes.++Similarly, to disable read-only remove the line or set it to `false`.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Advanced Usage/Safe mode.md b/docs/User Guide/User Guide/Advanced Usage/Safe mode.mdnew file mode 100644index 0000000000..e35be7ba13--- /dev/null+++ b/docs/User Guide/User Guide/Advanced Usage/Safe mode.md@@ -0,0 +1,11 @@+# Safe mode+Safe mode is triggered by setting the `TRILIUM_SAFE_MODE` environment variable to a truthy value, usually `1`.++In each artifact there is a `trilium-safe-mode.sh` (or `.bat`) script to enable it.++What it does:++* Disables `customWidget` launcher types in `app/widgets/containers/launcher.js`.+* Disables the running of `mobileStartup` or `frontendStartup` scripts.+* Displays the root note instead of the previously saved session.+* Disables the running of `backendStartup`, `hourly`, `daily` scripts and checks for the hidden subtree.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Advanced Usage/Sharing.md b/docs/User Guide/User Guide/Advanced Usage/Sharing.mdnew file mode 100644index 0000000000..69082c3db1--- /dev/null+++ b/docs/User Guide/User Guide/Advanced Usage/Sharing.md@@ -0,0 +1,314 @@+# Sharing+Trilium allows you to share selected notes as **publicly accessible** read-only documents. This feature is particularly useful for publishing content directly from your Trilium notes, making it accessible to others online.++<figure class="image"><img style="aspect-ratio:1144/660;" src="Sharing_image.png" width="1144" height="660"></figure>++## Features, interaction and limitations++* Searching by note title.+* Automatic dark/light mode based on the user's browser settings.+* Mobile-friendly layout, with sidebar.+* Collapsible tree with the same note icons as the application.+* Customizable logo.+* Toggle button for dark/light mode, which also stores the user preferences.+* Quick navigation buttons (previous and next note).+* Displaying the date of the last update of the note.++### By note type++<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> </th>+ <th>Supported features</th>+ <th>Limitations</th>+ </tr>+ </thead>+ <tbody>+ <tr>+ <th><a class="reference-link" href="../Note%20Types/Text.md">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><li><a href="../Note%20Types/Text/Include%20Note.md">Including notes</a> (only if the included notes are also shared).</li></ul></td>+ <td><ul><li>Inline Mermaid diagrams are not rendered.</li></ul></td>+ </tr>+ <tr>+ <th><a class="reference-link" href="../Note%20Types/Code.md">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="../Note%20Types/Saved%20Search.md">Saved Search</a></th>+ <td>Not supported.</td>+ <td> </td>+ </tr>+ <tr>+ <th><a class="reference-link" href="../Note%20Types/Relation%20Map.md">Relation Map</a></th>+ <td>Not supported.</td>+ <td> </td>+ </tr>+ <tr>+ <th><a class="reference-link" href="../Note%20Types/Note%20Map.md">Note Map</a></th>+ <td>Not supported.</td>+ <td> </td>+ </tr>+ <tr>+ <th><a class="reference-link" href="../Note%20Types/Render%20Note.md">Render Note</a></th>+ <td>Not supported.</td>+ <td> </td>+ </tr>+ <tr>+ <th><a class="reference-link" href="../Collections.md">Collections</a></th>+ <td><ul><li>The child notes are displayed in a fixed format. </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="../Note%20Types/Mermaid%20Diagrams.md">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="../Note%20Types/Canvas.md">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="../Note%20Types/Web%20View.md">Web View</a></th>+ <td>Not supported.</td>+ <td> </td>+ </tr>+ <tr>+ <th><a class="reference-link" href="../Note%20Types/Mind%20Map.md">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="../Collections/Geo%20Map.md">Geo Map</a></th>+ <td>Not supported.</td>+ <td> </td>+ </tr>+ <tr>+ <th><a class="reference-link" href="../Note%20Types/File.md">File</a></th>+ <td>Basic interaction (downloading the file).</td>+ <td><ul><li>No further interaction supported.</li></ul></td>+ </tr>+ </tbody>+</table>++While the sharing feature is powerful, it has some limitations:++* **Code Notes**: No syntax highlighting.+* **Static Note Tree**+* **Protected Notes**: Cannot be shared.+* **Include Notes**: Not supported.++Some of these limitations may be addressed in future updates.++## Prerequisites++To use the sharing feature, you must have a <a class="reference-link" href="../Installation%20%26%20Setup/Server%20Installation.md">Server Installation</a> of Trilium. This is necessary because the notes will be hosted from the server.++## Sharing a note++1. **Enable Sharing**: To share a note, toggle the `Shared` switch within the note's interface. Once sharing is enabled, an URL will appear, which you can click to access the shared note.++ +2. **Access the Shared Note**: 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 `localhost (127.0.0.1)`.++## Sharing a note subtree++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.++## Viewing and managing shared notes++You can view a list of all shared notes by clicking on "Show Shared Notes Subtree" in the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Global%20menu.md">Global menu</a>. This allows you to manage and navigate through all the notes you have made public.++## Security considerations++* Shared notes are published on the open internet and can be accessed by anyone with the URL unless the notes are password-protected.+* The URL's randomness does not provide security, so it is crucial not to share sensitive information through this feature.+* Trilium takes precautions to protect your publicly shared instance from leaking information for non-shared notes, including opening a separate read-only connection to the <a class="reference-link" href="Database.md">Database</a>. Depending on your threat model, it might make more sense to use <a class="reference-link" href="Sharing/Exporting%20static%20HTML%20for%20web%20publishing.md">Exporting static HTML for web publishing</a> and use battle-tested web servers such as Nginx or Apache to serve static content.++### Password protection++To protect shared notes with a username and password, you can use the `#shareCredentials` attribute. Add this label to the note with the format `#shareCredentials="username:password"`. To protect an entire subtree, make sure the label is [inheritable](Attributes/Attribute%20Inheritance.md).++## Advanced sharing options++### Customizing the appearance of shared notes++The default design should be a good starting point, but you can customize it using your own CSS:++* **Custom CSS**: Link a CSS <a class="reference-link" href="../Note%20Types/Code.md">Code</a> note to the shared page by adding a `~shareCss` 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 `#shareHiddenFromTree` label.+* **Omitting Default CSS**: For extensive styling changes, use the `#shareOmitDefaultCss` label to avoid conflicts with Trilium's [default stylesheet](../Basic%20Concepts%20and%20Features/Themes.md).++### Adding JavaScript++You can inject custom JavaScript into the shared note using the `~shareJs` relation. This allows you to access note attributes or traverse the note tree using the `fetchNote()` API, which retrieves note data based on its ID.++### Adding custom HTML++You can inject custom HTML snippets into specific locations of the shared page using the `~shareHtml` relation. The HTML note should contain the raw HTML content you want to inject, and you can control where it appears by adding the `#shareHtmlLocation` label to the HTML snippet note itself.++The `#shareHtmlLocation` label accepts values in the format `location:position`:++* **Locations**: `head`, `body`, `content`+* **Positions**: `start`, `end`++For example:++* `#shareHtmlLocation=head:start` - Injects HTML at the beginning of the `<head>` section+* `#shareHtmlLocation=head:end` - Injects HTML at the end of the `<head>` section (default)+* `#shareHtmlLocation=body:start` - Injects HTML at the beginning of the `<body>` section+* `#shareHtmlLocation=content:start` - Injects HTML at the beginning of the content area+* `#shareHtmlLocation=content:end` - Injects HTML at the end of the content area++If no location is specified, the HTML will be injected at `content:end` by default.++Example:++```javascript+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);+}+```++### Custom share templates++To completely redesign the share, it is possible to create or use an existing [custom share template](Sharing/Custom%20share%20template.md).++### Creating human-readable URL aliases++Shared notes typically have URLs like `http://domain.tld/share/knvU8aJy4dJ7`, where the last part is the note's ID. You can make these URLs more user-friendly by adding the `#shareAlias` label to individual notes (e.g., `#shareAlias=highlighting`). This will change the URL to `http://domain.tld/share/highlighting`.++**Important**:++1. Ensure that aliases are unique.+2. Using slashes (`/`) within aliases to create subpaths is not supported.++> [!TIP]+> * To easily identify pages that don't have a share alias, run a <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Navigation/Search.md">Search</a> with `#!shareAlias`.+> * To be able to enter the share alias faster, consider using <a class="reference-link" href="Attributes/Promoted%20Attributes.md">Promoted Attributes</a> (for example `#label:shareAlias(inheritable)="promoted,alias=Slug,single,text"`).++### Setting a custom favicon++To customize the favicon for your shared pages, create a relation `~shareFavicon` pointing to a file note containing the favicon (e.g., in `.ico` format).++### Sharing a note as the root++You can designate a specific note or folder as the root of your shared content by adding the `#shareRoot` label. This note will be linked when visiting `[http://domain.tld/share](http://domain/share)`, making it easier to use Trilium as a fully-fledged website.++> [!TIP]+> Consider combining this with the `#shareIndex` label, which will display a list of all shared notes.++### Displaying an index of shared notes++When accessing a share, the sub-notes will be displayed in a tree on the left. But since multiple note trees can be shared, it might be useful to display a list of all the different share trees.++To do so, create a shared text note and apply the `shareIndex` label. When viewed, the list of shared roots will be displayed at the bottom of the note.++### Linking to an external website++Sometimes it's useful to include a link to an external website alongside your shared notes — for example in the shared navigation or in an index. To do so, add the `#shareExternalLink` label to a note, with the target URL as its value (e.g. `#shareExternalLink="https://example.com"`).++Any link pointing to this note will then redirect to the external website and open in a new browser tab, instead of opening the note's own shared page. This applies to:++* the listing produced by the `#shareIndex` label;+* the "Subpages" list shown under a parent note;+* inline links to this note from within other shared notes.++The URL must be absolute and include the scheme (e.g. `https://`).++> [!NOTE]+> The note still exists in the share tree and its own page remains reachable by its direct URL — the label only changes how links to it behave.++## Attribute reference++<table class="ck-table-resized">+ <colgroup>+ <col style="width:18.38%;">+ <col style="width:81.62%;">+ </colgroup>+ <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>when a link points to this note (from the share index, a subpage list, or an inline link in another shared note), it redirects to the given external URL in a new tab instead of the note's shared page. Value is the absolute URL, e.g. <code>https://example.com</code>.</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 <a class="reference-link" href="Sharing/Serving%20directly%20the%20content%20of%20a%20note.md">Serving directly the content of a note</a> 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>+ <tr>+ <td><code>#shareHtmlLocation</code></td>+ <td>defines where custom HTML injected via <code>~shareHtml</code> relation should be placed. Applied to the HTML snippet note itself. Format: <code>location:position</code> where location is <code>head</code>, <code>body</code>, or <code>content</code> and position is <code>start</code> or <code>end</code>. Defaults to <code>content:end</code>.</td>+ </tr>+ </tbody>+</table>++### Customizing logo++It's possible to adjust the logo which is displayed on the top-left of the left pane.++| Attribute | Description |+| --- | --- |+| `~shareLogo` | Relation set to an image to use as logo. The image must be part of the share tree (it can be hidden if needed). |+| `#shareLogoWidth` | The width (in pixels, without unit) to set for the logo. Default is `53`. |+| `#shareLogoHeight` | The height (in pixels, without unit) to set for the logo. Default is `40`. |+| `#shareRootLink` | URL to navigate to when the logo is pressed. |++### Customizing OpenGraph++| Attribute | Description |+| --- | --- |+| `#shareOpenGraphColor` | This adjusts the `theme-color` meta-property. |+| `#shareOpenGraphURL` | This adjusts the `og:url` and `twitter:url` meta-properties. |+| `#shareOpenGraphDomain` | Adjusts the `twitter:domain` meta-property. |+| `#shareOpenGraphImage` <br>`~shareOpenGraphImage` | Can be either a label, case in which the value is passed on as-is, or it can be a relation to an image <a class="reference-link" href="../Note%20Types/File.md">File</a>. This controls the `og:image` meta-property. |++## Credits++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 [Trilium Rocks!](https://github.com/zerebos/trilium.rocks) by [zerebos](https://github.com/zerebos).\ No newline at end of filediff --git a/docs/User Guide/User Guide/Advanced Usage/Sharing/1_Serving directly the content of a note_image.png b/docs/User Guide/User Guide/Advanced Usage/Sharing/1_Serving directly the content of a note_image.pngnew file mode 100644index 0000000000..23592294b1Binary files /dev/null and b/docs/User Guide/User Guide/Advanced Usage/Sharing/1_Serving directly the content of a note_image.png differdiff --git a/docs/User Guide/User Guide/Advanced Usage/Sharing/Custom share template.md b/docs/User Guide/User Guide/Advanced Usage/Sharing/Custom share template.mdnew file mode 100644index 0000000000..d3c2c09449--- /dev/null+++ b/docs/User Guide/User Guide/Advanced Usage/Sharing/Custom share template.md@@ -0,0 +1,60 @@+# Custom share template+> [!NOTE]+> This topic of creating share templates is considered advanced and requires JavaScript/EJS knowledge.+>+> The default share template should cover most normal uses.++For full control over the HTML structure of a shared page — beyond what custom CSS, JS, or HTML snippets allow — you can replace the page template entirely using the `~shareTemplate` relation.++To do so:++1. Create a <a class="reference-link" href="../../Note%20Types/Code.md">Code</a> note with the language _Embedded JavaScript_ (EJS).+2. For a shared note to apply the newly created template, apply the `~shareTemplate` relation pointing to the note created at step (1). Make use of <a class="reference-link" href="../Attributes/Attribute%20Inheritance.md">Attribute Inheritance</a> to apply it to multiple shared notes.++There are two important constraints to be aware of:++* Because EJS templates execute arbitrary server-side JavaScript, `~shareTemplate` only takes effect when backend scripting is enabled. If it is disabled (see <a class="reference-link" href="../../Scripting/Security.md">Security</a>), the relation is ignored and the default template is used. For the same reason, **only apply templates from notes you trust**.+* The template note must be part of the shared subtree (just like `~shareCss`, `~shareJs`) in order for it to be loaded. To prevent it from being shown in the navigation, apply `#shareHiddenFromTree` to it.++## Content of the share template++Use the [original template](https://github.com/TriliumNext/Notes/blob/develop/packages/share-theme/src/templates/page.ejs) as reference when creating a new share template.++## Available variables++Your template is rendered with a context object exposing the note and its rendering environment. The most useful values are:++| Variable | Description |+| --- | --- |+| `note` | The note being rendered. Use it to read attributes (`note.getLabelValue(...)`), `note.title`, child notes, etc. |+| `content` | The note's already-rendered HTML content, as a string. |+| `header` | Extra HTML to place in the document head for this note (used by some note types). |+| `isEmpty` | `true` when the note has no content of its own. |+| `subRoot` | The root of the shared subtree as `{ note, branch }` — handy for a site-wide title or logo. |+| `cssToLoad` / `jsToLoad` | Arrays of stylesheet / script URLs the default theme would inject (includes anything added via `~shareCss` / `~shareJs`). |+| `faviconUrl` / `logoUrl` | Resolved favicon and logo URLs. |+| `isStatic` | `true` during a static HTML export, `false` for a live server render. |+| `t` | The `i18next` translation function. |+| `utils` | Helper utilities such as `slugify()` and `stripTags()`. |++## Error handling++If your template throws an error while rendering, Trilium logs the error and quietly falls back to the default template, so a broken template never takes the shared page down.++## Splitting a template into partials++A template can pull in other EJS notes as partials. Create them as **child notes** of the template note (each also a `code` / `application/x-ejs` note) and reference them by title:++```+<%- include("header") %>++<main>+ <h1><%= note.title %></h1>+ <%- content %>+</main>++<%- include("footer") %>++```++Here `header` and `footer` are the titles of child notes of the template. Only direct children are resolvable, and they must be EJS code notes.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Advanced Usage/Sharing/Exporting static HTML for web publishing.md b/docs/User Guide/User Guide/Advanced Usage/Sharing/Exporting static HTML for web publishing.mdnew file mode 100644index 0000000000..cc2e30825b--- /dev/null+++ b/docs/User Guide/User Guide/Advanced Usage/Sharing/Exporting static HTML for web publishing.md@@ -0,0 +1,49 @@+# Exporting static HTML for web publishing+As described in <a class="reference-link" href="../Sharing.md">Sharing</a>, Trilium can act as a public server in which the shared notes are displayed in read-only mode. While this can work in most cases, it's generally not meant for high-traffic websites and since it's running on a Node.js server it can be potentially exploited.++Another alternative is to generate static HTML files (just like other static site generators such as [MkDocs](https://www.mkdocs.org/)). Since the normal HTML ZIP export does not contain any styling or additional functionality, Trilium provides a way to export the same layout and style as the <a class="reference-link" href="../Sharing.md">Sharing</a> function into static HTML files.++Apart from the enhanced security, these HTML files are also easy to deploy on “serverless” deployments such as GitHub Pages or CloudFlare Pages and cache very easily.++> [!TIP]+> Trilium's documentation, available at [docs.triliumnotes.org](https://docs.triliumnotes.org/) is built using this function of exporting to static HTML files which are then deployed automatically to CloudFlare Pages.+>+> The process is [automated](https://github.com/TriliumNext/Trilium/blob/main/apps/edit-docs/src/build-docs.ts) by importing the Markdown documentation and exporting it via a script to the static web format.++## Differences from normal sharing++Apart from normal <a class="reference-link" href="../Sharing.md">Sharing</a>, exporting to static HTML files comes with a few subtle differences:++* The URL structure is different. Where in normal sharing it's something along the way of `example.com/share/noteid`, the notes follow an hierarchical structure, such as `docs.triliumnotes.org/user-guide/concepts/navigation/tree-concepts`.+* The `favicon.ico` is not handled automatically, it needs to be manually added on the server after the export is generated.+* The “Last updated” for notes is not available.+* The search functionality works slightly different since the normal one requires an active API to work. In the static export, search still works but uses a different mechanism so results might be different.++## Differences from normal .zip export++* The name of the files/URLs will prefer `shareAlias` to allow for clean URLs.+* The export requires a functional web server as the pages will not render properly if accessed locally via a web browser due to the use of module scripts.+* The directory structure is also slightly different:+ * A normal HTML export results in an index file and a single directory.+ * Instead, for static exporting the top-root level becomes the index file and the child directories are on the root instead.+ * This makes it possible to easily publish to a website, without forcing everything but the root note to be in a sub-directory.++## Testing locally++As mentioned previously, the exported static pages require a website to function. In order to test locally, a web server needs to be used.++One example is to use the Node.js-based [`http-server`](https://www.npmjs.com/package/http-server) which can be installed via:++```+npm i -g http-server+```++Once installed simply:++1. Extract the exported .zip file.+2. Inside the extracted directory, run `http-server`.+3. Access the indicated address (e.g. [http://localhost:8080](http://localhost:8080)).++## Automation++<a class="reference-link" href="../ETAPI%20(REST%20API).md">ETAPI (REST API)</a> could potentially be used to automate an export on a scheduled task.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Advanced Usage/Sharing/Reverse proxy configuration.md b/docs/User Guide/User Guide/Advanced Usage/Sharing/Reverse proxy configuration.mdnew file mode 100644index 0000000000..f3f3f02954--- /dev/null+++ b/docs/User Guide/User Guide/Advanced Usage/Sharing/Reverse proxy configuration.md@@ -0,0 +1,18 @@+# Reverse proxy configuration+It might be desirable to only expose the share functionality of Trilium to the Internet, and keep the application accessible only within a local network or via VPN.++To do so, a reverse proxy is required.++## Caddy++```+http://domain.com {+ reverse_proxy /share http://localhost:8080/share+}+```++This is for newer versions where the share functionality is isolated, for older versions it's required to also include `/assets`.[<sup>[1]</sup>](#fn2b8mg20aol8)++1. [**<sup>^</sup>**](#fnref2b8mg20aol8)++ [https://github.com/orgs/TriliumNext/discussions/7341#discussioncomment-14679897](https://github.com/orgs/TriliumNext/discussions/7341#discussioncomment-14679897)\ No newline at end of filediff --git a/docs/User Guide/User Guide/Advanced Usage/Sharing/Serving directly the content of a note.md b/docs/User Guide/User Guide/Advanced Usage/Sharing/Serving directly the content of a note.mdnew file mode 100644index 0000000000..40bb27c335--- /dev/null+++ b/docs/User Guide/User Guide/Advanced Usage/Sharing/Serving directly the content of a note.md@@ -0,0 +1,16 @@+# Serving directly the content of a note+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.++| A note displayed as a web page (HTML) | A note displayed as a raw format |+| --- | --- |+| <figure class="image"><img style="aspect-ratio:738/275;" src="1_Serving directly the content of a note_image.png" width="738" height="275"></figure> |  |++## By adding an attribute to the note++Simply add the `#shareRaw` attribute and the note will always be rendered _raw_ when accessed from the share URL.++## By altering the URL++Append `?raw` to the URL to display a note in its raw format regardless of whether the `#shareRaw` attribute is added on the note.++\ No newline at end of filediff --git a/docs/User Guide/User Guide/Advanced Usage/Sharing/Serving directly the content of a note_image.png b/docs/User Guide/User Guide/Advanced Usage/Sharing/Serving directly the content of a note_image.pngnew file mode 100644index 0000000000..bab0f97f53Binary files /dev/null and b/docs/User Guide/User Guide/Advanced Usage/Sharing/Serving directly the content of a note_image.png differdiff --git a/docs/User Guide/User Guide/Advanced Usage/Sharing_image.png b/docs/User Guide/User Guide/Advanced Usage/Sharing_image.pngnew file mode 100644index 0000000000..4c92b90c5aBinary files /dev/null and b/docs/User Guide/User Guide/Advanced Usage/Sharing_image.png differdiff --git a/docs/User Guide/User Guide/Advanced Usage/Sharing_share-single-note.png b/docs/User Guide/User Guide/Advanced Usage/Sharing_share-single-note.pngnew file mode 100644index 0000000000..87b99cabb2Binary files /dev/null and b/docs/User Guide/User Guide/Advanced Usage/Sharing_share-single-note.png differdiff --git a/docs/User Guide/User Guide/Advanced Usage/Snippets.md b/docs/User Guide/User Guide/Advanced Usage/Snippets.mdnew file mode 100644index 0000000000..1e346396a2--- /dev/null+++ b/docs/User Guide/User Guide/Advanced Usage/Snippets.md@@ -0,0 +1,2 @@+# Snippets+Snippets let you define reusable pieces of text, Markdown or code that can be quickly inserted into your notes.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Advanced Usage/Snippets/Code Snippets.md b/docs/User Guide/User Guide/Advanced Usage/Snippets/Code Snippets.mdnew file mode 100644index 0000000000..125ac1a99a--- /dev/null+++ b/docs/User Guide/User Guide/Advanced Usage/Snippets/Code Snippets.md@@ -0,0 +1,25 @@+# Code Snippets+Code Snippets are closely related to <a class="reference-link" href="../Templates.md">Templates</a>, but instead of defining the content of an entire note, a snippet is a reusable piece of code that can easily be inserted into a <a class="reference-link" href="../../Note%20Types/Code.md">Code</a> note.++## Creating a Code snippet++In the <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.md">Note Tree</a>:++1. Right-click the note where you want to place the snippet.+2. Select **Insert child** _note_.+3. Select _**Code snippet**_.++Then simply type the desired code into the note and set the correct language mode.++The note's title becomes the title of the snippet. Optionally, you can add a description in the <a class="reference-link" href="../Attributes/Promoted%20Attributes.md">Promoted Attributes</a> section.++## Inserting a snippet++To insert a snippet, type `/snippet` and select its title from the dropdown.++> [!IMPORTANT]+> Only code snippets whose language mode matches the current code note are listed. For example, a CSS code note shows only CSS snippets, not JavaScript ones. The exception is snippets set to "Plain text", which are available in <a class="reference-link" href="../../Note%20Types/Markdown.md">Markdown</a> notes and any code note regardless of its language mode.++## Limitations++* Unlike <a class="reference-link" href="../Templates.md">Templates</a>, snippets cannot be limited to a particular [workspace](../../Basic%20Concepts%20and%20Features/Navigation/Workspaces.md).\ No newline at end of filediff --git a/docs/User Guide/User Guide/Advanced Usage/Snippets/Markdown Snippets.md b/docs/User Guide/User Guide/Advanced Usage/Snippets/Markdown Snippets.mdnew file mode 100644index 0000000000..c32e3908b8--- /dev/null+++ b/docs/User Guide/User Guide/Advanced Usage/Snippets/Markdown Snippets.md@@ -0,0 +1,24 @@+# Markdown Snippets+Markdown Snippets are closely related to <a class="reference-link" href="../Templates.md">Templates</a>, but instead of defining the content of an entire note, a snippet is a reusable piece of Markdown text that can easily be inserted into a <a class="reference-link" href="../../Note%20Types/Markdown.md">Markdown</a> note.++## Creating a Markdown snippet++In the <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.md">Note Tree</a>:++1. Right-click the note where you want to place the snippet.+2. Select **Insert child** _note_.+3. Select _**Markdown snippet**_.++Then simply type the desired content into the note.++The note's title becomes the title of the snippet. Optionally, you can add a description in the <a class="reference-link" href="../Attributes/Promoted%20Attributes.md">Promoted Attributes</a> section.++## Inserting a snippet++To insert a snippet, type `/snippet` and select its title from the dropdown.++<a class="reference-link" href="Code%20Snippets.md">Code Snippets</a> with their language mode set to "Plain text" are also listed here.++## Limitations++* Unlike <a class="reference-link" href="../Templates.md">Templates</a>, snippets cannot be limited to a particular [workspace](../../Basic%20Concepts%20and%20Features/Navigation/Workspaces.md).\ No newline at end of filediff --git a/docs/User Guide/User Guide/Advanced Usage/Snippets/Text Snippets.clone.md b/docs/User Guide/User Guide/Advanced Usage/Snippets/Text Snippets.clone.mdnew file mode 100644index 0000000000..7132758273--- /dev/null+++ b/docs/User Guide/User Guide/Advanced Usage/Snippets/Text Snippets.clone.md@@ -0,0 +1,2 @@+# Text Snippets+This is a clone of a note. Go to its [primary location](../../Note%20Types/Text/Text%20Snippets.md).\ No newline at end of filediff --git a/docs/User Guide/User Guide/Advanced Usage/Technologies used.md b/docs/User Guide/User Guide/Advanced Usage/Technologies used.mdnew file mode 100644index 0000000000..7b9ff3119e--- /dev/null+++ b/docs/User Guide/User Guide/Advanced Usage/Technologies used.md@@ -0,0 +1,32 @@+# Technologies used+One core aspect of Trilium that allows it to have support for multiple [Note Types](../Note%20Types.md) is the fact that it makes use of various off-the-shelf or reusable libraries.++This page showcases some of the technologies used, for a better understanding of how Trilium works but also to credit the developers of that particular technology.++## CKEditor++CKEditor is the editor behind <a class="reference-link" href="../Note%20Types/Text.md">Text</a> notes, as well as integrated in various facets of the application such as the attribute editor in the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/New%20Layout/Status%20bar.md">Status bar</a> or the chat box in the <a class="reference-link" href="../AI.md">AI</a> sidebar or notes.++For more information see <a class="reference-link" href="Technologies%20used/CKEditor.md">CKEditor</a>.++## Excalidraw++[Excalidraw](https://excalidraw.com/) is the technology behind the <a class="reference-link" href="../Note%20Types/Canvas.md">Canvas</a> notes. The source code of the library is available on [GitHub](https://github.com/excalidraw/excalidraw).++We are using an unmodified version of it, so it shares the same [issues](https://github.com/excalidraw/excalidraw/issues) as the original.++## MapLibre GL JS++Trilium v0.105.0 introduces [MapLibre GL JS](https://github.com/maplibre/maplibre-gl-js) for the <a class="reference-link" href="../Collections/Geo%20Map.md">Geo Map</a> collection, which brings improved performance by using graphical acceleration (WebGL). Trilium ships its own track parsing logic as well as most of the UI such as the right panel.++## MindElixir++MindElixir is the library we are using for <a class="reference-link" href="../Note%20Types/Mind%20Map.md">Mind Map</a> note types. The main library is available on [GitHub as mind-elixir-core](https://github.com/SSShooter/mind-elixir-core/issues).++Trilium ships its own UI which covers the toolbars, the contextual menu, the zoom buttons and the right panel that shows when clicking a node.++## FullCalendar++[FullCalendar](https://fullcalendar.io/) is the technology behind the <a class="reference-link" href="../Collections/Calendar.md">Calendar</a> collection, providing the various views (day, week, month, year) and the event management. Trilium also ships its own UI in the form of the popup that appears when editing, as well as the header that appears in the <a class="reference-link" href="../Collections/Collection%20Properties.md">Collection Properties</a>.++Licensed under the MIT license.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Advanced Usage/Technologies used/CKEditor.md b/docs/User Guide/User Guide/Advanced Usage/Technologies used/CKEditor.mdnew file mode 100644index 0000000000..f6c5dcb438--- /dev/null+++ b/docs/User Guide/User Guide/Advanced Usage/Technologies used/CKEditor.md@@ -0,0 +1,34 @@+# CKEditor+## Editor core++The CKEditor is the WYSIWYG (standing for What You See Is What You Get) editor behind [Text](../../Note%20Types/Text.md) notes.++Their website is [ckeditor.com](https://ckeditor.com/).++CKEditor by itself is a commercial product, but the core is open-source. As described in [its documentation](https://ckeditor.com/docs/ckeditor5/latest/features/index.html), the editor supports quite a large number of features. Do note that not all the features are enabled in Trilium.++## Premium features++CKEditor ships some plugins as premium (slash commands, templates, AI integration). Initially Trilium (since v0.96.0) shipped some of them like slash commands as part of a license grant from CKEditor to the Trilium Notes developers.++In v0.105.0 we've decided to replace those premium plugins with our own open-source implementations. This also means that we can better tailor those plugins to the Trilium app.++## Plugins++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.++Trilium makes use of such features:++* The math feature is added by a version of [isaul32/ckeditor5-math: Math feature for CKEditor 5.](https://github.com/isaul32/ckeditor5-math) modified by us to fit our needs.+* We also make use of modified upstream plugins such as [ckeditor/ckeditor5-mermaid](https://github.com/ckeditor/ckeditor5-mermaid) to allow inline Mermaid code.+* [mlewand/ckeditor5-keyboard-marker: Plugin adds support for the keyboard input element (`<kbd>`) to CKEditor 5.](https://github.com/mlewand/ckeditor5-keyboard-marker)+* A modified version of [ThomasAitken/ckeditor5-footnotes: Footnotes plugin for CKEditor5](https://github.com/ThomasAitken/ckeditor5-footnotes) to allow footnotes.++Apart from that, Trilium also has its own set of specific plugins such as:++* <a class="reference-link" href="../../Note%20Types/Text/Cut%20to%20subnote.md">Cut to subnote</a>+* <a class="reference-link" href="../../Note%20Types/Text/Include%20Note.md">Include Note</a>+* Mentions, for linking pages.+* <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/Import%20%26%20Export/Markdown.md">Markdown</a>+* [Reference links](../../Note%20Types/Text/Links.md)+* [Admonitions](../../Note%20Types/Text/Block%20quotes%20%26%20admonitions.md), we ended up creating our own plugin but [aarkue/ckeditor5-admonition](https://github.com/aarkue/ckeditor5-admonition) was a good inspiration (including the toolbar icon).\ No newline at end of filediff --git a/docs/User Guide/User Guide/Advanced Usage/Templates.md b/docs/User Guide/User Guide/Advanced Usage/Templates.mdnew file mode 100644index 0000000000..5bb2313671--- /dev/null+++ b/docs/User Guide/User Guide/Advanced Usage/Templates.md@@ -0,0 +1,68 @@+# Templates+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:++1. **Attribute Inheritance**: All attributes from the template note are [inherited](Attributes/Attribute%20Inheritance.md) by the instance notes. Even attributes with `#isInheritable=false` are inherited by the instance notes, although only inheritable attributes are further inherited by the children of the instance notes.+2. **Content Duplication**: The content of the template note is copied to the instance note, provided the instance note is empty at the time of template assignment.+3. **Child Note Duplication**: All child notes of the template are deep-duplicated to the instance note.++## Example++A typical example would be a "Book" template note, which might include:++* **Promoted Attributes**: Such as publication year, author, etc. (see [promoted attributes](Attributes/Promoted%20Attributes.md)).+* **Outline**: An outline for a book review, including sections like themes, conclusion, etc.+* **Child Notes**: Additional notes for highlights, summary, etc.++++## Instance Note++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.++To create an instance note through the UI:++++For the template to appear in the menu, the template note must have the `#template` label. Do not confuse this with the `~template` relation, which links the instance note to the template note. If you use [workspaces](../Basic%20Concepts%20and%20Features/Navigation/Workspaces.md), you can also mark templates with `#workspaceTemplate` to display them only in the workspace.++Templates can also be added or changed after note creation by creating a `~template` relation pointing to the desired template note.++To specify a template for child notes, you can use a `~child:template` relation pointing to the appropriate template note. There is no limit to the depth of the hierarchy — you can use `~child:child:template`, `~child:child:child:template`, and so on.++> [!IMPORTANT]+> Changing the template hierarchy after the parent note is created will not retroactively apply to newly created child notes.+> For example, if you initially use `~child:template` and later switch to `~child:child:template`, it will not automatically apply the new template to the grandchild notes. Only the structure present at the time of note creation is considered.++## Default parent for new notes++A template can gather the notes created from it in one place, instead of having them land wherever they happen to be created. To do so, add a `~template:newNoteDefaultParent` relation to the template note, pointing at the note that should hold the instances, for example a _Person_ template pointing to a _People_ note.++Adding the relation several times places the new note in every target, as <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Notes/Cloning%20Notes.md">Cloning Notes</a>. The relation can also be inherited (e.g. from a folder holding several templates), in which case a relation owned by the template itself replaces the inherited one. The default parent is only inherited from the template's ancestors in the tree: a template created from another template does not adopt that template's default parent.++The default parent is used whenever a note is created from the template through the _Choose note type_ dialog:++* Via `@`\-completion in a <a class="reference-link" href="../Note%20Types/Text.md">Text</a> note+* Via the _Create note_ or _Create child note_ options of the note search (new tab or <a class="reference-link" href="../Note%20Types/Text/Links/Internal%20(reference)%20links.md">Internal (reference) links</a>), but only if the default/empty location is set.++Creating an instance note from the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.md">Note Tree</a> context menu (_Insert child note_, _Insert note after_) still creates it at the chosen place.++Unlike the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Notes/Note%20Inbox.md">Note Inbox</a>, which holds quickly captured notes until they are sorted, the default parent is meant as the instances' permanent location.++## Regarding note types++By default, newly created notes are <a class="reference-link" href="../Note%20Types/Text.md">Text</a> notes. If a parent note defines a `child:template` pointing to a template of a different type (e.g. a Code note), the behavior depends on how the new note is created:++* If no note type is explicitly chosen (e.g. the + button in the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.md">Note Tree</a>), the template is applied and the new note takes the type and content of the template.+* If a note type is explicitly selected (e.g. <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.md">Note Tree</a> → _Insert note after_ / _Insert child note_):+ * If the selected type matches the template's type, the template is applied.+ * If the selected type differs, the template is disregarded entirely — the new note is an empty note of the selected type.++Selecting a specific template from the creation menu always takes precedence over `child:template`.++## Additional Notes++From a visual perspective, templates can define `#iconClass` and `#cssClass` attributes, allowing all instance notes (e.g., books) to display a specific icon and CSS style.++Explore the concept further in the <a class="reference-link" href="Database/Demo%20Notes.md">Demo Notes</a>, including examples like the <a class="reference-link" href="../Note%20Types/Relation%20Map.md">Relation Map</a>, <a class="reference-link" href="Advanced%20Showcases/Task%20Manager.md">Task Manager</a>, and <a class="reference-link" href="Advanced%20Showcases/Day%20Notes.md">Day Notes</a>.++Additionally, see <a class="reference-link" href="Default%20Note%20Title.md">Default Note Title</a> for creating title templates. Note templates and title templates can be combined by creating a `#titleTemplate` for a template note.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Advanced Usage/Templates_template-create-instance-note.png b/docs/User Guide/User Guide/Advanced Usage/Templates_template-create-instance-note.pngnew file mode 100644index 0000000000..e0de7dc974Binary files /dev/null and b/docs/User Guide/User Guide/Advanced Usage/Templates_template-create-instance-note.png differdiff --git a/docs/User Guide/User Guide/Advanced Usage/Templates_template.png b/docs/User Guide/User Guide/Advanced Usage/Templates_template.pngnew file mode 100644index 0000000000..72af71ad8fBinary files /dev/null and b/docs/User Guide/User Guide/Advanced Usage/Templates_template.png differdiff --git a/docs/User Guide/User Guide/Advanced Usage/Text Extraction (OCR).md b/docs/User Guide/User Guide/Advanced Usage/Text Extraction (OCR).mdnew file mode 100644index 0000000000..beb98285e3--- /dev/null+++ b/docs/User Guide/User Guide/Advanced Usage/Text Extraction (OCR).md@@ -0,0 +1,100 @@+# Text Extraction (OCR)+Optical Character Recognition is the process in which the text from images or PDFs is extracted.++## Built-in support++Since v0.103.0, Trilium has built-in support for OCR. The extracted text can be:++* Integrated with <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Navigation/Search.md">Search</a>, to quickly find the image or file based on snippets of text.+* Integrated with the <a class="reference-link" href="../AI.md">AI</a> feature, which allows the agent to access the content of a non-text note.+* Manually accessed for other purposes (e.g. copying into a note or sending it somewhere else).++## Supported formats++OCR in Trilium supports the following formats:++### Images++* Both [individual image notes](../Note%20Types/File.md) and [attachments in text files](../Note%20Types/Text/Images.md) are supported.+* Supported formats:+ * JPEG+ * PNG+ * GIF (only non-animated)+ * BMP+ * WebP+* Note that this feature works best for computer-rendered text rather than handwriting.+* The underlying technology is Tesseract.js.++### PDFs++The PDF extraction supports:++* PDFs with text information (e.g. a PDF created by a browser or a word processing application), in which the text is extracted.+* Scanned PDFs, and other PDFs whose text cannot be selected (such as documents whose text was converted to outlines), in which the text is extracted through an OCR process.+* Mixed PDFs, containing both text and images with text content.++Note that OCR extraction is limited to 50 pages per PDF, pages containing text information (not as an image) are not subject to this limitation.++> [!NOTE]+> Text extraction for scanned PDFs using OCR was introduced in v0.106.0. If a scanned PDF was already processed by an earlier version, reprocess it individually via _Process OCR_; batch processing only handles files that haven't been OCR'd yet.++### Office documents++The text will be extracted from the following file formats:++* Microsoft Word documents+* Microsoft Excel documents+ * Only the raw text information, the cell structure is not maintained.+ * Values are extracted raw, so searching for dates will not work. The OpenDocument alternative will actually extract the properly formatted value.+* Microsoft PowerPoint documents+* The OpenDocument alternatives to the previous formats (Text, Spreadsheet, Presentation), created by editors such as LibreOffice and OpenOffice.+* [Rich Text Format (RTF)](https://en.wikipedia.org/wiki/Rich_Text_Format), since v0.104.0.+* [EPUB](https://en.wikipedia.org/wiki/EPUB), since v0.104.1.++## Configuring and triggering OCR++The OCR can be configured by going to <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Options.md">Options</a> → <a class="reference-link" href="#root/_hidden/_options/_optionsMedia">Media</a> and looking for the _Text Extraction (OCR)_ section.++There are three ways to trigger the OCR:++* By enabling _Auto-process new files_ which will process only the notes or attachments created after enabling the option, existing files will remain unprocessed.+* By pressing _Start Batch Processing_ which will process all the existing notes.+* By manually requesting for an image or file to have its text extracted, regardless of whether the automatic processing is enabled or not.++### Minimum confidence++When extracting text from an image, there is a certain level of confidence which indicates whether the extracted text appears relevant.++When the minimum confidence is set to a low percentage, the text extraction can interpret symbols and drawings incorrectly resulting in garbled text.++If the extracted text for a note or an attachment quality is lower than the minimum confidence, the OCR is disregarded.++## Language management++OCR needs to be aware of the language of the content in order for it to work correctly. The reason is that each language has its own data which needs to be downloaded, and accents or other symbols will not be supported by the default language.++To configure the languages that are supported by the OCR, simply go to <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Options.md">Options</a> → <a class="reference-link" href="#root/_hidden/_options/_optionsLocalization">Language & Region</a> and adjust the _Content languages_.++When there are no content languages defined, the user interface _Language_ is used instead.++After making this change, the automatic processing or manual reprocessing will take into consideration the new languages.++To enforce the detection in a particular language for a given note, use the `language` [attribute](Attributes.md), similar to [text content language](../Note%20Types/Text/Content%20language%20%26%20Right-to-left%20support.md). For <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Notes/Attachments.md">Attachments</a>, it's not possible to manually adjust the language.++> [!NOTE]+> The trained data for each language is not packaged with Trilium, as that would require a significant amount of space that might not be otherwise needed. As such, when the trained data will be downloaded automatically via [Tesseract.js](https://github.com/naptha/tesseract.js/).+>+> The downloaded trained data is located in the <a class="reference-link" href="../Installation%20%26%20Setup/Data%20directory.md">Data directory</a>, in the `ocr-cache` directory.++## Viewing extracted content for a single note++To access the extracted content of a note:++* For <a class="reference-link" href="../Note%20Types/File.md">File</a> notes, go to the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20buttons.md">Note buttons</a> → _Advanced_ → _View OCR Text_.+* For <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Notes/Attachments.md">Attachments</a> (e.g. <a class="reference-link" href="../Note%20Types/Text/Images.md">Images</a> in <a class="reference-link" href="../Note%20Types/Text.md">Text</a> notes), double-click the attachment to view the details, press the \[…\] button at the left and select _View extracted text (OCR)_.++This section allows:++* Viewing the extracted text, which can be copied elsewhere if needed or just to check the quality of the extraction.+* If the note has not been extracted yet, pressing _Process OCR_ will process it in the background. If the extraction confidence is lower than the minimum confidence, there will be a notification.+* Similarly, if the minimum confidence was changed in settings, it is possible to press the _Process OCR_ button again to extract the text again.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Active content.md b/docs/User Guide/User Guide/Basic Concepts and Features/Active content.mdnew file mode 100644index 0000000000..a8ad72b286--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Active content.md@@ -0,0 +1,33 @@+# Active content+_Active content_ is a generic name for powerful features in Trilium, these range from customizing the UI to advanced scripting that can alter your notes or even your PC.++## Safe import++Active content problem of safety, especially when this active content comes from a third-party such as if it is downloaded from a website and then imported into Trilium.++When [importing](Import%20%26%20Export.md) .zip archives into Trilium, _safe mode_ is active by default which will try to prevent untrusted code from executing. For example, a [custom widget](../Scripting/Frontend%20Basics/Custom%20Widgets.md) needs the `#widget` [label](../Advanced%20Usage/Attributes/Labels.md) in order to function; safe import works by renaming that label to `#disabled:widget`.++## Safe mode++Sometimes active content can cause issues with the UI or the server, preventing it from functioning properly. <a class="reference-link" href="../Advanced%20Usage/Safe%20mode.md">Safe mode</a> allows starting Trilium in such a way that active content is not loaded by default at start-up, allowing the user to fix the problematic scripts or widgets.++## Types of active content++These are the types of active content in Trilium, along with a few examples of what untrusted content of that type could cause:++| Name | Disabled on a safe [import](Import%20%26%20Export.md) | Description | Potential risks of untrusted code |+| --- | --- | --- | --- |+| [Front-end scripts](../Scripting/Frontend%20Basics.md) | Yes | Allow running arbitrary code on the client (UI) of Trilium, which can alter the user interface. | A malicious script can execute server-side code, access un-encrypted notes or change their contents. |+| <a class="reference-link" href="../Scripting/Frontend%20Basics/Custom%20Widgets.md">Custom Widgets</a> | Yes | Can add new UI features to Trilium, for example by adding a new section in the <a class="reference-link" href="UI%20Elements/Right%20Sidebar.md">Right Sidebar</a>. | The UI can be altered in such a way that it can be used to extract sensitive information or it can simply cause the application to crash. |+| <a class="reference-link" href="../Scripting/Backend%20scripts.md">Backend scripts</a> | Yes | Can run custom code on the server of Trilium (Node.js environment), with full access to the notes and the database. | Has access to all the unencrypted notes, but with full access to the database it can completely destroy the data. It also has access to execute other applications or alter the files and folders on the server). |+| <a class="reference-link" href="../Note%20Types/Web%20View.md">Web View</a> | Yes | Displays a website inside a note. | Can point to a phishing website which can collect the data (for example on a log in page). |+| <a class="reference-link" href="../Note%20Types/Render%20Note.md">Render Note</a> | Yes | Renders custom content inside a note, such as a dashboard or a new editor that is not officially supported by Trilium. | Can affect the UI similar to front-end scripts or custom widgets since the scripts are not completely encapsulated, or they can act similar to a web view where they can collect data entered by the user. |+| <a class="reference-link" href="../Theme%20development/Custom%20app-wide%20CSS.md">Custom app-wide CSS</a> | No | Can alter the layout and style of the UI using CSS, applied regardless of theme. | Generally less problematic than the rest of active content, but a badly written CSS can affect the layout of the application, requiring the use of <a class="reference-link" href="../Advanced%20Usage/Safe%20mode.md">Safe mode</a> to be able to use the application. |+| [Custom themes](../Theme%20development) | No | Can change the style of the entire UI. | Similar to custom app-wide CSS. |+| <a class="reference-link" href="Themes/Icon%20Packs.md">Icon Packs</a> | No | Introduces new icons that can be used for notes. | Generally are more contained and less prone to cause issues, but they can cause performance issues (for example if the icon pack has millions of icons in it). |++## Active content badge++Starting with v0.102.0, on the <a class="reference-link" href="UI%20Elements/New%20Layout.md">New Layout</a> a badge will be displayed near the note title, indicating that an active content is detected. Clicking the badge will reveal a menu with various options related to that content type, for example to open the documentation or to configure the execution of scripts.++For some active content types, such as backend scripts with custom triggering conditions a toggle button will appear. This makes it possible to easily disable scripts or widgets, but also to re-enable them if an import was made with safe mode active.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export.md b/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export.mdnew file mode 100644index 0000000000..03839488a4--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export.md@@ -0,0 +1,68 @@+# Import & Export+To import a note:++* The easiest way to import is to simply drag & drop a file or an archive into the <a class="reference-link" href="UI%20Elements/Note%20Tree.md">Note Tree</a>.+ * This will automatically detect some formats such as <a class="reference-link" href="Import%20%26%20Export/Importing%20data%20from%20other%20applications/Obsidian.md">Obsidian</a>.+ * _Safe import_ is automatically on to prevent accidental running of foreign scripts.+* To configure an import, there is a dedicated dialog which can be accessed from either <a class="reference-link" href="UI%20Elements/Note%20Tree.md">Note Tree</a> → _Import into note_ or <a class="reference-link" href="UI%20Elements/Note%20buttons.md">Note buttons</a> → _Import into note_.+ * This feature allows for dedicated importers for others apps such as <a class="reference-link" href="Import%20%26%20Export/Importing%20data%20from%20other%20applications/Obsidian.md">Obsidian</a> or <a class="reference-link" href="Import%20%26%20Export/Importing%20data%20from%20other%20applications/Microsoft%20OneNote.md">Microsoft OneNote</a>.+ * _Safe import_ as well as other options can be configured from the collapsed _Options_ section at the bottom.++To export a note, right click the note in the <a class="reference-link" href="UI%20Elements/Note%20Tree.md">Note Tree</a> and select _Export_. Similarly, in <a class="reference-link" href="UI%20Elements/Note%20buttons.md">Note buttons</a> there is a _Export note_ option.++## Supported formats++Trilium natively supports the following formats for both import and export.++* HTML:+ * This is the main format used by Trilium, where standard tags are used to represent basic formatting and layout (e.g. `<strong>`, `<table>`, `<pre>`).+ * Note that HTML is not a standardized format so some more specific features such as admonitions or <a class="reference-link" href="../Note%20Types/Text/Links/Internal%20(reference)%20links.md">Internal (reference) links</a> might not be supported by other applications.+ * The notes can also be exported as [static HTML that can be used for web publishing](../Advanced%20Usage/Sharing/Exporting%20static%20HTML%20for%20web%20publishing.md).+* <a class="reference-link" href="Import%20%26%20Export/Markdown.md">Markdown</a>+ * Most of the formatting is preserved, see <a class="reference-link" href="Import%20%26%20Export/Markdown/Supported%20syntax.md">Supported syntax</a>.+* OPML (Outliner Interchange Format)+ * Supports both OPML v1.0 for plain text and v2.0 with HTML support.++To import from other applications such as OneNote, Notion and others, see <a class="reference-link" href="Import%20%26%20Export/Importing%20data%20from%20other%20applications.md">Importing data from other applications</a>.++## Maximum import size++Versions prior to v0.104.0 had an upload limit of 250 MiB that could be bypassed via a `TRILIUM_NO_UPLOAD_LIMIT` environment variable; with v0.104.0 this limit was removed.++Nevertheless, there is still a limit for the maximum size of a **single item** (whether it's a <a class="reference-link" href="../Note%20Types/File.md">File</a>, an <a class="reference-link" href="Notes/Attachments.md">Attachments</a> or even a <a class="reference-link" href="../Note%20Types/Text.md">Text</a> note). The limit is approximately 374 MiB and it's determined by the <a class="reference-link" href="../Installation%20%26%20Setup/Synchronization.md">Synchronization</a> protocol. Attempts to import such large files will be refused.++During large imports or exports, memory consumption might spike but it will remain somewhere around the 2 gigabyte mark. Tested with a 2.4 GB database with ~21k notes.++> [!IMPORTANT]+> For the <a class="reference-link" href="../Installation%20%26%20Setup/Desktop%20Installation.md">Desktop Installation</a>, there are two distinct import mechanisms:+>+> * A quick import, from the <a class="reference-link" href="UI%20Elements/Note%20Tree.md">Note Tree</a>.+> * The import dialog (via right click in the note tree → _Import into note_ or from <a class="reference-link" href="UI%20Elements/Note%20buttons.md">Note buttons</a>).+>+> When dealing with large files (multi-gigabyte), prefer using the import dialog as it has a special mechanism which makes sure that the file is read directly from disk rather than uploaded again.++## Exporting the root note++The root note is the top-most note. Exporting it behaves just like any other note: right click on it in the <a class="reference-link" href="UI%20Elements/Note%20Tree.md">Note Tree</a> and select _Export_.++Starting with v0.104.0, when a root note is imported, it will be imported as a child of your existing root note. This behavior makes sure that the import cannot change or overwrite your existing notes.++You can easily move the notes onto the root using the tree's <a class="reference-link" href="UI%20Elements/Note%20Tree/Multiple%20selection.md">Multiple selection</a> and delete the redundant root note.++<table>+ <thead>+ <tr>+ <th scope="col">Before</th>+ <th scope="col">After</th>+ </tr>+ </thead>+ <tbody>+ <tr>+ <td><ul><li>root<ul><li>one</li><li>two</li></ul></li></ul></td>+ <td><ul><li>root (existing)<ul><li>root (from import)<ul><li>one</li><li>two</li></ul></li></ul></li></ul></td>+ </tr>+ </tbody>+</table>++> [!TIP]+> Instead of exporting full ZIPs (including the root note), consider using [backups](../Installation%20%26%20Setup/Backup.md) instead. Backups always contain the entire structure, as well as additional information a ZIP export does not have: maintains note IDs, contains the options/tokens and handle <a class="reference-link" href="Notes/Protected%20Notes.md">Protected Notes</a> better.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Importing data from other applications.md b/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Importing data from other applications.mdnew file mode 100644index 0000000000..c12102bdf5--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Importing data from other applications.md@@ -0,0 +1,24 @@+# Importing data from other applications+Starting with version v0.104.0, Trilium's importer was expanded to application-specific imports. Unlike the standard HTML or <a class="reference-link" href="Markdown.md">Markdown</a> import/export, these importers are tailored to support the features and note structure of a particular application.++## Supported applications++* <a class="reference-link" href="Importing%20data%20from%20other%20applications/Microsoft%20OneNote.md">Microsoft OneNote</a>, by connecting to your account using Microsoft Graph.+* <a class="reference-link" href="Importing%20data%20from%20other%20applications/Notion.md">Notion</a>, via a ZIP export.+* <a class="reference-link" href="Importing%20data%20from%20other%20applications/Google%20Keep.md">Google Keep</a>, via a ZIP export from _Google Takeout_ (Keep has no dedicated export mechanism).+* <a class="reference-link" href="Importing%20data%20from%20other%20applications/Evernote.md">Evernote</a>, via an ENEX export.+* <a class="reference-link" href="Importing%20data%20from%20other%20applications/Anytype.md">Anytype</a>, via a JSON export.+* <a class="reference-link" href="Importing%20data%20from%20other%20applications/Obsidian.md">Obsidian</a>, via a ZIP of the vault.++## Importing data from another application++To import from an application, there are two ways to access the import dialog:++* In the <a class="reference-link" href="../UI%20Elements/Note%20Tree.md">Note Tree</a>, right click on a note and select _Import into note_.+* In the <a class="reference-link" href="../UI%20Elements/Note%20buttons.md">Note buttons</a> area, select _Import files_.++A list of supported applications will appear at the top, each with their own configuration. Simply click one and proceed with the on-screen instructions.++## Acknowledgement++* Trilium's importer is inspired by Obsidian's [Importer plugin](https://github.com/obsidianmd/obsidian-importer) (licensed under the MIT license), for example regarding the OneNote connection process or the Notion ID management.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Importing data from other applications/Anytype.md b/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Importing data from other applications/Anytype.mdnew file mode 100644index 0000000000..d28d3e6b9f--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Importing data from other applications/Anytype.md@@ -0,0 +1,120 @@+# Anytype+Starting with v0.104.0, Trilium is able to import data from Anytype from JSON imports which preserve most of the formatting and the metainformation.++## Import process++The first step is to export the data from Anytype:++* To export a single page:+ * Select the page to export.+ * Press the \[…\] at the top-right of the window and select _Export_.+ * Ensure the following options are set:+ * Export format: Any-Block+ * File Format: JSON+ * Zip archive: On+ * Include linked objects: On+ * Include files: On+ * Include archived objects: On+* To export an entire channel:+ * Select the desired channel from the left bar.+ * Underneath the channel icon in the left sidebar, press the name of the channel with an arrow and select _Channel Settings_.+ * In the left sidebar, look for the _Integrations_ section and select _Export_.+ * Press _Any-Block_.+ * Ensure the following options are set:+ * File Format: JSON+ * Zip archive: On+ * Include files: On+ * Include archived objects: On++In Trilium Notes:++1. In the <a class="reference-link" href="../../UI%20Elements/Note%20Tree.md">Note Tree</a>, right click and select _Import into note_.+2. In the _Import from_ section, select _Anytype_.+3. Upload the ZIP.++> [!NOTE]+> Exporting collections individually can sometimes miss information that would otherwise be picked up from an export of the entire channel. The reason is that Anytype leaves out some information when exporting individual pages/collections.++## Supported features++The following features are preserved by Trilium during the import process:++* Basic formatting (bold, italic, underline, strikethrough, headings, colors, highlights, inline code).+* <a class="reference-link" href="../../../Note%20Types/Text/Lists.md">Lists</a> (numbered or bullet)+* <a class="reference-link" href="../../../Note%20Types/Text/Images.md">Images</a> and files are handled as <a class="reference-link" href="../../Notes/Attachments.md">Attachments</a>.+* To-do lists+* Toggle sections+* <a class="reference-link" href="../../../Note%20Types/Text/Tables.md">Tables</a>+* Inline <a class="reference-link" href="../../../Note%20Types/Mermaid%20Diagrams.md">Mermaid Diagrams</a>+* <a class="reference-link" href="../../../Note%20Types/Text/Math%20Equations.md">Math Equations</a>+* Highlight blocks are imported as block quotes.+* <a class="reference-link" href="../../../Note%20Types/Text/Developer-specific%20formatting/Code%20blocks.md">Code blocks</a>, with a best-effort attempt to restore the language.+* Links between other imported pages are converted to <a class="reference-link" href="../../../Note%20Types/Text/Links/Internal%20(reference)%20links.md">Internal (reference) links</a> if they are part of the same import.+ * Applies to both block links and inline links.+* Collections are imported as Trilium-native <a class="reference-link" href="../../../Collections.md">Collections</a> (see below).+ * Files inside collections are imported as <a class="reference-link" href="../../../Note%20Types/File.md">File</a> notes.+* Dividers (line, dots) are imported as horizontal rules.+* [Admonitions](../../../Note%20Types/Text/Block%20quotes%20%26%20admonitions.md) are preserved, including its emoji (added as part of the content).+* Creation and modification date of pages is preserved.++## Collections++Collections created in Anytype are imported on a best-effort basis, preserving both the view mode and the page properties as <a class="reference-link" href="../../../Advanced%20Usage/Attributes/Promoted%20Attributes.md">Promoted Attributes</a>.++The following view modes are supported:++* List as <a class="reference-link" href="../../../Collections/List%20View.md">List View</a>+* Gallery as <a class="reference-link" href="../../../Collections/Grid%20View.md">Grid View</a>+* <a class="reference-link" href="../../../Collections/Calendar.md">Calendar</a>, preserving the attribute which identifies the date.+* <a class="reference-link" href="../../../Collections/Kanban%20Board.md">Kanban Board</a>, preserving the board group column.+* <a class="reference-link" href="../../../Collections/Table.md">Table</a>, also used as fallback for unsupported collection layouts.++The following types are supported:++<table>+ <thead>+ <tr>+ <th scope="col">Anytype property type</th>+ <th scope="col">Trilium</th>+ </tr>+ </thead>+ <tbody>+ <tr>+ <td>Text / Select</td>+ <td>Single-valued <code>text</code> label</td>+ </tr>+ <tr>+ <td>Number</td>+ <td>Single-valued <code>number</code> label</td>+ </tr>+ <tr>+ <td>Multi-select</td>+ <td>One <code>text</code> label per option (multi)</td>+ </tr>+ <tr>+ <td>Date / Date with time</td>+ <td><ul><li><code>datetime</code> if the time is included.</li><li><code>date</code> if only dates.</li></ul></td>+ </tr>+ <tr>+ <td>File</td>+ <td>The files are preserved as attachments, and a link to them is prepended to the content of the note for visibility.</td>+ </tr>+ <tr>+ <td>Checkbox</td>+ <td><code>boolean</code> label (<code>true</code>/<code>false</code>).</td>+ </tr>+ <tr>+ <td>URL / Email / Phone</td>+ <td><code>url</code> label (<code>mailto:</code>, <code>tel:</code> prefix)</td>+ </tr>+ </tbody>+</table>++## Reporting issues++When importing your Anytype notes, you might find issues in how a note is imported; in that case consider [reporting](../../../Troubleshooting/Reporting%20issues.md) it.++When reporting such an issue make sure to provide the following information:++* A .zip export of the original note (and children if applicable). This allows us to reproduce the issue.+* A screenshot with how it originally looked like before the import and how it looks after the import.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Importing data from other applications/Evernote.md b/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Importing data from other applications/Evernote.mdnew file mode 100644index 0000000000..965eac7884--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Importing data from other applications/Evernote.md@@ -0,0 +1,103 @@+# Evernote+Trilium can import ENEX files, which are used by Evernote for backup/export. One ENEX file represents the content (notes and resources) of one notebook.++## Import process++The first step is to export the data from Evernote:++* To export a single notebook:+ * In the left sidebar, select _Notebooks_.+ * If you have a notebook stack, expand it.+ * Right click on a notebook and select _Export notebook_.+ * Make sure the following options are set:+ * File format is set to _ENEX format_.+ * All the options in _Export note attributes_ are checked.+* To export a bunch of notes (up to 100 notes):+ * In the left sidebar, select _Notes_.+ * In the list of notes, <kbd>Ctrl</kbd>\-click individual notes to select them. Alternatively, click on a note and then <kbd>Shift</kbd>\-click a more distant note to select all the notes in between.+ * At the bottom there should be a floating bar with some options. Select \[…\] → _Export._+ * Make sure the following options are set:+ * File format is set to _ENEX format_.+ * All the options in _Export note attributes_ are checked.+* To export a single note:+ * Select the note.+ * In the top-right, press the \[…\] button and select _Export_.+ * Make sure the following options are set:+ * File format is set to _ENEX format_.+ * All the options in _Export note attributes_ are checked.++> [!TIP]+> To export multiple notebooks in bulk, consider using a third-party CLI tool called [evernote-backup](https://github.com/vzhd1701/evernote-backup)++Once you have your ENEX files, do the following to import them in Trilium:++1. In the <a class="reference-link" href="../../UI%20Elements/Note%20Tree.md">Note Tree</a>, right click and select _Import into note_.+2. In the _Import from_ section, select _Evernote_.+3. During the import, you will see "Import in progress" message. If the import is successful, the message will change to “Import finished successfully” and then disappear.+4. We recommend you to check the imported notes and their attachments to verify that you haven’t lost any data.++## Supported features++The following features are preserved by Trilium during the import process:++* Basic formatting (bold, italic, underline, strikethrough, colors, highlights, superscript, subscript, text alignment, inline code).+* The hierarchy of headings (these are shifted to start with H2 because H1 is reserved for note title, see [Headings](../../../Note%20Types/Text/General%20formatting.md))+* To-do lists. The new task format is collapsed to standard to-do lists+* <a class="reference-link" href="../../../Note%20Types/Text/Images.md">Images</a> and <a class="reference-link" href="../../Notes/Attachments.md">Attachments</a>+* <a class="reference-link" href="../../../Note%20Types/Text/Lists.md">Lists</a> (with bullets or with numbers)+* <a class="reference-link" href="../../../Note%20Types/Text/Tables.md">Tables</a>+* Block quotes+* [Admonitions](../../../Note%20Types/Text/Block%20quotes%20%26%20admonitions.md) are preserved, including its emoji (added as part of the content).+* <a class="reference-link" href="../../../Note%20Types/Text/Developer-specific%20formatting/Code%20blocks.md">Code blocks</a>, with a best-effort attempt to restore the language.+* <a class="reference-link" href="../../../Note%20Types/Mermaid%20Diagrams.md">Mermaid Diagrams</a>+* <a class="reference-link" href="../../../Note%20Types/Text/Math%20Equations.md">Math Equations</a>+* Toggle sections+* External links+* Internal links are re-written to <a class="reference-link" href="../../../Note%20Types/Text/Links/Internal%20(reference)%20links.md">Internal (reference) links</a> if the target note is part of the same import.++## Limitations++* The size limit of one import is 250Mb. If the total size of your files is larger, you can increase the [upload limit](../../../Installation%20%26%20Setup/Server%20Installation.md), or divide your files, and run the import as many times as necessary.+* All resources (except for images) are created as notes’ attachments.+* If you have HTML inside ENEX files, the HTML formatting may be broken or lost after import in Trilium. See <a class="reference-link" href="../../../Troubleshooting/Reporting%20issues.md">Reporting issues</a>.++### Links to other notes++Since v0.104.0, the ENEX importer tries to recreate links to other notes automatically by converting their Evernote-specific URLs to Trilium's <a class="reference-link" href="../../../Note%20Types/Text/Links/Internal%20(reference)%20links.md">Internal (reference) links</a>.++Since the ENEX format does not provide the unique ID of notes, the note references are determined via their note title.++Limitations:++* Only notes that are part of the same import will have their links rewritten to reference links, to avoid linking to the wrong note.+* If there are to notes with the same name, internal links will not be created to avoid pointing to the wrong note.+* Links that couldn't be rewritten (e.g. referring to a missing/duplicate note) will be kept with their original `evernote://` URL.+* It will not fix links to anchors and links to notes that you renamed in Evernote after you created the links.++#### Post-processing notes++> [!TIP]+> This script allows rewriting links after the import has been done, and it should also allow finding links between two different imports.++If you want to restore the internal links in Trilium after you import all of your ENEX files, you can use or adapt this custom script: <a class="reference-link" href="Evernote/Process%20internal%20links%20by%20title.js">Process internal links by title</a>++The script does the following:++1. It finds all Evernote internal links.+2. For each one, it checks if its link text matches a note title, and if yes, it replaces the Evernote link with an internal Trilium link. If not, it leaves the Evernote link in place.+3. If it finds more than one note with a matching note title, it leaves the Evernote link in place.+4. It outputs the results in a log that you can see in the respective code note in Trilium.++The script has the following limitations:++* It will not fix links to anchors and links to notes that you renamed in Evernote after you created the links.+* Some note titles might not be well identified, even if they exist. This is especially the case if the note title contains some special characters. Should this be problematic, consider <a class="reference-link" href="../../../Troubleshooting/Reporting%20issues.md">Reporting issues</a>.++## Reporting issues++When importing your Evernote notebooks, you might find issues in how a note is imported; in that case consider [reporting](../../../Troubleshooting/Reporting%20issues.md) it.++When reporting such an issue make sure to provide the following information:++* A `.enex` export of the original note. This allows us to reproduce the issue.+* A screenshot with how it originally looked like before the import and how it looks after the import.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Importing data from other applications/Evernote/Process internal links by title.js b/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Importing data from other applications/Evernote/Process internal links by title.jsnew file mode 100644index 0000000000..732744ba6c--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Importing data from other applications/Evernote/Process internal links by title.js@@ -0,0 +1,33 @@+const query = `note.type = "text" and note.content *=* "evernote:///view/"`;+const notes = api.searchForNotes(query);++for (const note of notes) {+ api.log(`Processing note ${note.title}...`);++ const content = note.getContent();+ const root = api.htmlParser.parse(content);++ for (const el of root.querySelectorAll("a")) {+ const url = el.getAttribute("href");+ if (!url?.startsWith("evernote:///")) continue;++ const text = el.textContent;+ const matchingNotes = api.searchForNotes(`note.title = "${text}"`);+ if (matchingNotes.length === 0) {+ api.log(`No matching notes for "${text}..."`);+ continue;+ }++ if (matchingNotes.length > 1) {+ api.log(`Found multiple matching notes for "${text}". Skipping.`);+ continue;+ }++ const matchingNote = matchingNotes[0];++ api.log(`Found matching note: ${matchingNote.title} ${matchingNote.noteId}`);+ el.setAttribute("href", `#root/${matchingNote.noteId}`);+ el.classList.add("reference-link");+ }+ note.setContent(root.toString());+}diff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Importing data from other applications/Google Keep.md b/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Importing data from other applications/Google Keep.mdnew file mode 100644index 0000000000..ea81365b25--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Importing data from other applications/Google Keep.md@@ -0,0 +1,52 @@+# Google Keep+Trilium can import notes from Google Keep, preserving their structure and formatting.++## Import process++Google Keep has no native export process, but Google Takeout allows you to download a ZIP of all the notes.++The first step is to download your Google Keep information:++1. Navigate to [takeout.google.com](https://takeout.google.com/).+2. In the _Create a new export_ section, press _Deselect all._+3. In the list of data to export, check _Keep_.+4. Scroll all the way down and choose _Next step_.+5. In _Choose file type, frequency & destination_ make sure the following options are set:+ 1. _Transfer to_ is set to _Send download link via email_.+ 2. _Frequency_ is set to _Export once_.+ 3. _File type_ is set to _.zip_.+ 4. _File size_ can remain set to _2 GB_.+6. Press _Create export_ and wait for the export to finish.++Then in Trilium Notes:++1. In the <a class="reference-link" href="../../UI%20Elements/Note%20Tree.md">Note Tree</a>, right click and select _Import into note_.+2. In the _Import from_ section, select _Google Keep_.+3. Upload the ZIP obtained in the previous step.++## Supported features++* Basic formatting (bold, italic, underline)+* [Note color](../../Notes/Note%20Icons%20%26%20Colors.md)+* Note titles are maintained, if present.+ * In Google Keep it's common for notes not to have a title, case in which the date and time of the note are used as a title.+* To-do lists+* <a class="reference-link" href="../../../Note%20Types/Text/Images.md">Images</a> and <a class="reference-link" href="../../Notes/Attachments.md">Attachments</a>.+* Creation and modification dates are preserved.++## Limitations++Currently the following information is not imported:++* Labels are disregarded.+* Pinned, archived or trashed state is not preserved, all notes are treated the same.++## Reporting issues++When importing your notes from Google Keep, you might encounter some issues with how the notes are imported, or there might be some missing information. In this case, consider [reporting it](../../../Troubleshooting/Reporting%20issues.md).++When reporting such an issue make sure to provide the following information:++* A sample of the note is required to better understand what happened.+ * Because Google Keep has no per-note export, extract the Google Takeout ZIP and copy the files corresponding to the problematic note (`.html`, `.json` and any attachments if you are able to identify them).+* A screenshot with how it originally looked like before the import and how it looks after the import.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Importing data from other applications/Microsoft OneNote.md b/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Importing data from other applications/Microsoft OneNote.mdnew file mode 100644index 0000000000..e3e0f0f4c4--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Importing data from other applications/Microsoft OneNote.md@@ -0,0 +1,105 @@+# Microsoft OneNote+Trilium allows importing from OneNote. Currently the only mechanism supported is via the Microsoft Graph API which requires you to authenticate in a browser in order for the notes to be obtained by Trilium.++## Import process++1. In the <a class="reference-link" href="../../UI%20Elements/Note%20Tree.md">Note Tree</a>, right click and select _Import into note_.+2. In the _Import from_ section, select _OneNote_.+3. Press the _Connect_ button:+ 1. On the desktop app, you will be redirected to Microsoft's authentication screen where you can log into your account.+ 2. On the web app, the process is slightly more involved as it requires copying the code to clipboard, accessing the link, pasting the code and then signing in once more.+4. After the connection is successful, you should be able to see a list of sections that can be imported. Simply check the ones to import and press the _Import selected_ button.+5. Wait for the import to finish.++## Supported features++The following features are preserved by Trilium during the import process:++* Basic formatting (bold, italic, underline, strikethrough, subscript, super script, font sizes, headings, colors, highlights).+ * Black-colored text is intentionally stripped to allow it to work in dark themes.+* Inline code is automatically detected and formatted. Paragraphs that use the Code style are also converted to <a class="reference-link" href="../../../Note%20Types/Text/Developer-specific%20formatting/Code%20blocks.md">Code blocks</a>.+ * Unfortunately the indentation of the code might be lost because the information is simply not present in the data from the Microsoft API.+* <a class="reference-link" href="../../../Note%20Types/Text/Lists.md">Lists</a> with different bullet types.+* <a class="reference-link" href="../../../Note%20Types/Text/Tables.md">Tables</a>+ * Cell backgrounds are preserved, including a best-effort hue correction because the colors returned by the Graph API are sometimes incorrect.+ * Cell widths are also preserved proportionally, with the only difference that tables in Trilium have a percentage-based width, not fixed pixel sizes.+* Images and <a class="reference-link" href="../../Notes/Attachments.md">Attachments</a>.+ * Screen clippings are also properly supported since v0.104.1, displaying their timestamp as a figure caption.+* To-do lists+* Hand-drawing is preserved and displayed as an SVG image inside the note+ * OneNote's default color (black) is special since it also renders as white for dark themes. Since v0.104.1, this is also supported by using a special SVG tweak which reacts to light/dark themes.+* Links between other imported pages are converted to <a class="reference-link" href="../../../Note%20Types/Text/Links/Internal%20(reference)%20links.md">Internal (reference) links</a> if the text of the link matches the name of the page, or plain links otherwise. If the pages are not part of the import, the original `onenote:` link is kept.+* Tags (apart from to-do lists) are preserved by converting them to [inline icons](../../../Note%20Types/Text/Insert%20buttons/Icons.md), which are searchable by the icon's name and can be recolored like any other icon. Some icons are turned into emojis instead.++Regarding the note structure:++* The order of the pages within a section is maintained.+* Sub-pages and section groups are maintained by nesting notes in a hierarchical structure.+* Creation and modification of both notes and sections is preserved. The order of section or section groups is not preserved (see limitations).++## Error management and reporting++The OneNote importer uses Microsoft's Graph API which handles the HTML export (that we later post-process for Trilium use). The Graph API itself has to process the OneNote pages before sending them to us, and as such it's a time-consuming operation that is directly proportional to the number of notes and the complexity/size of the notes.++The Graph API throttles access if it detects too many operations. The importer takes that into account, but sometimes this means that most of the time is spent waiting for the Graph API to unblock access rather than actually importing data.++In addition, some pages may fail at the Graph API level due to an internal timeout on their side or other issues. Trilium will try to refetch pages in order to avoid that but sometimes pages cannot be retrieved even after multiple retries. In that case, the importer will still create a corresponding note in Trilium but with an error report instead of a content. This preserves <a class="reference-link" href="../../../Note%20Types/Text/Links/Internal%20(reference)%20links.md">Internal (reference) links</a> and makes it easy to identify and manually fix the pages that failed.++At the end of the import, the top-level note called _OneNote_ _import_ will contain information about how the import went:++* The number of notes imported;+* The success rate;+* A list of notes that could not be imported, as well as the failure reason;+* Pages whose images/attachments failed to download+* How long the import spent waiting out throttling.++To avoid cases in which the import is fundamentally broken (e.g. an expired sign-in), the import will error out if it fails to import 6 pages in a row.++## Attributes++Pages imported from OneNote have a few built-in [labels](../../../Advanced%20Usage/Attributes/Labels.md):++* `oneNotePageId`, with the corresponding page ID in OneNote. This can be used to identify the original OneNote page. Trilium doesn't use it in any way at this moment.+* `oneNoteImportFailed` attached to notes that couldn't be imported. This can be used to quickly <a class="reference-link" href="../../Navigation/Search.md">Search</a> for failed notes.++## Limitations++### Regarding OneNote's freehand structure++OneNote is fundamentally different to Trilium in structure because it allows freehand drawing to coexist with text, and text boxes can be placed anywhere in the document (e.g. a common use case is to have columns). Trilium has a document flow mechanism for <a class="reference-link" href="../../../Note%20Types/Text.md">Text</a> notes which means that it can't be freely positioned.++To cope with this difference, Trilium will flatten the text structure into normal paragraphs. The paragraphs will be ordered visually based on the original position of the text boxes, but their horizontal position will not be preserved. Parallel text such as columns may appear interleaved which can cause problems.++In addition, drawing in OneNote can be interleaved with text boxes. Text notes in Trilium do not allow for this feature, so all drawing will appear at the end. For some use cases (diagrams, for example) this will work fine, but if you have highlights or other text-dependent drawings they will appear out of order.++> [!NOTE]+> There are plans to support drawing-heavy notes that interleave with text boxes by converting them to a <a class="reference-link" href="../../../Note%20Types/Canvas.md">Canvas</a> instead.++### Password-protected sections++OneNote supports encryption at section level; when importing a notebook that contains these password-protection sections, Trilium will not be able to read the content of password-protected sections so they will appear empty. This is not a limitation of Trilium, the information is simply not available from the source (Graph API).++The section itself is kept for reference and all the sections that could not be imported will be shown in the report (the top-level note called _OneNote import_).++To unprotect a section in OneNote Desktop, right click on the protected section → _Password Protect This Section_ and press _Remove Password_ and sync. Then re-import either only the protected sections or remove everything and start the import from scratch.++## Other limitations++The following are known limitations due to how the information comes from the import (Microsoft Graph API), which means that they cannot be fixed.++* The order of the sections (and section groups) is not available, the sections are ordered by creation date instead.+* Revision history.+* Paragraph indentation, as well as code block indentation.+* Section colors.+* Drawings inside titles, the title might appear incomplete or “Untitled”.++## Reporting issues++When importing notes, you might find that some text is not rendered properly or the structure is not properly maintained. As long as this issue is not a fundamental issue (like the issue with freehand text not being preserved exactly), it's a good idea to [report it](../../../Troubleshooting/Reporting%20issues.md).++When reporting, make sure that you provide the following information:++* Import again the section, checking the debug checkbox before importing. This preserves the original document (and the hand-drawing data if any) as it came through from OneNote's cloud API so that it can be used for comparison.+* Export only the affected page as ZIP, making sure not to accidentally expose any sensitive information.+* Take screenshots of how the note looked like in OneNote and how it ends up in Trilium.+* Attach the ZIP and the screenshots to the issue report.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Importing data from other applications/Microsoft OneNote/Tags.md b/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Importing data from other applications/Microsoft OneNote/Tags.mdnew file mode 100644index 0000000000..4bc237ebe9--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Importing data from other applications/Microsoft OneNote/Tags.md@@ -0,0 +1,48 @@+# Tags+OneNote's _Tags_ functionality is imported in Trilium as <a class="reference-link" href="../../../../Note%20Types/Text/Insert%20buttons/Icons.md">Icons</a> using the default icon pack or emojis (if there is no suitable replacement).++> [!IMPORTANT]+> Custom tags are not supported by OneNote's Graph API so Trilium cannot import them.++### Decorative tags++These remain formatted as paragraphs, with the glyph prepended to the text. A paragraph can carry several tags at once, in which case their glyphs stack.++| OneNote tag | `data-tag` | Imported as | Searchable as |+| --- | --- | --- | --- |+| Important | `important` | <span class="tn-icon bx bx-star"></span> | `star` |+| Critical | `critical` | <span class="tn-icon bx bx-error-circle"></span> | `error-circle` |+| Question | `question` | <span class="tn-icon bx bx-help-circle"></span> | `help-circle` |+| Highlight | `highlight` | <span class="tn-icon bx bx-highlight"></span> | `highlight` |+| Definition | `remember-for-later` | <span class="tn-icon bx bx-pin"></span> | `pin` |+| Remember for later | `remember-for-later` | <span class="tn-icon bx bx-pin"></span> | `pin` |+| Remember for blog | `remember-for-blog` | <span class="tn-icon bx bx-edit"></span> | `edit` |+| Idea | `idea` | <span class="tn-icon bx bx-bulb"></span> | `bulb` |+| Password | `password` | <span class="tn-icon bx bx-key"></span> | `key` |+| Contact | `contact` | <span class="tn-icon bx bx-user"></span> | `user` |+| Address | `address` | <span class="tn-icon bx bx-home"></span> | `home` |+| Phone number | `phone-number` | <span class="tn-icon bx bx-phone"></span> | `phone` |+| Web site to visit | `web-site-to-visit` | <span class="tn-icon bx bx-globe"></span> | `globe` |+| Source for article | `source-for-article` | <span class="tn-icon bx bx-news"></span> | `news` |+| Send in email | `send-in-email` | <span class="tn-icon bx bx-envelope"></span> | `envelope` |+| Movie to see | `movie-to-see` | <span class="tn-icon bx bx-movie"></span> | `movie` |+| Book to read | `book-to-read` | <span class="tn-icon bx bx-book"></span> | `book` |+| Music to listen to | `music-to-listen-to` | <span class="tn-icon bx bx-music"></span> | `music` |+| Project A | `project-a` | 🅰️ | 🅰️ |+| Project B | `project-b` | 🅱️ | 🅱️ |++### Check box tags++These become <a class="reference-link" href="../../../../Note%20Types/Text/To-do%20Lists.md">To-do Lists</a>, with the glyph inside the item with the tick state preserved:++| OneNote tag | `data-tag` | Imported as | Searchable as |+| --- | --- | --- | --- |+| To Do | `to-do` | _(none)_ | — |+| To Do priority 1 | `to-do-priority-1` | 1️⃣ | 1️⃣ |+| To Do priority 2 | `to-do-priority-2` | 2️⃣ | 2️⃣ |+| Discuss with Person A | `discuss-with-person-a` | <span class="tn-icon bx bx-message-rounded"></span> | `message-rounded` |+| Discuss with Person B | `discuss-with-person-b` | <span class="tn-icon bx bx-message-rounded"></span> | `message-rounded` |+| Discuss with manager | `discuss-with-manager` | <span class="tn-icon bx bx-conversation"></span> | `conversation` |+| Schedule meeting | `schedule-meeting` | <span class="tn-icon bx bx-calendar"></span> | `calendar` |+| Call back | `call-back` | <span class="tn-icon bx bx-phone-call"></span> | `phone-call` |+| Client request | `client-request` | <span class="tn-icon bx bx-clipboard"></span> | `clipboard` |\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Importing data from other applications/Notion.md b/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Importing data from other applications/Notion.mdnew file mode 100644index 0000000000..87a42bfab1--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Importing data from other applications/Notion.md@@ -0,0 +1,159 @@+# Notion+Trilium can import ZIP exports from Notion while preserving structure and formatting.++## Import process++In Notion, there are two ways to export data:++* To export a single page (and optionally its sub-pages):+ * Select the page to export.+ * Press the \[…\] button at the top-right of the window and select _Export_.+ * Ensure the following options are set:+ * Export format: HTML+ * Page content: Everything+ * Include subpages: On+ * Create folders for subpages: On+ * Press the Export button.+ * Wait for the download to finish.+* To export an entire workspace, press your user name badge at top-left and select _Settings_.+ * In the left section, look for the _Workspace_ category and select _General_.+ * In the _General_ settings page, look for the _Export_ section and press the _Export_ button corresponding to _Workspace content_.+ * Ensure the following options are set:+ * Export format: HTML+ * Page content: Everything+ * Include subpages: On+ * Create folders for subpages: On+ * Press the Export button.+ * Wait for the download to finish. Depending on the size of your workspace it might take a while. You will get a downloadable copy via email if takes too long.++In Trilium Notes:++1. In the <a class="reference-link" href="../../UI%20Elements/Note%20Tree.md">Note Tree</a>, right click and select _Import into note_.+2. In the _Import from_ section, select _Notion_.+3. Upload the ZIP obtained in the previous step.++## Supported features++The following features are preserved by Trilium during the import process:++* Basic formatting (bold, italic, underline, strikethrough, headings, colors, highlights).+* <a class="reference-link" href="../../../Note%20Types/Text/Lists.md">Lists</a>+* To-do lists+* <a class="reference-link" href="../../../Note%20Types/Text/Images.md">Images</a> and <a class="reference-link" href="../../Notes/Attachments.md">Attachments</a>.+* Toggle sections+ * Nested toggle sections are also supported.+ * Toggle headings are stripped of their toggle button and become normal headings instead.+* <a class="reference-link" href="../../../Note%20Types/Text/Math%20Equations.md">Math Equations</a> (inline or block)+* <a class="reference-link" href="../../../Note%20Types/Text/Link%20Previews.md">Link Previews</a>+ * The icon and image of the links need to be retrieved online since the exports don't carry the images. This operation is done only if _Download images automatically_ is enabled in <a class="reference-link" href="../../UI%20Elements/Options.md">Options</a> → _Media_.+* <a class="reference-link" href="../../../Note%20Types/Text/Developer-specific%20formatting/Code%20blocks.md">Code blocks</a>, with a best-effort attempt to restore the language.+* <a class="reference-link" href="../../../Note%20Types/Mermaid%20Diagrams.md">Mermaid Diagrams</a>+* Links between other imported pages are converted to <a class="reference-link" href="../../../Note%20Types/Text/Links/Internal%20(reference)%20links.md">Internal (reference) links</a> if they are part of the same import.+* Databases are imported as <a class="reference-link" href="../../../Collections.md">Collections</a> (see below).+* [Admonitions](../../../Note%20Types/Text/Block%20quotes%20%26%20admonitions.md) are preserved, including its emoji (added as part of the content).+* Columns are imported as transparent [tables](../../../Note%20Types/Text/Tables.md), preserving the column definition.+* Table of content blocks are _removed_, as the table of contents is already present in the sidebar (see <a class="reference-link" href="../../../Note%20Types/Text/Table%20of%20contents.md">Table of contents</a>), as well as in shared notes.++## Databases++Notion databases are imported into <a class="reference-link" href="../../../Collections.md">Collections</a>, where each item of the database is saved as a page in the collection. Through the use of [inherited](../../../Advanced%20Usage/Attributes/Attribute%20Inheritance.md) <a class="reference-link" href="../../../Advanced%20Usage/Attributes/Promoted%20Attributes.md">Promoted Attributes</a>, most of the page properties in Notion are preserved by the import.++The resulting collection will be <a class="reference-link" href="../../../Collections/Table.md">Table</a> regardless of the original view the database was exported in. That's because the active view is not saved in the export and the table collection is the most compatible with Notion.++<table>+ <thead>+ <tr>+ <th scope="col">Notion type</th>+ <th scope="col">Trilium</th>+ </tr>+ </thead>+ <tbody>+ <tr>+ <td>Text / Select / Status / Place</td>+ <td>Single-valued <code>text</code> label</td>+ </tr>+ <tr>+ <td>Number</td>+ <td>Single-valued <code>number</code> label for plain numbers. Formatted values (currency, percent, thousands separators) are normalized to a bare number, e.g. <code>$1,200.50</code> → <code>1200.50</code>.</td>+ </tr>+ <tr>+ <td>ID</td>+ <td>Single-valued <code>number</code> or <code>text</code> label (depending on whether a prefix is configured)</td>+ </tr>+ <tr>+ <td>Multi-select</td>+ <td>One text label per option (multi)</td>+ </tr>+ <tr>+ <td>URL / Email / Phone</td>+ <td><code>url</code> label (<code>mailto:</code>, <code>tel:</code> prefix)</td>+ </tr>+ <tr>+ <td>Date</td>+ <td><ul><li><code>datetime</code> if at least one has time.</li><li><code>date</code> if only dates.</li><li>Two attributes if any of the dates have an end date.</li></ul></td>+ </tr>+ <tr>+ <td>Checkbox</td>+ <td><code>boolean</code> label (<code>true</code>/<code>false</code>).</td>+ </tr>+ <tr>+ <td>Person</td>+ <td>One text label per user (multi)</td>+ </tr>+ <tr>+ <td>Created by / Edited by</td>+ <td>Single-valued <code>text</code> label</td>+ </tr>+ <tr>+ <td>Created time / Last edited time</td>+ <td>Assigned to the note's creation and modification date.</td>+ </tr>+ <tr>+ <td>Relation</td>+ <td>Mapped to <a href="../../../Advanced%20Usage/Attributes/Relations.md">relations</a>, each link resolved to its target note via the existing cross-page map; targets outside the import are dropped.</td>+ </tr>+ <tr>+ <td>Files & Media</td>+ <td>The files are preserved as attachments, and a link to them is prepended to the content of the note for visibility.</td>+ </tr>+ <tr>+ <td>Formulas / Rollup</td>+ <td><p>A <code>text</code>, <code>number</code> or <code>boolean</code> label depending on the value. Dates are rendered as <code>text</code> because the export doesn't offer any type information.</p><p>The Notion export does not preserve the formula/rollup configuration itself, instead it just exports the value.</p></td>+ </tr>+ <tr>+ <td>Button / Verification / any other type</td>+ <td>Unsupported, they will be dropped from the import.</td>+ </tr>+ </tbody>+</table>++> [!NOTE]+> **Technical information**+>+> Every page property that can be preserved according to the table above is saved as a label or relation to the corresponding note (except for creation and modification dates which are saved at note level).+>+> To maintain a similar UX to Notion, every property is also turned into <a class="reference-link" href="../../../Advanced%20Usage/Attributes/Promoted%20Attributes.md">Promoted Attributes</a> at collection level. This also makes the columns visible in the table collection. The promoted attributes are made inheritable so that they appear when navigating in the child notes as well.+>+> The names of the labels are intentionally converted to `camelCase` to match Trilium's conventions, but the full name of the column is preserved through the _Alias_ mechanism of promoted attributes.++## Limitations++### Missing data from the import++The following information is not preserved by the import because it is not available in the export so it cannot be restored:++* The order of the pages and sub-pages.+* Creation/modification dates are restored only when the page includes Created time / Last edited time properties (collection or not); otherwise the import time is used.++### Cover images and page icon++The page icon or emoji is not preserved, with created notes having the default icon. The cover image is not imported at all.++## Reporting issues++When importing your Notion workspace, you might find issues in how a note is imported; in that case consider [reporting](../../../Troubleshooting/Reporting%20issues.md) it.++When reporting such an issue make sure to provide the following information:++* A .zip export of the original Notion note (and children if applicable). This allows us to reproduce the issue.+* A screenshot with how it originally looked like before the import and how it looks after the import.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Importing data from other applications/Obsidian.md b/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Importing data from other applications/Obsidian.mdnew file mode 100644index 0000000000..f883d08dcb--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Importing data from other applications/Obsidian.md@@ -0,0 +1,84 @@+# Obsidian+Although Obsidian was indirectly supported through the standard <a class="reference-link" href="../Markdown.md">Markdown</a> import, its vault structure is distinct enough to warrant its own dedicated import channel.++## Import process++The first step is to obtain a .zip of your Obsidian vault:++1. First, identify where your Obsidian vault is located. The easiest way to do so is to open Obsidian and right clicking the name of the vault at the bottom of the left sidebar and then selecting _Show in system explorer_.+2. In your system explorer, right click the directory containing your Obsidian vault and compress it to a ZIP file (e.g. on Windows, _Compress To_ → _ZIP_).++> [!TIP]+> When zipping, you can either ZIP the outer folder of the vault, or the contents of the vault as Trilium will automatically determine the position of the vault in the archive via the `.obsidian` directory.++Then, in Trilium Notes:++1. In the <a class="reference-link" href="../../UI%20Elements/Note%20Tree.md">Note Tree</a>, right click and select _Import into note_.+2. In the _Import from_ section, select _Obsidian_.+3. Upload the ZIP obtained in the previous step.++Alternatively, simply drag & drop the .zip archive in the <a class="reference-link" href="../../UI%20Elements/Note%20Tree.md">Note Tree</a> and Trilium will auto-detect it as an Obsidian import provided there is a `.obsidian` directory. If not, follow the previous steps instead.++## Supported features++The following features are preserved by Trilium during the import process:++* Folder hierarchy is preserved.+* Basic Markdown formatting (bold, italic, underline, strikethrough, headings).+* Specific Obsidian formatting (highlighting).+* <a class="reference-link" href="../../../Note%20Types/Text/Lists.md">Lists</a>+* To-do lists+* <a class="reference-link" href="../../../Note%20Types/Text/Images.md">Images</a> and <a class="reference-link" href="../../Notes/Attachments.md">Attachments</a>+ * Non-Markdown files in the Vault are treated as attachments by default if they are referenced by at least one note.+ * Otherwise, they will be imported as <a class="reference-link" href="../../../Note%20Types/File.md">File</a> notes.+* Transclusions are converted to <a class="reference-link" href="../../../Note%20Types/Text/Include%20Note.md">Include Note</a> or <a class="reference-link" href="../../../Note%20Types/Text/Images.md">Images</a> (depending on type).+* <a class="reference-link" href="../../../Note%20Types/Text/Math%20Equations.md">Math Equations</a> (inline or block)+* <a class="reference-link" href="../../../Note%20Types/Text/Developer-specific%20formatting/Code%20blocks.md">Code blocks</a>, with a best-effort attempt to restore the language.+* Links between pages are converted to <a class="reference-link" href="../../../Note%20Types/Text/Links/Internal%20(reference)%20links.md">Internal (reference) links</a>.+* Callouts are converted to Trilium's [Admonitions](../../../Note%20Types/Text/Block%20quotes%20%26%20admonitions.md).+ * Obsidian has many more types of callouts (`tldr`, `question`, `attention`), these are all mapped to one of Trilium's existing admonition types (e.g. Note, Tip, Important).+ * Custom titles are kept and shown as a bold line at the top of the admonition, since there is no concept of admonition title in Trilium.+ * Foldable callouts are imported expanded and without a fold marker.+* Notes created by the [_Excalidraw_](https://github.com/zsviczian/obsidian-excalidraw-plugin) community plugin for Obsidian are converted to <a class="reference-link" href="../../../Note%20Types/Canvas.md">Canvas</a> (same underlying technology).+ * Note that custom features introduced by that plugin will not be supported.+* Modification date is preserved via the information obtained from the .zip archive, creation date is not recoverable so it's kept the same as the modification date.++## Properties++Properties are Obsidian's equivalent of <a class="reference-link" href="../../../Advanced%20Usage/Attributes/Promoted%20Attributes.md">Promoted Attributes</a>. One of the core differences between the two is where the property information is stored (i.e. name and type): in Obsidian everything is stored at vault level and shared across all notes, whereas in Trilium each page can have individual promoted attributes, shared through <a class="reference-link" href="../../../Advanced%20Usage/Templates.md">Templates</a> or <a class="reference-link" href="../../../Advanced%20Usage/Attributes/Attribute%20Inheritance.md">Attribute Inheritance</a>.++Another important difference is that promoted attributes in Trilium are always displayed, even if empty. In Obsidian, these are simply suggested when creating a new property.++To reconcile all these differences, properties are converted to <a class="reference-link" href="../../../Advanced%20Usage/Attributes/Promoted%20Attributes.md">Promoted Attributes</a> at note level.++The following note types are supported:++| Obsidian type | Trilium |+| --- | --- |+| Text or not defined | Single-valued `text` label |+| Number | Single-valued `number` label |+| Multitext | Multi-valued `text` label |+| Checkbox | `boolean` label (`true`/`false`). |+| Date | `date` |+| Date & Time | `datetime` |++### Special properties++Obsidian has a few reserved property names, which are treated differently in Trilium as well:++* `tags`, where every tag is turned into its own [label](../../../Advanced%20Usage/Attributes/Labels.md) (e.g. `#one`, `#two` when `tags: [ one, two ]`).+* `aliases` are simply mapped to individual `#alias` labels+* `cssclasses`, `publish`, `permalink` are ignored.++## Limitations++* Comments (`%%` syntax) are simply stripped.+* Obsidian _bases_ functionality is not preserved.+ * The closest equivalent in Trilium would be <a class="reference-link" href="../../../Collections.md">Collections</a> but they work fundamentally different because bases don't store particular notes, they act more like a <a class="reference-link" href="../../../Note%20Types/Saved%20Search.md">Saved Search</a> with a collection view.+ * Since the base query format is quite different to Trilium's <a class="reference-link" href="../../Navigation/Search.md">Search</a> syntax, it's unlikely they'll ever be supported.+ * When a base is encountered, it is simply ignored from the import.+* Canvases are not imported.+ * Theoretically they could map to either <a class="reference-link" href="../../../Note%20Types/Canvas.md">Canvas</a> or <a class="reference-link" href="../../../Note%20Types/Relation%20Map.md">Relation Map</a> but they are too different to reconcile.+* Links+ * Links to a specific heading in another note will still point to the right note, but the heading anchor will be dropped.+ * Dangling links (pointing to a note that doesn't exist) and ambiguous links (same base name in 2+ notes) are unwrapped to plain text.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Markdown.md b/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Markdown.mdnew file mode 100644index 0000000000..7d8bfe0a24--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Markdown.md@@ -0,0 +1,43 @@+# Markdown+Trilium supports Markdown for both import and export, while trying to keep compatibility as high as possible.++## Import++### Clipboard import++If you want to import just a chunk of markdown from clipboard, you can do it from editor block menu:++++### File import++You can also import Markdown files from files:++* single markdown file (with .md extension)+* whole tree of markdown files (packaged into [.zip](https://en.wikipedia.org/wiki/Tar_\(computing\)) archive)+ * Markdown files need to be packaged into ZIP archive because browser can't read directories, only single files.+ * You can use e.g. [7-zip](https://www.7-zip.org) to package directory of markdown files into the ZIP file++++## Export++### Subtree export++You can export whole subtree to ZIP archive which will have directory structured modelled after subtree structure:++++### Single note export++If you want to export just single note without its subtree, you can do it from Note actions menu:++++### Exporting protected notes++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.++## Supported syntax++See the dedicated page: <a class="reference-link" href="Markdown/Supported%20syntax.md">Supported syntax</a>\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Markdown/Supported syntax.md b/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Markdown/Supported syntax.mdnew file mode 100644index 0000000000..5322ddd2b3--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Markdown/Supported syntax.md@@ -0,0 +1,74 @@+# Supported syntax+[GitHub-Flavored Markdown](https://github.github.com/gfm/) is the main syntax that Trilium is following.++## Images++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.++## Tables++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.++## Links++Standard Markdown links are supported.++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.++## Math equations++Both inline and display equations are supported, using the `$` and `$$` syntaxes.++## Admonitions++The Markdown syntax for admonitions as supported by Trilium is the one that GitHub uses, which is as follows:++```+> [!NOTE]+> This is a note.++> [!TIP]+> This is a tip.++> [!IMPORTANT]+> This is a very important information.++> [!CAUTION]+> This is a caution.+```++There are currently no plans of supporting alternative admonition syntaxes such as `!!! note`.++## Wikilinks++Basic support for wikilinks has been added in v0.96.0:++* `[[foo/bar]]` will look for the `bar.md` file in the `foo` directory and turn it into an internal link.+* `![[foo/baz.png]]` will look for the `baz.png` file in the `foo` directory and turn it into an image.++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.++> [!IMPORTANT]+> The path to pages in wikilinks is resolved relatively to the _import root_ and not the current directory of the note. This is to be inline with other platforms that use wikilinks such as SilverBullet.+>+> The root path of the import is determined as follows:+>+> * If there is a single directory within the archive at root level, then that directory is considered the root.+> * If there are multiple files & directories at root level, then the archive root (containing all of these items) is considered the root.++## Highlights++Background highlights are supported in two ways:++* The Markdown `==` extension which is supported by other Markdown-based applications such as Obsidian:++ ```+ ==highlighted==+ ```+* The canonical HTML representation of highlights, as supported by Trilium:++ ```html+ <span style="background-color:hsl(0,0%,100%);">Highlighted</span>+ ```++When the yellow highlight is used, import/export prefers the `==` syntax whereas the canonical HTML reprepresentation is used otherwise.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Markdown_markdown-export-note.gif b/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Markdown_markdown-export-note.gifnew file mode 100644index 0000000000..d1eb7c0876Binary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Markdown_markdown-export-note.gif differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Markdown_markdown-export-subtree.gif b/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Markdown_markdown-export-subtree.gifnew file mode 100644index 0000000000..13316bb5fbBinary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Markdown_markdown-export-subtree.gif differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Markdown_markdown-file-import.gif b/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Markdown_markdown-file-import.gifnew file mode 100644index 0000000000..bcb2541f31Binary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Markdown_markdown-file-import.gif differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Markdown_markdown-inline-import.gif b/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Markdown_markdown-inline-import.gifnew file mode 100644index 0000000000..bf27467fd7Binary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/Import & Export/Markdown_markdown-inline-import.gif differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Keyboard Shortcuts.md b/docs/User Guide/User Guide/Basic Concepts and Features/Keyboard Shortcuts.mdnew file mode 100644index 0000000000..b06963e3f2--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Keyboard Shortcuts.md@@ -0,0 +1,83 @@+# Keyboard Shortcuts+This is supposed to be a complete list of keyboard shortcuts. Note that some of these may work only in certain contexts (e.g. in tree pane or note editor).++## Configuring keyboard shortcuts++It is also possible to configure most keyboard shortcuts in <a class="reference-link" href="UI%20Elements/Options.md">Options</a> → _Shortcuts_.++On the <a class="reference-link" href="../Installation%20%26%20Setup/Desktop%20Installation.md">Desktop Installation</a>, it's also possible to make shortcuts global by pressing on the globe icon near the key combination, which makes the shortcut work even without Trilium being in focus.++## Shortcut reference++> [!NOTE]+> All these shortcuts indicate the default key-bindings which can be changed individually from <a class="reference-link" href="UI%20Elements/Options.md">Options</a> → _Shortcuts._++### Tree++See the corresponding section: <a class="reference-link" href="UI%20Elements/Note%20Tree/Keyboard%20shortcuts.md">Keyboard shortcuts</a>++### Note navigation++* <kbd>Alt</kbd>+<kbd>←</kbd>, <kbd>Alt</kbd>+<kbd>→</kbd> – go back / forwards in the history+* <kbd>Ctrl</kbd>+<kbd>J</kbd> – show ["Jump to" dialog](Navigation/Note%20Navigation.md)+* <kbd>Ctrl</kbd>+<kbd>.</kbd> – scroll to current note (useful when you scroll away from your note or your focus is currently in the editor)+* <kbd>Backspace</kbd> – jumps to parent note+* <kbd>Alt</kbd>+<kbd>C</kbd> – collapse whole note tree+* <kbd>Alt</kbd>+<kbd>-</kbd> (alt with minus sign) – collapse subtree (if some subtree takes too much space on tree pane you can collapse it)+* you can define a [label](../Advanced%20Usage/Attributes.md) `#keyboardShortcut` with e.g. value `Ctrl + I` . Pressing this keyboard combination will then bring you to the note on which it is defined. Note that Trilium must be reloaded/restarted (<kbd>Ctrl</kbd>+<kbd>R</kbd> ) for changes to be in effect.++See demo of some of these features in [note navigation](Navigation/Note%20Navigation.md).++### Tabs++* <kbd>Ctrl</kbd> + <kbd>🖱 Left click</kbd> – (or middle mouse click) on note link opens note in a new tab++Only in desktop (electron build):++* <kbd>Ctrl</kbd>+<kbd>T</kbd> – opens empty tab+* <kbd>Ctrl</kbd>+<kbd>W</kbd> – closes active tab+* <kbd>Ctrl</kbd>+<kbd>Tab</kbd> – activates next tab+* <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>Tab</kbd> – activates previous tab++### Splits++<a class="reference-link" href="UI%20Elements/Split%20View.md">Split View</a> can also be controlled through keyboard actions, such as:++* Creating a new split+* Closing the active split+* Moving a split left/right+* Focusing the split to the left/right.++All these keyboard shortcuts do not have a default set, go to <a class="reference-link" href="UI%20Elements/Options.md">Options</a> → _Shortcuts_ and look for the _Split View_ category.++### Creating notes++* <kbd>Ctrl</kbd>+<kbd>O</kbd> – creates new note after the current note+* <kbd>Ctrl</kbd>+<kbd>P</kbd> – creates new sub-note into current note+* <kbd>F2</kbd> – edit the <a class="reference-link" href="Notes/Cloning%20Notes/Branch%20prefix.md">Branch prefix</a> of current note clone++### Editing notes++> [!NOTE]+> For keyboard shortcuts specific to <a class="reference-link" href="../Note%20Types/Text.md">Text</a> notes, refer to <a class="reference-link" href="../Note%20Types/Text/Keyboard%20shortcuts.md">Keyboard shortcuts</a> and <a class="reference-link" href="../Note%20Types/Text/Markdown-like%20formatting.md">Markdown-like formatting</a>.++* Enter in tree pane switches from tree pane into note title. Enter from note title switches focus to text editor. <kbd>Ctrl</kbd>+<kbd>.</kbd> switches back from editor to tree pane.+* <kbd>Ctrl</kbd>+<kbd>.</kbd> – jump away from the editor to tree pane and scroll to current note++### Runtime shortcuts++These are hooked in Electron to be similar to native browser keyboard shortcuts.++* <kbd>F5</kbd>, <kbd>Ctrl</kbd>+<kbd>R</kbd> – reloads Trilium front-end+* <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>I</kbd> – show developer tools+* <kbd>Ctrl</kbd>+<kbd>F</kbd> – show search dialog+* <kbd>Ctrl</kbd>+<kbd>-</kbd> – zoom out+* <kbd>Ctrl</kbd>+<kbd>=</kbd> – zoom in++### Other++* <kbd>Alt</kbd>+<kbd>O</kbd> – show SQL console (use only if you know what you're doing)+* <kbd>Alt</kbd>+<kbd>M</kbd> – distraction-free mode - display only note editor, everything else is hidden+* <kbd>F11 </kbd> – toggle full screen+* <kbd>Ctrl</kbd>+<kbd>S</kbd> – toggle [search](Navigation/Search.md) form in tree pane+* <kbd>Alt</kbd>+<kbd>A</kbd> – show note [attributes](../Advanced%20Usage/Attributes.md) dialog\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/1_Jump to & command palette_image.png b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/1_Jump to & command palette_image.pngnew file mode 100644index 0000000000..4304944c41Binary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/1_Jump to & command palette_image.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/1_Workspaces_image.png b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/1_Workspaces_image.pngnew file mode 100644index 0000000000..ae10ee7cb1Binary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/1_Workspaces_image.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Bookmarks.md b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Bookmarks.mdnew file mode 100644index 0000000000..332ec24172--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Bookmarks.md@@ -0,0 +1,18 @@+# Bookmarks+Frequently used notes can be bookmarked, which will make them appear in the <a class="reference-link" href="../UI%20Elements/Launch%20Bar.md">Launch Bar</a> for easy access.++## Configuring the launch bar++If bookmarks don't appear in the launch bar, then most likely the bookmark section has been hidden. Go to the <a class="reference-link" href="../UI%20Elements/Launch%20Bar.md">Launch Bar</a> configuration from the <a class="reference-link" href="../UI%20Elements/Global%20menu.md">Global menu</a> and ensure _Bookmarks_ is in the _Visible Launchers_ section.++## Bookmark folder++Space in the left panel is limited, and you might want to bookmark many items. One possible solution is to bookmark a folder, so it shows its children:++To do this, bookmark a folder and assign it the `#bookmarkFolder` label.++## Mobile++On mobile, bookmarks are only displayed starting with v0.102.0. Because of the more constrained screen size, the bookmarks are grouped under a single icon instead of displaying them as separate icons.++When pressed, a menu will appear listing all the bookmarks. Bookmark folders are also supported and will appear as sub-menus.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Jump to & command palette_image.png b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Jump to & command palette_image.pngnew file mode 100644index 0000000000..707dbc309dBinary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Jump to & command palette_image.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Note Hoisting.md b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Note Hoisting.mdnew file mode 100644index 0000000000..f885cc1127--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Note Hoisting.md@@ -0,0 +1,8 @@+# Note Hoisting+Hoisting is a standard outliner feature which allows you to focus on (or "zoom into") a specific note and its subtree by hiding all parent and sibling notes. Demo:++++In addition to showing only this subtree, this also narrows both full text search and [“jump to note”](Note%20Navigation.md) to just notes present in hoisted subtree.++See also [Workspace](Workspaces.md) which extends this feature.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Note Hoisting_note-hoisting.gif b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Note Hoisting_note-hoisting.gifnew file mode 100644index 0000000000..cafab4a165Binary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Note Hoisting_note-hoisting.gif differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Note Navigation.md b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Note Navigation.mdnew file mode 100644index 0000000000..10edf13097--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Note Navigation.md@@ -0,0 +1,16 @@+# Note Navigation+One of the Trilium's goals is to provide fast and comfortable navigation between notes.++## Backwards and forward++You can use alt-left and alt-right to move back and forward in history of viewed pages.++This works identically to browser backwards / forwards, it's actually using built-in browser support for this.++++## Jump to note++This is useful to quickly find and view arbitrary notes - click on `Jump to` button on the top or press <kbd>Ctrl</kbd> + <kbd>J</kbd> . Then type part of the note name and autocomplete will help you pick the desired note.++See <a class="reference-link" href="Jump%20to%20%26%20command%20palette.md">Jump to Note</a> for more information.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Note Navigation_image.png b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Note Navigation_image.pngnew file mode 100644index 0000000000..2ea2690121Binary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Note Navigation_image.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Quick edit.md b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Quick edit.mdnew file mode 100644index 0000000000..a9b27e7c82--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Quick edit.md@@ -0,0 +1,41 @@+# Quick edit+<figure class="image image-style-align-right image_resized" style="width:53.13%;"><img style="aspect-ratio:895/694;" src="Quick edit_image.png" width="895" height="694"></figure>++_Quick edit_ provides an alternative to the standard tab-based navigation and editing.++Instead of clicking on a note which switches the <a class="reference-link" href="../UI%20Elements/Note%20Tree.md">Note Tree</a> to the newly selected note, or navigating between two different <a class="reference-link" href="../UI%20Elements/Tabs.md">Tabs</a>, the _Quick edit_ feature opens as a popup window that can be easily dismissed.++This feature is also well integrated with <a class="reference-link" href="../../Collections.md">Collections</a> such as the calendar view, which makes it easy to edit entries without having to go back and forth between the child note and the calendar.++## Feature highlights++* All note types are supported, including <a class="reference-link" href="../../Collections.md">Collections</a>.+* Note that the <a class="reference-link" href="../Notes/Note%20List.md">Note List</a> will not be displayed, except for notes of type <a class="reference-link" href="../../Collections.md">Collections</a>.+* For <a class="reference-link" href="../../Note%20Types/Text.md">Text</a> notes, depending on user preference, both the floating and classic editors are supported. See <a class="reference-link" href="../../Note%20Types/Text/Formatting%20toolbar.md">Formatting toolbar</a>.+* The title and the note and the icon are editable, just like a normal tab.+* The <a class="reference-link" href="../../Advanced%20Usage/Attributes/Promoted%20Attributes.md">Promoted Attributes</a> are also displayed.+ * This integrates well with <a class="reference-link" href="../../Collections.md">Collections</a> where there are predefined attributes such as the _Start date_ and _End date_, allowing for easy editing.++## Accessing the quick edit++* From the <a class="reference-link" href="../UI%20Elements/Note%20Tree.md">Note Tree</a>:+ * Right click on a note and select _Quick edit_.+ * or, press <kbd>Ctrl</kbd>+<kbd>Right click</kbd> on a note.+* On <a class="reference-link" href="../../Note%20Types/Text/Links/Internal%20(reference)%20links.md">Internal (reference) links</a>:+ * Right click and select _Quick edit_.+ * or, press <kbd>Ctrl</kbd>+<kbd>Right click</kbd> on the link.+* On a <a class="reference-link" href="../UI%20Elements/Note%20Tooltip.md">Note Tooltip</a>, press the quick edit icon.+* In <a class="reference-link" href="../../Collections.md">Collections</a>:+ * For <a class="reference-link" href="../../Collections/Calendar.md">Calendar</a>:+ * Clicking on an event will open that event for quick editing.+ * If the calendar is for the <a class="reference-link" href="../../Advanced%20Usage/Advanced%20Showcases/Day%20Notes.md">Day Notes</a> root, clicking on the day number will open the popup for that day note.+ * For <a class="reference-link" href="../../Collections/Geo%20Map.md">Geo Map</a>:+ * Clicking on a marker will open that marker, but only if the map is in read-only mode.++## Handling of read-only notes++The Quick edit feature has a unique behavior for <a class="reference-link" href="../Notes/Read-Only%20Notes.md">Read-Only Notes</a>:++* If the note is read-only due to performance reasons (auto read-only), then the note is made editable for quick editing.+* If the note has been manually set to read-only, then the note is read-only to prevent accidental change.+ * In this case, the note can still be edited by on-screen instructions.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Quick edit_image.png b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Quick edit_image.pngnew file mode 100644index 0000000000..89882f216eBinary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Quick edit_image.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Quick search.md b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Quick search.mdnew file mode 100644index 0000000000..730b6c2b93--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Quick search.md@@ -0,0 +1,96 @@+# Quick search+<figure class="image image-style-align-center"><img style="aspect-ratio:659/256;" src="Quick search_image.png" width="659" height="256"></figure>++The _Quick search_ function does a full-text search (that is, it searches through the content of notes and not just the title of a note) and displays the result in an easy-to-access manner.++The alternative to the quick search is the <a class="reference-link" href="Search.md">Search</a> function, which opens in a dedicated tab and has support for advanced queries.++For even faster navigation, it's possible to use <a class="reference-link" href="Jump%20to%20%26%20command%20palette.md">Jump to & command palette</a> which will only search through the note titles instead of the content.++## Layout++Based on the <a class="reference-link" href="../UI%20Elements/Vertical%20and%20horizontal%20layout.md">Vertical and horizontal layout</a>, the quick search is placed:++* On the vertical layout, it is displayed right above the <a class="reference-link" href="../UI%20Elements/Note%20Tree.md">Note Tree</a>.+* On the horizontal layout, it is displayed in the <a class="reference-link" href="../UI%20Elements/Launch%20Bar.md">Launch Bar</a>, where it can be positioned just like any other icon.++## Search Features++Quick search includes the following features:++### Content Previews++Search results now display a 200-character preview of the note content below the note title. This preview shows the context where your search terms appear, making it easier to identify the right note without opening it.++### Infinite Scrolling++Results are loaded progressively as you scroll:++* Initial display shows 15 results+* Scrolling near the bottom automatically loads 10 more results+* Continue scrolling to load all matching notes++### Visual Features++* **Highlighting**: Search terms appear in bold with accent colors+* **Separation**: Results are separated with dividers+* **Theme Support**: Highlighting colors adapt to light/dark themes++### Search Behavior++Quick search uses progressive search:++1. Shows exact matches first+2. Includes fuzzy matches when exact results are fewer than 5+3. Exact matches appear before fuzzy matches++### Search Scope++Quick search covers only the subtree you are currently working in:++* Without hoisting, it covers the whole note tree.+* Under a [hoisted note](Note%20Hoisting.md) or inside a [workspace](Workspaces.md), it covers only that subtree.+* Notes that exist only in the hidden tree, such as the built-in help pages and the launch bar configuration, are not returned. Hoist into the help to search it, or use [Jump to…](Jump%20to%20%26%20command%20palette.md), which searches titles across the hidden tree.++To search the whole database while hoisted, use the full <a class="reference-link" href="Search.md">Search</a> and leave _Ancestor_ field empty.++### Keyboard Navigation++* Press `Enter` to open the first result+* Use arrow keys to navigate through results+* Press `Escape` to close the quick search++## Using Quick Search++1. **Typo tolerance**: Search finds results despite minor typos+2. **Content previews**: 200-character snippets show match context+3. **Infinite scrolling**: Additional results load on scroll+4. **Specific terms**: Specific search terms return more focused results+5. **Match locations**: Bold text indicates where matches occur++## Quick Search - Exact Match Operator++Quick Search shares the same search engine as the full <a class="reference-link" href="Search.md">Search</a>, so the exact match operator (`=`) behaves identically in both. Start your query with `=` (no space after it) to switch from the default "contains" behavior to exact whole-word or phrase matching.++**What** `**=**` **actually does:** it finds notes where the title or content contains your term as a **whole word or phrase**, ignoring surrounding punctuation. It does **not** require the whole note to equal your term, and it does **not** do substring or fuzzy matching.++| Query | Example note content | Matches? | Why |+| --- | --- | --- | --- |+| `sync` | `synchronize the database now` | Yes | default search matches the substring |+| `=sync` | `see (sync) mode` | Yes | `=` matches the whole word `sync`, punctuation ignored |+| `=sync` | `synchronize the database now` | No | `=` never matches substrings |+| `="project plan"` | `the (project plan) is ready to share` | Yes | quote a multi-word phrase to match it exactly |++The search is case- and diacritic-insensitive. For the complete explanation of the three matching modes, fuzzy operators and relevance ranking, see [How search matches your text](Search.md) in the full Search documentation.++### Limitations++* The `=` operator must be at the very beginning of the search query.+* A space immediately after `=` is treated as a regular search.+* Multiple `=` operators (like `==example`) are treated as regular text search.++### Related Features++* For attribute, property, boolean and ordering queries, use the full [Search](Search.md) functionality.+* For fuzzy matching (finding results despite typos), use the `~=` or `~*` operators in the full search.+* For partial matches with wildcards, use operators like `*=*`, `=*`, or `*=` in the full search.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Quick search_image.png b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Quick search_image.pngnew file mode 100644index 0000000000..997ff79c90Binary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Quick search_image.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Search in note.md b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Search in note.mdnew file mode 100644index 0000000000..75e49b0fbd--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Search in note.md@@ -0,0 +1,29 @@+# Search in note+<figure class="image image_resized" style="width:100%;"><img style="aspect-ratio:898/93;" src="Search in note_image.png" width="898" height="93"></figure>++Local search allows you to search within the currently displayed note.++## Alternatives++* Pressing Ctrl+F while in a browser while not focused in a <a class="reference-link" href="../../Note%20Types/Text.md">Text</a> or a <a class="reference-link" href="../../Note%20Types/Code.md">Code</a> note will trigger the browser's native search. This will also find text that is part of Trilium's UI.+* Pressing Ctrl+F in a <a class="reference-link" href="../../Note%20Types/Text.md">Text</a> note will reveal <a class="reference-link" href="../../Advanced%20Usage/Technologies%20used/CKEditor.md">CKEditor</a>'s search functionality.++## Accessing the search++* On desktop, press<kbd>Ctrl</kbd> + <kbd>F</kbd>+* From the <a class="reference-link" href="../UI%20Elements/Note%20buttons.md">Note buttons</a>, look for the context menu and select _Search in note_.++## Interaction++* Finding:+ * Fill in the _Find in text…_ with the text to search for.+ * The search will be executed automatically in the background.+ * Use up and down arrows of the text box to navigate between results.+* Replacing:+ * Fill in the _Find in text_… field with the text to replace.+ * Fill in the _Replace with…_ field the text to replace it with.+ * Press _Replace_ to replace only the current result.+ * Press _Replace all_ to replace all of them at once.+* Options:+ * _Case sensitive_ – the search will distinguish upper case characters from lower case (e.g. searching for Hello will not match `hello`).+ * _Match words_ - the search will find only exact word matches (e.g. searching for `Java` will not match `JavaScript`).\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Search in note_image.png b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Search in note_image.pngnew file mode 100644index 0000000000..762d1e543aBinary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Search in note_image.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Search.md b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Search.mdnew file mode 100644index 0000000000..1e5cbe8fe2--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Search.md@@ -0,0 +1,224 @@+# Search+<figure class="image"><img style="aspect-ratio:987/725;" src="Search_image.png" width="987" height="725"></figure>++Note search enables you to find notes by searching for text in the title, content, or [attributes](../../Advanced%20Usage/Attributes.md) of the notes. You also have the option to save your searches, which will create a special search note which is visible on your navigation tree and contains the search results as sub-items.++## Types of search++There are multiple types of searches, all using the same search mechanism and query language:++* <a class="reference-link" href="Quick%20search.md">Quick search</a> which can be found in the <a class="reference-link" href="../UI%20Elements/Launch%20Bar.md">Launch Bar</a> for small one-off searches.++ * The results are shown in a popup and it has an infinite scroll.+* _Full search_ is the more advanced search mechanism.++ * The results are displayed in a separate page and it has multiple advanced features (search script, fast search, include archived notes, order by, limit).+ * <a class="reference-link" href="../../Advanced%20Usage/Bulk%20Actions.md">Bulk Actions</a> such as adding a label/relation can be applied to the results.+ * The results are paginated and they can be displayed in any <a class="reference-link" href="../../Collections.md">Collections</a> view (e.g. grid, list, calendar, table).+* Some <a class="reference-link" href="../../Collections.md">Collections</a> such as board view have a dedicated search bar which applies to that collection.++ * In this case, the results are displayed directly in the collection instead of a popup and they are limited to the collection but the query language remains the same.++> [!NOTE]+> [Jump to note](Jump%20to%20%26%20command%20palette.md) is a similar concept but it's mainly used to search for notes by title, not by content. Nevertheless, it also features a way to search in full text if the results are unsatisfactory.++## Accessing the search++* From the <a class="reference-link" href="../UI%20Elements/Launch%20Bar.md">Launch Bar</a>, look for the dedicated search button.+* To limit the search to a note and its children, select _Search from subtree_ from the <a class="reference-link" href="../UI%20Elements/Note%20Tree/Note%20tree%20contextual%20menu.md">Note tree contextual menu</a> or press <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>S</kbd>.+* Go to <a class="reference-link" href="Jump%20to%20%26%20command%20palette.md">Jump to & command palette</a>, look for something then press _Search in full text_ (or <kbd>Ctrl</kbd>+<kbd>Enter</kbd>).++## Interaction++To search for notes, click on the magnifying glass icon on the toolbar or press the keyboard [shortcut](../Keyboard%20Shortcuts.md).++1. Set the text to search for in the _Search string_ field.+ 1. Apart from searching for words literally, there is also the possibility to search for attributes or properties of notes.+ 2. See the examples below for more information.+2. To limit the search to a note and its sub-children, set a note in _Ancestor_.+ 1. This value is also pre-filled if the search is triggered from a [hoisted note](Note%20Hoisting.md) or a [workspace](Workspaces.md).+ 2. To search the entire database, keep the value empty.+3. To limit the search to only a few levels of hierarchy (e.g. look in sub-children but not in sub-sub-children of a note), set the _depth_ field to one of the provided values.+4. In addition to that, the search can be configured via the _Add search options_ buttons, as described in the follow-up section.+5. Press _Search_ to trigger the search. The results are displayed below the search configuration pane.+6. The _Search & Execute actions_ button is only relevant if at least one action has been added (as described in the section below).+7. The _Save to note_ will create a new note with the search configuration. For more information, see <a class="reference-link" href="../../Note%20Types/Saved%20Search.md">Saved Search</a>.++## Features++### Autocomplete++To help with the syntax, Trilium offers an autocomplete functionality which can be triggered by pressing <kbd>Ctrl</kbd>+<kbd>Space</kbd>.++The autocomplete offers:++* Basic operators such as `*=` and keywords (`limit`, `not`).+* Fields for object-like fields such as `note` or `~relation`, triggered by typing `.`.+* Contextual enumerations such as `note.type = "` or `note.mime = "`.+* [Label](../../Advanced%20Usage/Attributes/Labels.md) names by typing `#`, with user-defined ones shown first.++ * A gear icon indicates system attributes.+ * After typing the label name, the value is also autocompleted with values that are present in the database.+* [Relation](../../Advanced%20Usage/Attributes/Relations.md) names by typing `~`.+* [Note ID](../../Advanced%20Usage/Note%20ID.md)s can be inserted easily by typing `@` and looking for a note.++ * If the note ID is under a valid syntax, it will be shown as a chip of the note instead of the raw ID.+ * This is especially useful for queries that make use of the note ID such as searching by template: `~template.noteId = @`++### Syntax highlighting++The search input features syntax highlighting, making recognized fields such as `note.` and operators like `NOT` stand out.++### Error highlighting & linting++The search is also checked for errors in two phases, which will be displayed as a red squiggle:++* Linter errors which identify common error patterns and also provide a way to fix them.+* Search errors which are checked by the server, without indicating the exact place the error occurred.++### Multiline++Long or complicated searches can be formatted by using newlines, similar to SQL queries. Newlines are treated just like spaces.++To add a new line, press <kbd>Shift</kbd>+<kbd>Enter</kbd>.++> [!NOTE]+> Multiline is available only for the full search, other inputs such as the quick search or the collection filter are single line.++## Search options++Click on which search option to apply from the Add search option section.++* For each search option selected, the search configuration will update to reveal the entry. Each search option will have its own configuration.+* To remove a search option, simply press the X button to the right of it.++The options available are:++1. Search script+ 1. This feature allows writing a <a class="reference-link" href="../../Note%20Types/Code.md">Code</a> note that will handle the search on its own.+2. Fast search+ 1. The search will not look into the content of the notes, but it will still look into note titles and attributes, relations (based on the search query).+ 2. This method can speed up the search considerably for large [databases](../../Advanced%20Usage/Database.md).+3. Include archived+ 1. <a class="reference-link" href="../Notes/Archived%20Notes.md">Archived Notes</a> will also be included in the results, whereas otherwise they would be ignored.+4. Order by+ 1. Allows changing the criteria for ordering the results, for example to order by creation date or alphabetically instead of by relevancy (default).+ 2. It's also possible to change the order (ascending or descending) of the results.+5. Limit+ 1. Limits the results to a given maximum.+ 2. This can help if the number of results would otherwise be high, at the cost of not being able to view all the results.+6. Debug+ 1. This will print additional information in the server log (see <a class="reference-link" href="../../Troubleshooting/Error%20logs.md">Error logs</a>), regarding how the search expression was parsed.+ 2. This function is especially useful after understanding the search functionality in detail, in order to determine why a complex search query is not working as expected.+7. Action+ 1. Apart from just searching, it is also possible to apply actions such as to add a label or a relation to the notes that have been matched by the search.+ 2. Unlike other search configurations, here it's possible to apply the same action multiple times (i.e. in order to be able to apply multiple labels to notes).+ 3. The actions given are the same as the ones in <a class="reference-link" href="../../Advanced%20Usage/Bulk%20Actions.md">Bulk Actions</a>, which is an alternative for operating directly with notes within the <a class="reference-link" href="../UI%20Elements/Note%20Tree.md">Note Tree</a>.+ 4. After defining the actions, first press _Search_ to check the matched notes and then press _Search & Execute actions_ to trigger the actions.++## Viewing search results++Results appear below the search pane as a list of **snippet cards**. Each card shows the note title and a short excerpt of the text that matched.++The search will also highlight the words from the title or content that matched:++* With a solid underlined green for a direct match;+* With a dotted underline orange for a partial match (matched by the fuzzy search).++In addition:++* The **total number of results** is always shown, so you can immediately tell how broad a query is.+* A **page-size selector** lets you choose how many results to display per page. Your choice is remembered and synced across your devices (stored in the `searchResultsPageSize` option), so you do not have to reset it on every device.+* **Clicking a result** opens the note and jumps straight to the first match. The in-note find bar opens pre-filled with your search terms, so you can step through the remaining matches with the find controls.+* If a match is inside a **collapsed section** (for example a folded heading), that section is expanded automatically so the match is visible.++## Simple Note Search Examples++* `rings tolkien`: Full-text search to find notes containing both "rings" and "tolkien".+* `"The Lord of the Rings" Tolkien`: Full-text search where "The Lord of the Rings" must match exactly.+* `note.content *=* rings OR note.content *=* tolkien`: Find notes containing "rings" or "tolkien" in their content.+* `towers #book`: Combine full-text and attribute search to find notes containing "towers" and having the "book" label.+* `towers #book or #author`: Search for notes containing "towers" and having either the "book" or "author" label.+* `towers #!book`: Search for notes containing "towers" and not having the "book" label.+* `#book #publicationYear = 1954`: Find notes with the "book" label and "publicationYear" set to 1954.+* `#genre *=* fan`: Find notes with the "genre" label containing the substring "fan". Additional operators include `*=*` for "contains", `=*` for "starts with", `*=` for "ends with", and `!=` for "is not equal to".+* `#book #publicationYear >= 1950 #publicationYear < 1960`: Use numeric operators to find all books published in the 1950s.+* `#dateNote >= TODAY-30`: Find notes with the "dateNote" label within the last 30 days. Supported date values include NOW +- seconds, TODAY +- days, MONTH +- months, YEAR +- years.+* `~author.title *=* Tolkien`: Find notes related to an author whose title contains "Tolkien".+* `#publicationYear %= '19[0-9]{2}'`: Use the '%=' operator to match a regular expression (regex). This feature has been available since Trilium 0.52.+* `note.content %= '\\d{2}:\\d{2} (PM|AM)'`: Find notes that mention a time. Backslashes in a regex must be escaped.++## Advanced Use Cases++* `~author.relations.son.title = 'Christopher Tolkien'`: Search for notes with an "author" relation to a note that has a "son" relation to "Christopher Tolkien". This can be modeled with the following note structure:+ * Books+ * Lord of the Rings+ * label: “book”+ * relation: “author” points to “J. R. R. Tolkien” note+ * People+ * J. R. R. Tolkien+ * relation: “son” points to "Christopher Tolkien" note+ * Christopher Tolkien+* `~author.title *= Tolkien OR (#publicationDate >= 1954 AND #publicationDate <= 1960)`: Use boolean expressions and parentheses to group expressions. Note that expressions starting with a parenthesis need an "expression separator sign" (# or ~) prepended.+* `note.parents.title = 'Books'`: Find notes with a parent named "Books".+* `note.parents.parents.title = 'Books'`: Find notes with a grandparent named "Books".+* `note.ancestors.title = 'Books'`: Find notes with an ancestor named "Books".+* `note.children.title = 'sub-note'`: Find notes with a child named "sub-note".++See also <a class="reference-link" href="Search/Under%20the%20hood.md">Under the hood</a> for more syntax references.++### Search with Note Properties++Notes have properties that can be used in searches, such as `noteId`, `dateModified`, `dateCreated`, `isProtected`, `type`, `title`, `text`, `content`, `rawContent`, `ownedLabelCount`, `labelCount`, `ownedRelationCount`, `relationCount`, `ownedRelationCountIncludingLinks`, `relationCountIncludingLinks`, `ownedAttributeCount`, `attributeCount`, `targetRelationCount`, `targetRelationCountIncludingLinks`, `parentCount`, `childrenCount`, `isArchived`, `contentSize`, `noteSize`, and `revisionCount`.++These properties can be accessed via the `note.` prefix, e.g., `note.type = code AND note.mime = 'application/json'`.++### Order by and Limit++```+#author=Tolkien orderBy #publicationDate desc, note.title limit 10+```++This example will:++1. Find notes with the author label "Tolkien".+2. Order the results by `publicationDate` in descending order.+3. Use `note.title` as a secondary ordering if publication dates are equal.+4. Limit the results to the first 10 notes.++### Negation++Some queries can only be expressed with negation:++```+#book AND not(note.ancestors.title = 'Tolkien')+```++This query finds all book notes not in the "Tolkien" subtree.++## Under the Hood++See the [dedicated page](Search/Under%20the%20hood.md) to understand how progressive search works in Trilium, as well as some advanced use cases.++## Auto-Trigger Search from URL++You can open Trilium and automatically trigger a search by including the search [url encoded](https://meyerweb.com/eric/tools/dencoder/) string in the URL:++`http://localhost:8080/#?searchString=abc`++## Search Configuration++### Parameters++| Parameter | Value | Description |+| --- | --- | --- |+| `MIN_FUZZY_TOKEN_LENGTH` | 3 | Minimum characters the `~=` and `~*` operators accept |+| `MAX_EDIT_DISTANCE` | 2 | Ceiling on character changes, reached only by 7+ character terms; shorter terms allow fewer. See the _Fuzzy tolerance_ section above |+| `RESULT_SUFFICIENCY_THRESHOLD` | 5 | Minimum exact results before fuzzy fallback |+| `MAX_CONTENT_SIZE` | 10MB | Maximum note content size for search processing |++### Limits++* Searched note content is limited to 10MB per note to prevent performance issues+* Notes exceeding this limit will still be included in title and attribute searches+* Terms of 3 characters or fewer are matched exactly; typo tolerance starts at 4 characters\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Search/How search matches your text.md b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Search/How search matches your text.mdnew file mode 100644index 0000000000..e74508cce8--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Search/How search matches your text.md@@ -0,0 +1,131 @@+# How search matches your text+The single most common source of confusion is that the `=` sign means two _different_ things depending on where it appears. Read this section once and the rest of search becomes predictable.++There are three matching modes:++| Mode | How you trigger it | What it matches | Substring? | Fuzzy (typos)? |+| --- | --- | --- | --- | --- |+| **Default** | type words with no prefix | whole words _and_ substrings, anywhere in title, content or attributes, relevance-ranked | Yes | Yes |+| **Exact full-text** | a leading `=` (e.g. `=sync`) | the exact whole word or phrase, ignoring surrounding punctuation | No | No |+| **Attribute / property equality** | `=` inside a `#label=value` or `note.property=value` clause | the _entire_ attribute or property value, exactly | No | No |++### Default matching (no prefix)++**Rule:** typing words with no prefix finds notes that contain those words anywhere in the title, content or attributes, as whole words or as substrings. The closest matches are ranked first.++| Query | Example note content | Matches? | Why |+| --- | --- | --- | --- |+| `sync` | `please sync the folders` | Yes (ranked higher) | contains the exact word `sync` |+| `sync` | `synchronize the database now` | Yes (ranked lower) | `sync` is a substring of `synchronize` |++### Exact match with the `=` prefix++**Rule:** a leading `=` switches the full-text search to exact matching. It finds the whole word or phrase only, ignoring surrounding punctuation, with **no** substring and **no** fuzzy matching. Use it when a normal search returns too many near-matches.++| Query | Example note content | Matches? | Why |+| --- | --- | --- | --- |+| `=sync` | `see (sync) mode` | Yes | `(sync)` is the whole word `sync`; punctuation is ignored |+| `=sync` | `in sync, then continue` | Yes | `sync,` is the whole word `sync` |+| `=sync` | `he said "sync" out loud` | Yes | `"sync"` is the whole word `sync` |+| `=sync` | `synchronize the database now` | No | `=` never matches substrings |+| `=sync` | `please send the file` | No | `=` never matches typos / fuzzy |++To match an exact **phrase**, quote it after the `=` (single, double or backtick quotes all work). The phrase must appear as consecutive words, but punctuation between or around them is ignored:++| Query | Example note (title or content) | Matches? | Why |+| --- | --- | --- | --- |+| `="project plan"` | title `Project Plan` | Yes | the title is exactly the phrase |+| `="project plan"` | `the (project plan) is ready to share` | Yes | the consecutive phrase appears; punctuation is ignored |+| `="project plan"` | `the plan for this project is late` | No | the words are present but not consecutive |++### Attribute and property equality (`=`, `!=`)++**Rule:** when `=` compares an attribute or property, as in `#label=value` or `note.title=value`, it is **strict full-value equality**: the _whole_ value must equal what you typed, ignoring case and diacritics. This is **not** word matching. `!=` inverts it.++The examples below assume four notes: _Austria_ (`#capital=Vienna`), _Somewhere_ (`#capital=Vienna Austria`), _Czech Republic_ (`#capital=Prague`) and _Switzerland_ (`#capital=Zürich`).++| Query | Example label value | Matches? | Why |+| --- | --- | --- | --- |+| `#capital=Vienna` | `Vienna` | Yes | the whole value equals `Vienna` |+| `#capital=Vienna` | `Vienna Austria` | No | the whole value is `Vienna Austria`, not `Vienna` |+| `#capital="Vienna Austria"` | `Vienna Austria` | Yes | quote a multi-word value to match it in full |+| `#capital=Zurich` | `Zürich` | Yes | equality ignores diacritics |+| `#capital!=Vienna` | `Prague` | Yes | `!=` matches every value that is not `Vienna` |+| `#capital!=Vienna` | `Vienna` | No | `!=` excludes the exact value |++> **Quick search relaxes this.** The [Quick search](../Quick%20search.md) bar and autocomplete treat an attribute `=` as "contains", so `#capital=Vienna` typed there also matches `Vienna Austria`. The strict full-value equality described here applies only in the full Search.++### Fuzzy operators (`~=` and `~*`)++**Rule:** the fuzzy operators tolerate typos. `~=` (fuzzy-equals) matches a value that is a close whole-word variant of your term. `~*` (fuzzy-contains) matches when your term appears anywhere inside the value, either as a fragment or as a near-miss. Both work on note properties such as `note.title` and `note.content`, and on labels (`#label`). Fuzzy operators accept terms of at least 3 characters, though how many typos each term tolerates depends on its length — see _Fuzzy tolerance_ below.++The examples assume a note titled `Books` carrying the label `#author=Tolkien`, and a note whose content is `learn programming today`.++| Query | Example value | Matches? | Why |+| --- | --- | --- | --- |+| `note.title ~= boks` | title `Books` | Yes | one edit away from `books` |+| `#author ~= tolkein` | author `Tolkien` | Yes | `tolkein` is a typo of `tolkien` |+| `note.content ~* progr` | `learn programming today` | Yes | `progr` is a fragment of `programming` |+| `note.content ~* programing` | `learn programming today` | Yes | `programing` is one edit from `programming` |++### Fuzzy tolerance++**Rule:** how many typos are tolerated depends on the **length** of your search term. Short terms must match exactly, because a single edit is enough to turn one short word into an unrelated one; longer terms have greater tolerance.++| Term length | Edits allowed |+| --- | --- |+| 1–3 characters | 0 (exact only) |+| 4–6 characters | 1 |+| 7+ characters | 2 |++| Query | Term length | Example note content | Matches? | Why |+| --- | --- | --- | --- | --- |+| `cat` | 3 | `a bright red car` | No | No edits are allowed below 4 characters, so `cat` does not reach `car` |+| `carr` | 4 | `a blue debit card` | Yes | 1 edit is within budget for 4–6 character terms |+| `ceck` | 4 | `the latest tech trends` | No | `ceck`→`tech` needs 2 edits; only 1 is allowed at this length |+| `combinef` | 8 | `the values were combined together` | Yes | `combinef`→`combined` is 1 edit; up to 2 are allowed at 7+ characters |++### Relevance ranking++**Rule:** results are ordered by _how well_ they match, not merely whether they match. Exact whole-word and phrase matches rank above substring and fuzzy matches, and a note where your words appear as a consecutive phrase outranks one where they are scattered.++| Query | Ranked higher | Ranked lower | Why |+| --- | --- | --- | --- |+| `sync` | `please sync the folders` | `synchronize the database now` | exact word beats substring |+| `you and me` | `I like you and me as a phrase` | `the menu is here and you know it` | consecutive phrase beats scattered words |++### What is searchable++A search looks at more than the visible body text. All of the following are indexed and searchable:++* note titles,+* note body content,+* labels and relations ([attributes](../../../Advanced%20Usage/Attributes.md)),+* link URLs and the titles/descriptions of link previews,+* the titles of notes that a note reference-links to.++The last point is the least obvious: if a note's only content is a reference link to another note, searching for that other note's **title** still finds the linking note.++| Query | Setup | Matches? | Why |+| --- | --- | --- | --- |+| `special topic` | a note whose only content is a reference link to a note titled `Special Topic` | Yes, and the linked target ranks first | the target's title is indexed into the linking note's searchable text |+| `special` | the same note (only a reference link to `Special Topic`) | Yes, one word from the target's title is enough | the indexed title is normalized just like body text, so even one lowercased word matches |+| `zurich` | a note whose only content is a reference link to a note titled `Zürich` | Yes | the indexed title has its accents normalized, so the plain form matches the accented title |++### Diacritics++**Rule:** accents are normalized on both sides, so an accented word and its plain form match each other.++| Query | Example note content | Matches? |+| --- | --- | --- |+| `ktory` | `slovo ktorý znamena nieco` | Yes |+| `ktorý` | `the word ktory appears here` | Yes |++### Regular expressions (`%=`)++**Rule:** the `%=` operator matches a property or label value against a regular expression.++| Query | Example note content | Matches? |+| --- | --- | --- |+| `note.content %= 'colou?r'` | `my favorite color of all` | Yes |+| `note.content %= 'colou?r'` | `my favourite colour of all` | Yes |\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Search/Under the hood.md b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Search/Under the hood.mdnew file mode 100644index 0000000000..ae6e408dab--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Search/Under the hood.md@@ -0,0 +1,83 @@+# Under the hood+## Progressive Search Strategy++Trilium uses a progressive search strategy that performs exact matching first, then adds fuzzy matching when needed.++The search has three phases:++1. **Phase 1 - Exact Matching**: When you search, Trilium first looks for exact matches of your search terms. This handles the vast majority of searches (90%+) and returns results almost instantly.+2. **Phase 2 - Fuzzy Fallback**: If Phase 1 doesn't find enough high-quality results (fewer than 5 results with good relevance scores), Trilium automatically adds fuzzy matching to find results with typos or spelling variations.+3. **Result Ordering**: Exact matches always appear before fuzzy matches, regardless of individual scores. This ensures that when you search for "project", notes containing the exact word "project" will appear before notes containing similar words like "projects" or "projection".++### Progressive Search Behavior++* **Speed**: Most searches complete using only exact matching+* **Ordering**: Exact matches appear before fuzzy matches+* **Fallback**: Fuzzy matching activates when exact matches return fewer than 5 results+* **Identification**: Results indicate whether they are exact or fuzzy matches++## Search Performance++Search system specifications:++* Content size limit: 10MB per note (previously 50KB)+* Edit distance calculations for fuzzy matching+* Infinite scrolling in Quick Search++## Label and Relation Shortcuts++The "full" syntax for searching by labels is:++```+note.labels.publicationYear = 1954+```++For relations:++```+note.relations.author.title *=* Tolkien+```++However, common label and relation searches have shortcut syntax:++```+#publicationYear = 1954+~author.title *=* Tolkien+```++## Separating Full-Text and Attribute Parts++Search syntax allows combining full-text search with attribute-based search. For example, `tolkien #book` contains:++1. Full-text tokens - `tolkien`+2. Attribute expressions - `#book`++Trilium detects the separation between full text search and attribute/property search by looking for certain special characters or words that denote attributes and properties (e.g., #, ~, note.). If you need to include these in full-text search, escape them with a backslash so they are processed as regular text:++```+"note.txt"+\#hash+#myLabel = 'Say "Hello World"'+```++## Escaping Special Characters++Special characters can be enclosed in quotes or escaped with a backslash to be used in full-text search:++```+"note.txt"+\#hash+#myLabel = 'Say "Hello World"'+```++Three types of quotes are supported: single, double, and backtick.++## Type Coercion++Label values are technically strings but can be coerced for numeric comparisons:++```+note.dateCreated =* '2019-05'+```++This finds notes created in May 2019. Numeric operators like `#publicationYear >= 1960` convert string values to numbers for comparison.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Search_image.png b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Search_image.pngnew file mode 100644index 0000000000..55f550c543Binary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Search_image.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Similar Notes.md b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Similar Notes.mdnew file mode 100644index 0000000000..67d4fd9e1e--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Similar Notes.md@@ -0,0 +1,15 @@+# Similar Notes+<figure class="image image-style-align-right image_resized" style="width:50.46%;"><img style="aspect-ratio:538/290;" src="Similar Notes_image.png" width="538" height="290"></figure>++The Similar Notes feature tries to identify notes that relate to the current note by looking at the content of the notes, their relationships, as well as the date they were created.++To access the list of similar notes:++* On the <a class="reference-link" href="../UI%20Elements/New%20Layout.md">New Layout</a>, go to the <a class="reference-link" href="../UI%20Elements/Right%20Sidebar/Connections%20tab.md">Connections tab</a> in the <a class="reference-link" href="../UI%20Elements/Right%20Sidebar.md">Right Sidebar</a> and look for the corresponding section.+* On the old layout, press the _Similar Notes_ tab in the <a class="reference-link" href="../UI%20Elements/Ribbon.md">Ribbon</a>.++## Interaction++* Hover over a note to see a short preview of the note.+* Click over a note to open it in the current view.+* <kbd>Ctrl</kbd> + click a note to open it in a separate tab.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Similar Notes_image.png b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Similar Notes_image.pngnew file mode 100644index 0000000000..ddf6536e66Binary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Similar Notes_image.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Tree Concepts.md b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Tree Concepts.mdnew file mode 100644index 0000000000..83699e32fc--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Tree Concepts.md@@ -0,0 +1,24 @@+# Tree Concepts+This page explains the basic concepts related to the tree structure of notes in TriliumNext.++## Note++A note is the central entity in TriliumNext. For more details, see <a class="reference-link" href="../Notes.md">Notes</a>.++## Branch++A branch describes the placement of a note within the note tree. Essentially, it is a tuple of `parentNoteId` and `noteId`, indicating that the given note is placed as a child under the specified parent note.++Each note can have multiple branches, meaning any note can be placed in multiple locations within the tree. This concept is referred to as <a class="reference-link" href="../Notes/Cloning%20Notes.md">Cloning Notes</a>.++## Prefix++A prefix is a branch-specific title modifier for a note. If you place your note in two different locations within the tree and want to alter the title slightly in one of those placements, you can use a prefix.++To edit a prefix, right-click on the note in the tree pane and select _Edit branch prefix_.++The prefix is not part of the note itself and is not encrypted when the note is protected. This can be useful if you want part of the title to remain visible in the tree for easier navigation, even when the note is protected.++## Subtree++A subtree consists of a particular note (the subtree root) and all its children and descendants. Some operations, such as exporting, work on entire subtrees.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Workspaces.md b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Workspaces.mdnew file mode 100644index 0000000000..d26281d523--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Workspaces.md@@ -0,0 +1,23 @@+# Workspaces+Workspace is a concept built up on top of [note hoisting](Note%20Hoisting.md). It is based on the idea that a user has several distinct spheres of interest. An example might be "Personal" and "Work", these two spheres are quite distinct and don't interact together. When I focus on Work, I don't really care about personal notes.++So far workspace consists of these features:++* [note hoisting](Note%20Hoisting.md) - you can "zoom" into a workspace subtree to focus only on the relevant notes+* easy entering of workspace:++ +* visual identification of workspace in tabs:+ ++### Configuration++| Label | Description |+| --- | --- |+| `workspace` | Marks this note as a workspace, button to enter the workspace is controlled by this |+| `workspaceIconClass` | defines box icon CSS class which will be used in tab when hoisted to this note |+| `workspaceTabBackgroundColor` | CSS color used in the note tab when hoisted to this note, use any CSS color format, e.g. "lightblue" or "#ddd". See [https://www.w3schools.com/cssref/css\_colors.asp](https://www.w3schools.com/cssref/css_colors.asp). |+| `workspaceCalendarRoot` | Marking a note with this label will define a new per-workspace calendar for <a class="reference-link" href="../../Advanced%20Usage/Advanced%20Showcases/Day%20Notes.md">Day Notes</a>. If there's no such note, the global calendar will be used. |+| `workspaceTemplate` | This note will appear in the selection of available template when creating new note, but only when hoisted into a workspace containing this template |+| `workspaceSearchHome` | new search notes will be created as children of this note when hoisted to some ancestor of this workspace note |+| `workspaceInbox` | Default inbox location for new notes when hoisted to some ancestor of this workspace note. See <a class="reference-link" href="../Notes/Note%20Inbox.md">Note Inbox</a> for more information. |\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Workspaces_image.png b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Workspaces_image.pngnew file mode 100644index 0000000000..2401cf0836Binary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Workspaces_image.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Notes.md b/docs/User Guide/User Guide/Basic Concepts and Features/Notes.mdnew file mode 100644index 0000000000..7db19f3665--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Notes.md@@ -0,0 +1,36 @@+# Notes+Note is a central entity in Trilium. Main attributes of note are [title](Notes/Title.md) and content.++### Note types++The main note type is a rich-text note type called <a class="reference-link" href="../Note%20Types/Text.md">Text</a>. For diagrams and drawing there is <a class="reference-link" href="../Note%20Types/Canvas.md">Canvas</a> and <a class="reference-link" href="../Note%20Types/Mermaid%20Diagrams.md">Mermaid Diagrams</a>.++There are also more complex note types such as <a class="reference-link" href="../Note%20Types/Saved%20Search.md">Saved Search</a>, <a class="reference-link" href="../Note%20Types/Render%20Note.md">Render Note</a> that usually go hand-in-hand with <a class="reference-link" href="../Scripting.md">Scripting</a>.++In Trilium there's no specific "folder" note type. Any note can have children and thus be a folder.++### Root note++There's one special note called "root note" which is root of the note tree. All other notes are placed below it in the structure.++### Tree structure++Importantly, note itself doesn't carry information on its placement in note tree. See <a class="reference-link" href="Notes/Cloning%20Notes.md">Cloning Notes</a> for details.++Tree structure of notes can resemble file system - but compared to that notes in Trilium can act as both file and directory - meaning that note can both have its own content and have children. "Leaf note" is a note which doesn't have any children.++### Deleting / undeleting notes++When you delete a note in Trilium, it is actually only marked for deletion (soft-delete) - the actual content, title, attributes etc. are not deleted, only hidden.++Within (by default) 7 days, it is possible to undelete these soft-deleted notes - open the <a class="reference-link" href="UI%20Elements/Recent%20Changes.md">Recent Changes</a> dialog, and you will see a list of all modified notes including the deleted ones. Notes available for undeletion have a link to do so. This is kind of "trash can" functionality known from e.g. Windows.++Clicking an undelete will recover the note, its content and attributes - note should be just as before being deleted. This action will also undelete note's children which have been deleted in the same action.++To be able to undelete a note, it is necessary that deleted note's parent must be undeleted (otherwise there's no place where we can undelete it to). This might become a problem when you delete more notes in succession - the solution is then undelete in the reverse order of your deletion.++After the 7 days (configurable) the notes will be "erased" - their title, content, revisions and attributes will be erased, and it will not be possible anymore to recover them (unless you restore a <a class="reference-link" href="../Installation%20%26%20Setup/Backup.md">Backup</a>).++## See also++* <a class="reference-link" href="Notes/Read-Only%20Notes.md">Read-Only Notes</a>\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Archived Notes.md b/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Archived Notes.mdnew file mode 100644index 0000000000..2a6cd4a0c5--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Archived Notes.md@@ -0,0 +1,10 @@+# Archived Notes+Archived notes are notes which have `archived` [attribute](../../Advanced%20Usage/Attributes.md) - either directly or [inherited](../../Advanced%20Usage/Attributes/Attribute%20Inheritance.md).++Such notes are then by default not shown in the autocomplete and in the full text [search](../Navigation/Search.md).++This can be useful for notes which are no longer very useful but still valuable enough to keep around without them getting too much in the way.++You can control whether archived notes are displayed in the note tree with a setting:++\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Archived Notes_hide-archived.png b/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Archived Notes_hide-archived.pngnew file mode 100644index 0000000000..82528ac634Binary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Archived Notes_hide-archived.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Attachments.md b/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Attachments.mdnew file mode 100644index 0000000000..48f55e1933--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Attachments.md@@ -0,0 +1,33 @@+# Attachments+A [note](../Notes.md) in Trilium can _own_ one or more attachments, which can be either images or files. These attachments can be displayed or linked within the note that owns them.++This can be especially useful to include dependencies for your [scripts](../../Scripting.md). The <a class="reference-link" href="../../Advanced%20Usage/Advanced%20Showcases/Weight%20Tracker.md">Weight Tracker</a> shows how to use [chartjs](https://chartjs.org/) which is attached to the script note.++Each note exclusively owns its attachments, meaning attachments cannot be shared or linked from one note to another. If an attachment link is copied to a different note, the attachment itself is duplicated, and the copies are managed independently thereafter.++Attachments, especially image files, are the recommended method for embedding visuals in notes. It is important to link image attachments within the text of the owning note; otherwise, they will be automatically deleted after a configurable timeout period if not referenced.++## Types of attachments++There are two different types of attachment:++* _User content_, representing files or images that are uploaded and part of the content of the note.+* _System attachments_ which are used internally by Trilium and can be of multiple types, including:+ * <a class="reference-link" href="../../Collections.md">Collections</a> to store information about views such as the column information for the <a class="reference-link" href="../../Collections/Kanban%20Board.md">Kanban Board</a>.+ * Icons and cover images for <a class="reference-link" href="../../Note%20Types/Text/Link%20Previews.md">Link Previews</a>.+ * Debug information for some importers such as <a class="reference-link" href="../Import%20%26%20Export/Importing%20data%20from%20other%20applications/Microsoft%20OneNote.md">Microsoft OneNote</a> (only if the debug flag was enabled at import time).++The system attachments are displayed at the end of the attachments list, in a dedicated section (_Generated by Trilium_).++## Converting notes to attachments++<a class="reference-link" href="../../Note%20Types/File.md">File</a> notes can be easily converted to attachments of the parent note.++To do so:++* For a single note, press the context menu from the <a class="reference-link" href="../UI%20Elements/Note%20buttons.md">Note buttons</a> and select _Convert into attachment_.+* For multiple notes, select the given notes in the <a class="reference-link" href="../UI%20Elements/Note%20Tree.md">Note Tree</a>, right click → Advanced → Convert to attachment.++## Attachment previews++Attachments share the same content preview for images, videos, PDFs, etc. as the <a class="reference-link" href="../../Note%20Types/File.md">File</a> note type.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Cloning Notes.md b/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Cloning Notes.mdnew file mode 100644index 0000000000..37e6b37677--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Cloning Notes.md@@ -0,0 +1,65 @@+# Cloning Notes+## Motivation++Trilium's core feature is the ability to structure your notes into hierarchical tree-like structure.++It is expected then that you'll have an elaborate and deep note hierarchy - each subtree will represent a more refined and specialized view of your knowledge base.++This is a pretty powerful approach, but it also carries a hidden assumption that each "subtopic" is "owned" by one parent. I'll illustrate this with an example - let's say my basic structure is this:++* Technology+ * Programming+ * Kotlin+ * JavaScript+ * Operating systems+ * Linux+ * Windows++Now, I'm starting to learn about [Bash](https://en.wikipedia.org/wiki/Bash_\(Unix_shell\)) and would like to create notes related to this topic. But now I'm facing a problem of where to categorize this. The issue here is that Bash is both a programming language and a tool (shell) very much tied into Linux. It seems it belongs to both of these, I can't (and don't want to) choose one over the other.++## Solution++The solution to the problem shown above is to allow notes to have multiple parents.++I call these "clones", but that is a bit misleading - there's no original and cloned note - the notes in both of the parents categories are identical.++Another misleading thing about "cloning" is that it suggests that a copy of the note has been made. That's not really true, the note itself stays in just one original, it is just referenced in multiple places in the tree hierarchy. So changing it in one category changes it in all the others, because they're all the same note.++Here's the final structure with cloning:++* Technology+ * Programming+ * Kotlin+ * JavaScript+ * Bash+ * some sub-notes ...+ * Operating systems+ * Linux+ * Bash+ * some sub-notes ...+ * Windows++So now the "Bash" subtree appears on multiple locations in the hierarchy. Both the Bash subtrees are the same and contain the same sub-categories and notes.++### Demo++++In the demo, you can see how a clone can be created using the context menu. It's possible to do this also using the Add Link dialog or with <kbd>Ctrl</kbd>+<kbd>C</kbd> and <kbd>Ctrl</kbd>+<kbd>V</kbd> [keyboard shortcuts](../Keyboard%20Shortcuts.md).++You can view the list of all available clones:++* In the <a class="reference-link" href="../UI%20Elements/Right%20Sidebar/Connections%20tab.md">Connections tab</a> for the <a class="reference-link" href="../UI%20Elements/New%20Layout.md">New Layout</a>.+* For the old layout, in the "Note Paths" tab in the <a class="reference-link" href="../UI%20Elements/Ribbon.md">Ribbon</a>.++Titles of cloned notes in the tree view have an asterisk to the right to easily see that the note is also placed into some other location.++## Deleting notes/clones++With clones, it might not be immediately obvious how deleting works.++If you try to delete a note, it works like this:++1. if the note has multiple clones, delete just this clone and leave the actual note (and its other clones) as it is.+2. if this note doesn't have any other clones, delete the note+ * Run the whole process starting with 1. on all note's children notes\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Cloning Notes/Branch prefix.md b/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Cloning Notes/Branch prefix.mdnew file mode 100644index 0000000000..cac96c46b1--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Cloning Notes/Branch prefix.md@@ -0,0 +1,6 @@+# Branch prefix+Since a single note can appear into multiple places in the <a class="reference-link" href="../../UI%20Elements/Note%20Tree.md">Note Tree</a> via a process called <a class="reference-link" href="../Cloning%20Notes.md">Cloning Notes</a>, it's recommended to choose a generalized name that fits into all locations instead of something more specific to avoid confusion.++In some cases this isn't possible so Trilium provides "branch prefixes", which is shown before the note name in the tree and as such provides a specific kind of context.++The prefix is location-specific, so it's displayed only in the note tree.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Cloning Notes_create-clone.gif b/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Cloning Notes_create-clone.gifnew file mode 100644index 0000000000..7429e5e737Binary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Cloning Notes_create-clone.gif differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Note Icons & Colors.md b/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Note Icons & Colors.mdnew file mode 100644index 0000000000..4e20d940c9--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Note Icons & Colors.md@@ -0,0 +1,21 @@+# Note Icons & Colors+## Icons++<figure class="image image-style-align-right image_resized" style="width:48.4%;"><img style="aspect-ratio:1089/995;" src="Note Icons & Colors_image.png" width="1089" height="995"></figure>++Icons are useful for distinguishing notes and are displayed near the note title, as well as in various places such as the <a class="reference-link" href="../UI%20Elements/Note%20Tree.md">Note Tree</a>, <a class="reference-link" href="../../Note%20Types/Text/Links/Internal%20(reference)%20links.md">Internal (reference) links</a> or the <a class="reference-link" href="../Navigation/Jump%20to%20%26%20command%20palette.md">Jump to & command palette</a>.++While editing a note, click on the icon next to the title to bring up a chooser gallery.++Icons can be inherited through the use of <a class="reference-link" href="../../Advanced%20Usage/Templates.md">Templates</a>, or <a class="reference-link" href="../../Advanced%20Usage/Attributes/Attribute%20Inheritance.md">Attribute Inheritance</a>.++> [!NOTE]+> At the technical level, they are set by the `iconClass` attribute which adds a CSS class to the note. For example `#iconClass="bx bx-calendar"` will show a calendar instead of the default page or folder icon. Looking up and remembering the CSS class names is not necessary.++## Colors++Notes can also carry a custom color. Similar to the note icon, this color will be shown in various places such as the <a class="reference-link" href="../UI%20Elements/Note%20Tree.md">Note Tree</a> and <a class="reference-link" href="../../Note%20Types/Text/Links/Internal%20(reference)%20links.md">Internal (reference) links</a>.++To set a custom color, right click on the note in the <a class="reference-link" href="../UI%20Elements/Note%20Tree.md">Note Tree</a> and select a predefined color from there or use the color picker (last option).++Alternatively, a custom color can be set manually through the `#color` [label](../../Advanced%20Usage/Attributes/Labels.md), whose value must be a valid hex color including the leading `#` (e.g. `#ff0000` for red). This color can be carried over across multiple notes via <a class="reference-link" href="../../Advanced%20Usage/Attributes/Attribute%20Inheritance.md">Attribute Inheritance</a>.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Note Icons & Colors_image.png b/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Note Icons & Colors_image.pngnew file mode 100644index 0000000000..0157d47413Binary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Note Icons & Colors_image.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Note Inbox.md b/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Note Inbox.mdnew file mode 100644index 0000000000..5c8a5f933c--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Note Inbox.md@@ -0,0 +1,30 @@+# Note Inbox+The inbox is the default destination for quickly captured notes. When a note is created without picking a location first, it lands in the inbox. This makes it easy to quickly capture notes and sort them later.++## Where the inbox is used++* The _New note_ button in the <a class="reference-link" href="../UI%20Elements/Launch%20Bar.md">Launch Bar</a>.+* The global _Create note into inbox_ shortcut (default <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>P</kbd>).+* The _New note_ action in the [tray icon menu](../../Installation%20%26%20Setup/Desktop%20Installation/Tray%20icon%20%26%20automatic%20startup.md).+* The <a class="reference-link" href="../../Installation%20%26%20Setup/Web%20Clipper.md">Web Clipper</a> extension.+* The _Create note_ option offered when a search finds no match, in <a class="reference-link" href="../Navigation/Jump%20to%20%26%20command%20palette.md">Jump to & command palette</a>, in an empty tab and in the `@` completion of a text note.++## Setting a note inbox++To create a note inbox, apply the `#inbox` [label](../../Advanced%20Usage/Attributes/Labels.md) to it.++Only one note should carry this label. If there are multiple notes, only one will be used by the application.++> [!NOTE]+> If there is no inbox note, Trilium will fall back to today's [day note](../../Advanced%20Usage/Advanced%20Showcases/Day%20Notes.md), creating it and its calendar ancestors as needed. If the journal has been removed altogether, the note is created at the top level instead of a new journal being built for it.++## Workspace inboxes++Each [workspace](../Navigation/Workspaces.md) can have its own inbox, set via the `#workspaceInbox` label.++When a new note is created while hoisted in a workspace, the location is determined in the following order:++* A note carrying the `#workspaceInbox` label in that workspace.+* A note carrying the `#inbox` within that workspace.+* Today's [day note](../../Advanced%20Usage/Advanced%20Showcases/Day%20Notes.md), if the workspace has a `#workspaceCalendarRoot`.+* The workspace root note itself.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Note List.md b/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Note List.mdnew file mode 100644index 0000000000..16b3caf280--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Note List.md@@ -0,0 +1,15 @@+# Note List+<figure class="image"><img style="aspect-ratio:990/590;" src="Note List_image.png" width="990" height="590"></figure>++When a note has one or more child notes, they will be listed at the end of the note for easy navigation.++## Configuration++* To hide the note list for a particular note, simply apply the `hideChildrenOverview` [label](../../Advanced%20Usage/Attributes.md).+* For some view types, such as Grid view, only a subset of notes will be displayed and pagination can be used to navigate through all of them for performance reasons. To adjust the number of notes per page, set `pageSize` to the desired number.++## View types++The view types dictate how the child notes are represented. By default, the notes will be displayed in a grid, however there are also some other view types available.++Generally the view type can only be changed in a <a class="reference-link" href="../../Collections.md">Collections</a> note from the <a class="reference-link" href="../UI%20Elements/Ribbon.md">Ribbon</a>, but it can also be changed manually on any type of note using the `#viewType` attribute.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Note List_image.png b/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Note List_image.pngnew file mode 100644index 0000000000..8de2914c1cBinary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Note List_image.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Protected Notes.md b/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Protected Notes.mdnew file mode 100644index 0000000000..6136f1434b--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Protected Notes.md@@ -0,0 +1,48 @@+# Protected Notes+Trilium is designed to store a wide variety of data, including sensitive information such as personal journals, credentials, or confidential documents. To safeguard this type of content, Trilium offers the option to protect notes, which involves the following measures:++* **Encryption:** Protected notes are encrypted using a key derived from your password. This ensures that without the correct password, protected notes remain indecipherable. Even if someone gains access to your Trilium [database](../../Advanced%20Usage/Database.md), they won't be able to read your encrypted notes.+* **Time-limited access:** To access protected notes, you must first enter your password, which decrypts the note for reading and writing. However, after a specified period of inactivity (10 minutes by default), the note is unloaded from memory, requiring you to re-enter your password to access it again.+ * The session timeout is extended automatically while you're interacting with the protected note, so if you're actively editing, the session remains open. However, if you switch to an unprotected note, the session timer starts, and the session expires after 10 minutes of inactivity unless you return to the protected notes.+* **Protection scope:** Protected notes ensure the confidentiality of their content and partially their integrity. While unauthorized users cannot read or edit protected notes, they can still delete or move them outside of the protected session.++## Using Protected Notes++By default, notes are unprotected. To protect a note, simply click on the shield icon next to the note's title, as shown here:++++## What is Encrypted?++Trilium encrypts the data within protected notes but not their metadata. Specifically:++**Encrypted:**++* Note title+* Note content+* Images+* File attachments++**Not encrypted:**++* Note structure (i.e., it remains visible that there are protected notes)+* Metadata, such as the last modified date+* [Attributes](../../Advanced%20Usage/Attributes.md)++## Encryption Details++The following steps outline how encryption and decryption work in Trilium:++1. The user enters a password.+2. The password is passed through the [scrypt](https://en.wikipedia.org/wiki/Scrypt) algorithm along with a "password verification" [salt](https://en.wikipedia.org/wiki/Salt_\(cryptography\)) to confirm that the password is correct.+3. The password is then processed again through scrypt with an "encryption" salt, which generates a hash.+ * Scrypt is used for [key stretching](https://en.wikipedia.org/wiki/Key_stretching) to make the password harder to guess.+4. The generated hash is used to decrypt the actual _data encryption key_.+ * The data encryption key is encrypted using [AES-128](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard) with a random [IV](https://en.wikipedia.org/wiki/Initialization_vector).+ * The data encryption key is randomly generated during the [database](../../Advanced%20Usage/Database.md) initialization and remains constant throughout the document’s lifetime. When the password is changed, only this key is re-encrypted.+5. The data encryption key is then used to decrypt the actual content of the note, including its title and body.+ * The encryption algorithm used is AES-128 with [CBC mode](https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation), where a unique IV is generated for each encryption operation and stored with the cipher text.++## Sharing Protected Notes++Protected notes cannot be shared in the same way as regular notes. Their encryption ensures that only authorized users with the correct password can access them.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Protected Notes_protecting-note.gif b/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Protected Notes_protecting-note.gifnew file mode 100644index 0000000000..23a6213df4Binary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Protected Notes_protecting-note.gif differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Restoring Deleted Notes.md b/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Restoring Deleted Notes.mdnew file mode 100644index 0000000000..25d8ab6029--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Restoring Deleted Notes.md@@ -0,0 +1,11 @@+# Restoring Deleted Notes+Deleted notes are listed in the "Deleted Notes" dialog (**Global Menu → Show Deleted Notes**) and can be restored by pressing the "**undelete**" link.++If a note has child notes, they will be restored along with it. Should the original location no longer exist (e.g. the parent has been deleted), the note will be restored into the default location for new notes (<a class="reference-link" href="Note%20Inbox.md">Note Inbox</a>).++> [!NOTE]+> When a note is hoisted in the tree, the dialog will only display notes deleted from the subtree of that hoisted note.++To permanently erase deleted notes and clear the list, press the three-dots menu and select **"Erase deleted notes now"**.++Deleted notes are permanently erased after a certain amount of time (7 days by default). To change this interval, press the three-dots menu and select **"Deleted Notes Settings"**.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Sorting Notes.md b/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Sorting Notes.mdnew file mode 100644index 0000000000..f68cd0bbf9--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Sorting Notes.md@@ -0,0 +1,67 @@+# Sorting Notes+## Manual sorting++You can sort notes by right-clicking the parent note in the <a class="reference-link" href="../UI%20Elements/Note%20Tree.md">Note Tree</a> and selecting Advanced -> Sort notes by ... This will sort existing notes, but will not automatically sort future notes added to this parent note.++The sorting dialog allows:++* Sorting by title, creation or modification date, or by the value of a label on the child notes.+* Sorting by several such criteria in turn, each ascending or descending: the next level only decides between notes the previous ones left equal.+* Ensuring folders are displayed at the top.+* Natural sort, based on the sorting rules of a particular language.++## Automatic/Permanent Sorting++Child notes can be automatically sorted by attaching specific [labels](../../Advanced%20Usage/Attributes.md) to the parent note:++<table>+ <thead>+ <tr>+ <th>Label</th>+ <th>Description</th>+ </tr>+ </thead>+ <tbody>+ <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 other criteria instead: a comma-separated list of levels, each <code>title</code>, <code>dateCreated</code>, <code>dateModified</code> or the name of a label on the child notes, optionally followed by <code>asc</code> or <code>desc</code>, as in a search's <code>orderBy</code>. For example <code>#sorted="priority desc, dueDate"</code> sorts by priority, highest first, and notes of equal priority by due date. A child note without a level's label sorts after every child that has it, whichever direction the level runs in. When neither note has the label, the next level decides.</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><p>A level of <code>sorted</code> followed by its own <code>asc</code> or <code>desc</code> keeps that direction regardless.</p></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 (at the bottom when <code>#sortDirection</code> is <code>desc</code>), and the rest will be sorted.</td>+ </tr>+ <tr>+ <td><code>#sortNatural</code></td>+ <td>Sort numbers naturally instead of alphabetically, so 2 comes before 10.</td>+ </tr>+ <tr>+ <td><code>#sortLocale</code></td>+ <td>The language code driving the natural sort (e.g. <code>zh-CN</code>, <code>de</code>). Only meaningful together with <code>#sortNatural</code>.</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>#bottom</code></td>+ <td>If <code>sorted</code> is applied to the parent note, keeps given note on bottom in its parent.</td>+ </tr>+ </tbody>+</table>++Sorting is done by comparing note properties or specific labels on child notes. There are four sorting levels, with the first having the highest priority. Lower priority levels are applied only if higher priority comparisons result in equality.++1. **Top Label Sorting**: Child notes with the `#top` label will appear at the top of the folder.+2. **Bottom Label Sorting**: (Introduced in Trilium 0.62) Child notes with the `#bottom` label will appear at the bottom of the folder.+3. **Property/Label-Based Sorting**: Sorting is based on the parent note's `#sorted` label:+ * **Default Sorting**: If `#sorted` has no value, notes are sorted alphabetically.+ * **Property Sorting**: If `#sorted` is set to `title`, `dateModified`, or `dateCreated`, notes are sorted based on the specified property.+ * **Label Sorting**: If `#sorted` has any other value, this value is treated as the name of a child note's label, and sorting is based on the values of this label. For example, setting `#sorted=myOrder` on the parent note and using `#myOrder=001`, `#myOrder=002`, etc., on child notes.+ * **Multi-Level Sorting**: Several of the above can be combined, separated by commas; each level is applied only where the previous ones are equal. Every level can carry its own direction as a word after the name, `asc` or `desc`, otherwise it follows `#sortDirection`. For example `#sorted="priority desc, area, dateCreated"` sorts by priority, highest first, then by area, then by creation date.+4. **Alphabetical Sorting**: Used as a last resort when other criteria result in equality.++All comparisons are made string-wise (e.g., "1" \< "2" or "2020-10-10" < "2021-01-15", but also "2" \> "10").\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Title.md b/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Title.mdnew file mode 100644index 0000000000..a58b4855c5--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Title.md@@ -0,0 +1,53 @@+# Title+Alongside its content, the **title** is one of the two main attributes of a [note](../Notes.md). It's the short, human-readable name shown in the editable field at the top of every note, and it's what identifies the note throughout the interface (in the <a class="reference-link" href="../UI%20Elements/Note%20Tree.md">Note Tree</a>, in tabs, in the <a class="reference-link" href="../UI%20Elements/New%20Layout/Breadcrumb.md">Breadcrumb</a> and win <a class="reference-link" href="../../Note%20Types/Text/Links/Internal%20(reference)%20links.md">Internal (reference) links</a>.++Internally, notes are identified by a unique <a class="reference-link" href="../../Advanced%20Usage/Note%20ID.md">Note ID</a> rather than by their title, so the title is purely for your benefit. This has a few consequences:++* **Titles don't have to be unique.** You can have any number of notes that share the same title without conflict.+* **Renaming a note never breaks links to it.** Links between notes point at the underlying note, so changing a title leaves existing links intact (they'll simply display the new title).+* **The title can be left empty.** Notes with no title display a placeholder (_type note's title here…_) but are otherwise perfectly valid.++In addition:++* There is no limitation on the length of the title, however in exports the title might get trimmed.+* There are no forbidden symbols, unsupported characters will get trimmed when exporting.+* When exporting to a ZIP file, a meta file will contain the full title which will be recognized by Trilium when importing again.++### Editing the title++To rename a note, simply click into the title field and type. Changes are saved automatically as you type.++You can also begin editing the title directly from the <a class="reference-link" href="../UI%20Elements/Note%20Tree.md">Note Tree</a> by selecting a note and pressing <kbd>Enter</kbd> (see _Edit note title_ in <a class="reference-link" href="../Keyboard%20Shortcuts.md">Keyboard Shortcuts</a>), which focuses the title field for the active note.++> [!NOTE]+> Titles may contain any characters, including Unicode and emoji. For security, any HTML in the title is stripped automatically, so the title is always treated as plain text.++### Easily navigating between the title and the content++When the cursor is in the title field, pressing <kbd>Enter</kbd> moves focus into the note's content. For <a class="reference-link" href="../../Note%20Types/Text.md">Text</a> notes this also inserts a fresh empty paragraph at the very top of the document, so you can start writing immediately — much like other note-taking apps.++This makes it possible to create a note, type its title, press <kbd>Enter</kbd>, and continue straight into the body without reaching for the mouse.++### Working with new notes++When you create a new note it's given a default title (_new note_) which is pre-selected, so you can type a name right away to replace it. The default title for new notes can be customized per-section — see <a class="reference-link" href="../../Advanced%20Usage/Default%20Note%20Title.md">Default Note Title</a>.++If you decide you don't want the note after all, pressing <kbd>Escape</kbd> while the title of a freshly created note is still focused will discard it.++### Automatically generated titles++Some notes get their titles assigned automatically rather than typed:++* **Day, week, month and year notes** in the <a class="reference-link" href="../../Advanced%20Usage/Advanced%20Showcases/Day%20Notes.md">Day Notes</a> are named from a configurable date pattern.+* <a class="reference-link" href="../../Note%20Types/Saved%20Search.md">Saved Search</a> notes are named after the search they perform.+* When a note is duplicated, a suffix is appended to the copy's title to tell it apart from the original.++### Protected notes++For <a class="reference-link" href="Protected%20Notes.md">Protected Notes</a>, the title is _not_ encrypted — only the content is. The title therefore remains visible in the tree and tabs even when no protected session is active. While locked, however, the title field is read-only and cannot be edited until you enter your password.++## Protected notes++The titles of <a class="reference-link" href="Protected%20Notes.md">Protected Notes</a> are encrypted along with their content. Before entering your password, Trilium cannot decrypt the title, so it is shown as `[protected]` in instead and the title cannot be modified.++Once you enter your password and a protected session is active, the real title is decrypted and displayed, and becomes editable again.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Themes.md b/docs/User Guide/User Guide/Basic Concepts and Features/Themes.mdnew file mode 100644index 0000000000..98a8b4eed1--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Themes.md@@ -0,0 +1,132 @@+# Themes+## Default Themes++Trilium comes with a couple pre-installed color themes, with the default being a light theme. To switch to a dark theme or any other available theme, navigate to the Options menu (accessible via the app icon in the top-left corner), select the Appearance tab, and choose your preferred theme.++++## Creating Custom CSS Themes++Trilium supports custom user themes, allowing you to personalize the application's appearance. To create a custom theme, follow these steps:++1. **Create a CSS Code Note**: Start by creating a new [code note](../Note%20Types/Code.md) with the `CSS` type.+2. **Annotate with** `#appTheme`: Add the [attribute](../Advanced%20Usage/Attributes.md) `#appTheme=my-theme-name` to your note, where `my-theme-name` is the name of your custom theme.+3. **Define Your Styles**: Write your custom CSS within the note. Below is an example of a custom theme:++```+@font-face {+ font-family: 'Raleway';+ font-style: normal;+ font-weight: 400;+ src: url('/custom/fonts/raleway.woff2') format('woff2');+}++:root {+ --main-font-family: 'Raleway' !important;+ --main-font-size: normal;+ --tree-font-family: inherit;+ --tree-font-size: normal;+ --detail-font-family: inherit;+ --detail-font-size: normal;+ --detail-text-font-family: 'Garamond' !important;++ --main-background-color: #404552;+ --main-text-color: #AFB8C6;+ --main-border-color: #AFB8C6;+ --accented-background-color: #383C4A;+ --more-accented-background-color: #2F343F;+ --header-background-color: #383C4A;+ --button-background-color: #2F343F;+ --button-disabled-background-color: #404552;+ --button-border-color: #333;+ --button-text-color: #AFB8C6;+ --button-border-radius: 2px;+ --primary-button-background-color: #6c757d;+ --primary-button-text-color: white;+ --primary-button-border-color: #6c757d;+ --muted-text-color: #86919F;+ --input-text-color: #AFB8C6;+ --input-background-color: #404552;+ --hover-item-text-color: white;+ --hover-item-background-color: #4877B1;+ --active-item-text-color: white;+ --active-item-background-color: #4877B1;+ --menu-text-color: #AFB8C6;+ --menu-background-color: #383C4A;+ --tooltip-background-color: #383C4A;+ --link-color: lightskyblue;+ --modal-background-color: #404552;+ --modal-backdrop-color: black;+ --scrollbar-border-color: rgba(175, 184, 198, 0.5);+}++body .note-detail-text {+ font-size: 120%;+}++body .CodeMirror {+ filter: invert(100%) hue-rotate(180deg);+}+```++### Activating Your Custom Theme++Once you've created your custom theme:++1. Go to "Menu" -> "Options" -> "Appearance."+2. In the theme selection dropdown, you should see your custom theme listed under the name you provided with the `#appTheme` [label](../Advanced%20Usage/Attributes.md).+3. Select your custom theme to activate it.++If you make changes to your theme, press Ctrl + R to reload the frontend and apply your updates.++### Sharing and Importing Themes++Custom themes can be exported as `.tar` archives, which can be shared with other users. However, be cautious when importing themes from untrusted sources, as they may contain executable scripts that could pose security risks.++An example user theme, _Steel Blue_, is available in the demo document.++++### Using Custom CSS for Specific Purposes++In addition to full themes, Trilium allows for custom CSS that isn't tied to a theme. This can be particularly useful in scripting contexts, where you might want to modify specific UI elements, such as changing the colors of notes in the tree view.++### Applying Custom CSS++To use custom CSS:++1. **Create a CSS Code Note**: Create a new <a class="reference-link" href="../Note%20Types/Code.md">Code</a> note with the `CSS` type.+2. **Add the** `appCss` **Label**: Annotate the note with the `#appCss` [label](../Advanced%20Usage/Attributes.md).+3. **Write Your CSS**: Add your custom CSS rules to the note.++For example:++```+/* Custom CSS to style specific elements */+.tree-item {+ color: #ff6347; /* Change tree item color */+}+```++When Trilium's frontend starts, all notes labeled with `appCss` are automatically included in the style element of the HTML page.++After making changes, press Ctrl + R to reload the frontend and apply your new styles.++++### Styling Specific Notes in the Tree++To apply specific styles to certain notes in the tree:++* **Use the** `cssClass` **Attribute**: Add the `cssClass` [attribute](../Advanced%20Usage/Attributes.md) to a note, and assign it a value representing the desired CSS class.+* **Define an** `iconClass`: You can also define a custom icon for a note using the `iconClass` attribute, selecting from [Box Icons](https://boxicons.com) or your own custom classes.++For example, if you want to style notes of a specific type, such as notes containing PNG images, you can target them with classes like `type-image mime-image-png`.++### User-Provided Themes++A gallery of user-created themes is available, showcasing the variety of customizations that the Trilium community has developed. For more information, check the <a class="reference-link" href="Themes/Theme%20Gallery.md">Theme Gallery</a>.++### Asset Path Management++When referencing built-in assets like images in your custom themes or CSS, you can avoid hardcoding version numbers by using the `vX` alias. For example, instead of specifying `/assets/v0.57.0-beta/images/icon-grey.png`, you can use `/assets/vX/images/icon-grey.png` to keep your theme compatible with future versions of Trilium.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Themes/Icon Packs.md b/docs/User Guide/User Guide/Basic Concepts and Features/Themes/Icon Packs.mdnew file mode 100644index 0000000000..222ea406f9--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Themes/Icon Packs.md@@ -0,0 +1,58 @@+# Icon Packs+<figure class="image image-style-align-right image_resized" style="width:45.14%;"><img style="aspect-ratio:854/649;" src="Icon Packs_image.png" width="854" height="649"></figure>++By default, Trilium comes with a set of icons called Boxicons v2. Since v0.102.0, custom icon packs allow a wider selection of icons for notes.++Icon packs are specific to Trilium, so they must either be created from scratch (see below) or imported from a ZIP file from a third-party developer.++## Sample icon packs++The Trilium team maintains a few icon packs that are not shipped with Trilium. These icon packs can be found on the official website on the [Resources page](https://triliumnotes.org/resources).++## Importing an existing icon pack++> [!NOTE]+> **Icon packs are third-party content**+>+> Apart from the [sample icon packs](https://triliumnotes.org/resources), the Trilium maintainers are not responsible for keeping icon packs up to date. If you have an issue with a specific icon pack, then the issue must be reported to the third-party developer responsible for it, not the Trilium team.++To import an icon pack:++1. Ideally, create a dedicated spot in your note tree where to place the icon packs.+2. Right click the note where to put it and select _Import into note_.+3. Uncheck _Safe import_.+4. Select _Import_.+5. [Refresh the application](../../Troubleshooting/Refreshing%20the%20application.md).++> [!WARNING]+> Since _Safe import_ is disabled, make sure you trust the source as it could contain dangerous third-party scripts. One good way to check if the icon pack is safe is to manually extract the .zip and inspect the file contents. Icon packs should only contain a font file and a JSON file. Other files (especially scripts) are to be considered harmful.++## Creating an icon pack++Creating an icon pack requires some scripting knowledge outside Trilium in order to generate the list of icons. For information, see <a class="reference-link" href="../../Theme%20development/Creating%20an%20icon%20pack.md">Creating an icon pack</a>.++## Using an icon from an icon pack++After [refreshing the application](../../Troubleshooting/Refreshing%20the%20application.md), the icon pack should be enabled by default. To test this, simply select an existing note or create a new one and try to change the note icon.++There should be a _Filter_ button to the right of the search bar in the icon list. Clicking it allows filtering by icon pack and the newly imported icon pack should be displayed there.++> [!NOTE]+> If the icon pack is missing from that list, then most likely there's something wrong with it.+>+> * Try checking the <a class="reference-link" href="../../Troubleshooting/Error%20logs/Backend%20(server)%20logs.md">Backend (server) logs</a> for clues and make sure that the icon pack has the `#iconPack` [label](../../Advanced%20Usage/Attributes/Labels.md) with a value assigned to it (a prefix).+> * Icon packs that are [protected](../Notes/Protected%20Notes.md) are ignored.++## Integration with the share and export functionality++Custom icon packs are also supported by the <a class="reference-link" href="../../Advanced%20Usage/Sharing.md">Sharing</a> feature, where they will be shown in the note tree. However, in order for an icon pack to be visible to the share function, the icon pack note must also be shared.++If you are using a custom share theme, make sure it supports the `iconPackCss`, otherwise icons will not show up. Check the original share template source code for reference.++Custom icon packs will also be preserved when <a class="reference-link" href="../../Advanced%20Usage/Sharing/Exporting%20static%20HTML%20for%20web%20publishing.md">Exporting static HTML for web publishing</a>. In this case, there's no requirement to make the icon pack shared.++## What happens if I remove an icon pack++If an icon pack is removed or disabled (by removing or altering its `#iconPack` label), all the notes that use this icon pack will show in the <a class="reference-link" href="../UI%20Elements/Note%20Tree.md">Note Tree</a> with no icon. This won't cause any issues apart from looking strange.++The solution is to replace the icons with some else, try using <a class="reference-link" href="../Navigation/Search.md">Search</a> which supports bulk actions, to identify the notes with the now deleted icon pack (by looking for the prefix) and changing or removing their `iconClass`.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Themes/Icon Packs_image.png b/docs/User Guide/User Guide/Basic Concepts and Features/Themes/Icon Packs_image.pngnew file mode 100644index 0000000000..2730befaa6Binary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/Themes/Icon Packs_image.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Themes/Personalizing the font.md b/docs/User Guide/User Guide/Basic Concepts and Features/Themes/Personalizing the font.mdnew file mode 100644index 0000000000..e3af99aa89--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Themes/Personalizing the font.md@@ -0,0 +1,65 @@+# Personalizing the font+## Using different fonts++Trilium comes by default with its own font (_Inter_), but the font can be adjusted in <a class="reference-link" href="../UI%20Elements/Options.md">Options</a> → _Appearance_, by checking _Use different fonts_ in the _Fonts_ section.++The font can be personalized for the following areas of the application:++* Interface text, for most of the UI (menus, toolbars, dialogs).+* <a class="reference-link" href="../UI%20Elements/Note%20Tree.md">Note Tree</a>.+* Document text, for the actual content of the notes (especially for <a class="reference-link" href="../../Note%20Types/Text.md">Text</a> notes).+* Monospace text, e.g. for <a class="reference-link" href="../../Note%20Types/Code.md">Code</a> notes and <a class="reference-link" href="../../Note%20Types/Text/Developer-specific%20formatting/Code%20blocks.md">Code blocks</a>.++Each area also has its own _Size_. The note tree and document sizes are relative to the interface size, so changing the interface size moves them along with it.++The list of fonts contains the following items:++* **Generic fonts**+ * _Theme defined_ which uses the font that is embedded with the current [theme](../Themes.md). For example on the default modern theme, the font is _Inter_. This does not require the font to be installed.+ * _System default_ which uses a combination of fonts that works best for the [desktop app](../../Installation%20%26%20Setup/Desktop%20Installation.md). For example on Windows it will use _Segoe UI_.+ * Generic font selections for fonts with serifs (e.g. _Times New Roman_\-like), no serifs and monospace.+* **Web fonts** which appear on the <a class="reference-link" href="../../Installation%20%26%20Setup/Server%20Installation.md">Server Installation</a>, which is a predefined list of fonts and grouped into Sans-serif, serif, monospace and handwriting. The fonts that are not supported by your system (i.e. not installed) are not displayed.+* **System fonts** which appear on the <a class="reference-link" href="../../Installation%20%26%20Setup/Desktop%20Installation.md">Desktop Installation</a>. Unlike the server fonts which are predefined, the system fonts are listed from your operating system.+* **Custom fonts**, allowing any font to be used provided it's imported into Trilium. See the section below for more information.++Font changes take effect after a reload; the section offers a _Reload to apply changes_ button once something has been changed.++## Custom fonts++A font file imported into Trilium can be used by the application itself, without writing any CSS.++### Adding a font++1. Import the font file, by dragging it into the <a class="reference-link" href="../UI%20Elements/Note%20Tree.md">Note Tree</a> or through _Import into note_. TrueType (`.ttf`), OpenType (`.otf`) and Web Open Font Format (`.woff`, `.woff2`) files are recognized; the note takes the font's name without its extension and is marked with a font icon (an “A” icon).+2. Select the resulting note where a preview of a font will be displayed: a specimen line to type your own text into, a slider for its size, a preview in multiple sizes, and the Latin character set.+3. Turn on _In font picker_ above the specimen.+4. In <a class="reference-link" href="../UI%20Elements/Options.md">Options</a> → _Appearance_ → _Fonts_, the font is now offered under _Custom fonts_, ahead of the built-in families, and can be set for any of the four areas.++> [!NOTE]+> Embedded OpenType (`.eot`) files and TrueType collections (`.ttc`) cannot be drawn by the browser, so they are treated as ordinary files: no preview, and no entry in the picker.++### How custom fonts behave++* Each entry is named after its note, so renaming the note renames the entry. The setting refers to the note itself rather than to its name, and keeps working across a rename.+* The font file is an ordinary note, so <a class="reference-link" href="../../Installation%20%26%20Setup/Synchronization.md">Synchronization</a> carries it to your other devices. The choice of font is not synced: appearance settings are deliberately kept per-device, so on another device the font is already there and only needs to be selected again.+* A font kept in a [protected note](../Notes/Protected%20Notes.md) can only be previewed and used while the protected session is open.++For theme authors, a font can also be embedded in a theme's CSS through <a class="reference-link" href="../../Advanced%20Usage/Custom%20Resource%20Providers.md">Custom Resource Providers</a>, which is the route to take when the font should come with the theme rather than be chosen in the settings.++### Downloading from Google Fonts++A large selection of fonts can be easily retrieved from Google Fonts, as follows:++1. Go to [https://fonts.google.com](https://fonts.google.com).+2. Search for a desired font.+3. Press _Get font_ in the top right.+4. Check that the list of fonts on the left side corresponds to your selection.+5. Press _Download all_.+6. In the <a class="reference-link" href="../UI%20Elements/Note%20Tree.md">Note Tree</a>, create a note where to store the new fonts.+7. In the <a class="reference-link" href="../UI%20Elements/Note%20Tree.md">Note Tree</a>, drag-and-drop the .zip file directly onto the newly created note and follow the steps from the previous section.++## Programming ligatures++Some fonts support programming ligatures, which will turn character combinations such as `!=` into `≠` or `->` as `→` in <a class="reference-link" href="../../Note%20Types/Text/Developer-specific%20formatting/Code%20blocks.md">Code blocks</a> and <a class="reference-link" href="../../Note%20Types/Code.md">Code</a> notes.++These are only a display affordance, so copying the text is not affected. Regardless, this feature can be disabled in Trilium by unchecking _Programming ligatures_ in the font settings.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Themes/Theme Gallery.md b/docs/User Guide/User Guide/Basic Concepts and Features/Themes/Theme Gallery.mdnew file mode 100644index 0000000000..34a7811a05--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Themes/Theme Gallery.md@@ -0,0 +1,30 @@+# Theme Gallery+These are user-created themes which were made publicly available:++## Legacy Themes++These themes may or may not be compatible with the latest versions of TriliumNext and are based on the original/legacy theme.++| Theme | Author |+| --- | --- |+| [Midnight](https://github.com/tobealive/trilium-midnight-theme) | [tobealive](https://github.com/tobealive) |+| [EOTE](https://github.com/tobealive/trilum-eote-theme) | [tobealive](https://github.com/tobealive) |+| [Trilium Themes](https://github.com/Abourass/TriliumThemes) | [Abourass](https://github.com/Abourass) |+| [MaterialDark](https://github.com/ZMonk91/Material-Dark-Trilium) | [ZMonk91](https://github.com/ZMonk91) |+| [lightslategray](https://github.com/jaroet/trilium-theme-lightslategray) | [jaroet](https://github.com/jaroet) |+| [melon-4](https://github.com/raphwriter/trilium-theme-melon) | [raphwriter](https://github.com/raphwriter) |+| [Neon\_Dark](https://github.com/Engr-AllanG/trilium-themes) | [Engr-AllanG](https://github.com/Engr-AllanG) |+| [Coder\_Dark](https://github.com/Engr-AllanG/trilium-themes) | [Engr-AllanG](https://github.com/Engr-AllanG) |+| [velvet](https://github.com/idelem/trilium-theme-velvet) | [idelem](https://github.com/idelem) |+| [Dark Plus](https://github.com/SADAVA/trilium-notes-theme-dark-plus) | [SADAVA](https://github.com/SADAVA) |+| [Solarized](https://github.com/WKSu/trilium-solarized-theme) | [WKSu](https://github.com/WKSu) |+| [Nord](https://github.com/en3r0/Trilium-Nord-Theme) | [en3r0](https://github.com/en3r0) |+| [Bear Note Light](https://github.com/AllanZyne/trilium-bear-theme) | [AllanZyne](https://github.com/AllanZyne) |+| [Bear Note Dark](https://github.com/AllanZyne/trilium-bear-theme) | [AllanZyne](https://github.com/AllanZyne) |+| [Miku Hatsune](https://github.com/Sebiann/miku-hatsune-trilium-theme) | [Sebiann](https://github.com/Sebiann) |+| [Midnight](https://github.com/cwilliams5/Midnight-Trilium-Dark-Mode) | [cwilliams5](https://github.com/cwilliams5) |+| [Blue](https://github.com/SiriusXT/trilium-theme-blue) (light) | [SiriusXT](https://github.com/SiriusXT) |+| [Blue](https://github.com/SiriusXT/trilium-theme-blue) (dark) | [SiriusXT](https://github.com/SiriusXT) |++> [!TIP]+> If you would like to add your theme to this gallery, write a new post in [👐 Show and tell](https://github.com/TriliumNext/Trilium/discussions/categories/show-and-tell).\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Themes_dark-theme.png b/docs/User Guide/User Guide/Basic Concepts and Features/Themes_dark-theme.pngnew file mode 100644index 0000000000..8a3e85714bBinary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/Themes_dark-theme.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Themes_image.png b/docs/User Guide/User Guide/Basic Concepts and Features/Themes_image.pngnew file mode 100644index 0000000000..49df907308Binary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/Themes_image.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Themes_steel-blue.png b/docs/User Guide/User Guide/Basic Concepts and Features/Themes_steel-blue.pngnew file mode 100644index 0000000000..4a5ed7bdb6Binary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/Themes_steel-blue.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/1_New Layout_image.png b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/1_New Layout_image.pngnew file mode 100644index 0000000000..c9a85f7773Binary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/1_New Layout_image.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/2_New Layout_image.png b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/2_New Layout_image.pngnew file mode 100644index 0000000000..efd435a32dBinary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/2_New Layout_image.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/3_New Layout_image.png b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/3_New Layout_image.pngnew file mode 100644index 0000000000..10676a08efBinary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/3_New Layout_image.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/4_New Layout_image.png b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/4_New Layout_image.pngnew file mode 100644index 0000000000..b4452f6952Binary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/4_New Layout_image.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/5_New Layout_image.png b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/5_New Layout_image.pngnew file mode 100644index 0000000000..4a2f36ae2eBinary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/5_New Layout_image.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/6_New Layout_image.png b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/6_New Layout_image.pngnew file mode 100644index 0000000000..ca7593700bBinary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/6_New Layout_image.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Content width.md b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Content width.mdnew file mode 100644index 0000000000..134975521e--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Content width.md@@ -0,0 +1,22 @@+# Content width+Some note types such as <a class="reference-link" href="../../Note%20Types/Text.md">Text</a>, <a class="reference-link" href="../../Note%20Types/Relation%20Map.md">Relation Map</a>, and saved search intentionally limit the width of the content.++This might appear surprising at first, but the idea is to make text fit well on wider screens without appearing distorted. This is especially the case if the document contains <a class="reference-link" href="../../Note%20Types/Text/Images.md">Images</a>, tables or other width-dependent elements.++## Configuring the content width and alignment++The content width is expressed in pixels and can be changed from <a class="reference-link" href="Options.md">Options</a> → _Appearance_ → _Content Width_ and adjusting the _Max content width_ section.++To effectively disable the content width limitation, simply set the width to a value larger than your screen size (e.g. 9999).++By default, the content is aligned to the left, but it can be centered horizontally by checking _Keep content centered_ from the same section as the content width.++## Adjusting at note level++For notes with large elements such as <a class="reference-link" href="../../Note%20Types/Text/Tables.md">Tables</a>, it sometimes makes sense to avoid the content width without affecting other notes. To do so:++* Since v0.104.0 in the <a class="reference-link" href="New%20Layout.md">New Layout</a> only, go to <a class="reference-link" href="Note%20buttons.md">Note buttons</a> and toggle _Full width_.+* Or manually apply the `fullContentWidth` [label](../../Advanced%20Usage/Attributes/Labels.md) to the note.++> [!NOTE]+> Some [note types](../../Note%20Types.md) are full width by default, such as the <a class="reference-link" href="../../Note%20Types/Canvas.md">Canvas</a>. In that case the _Full width_ toggle will not be displayed and the label will have no effect.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Floating buttons.md b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Floating buttons.mdnew file mode 100644index 0000000000..36e55df2fe--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Floating buttons.md@@ -0,0 +1,13 @@+# Floating buttons+<figure class="image image-style-align-center"><img style="aspect-ratio:893/144;" src="Floating buttons_image.png" width="893" height="144"></figure>++Depending on the current note, a panel will appear near the top-right of the note, right underneath the <a class="reference-link" href="Ribbon.md">Ribbon</a>. These buttons offer additional interaction that is specific to that particular note.++For example:++* For <a class="reference-link" href="../../Note%20Types/Mermaid%20Diagrams.md">Mermaid Diagrams</a> and <a class="reference-link" href="../../Note%20Types/Canvas.md">Canvas</a>, there are buttons to download the SVG representation of the note, or to copy a reference to the note for pasting it a <a class="reference-link" href="../../Note%20Types/Text.md">Text</a> note.+* For [read-only notes](../Notes/Read-Only%20Notes.md), there is a button to temporarily edit the note for quick modifications.++## Interaction++The floating button area can be collapsed by pressing the two right arrows at the end of the section.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Floating buttons_image.png b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Floating buttons_image.pngnew file mode 100644index 0000000000..1db317feb3Binary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Floating buttons_image.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Global menu.md b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Global menu.mdnew file mode 100644index 0000000000..ead4bba18e--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Global menu.md@@ -0,0 +1,8 @@+# Global menu+The global menu configures the current window (zoom, keeping the window on top) and offers access to some more advanced options.++++## Accessing the global menu++See [Vertical and horizontal layout](Vertical%20and%20horizontal%20layout.md) since the position of the global menu is changed based on which layout has been selected.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Global menu_image.png b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Global menu_image.pngnew file mode 100644index 0000000000..957a04b164Binary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Global menu_image.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Launch Bar.md b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Launch Bar.mdnew file mode 100644index 0000000000..c802dbf872--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Launch Bar.md@@ -0,0 +1,75 @@+# Launch Bar+## Position of the Launch bar++On desktop, depending on the layout selected, the launcher bar will either be on the left side of the screen with buttons displayed vertically or at the top of the screen. See <a class="reference-link" href="Vertical%20and%20horizontal%20layout.md">Vertical and horizontal layout</a> for more information.++On mobile, the launch bar will always be at the bottom.++If there are too many items in the launch bar to fit the screen, it will become scrollable.++## Terminology++* **Launcher**: a button that can be (or is) displayed on the launch bar.+* **Available Launcher**: a launcher that is not displayed on the launch bar, but can be added.+* **Visible Launcher**: a launcher that is currently displayed on the launch bar.++## Configuring the desktop Launch bar++There are two ways to configure the launch bar:++* Right click in the empty space between launchers on the launch bar and select _Configure Launchbar._+* Click on the <a class="reference-link" href="Global%20menu.md">Global menu</a> and select _Configure Launchbar_.++This will open a new tab with the <a class="reference-link" href="Note%20Tree.md">Note Tree</a> listing the launchers.++++Expanding _Available Launchers_ section will show the list of launchers that are not displayed on the launch bar. The _Visible Launchers_ will show the ones that are currently displayed.++## Configuring the mobile launch bar++The launch bar on mobile uses a different configuration from the desktop one. The reasoning is that not all desktop icons are available on mobile, and fewer icons fit on a mobile screen.++To configure the launch bar on mobile, go to <a class="reference-link" href="Global%20menu.md">Global menu</a> and select _Configure Launchbar_.++The configure the mobile launch bar while on the desktop (especially useful to configure more complicated launchers such as scripts or custom widgets), go to <a class="reference-link" href="Global%20menu.md">Global menu</a> → Advanced → Show Hidden Subtree and look for the _Mobile Launch Bar_ section. While in the hidden subtree, it's also possible to drag launchers between the _Mobile Launch Bar_ and (Desktop) _Launch Bar_ sections.++### Adding/removing and reordering launchers++To display a new launcher in the launch bar, first look for it in the _Available Launchers_ section. Then right click it and select _Move to visible launchers_. It is also possible to drag and drop the item manually.++Similarly, to remove it from the launch bar, simply look for it in _Visible Launchers_ then right click it and select _Move to available launchers_ or use drag-and-drop.++Drag-and-drop the items in the tree in order to change their order. See <a class="reference-link" href="Note%20Tree.md">Note Tree</a> for more interaction options, including using keyboard shortcuts.++## Customizing the launcher++* The icon of a launcher can be changed just like a normal note. See <a class="reference-link" href="../Notes/Note%20Icons%20%26%20Colors.md">Note Icons</a> for more information.+* The title of the launcher can also be changed.++### Resetting++Resetting allows restoring the original configuration of Trilium for the launcher bar, or for a portion of it. Simply right click a launcher (or even the entire _Launch Bar_ section) and select _Reset_ to bring it back to the original state.++### Creating new launchers / types of launchers++Right click either the _Available launchers_ or _Visible launchers_ sections and select one of the options:++1. **Note Launcher**+ A note launcher will simply navigate to a specified note.++ 1. Set the `target` promoted attribute to the note to navigate to.+ 2. Optionally, set `hoistedNote` to hoist a particular note. See <a class="reference-link" href="../Navigation/Note%20Hoisting.md">Note Hoisting</a> for more information.+ 3. Optionally, set a `keyboardShortcut` to trigger the launcher.+2. **Script Launcher**+ An advanced launcher which will run a script upon pressing. See <a class="reference-link" href="../../Scripting.md">Scripting</a> for more information.++ 1. Set `script` to point to the desired script to run.+ 2. Optionally, set a `keyboardShortcut` to trigger the launcher.+3. **Custom Widget**++ Allows defining a custom widget to be rendered inside the launcher. See <a class="reference-link" href="../../Scripting/Frontend%20Basics/Custom%20Widgets/Widget%20Basics.md">Widget Basics</a> for more information.+4. **Spacers**+ Launchers that create some distance between other launchers for better visual distinction.++Launchers are configured via predefined <a class="reference-link" href="../../Advanced%20Usage/Attributes/Promoted%20Attributes.md">Promoted Attributes</a>.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Launch Bar_image.png b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Launch Bar_image.pngnew file mode 100644index 0000000000..6e8c374800Binary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Launch Bar_image.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/New Layout/Breadcrumb.md b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/New Layout/Breadcrumb.mdnew file mode 100644index 0000000000..fb27f092a2--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/New Layout/Breadcrumb.md@@ -0,0 +1,26 @@+# Breadcrumb+<figure class="image"><img style="aspect-ratio:1150/27;" src="Breadcrumb_image.png" width="1150" height="27"></figure>++The breadcrumb allows quickly viewing the note hierarchy of the current note and navigating through it.++It is part of the <a class="reference-link" href="Status%20bar.md">Status bar</a>, displayed in the bottom-left of the screen.++## Layout and Interaction++* If a note or workspace is hoisted, a badge will appear on the left-most side.+ * Clicking on the badge will un-hoist the note/workspace.+* The left-most icon represents the root note, or the hoisted note or workspace.+ * Clicking the icon will jump to the root note.+ * Right clicking the icon will display a menu that allows opening the note in a new tab, split, etc.+* Each segment shows the title of a note in the current note hierarchy.+ * Clicking the icon will jump to that note.+ * Right clicking will open a menu with multiple options such as opening the note in a different tab/split/window, hoisting, moving/cloning the note, duplicating as well as changing the color of the note.+* Clicking the arrow next to each segment will reveal the child notes of the segment on the left.+ * Clicking on an icon will navigate to that particular note.+ * It's also possible to create a new child note from here.+ * The menu can optionally hide the archived notes.+* If the current note is deep within a hierarchy, the segments will collapse into a \[…\] button in order not to occupy too much space.+ * Clicking this button will display each collapsed entry as a menu item. Clicking on it will navigate to that particular note.+* Right clicking on an empty space to the right of the breadcrumb (before the other status bar items) will reveal another menu that allows:+ * Toggling whether archived notes are displayed in the breadcrumb and in the note tree.+ * Copying the current note path to clipboard.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/New Layout/Breadcrumb_image.png b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/New Layout/Breadcrumb_image.pngnew file mode 100644index 0000000000..4a2f36ae2eBinary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/New Layout/Breadcrumb_image.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/New Layout/Status bar.md b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/New Layout/Status bar.mdnew file mode 100644index 0000000000..377f870c44--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/New Layout/Status bar.md@@ -0,0 +1,30 @@+# Status bar+The status bar displays information about the current note and allows changing settings related to it such as configuring the language or attributes.++## Layout and interaction++On the left side, the <a class="reference-link" href="Breadcrumb.md">Breadcrumb</a> is displayed which indicates the current note as well as its parent notes and allows for quick navigation throughout the hierarchy.++On the right side, specific sections will show depending on the type of the current note.++1. For <a class="reference-link" href="../../../Note%20Types/Code.md">Code</a> notes, the language mode of the note is indicated (e.g. JavaScript, plain text), as well as allowing easy switching to another mode.+2. For <a class="reference-link" href="../../../Note%20Types/Text.md">Text</a> notes, the content language is displayed and can be changed, thus configuring the spell-check and the right-to-left support.+ 1. Note that this applies to the entire note and not the selection, unlike some text editors.+3. If a note is placed in multiple places in the tree (cloned), the number of the note paths will be displayed.+ 1. Clicking it will reveal the full list of note paths in the sidebar's <a class="reference-link" href="../Right%20Sidebar/Connections%20tab.md">Connections tab</a>.+4. If a note has attachments, their number will be displayed.+ 1. Clicking on it will reveal the list of attachments in a new tab.+5. If a note is linked from other text notes (backlinks), the number of backlinks will be displayed.+ 1. Clicking on it will show the list of notes that link to this note, as well as an excerpt of where the note is referenced in the sidebar's <a class="reference-link" href="../Right%20Sidebar/Connections%20tab.md">Connections tab</a>.++Regardless of note type, the following items will always be displayed if there is a note:++1. Note info, which displays:+ 1. The creation/modification date of the note.+ 2. The type and MIME of the note.+ 3. The note ID.+ 4. An estimation of the note size of the note itself and its children.+ 5. A button to reveal the Similar notes in the sidebar's <a class="reference-link" href="../Right%20Sidebar/Connections%20tab.md">Connections tab</a>.++> [!NOTE]+> When pressing a button which reveals the <a class="reference-link" href="../Right%20Sidebar.md">Right Sidebar</a>, it has a specific behavior if the sidebar is hidden: the sidebar will be peeked instead of docked. Regardless the sidebar will be switched to the appropriate tab and the corresponding section will be highlighted.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/New Layout_image.png b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/New Layout_image.pngnew file mode 100644index 0000000000..12f5e0d5f0Binary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/New Layout_image.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tooltip.md b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tooltip.mdnew file mode 100644index 0000000000..dc0c702cda--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tooltip.md@@ -0,0 +1,21 @@+# Note Tooltip+<figure class="image image-style-align-right"><img style="aspect-ratio:505/261;" src="Note Tooltip_image.png" width="505" height="261"></figure>++The note tooltip is a convenience feature which displays a popup when hovering over an [internal link](../../Note%20Types/Text/Links/Internal%20\(reference\)%20links.md) to another note.++The following information is displayed:++* The note path, at the top of the popup.+* The title of the note.+ * Clicking on the title will open the note in the current tab.+ * Holding <kbd>Ctrl</kbd> pressed while clicking the title will open in a new tab instead of the current one.+* A snippet of the content will be displayed as well.+* A button to [quickly edit](../Navigation/Quick%20edit.md) the note in a popup.++The tooltip can be found in multiple places, including:++* In <a class="reference-link" href="../../Note%20Types/Text.md">Text</a> notes, when hovering over <a class="reference-link" href="../../Note%20Types/Text/Links/Internal%20(reference)%20links.md">Internal (reference) links</a> .+* <a class="reference-link" href="../../Collections.md">Collections</a>:+ * <a class="reference-link" href="../../Collections/Geo%20Map.md">Geo Map View</a>, when hovering over a marker.+ * <a class="reference-link" href="../../Collections/Calendar.md">Calendar View</a>, when hovering over an event.+ * <a class="reference-link" href="../../Collections/Table.md">Table View</a>, when hovering over a note title, or over a [relation](../../Advanced%20Usage/Attributes/Relations.md).\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tooltip_image.png b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tooltip_image.pngnew file mode 100644index 0000000000..049a07d61bBinary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tooltip_image.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree.md b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree.mdnew file mode 100644index 0000000000..90f646962b--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree.md@@ -0,0 +1,45 @@+# Note Tree+This page explains how to manipulate the note tree in TriliumNext, focusing on moving notes.++++## Drag and Drop++++You can easily rearrange the note tree by dragging and dropping notes, as demonstrated in the example above.++### Importing files++A file or archive can easily be imported into Trilium just by dragging it inside the note tree.++Note that a drag & drop always imports with _safe import_ on, meaning that some features such as scripts are disabled in the upcoming notes. To bypass that, use the dedicated [import](../Import%20%26%20Export.md) feature (right click → _Import into note_).++Unlike the import dialog, the drag & drop also has some basic auto-detection of the import. For example, dragging a .zip file with a `.obsidian` folder in it will automatically trigger a dedicated <a class="reference-link" href="../Import%20%26%20Export/Importing%20data%20from%20other%20applications/Obsidian.md">Obsidian</a> import.++## Keyboard Manipulation++Trilium offers efficient keyboard-based manipulation using the following [shortcuts](../Keyboard%20Shortcuts.md):++* <kbd>Ctrl</kbd> + <kbd>↑</kbd> and <kbd>Ctrl</kbd> +<kbd>↓</kbd>: Move the note up or down in the order.+* <kbd>Ctrl</kbd>+<kbd>←</kbd>: Move the note up in the hierarchy by changing its parent to the note's grandparent.+* <kbd>Ctrl</kbd>+<kbd>→</kbd>: Move the note down in the hierarchy by setting its parent to the note currently above it (this action is best understood through a demo or hands-on experience).+* <kbd>←</kbd> and <kbd>→</kbd>: Expand and collapse a sub-tree.++## Context Menu++You can also move notes using the familiar cut and paste functions available in the context menu, or with the associated keyboard [shortcuts](../Keyboard%20Shortcuts.md): `CTRL-C` ( [copy](../Notes/Cloning%20Notes.md)), <kbd>Ctrl</kbd> + <kbd>X</kbd> (cut) and <kbd>Ctrl</kbd> + <kbd>V</kbd> (paste).++See <a class="reference-link" href="Note%20Tree/Note%20tree%20contextual%20menu.md">Note tree contextual menu</a> for more information.++## Tree Settings++Click the tree icon in the tree toolbar to open the tree settings popup. It contains the following options:++* **Hide archived notes**: When enabled, archived notes are not shown in the tree.+* **Automatically collapse notes**: When enabled, notes are collapsed after a period of inactivity to keep the tree tidy.+* **Follow active note**: When enabled (default), the tree automatically scrolls and expands parent nodes to keep the currently active note visible. When disabled, the tree is fully detached from navigation — only the background highlight of the active note is updated, but the tree viewport and its expanded/collapsed state are never changed by navigation. Use the crosshair button to manually jump the tree to the active note at any time.++## Keyboard shortcuts++The note tree comes with multiple keyboard shortcuts to make editing faster, consult the dedicated <a class="reference-link" href="Note%20Tree/Keyboard%20shortcuts.md">Keyboard shortcuts</a> section.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/1_Hiding the subtree_image.png b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/1_Hiding the subtree_image.pngnew file mode 100644index 0000000000..44f0bbe515Binary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/1_Hiding the subtree_image.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/1_Multiple selection_image.png b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/1_Multiple selection_image.pngnew file mode 100644index 0000000000..ad3c045078Binary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/1_Multiple selection_image.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/1_Note tree contextual menu_image.png b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/1_Note tree contextual menu_image.pngnew file mode 100644index 0000000000..cd9f40c1cbBinary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/1_Note tree contextual menu_image.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/2_Multiple selection_image.png b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/2_Multiple selection_image.pngnew file mode 100644index 0000000000..9ec0a2fdf3Binary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/2_Multiple selection_image.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/Hiding the subtree.md b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/Hiding the subtree.mdnew file mode 100644index 0000000000..a2c3f26cc9--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/Hiding the subtree.md@@ -0,0 +1,51 @@+# Hiding the subtree+<figure class="image image-style-align-right"><img style="aspect-ratio:328/45;" src="1_Hiding the subtree_image.png" width="328" height="45"><figcaption>An example of a collection with a relatively large number of children that are hidden from the tree.</figcaption></figure>++The tree works well when the notes are structured in a hierarchy so that the number of items stays small. When a note has a large number of notes (in the order of thousands or tens of thousands), two problems arise:++* Navigating between notes becomes cumbersome and the tree itself gets cluttered with a large amount of notes.+* The large amount of notes can slow down the application considerably.++Since v0.102.0, Trilium allows the tree to hide the child notes of particular notes. This works for both <a class="reference-link" href="../../../Collections.md">Collections</a> and normal notes.++## Interaction++When the subtree of a note is hidden, there are a few subtle changes:++* To indicate that the subtree is hidden, the note will not have an expand button and it will display the number of children to the right.+* It's not possible to add a new note directly from the tree.+ * For <a class="reference-link" href="../../../Collections.md">Collections</a>, it's best to use the built-in mechanism to create notes (for example by creating a new point on a geo-map, or by adding a new row in a table).+ * For normal notes, it's still possible to create children via other means such as using the <a class="reference-link" href="../../../Note%20Types/Text/Links/Internal%20(reference)%20links.md">Internal (reference) links</a> system.+* Notes can be dragged from outside the note, case in which they will be cloned into it.+ * Instead of switching to the child notes that were copied, the parent note is highlighted instead.+ * A notification will indicate this behavior.+* Similarly, features such as cut/copy and then paste into the note will also work.++## Spotlighting++<figure class="image image-style-align-right"><img style="aspect-ratio:322/83;" src="Hiding the subtree_image.png" width="322" height="83"></figure>++Even if the subtree of a note is hidden, if a child note manages to become active, it will still appear inside the tree in a special state called _spotlighted_.++During this state, the note remains under its normal hierarchy, so that its easy to tell its location. In addition, this means that:++* The note position is clearly visible when using the <a class="reference-link" href="../../Navigation/Search.md">Search</a>.+* The note can still be operated on from the tree, such as adding a <a class="reference-link" href="../../Notes/Cloning%20Notes/Branch%20prefix.md">Branch prefix</a> or moving it outside the collection.++The note appears in italics to indicate its temporary display. When switching to another note, the spotlighted note will disappear.++> [!NOTE]+> Only one note can be highlighted at the time. When working with multiple notes such as dragging them into the collection, no note will be spotlighted. This is intentional to avoid displaying a partial state of the subtree.++## Working with collections++For large collections, it can be helpful to hide their child notes for performance reasons or de-cluttering the tree.++To toggle this behavior:++* Open the collection and in <a class="reference-link" href="../../../Collections/Collection%20Properties.md">Collection Properties</a>, look for _Hide child notes in tree_.+* Right click the collection note in the <a class="reference-link" href="../Note%20Tree.md">Note Tree</a> and select _Advanced_ → _Show subtree_.++## Working with normal notes++It's possible to hide the subtree for normal notes as well, not just collections. To do so, right click the note in the <a class="reference-link" href="../Note%20Tree.md">Note Tree</a> and select _Advanced_ → _Hide subtree._\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/Hiding the subtree_image.png b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/Hiding the subtree_image.pngnew file mode 100644index 0000000000..7b75834e96Binary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/Hiding the subtree_image.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/Keyboard shortcuts.md b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/Keyboard shortcuts.mdnew file mode 100644index 0000000000..89e5e72c8d--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/Keyboard shortcuts.md@@ -0,0 +1,36 @@+# Keyboard shortcuts+The <a class="reference-link" href="../Note%20Tree.md">Note Tree</a> comes with multiple keyboard shortcuts to make editing faster:++## Navigation within the tree++* <kbd><span>↑</span></kbd> and <kbd><span>↑</span></kbd> to navigate between notes.+* <kbd><span>←</span></kbd> to collapse a note with children, or <kbd><span>→</span></kbd> to expand it.+* <kbd><span>←</span></kbd> on a note with no children to navigate to its parent.++## Opening notes++* <kbd>Click</kbd> to open the note in the current tab.+* <kbd>Ctrl</kbd>+<kbd>Click</kbd> or <kbd>Middle click</kbd> to open the note in a new tab.+* <kbd>Ctrl</kbd>+<kbd>Right click</kbd> to open the note in <a class="reference-link" href="../../Navigation/Quick%20edit.md">Quick edit</a>.++## Clipboard management++* <kbd>Ctrl</kbd>+<kbd>C</kbd> to copy one or more notes based on selection (see <a class="reference-link" href="../../Notes/Cloning%20Notes.md">Cloning Notes</a>).+* <kbd>Ctrl</kbd>+<kbd>X</kbd> to cut one or more notes (for moving them).+* <kbd>Ctrl</kbd>+<kbd>V</kbd> to paste them somewhere (which results in a copy or move based on the shortcut used).++## Moving notes++* <kbd>Ctrl</kbd> + <kbd><span>↑</span></kbd> , <kbd>Ctrl</kbd> + <kbd><span>↓</span></kbd> - move note up/down in the note list.+* <kbd>Ctrl</kbd> + <kbd><span>←</span></kbd> - move note up in the note tree.+* <kbd>Ctrl</kbd>+<kbd><span>→</span></kbd> - move note down in the note tree.+* <kbd>Del</kbd> - deletes note and optionally its subtree (asked in the dialog).++## Multiple selection++See <a class="reference-link" href="Multiple%20selection.md">Multiple selection</a> for more information about how selection works.++* <kbd>Alt</kbd>+<kbd>Click</kbd> – add a single note to the current selection.+* <kbd>Shift</kbd>+<kbd>Click</kbd> – select a range of notes, starting from the current note (the highlighted one) to the one that is being clicked.+* <kbd>Shift</kbd>+<kbd><span>↑</span></kbd>, <kbd>Shift</kbd>+<kbd><span>↓</span></kbd> – multi-select not above/below.+* <kbd>Ctrl</kbd>+<kbd>A</kbd> – select all notes in the current level\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/Multiple selection.md b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/Multiple selection.mdnew file mode 100644index 0000000000..fd0b852440--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/Multiple selection.md@@ -0,0 +1,31 @@+# Multiple selection+In the <a class="reference-link" href="../Note%20Tree.md">Note Tree</a>, it's possible to select multiple notes at one time. This won't affect the currently displayed note, but it allows to do batch operations.++## Types of multiple selection++<figure class="image image-style-align-right image_resized" style="width:28.54%;"><img style="aspect-ratio:335/306;" src="Multiple selection_image.png" width="335" height="306"></figure>++### Selecting notes one by one++To individually select each note, press the <kbd>Alt</kbd> key and click on the note to be selected.++The selected notes will be indicated via a different background color and an icon.++### Selecting notes in a sequence++<figure class="image image-style-align-right image_resized" style="width:29.24%;"><img style="aspect-ratio:233/205;" src="1_Multiple selection_image.png" width="233" height="205"></figure>++When notes are in a sequence (e.g. one underneath the other), the entire selection can be made just by selecting the first and the last item instead of individually clicking all the notes.++To do so, first select the note to start the selection with. Then hold <kbd>Shift</kbd> and click on the note to end the selection with. All the notes between the start and the end note will be selected as well.++## Selected notes vs. active note++There is a distinction between _selected notes_ and the _active note_:++* _Selected notes_ are simply the notes that were selected in the multiple section process (i.e. either via <kbd>Alt</kbd> or <kbd>Shift</kbd>).+* The _active note_ is simply the note that whose content is being displayed to the right of the tree.+ * Visually, it's identified in the tree by having a different background color and a subtle shadow.+ * The active note can also be selected case in which the icon and background will also change:++ <img class="image_resized" style="aspect-ratio:317/223;width:35.1%;" src="2_Multiple selection_image.png" width="317" height="223">\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/Multiple selection_image.png b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/Multiple selection_image.pngnew file mode 100644index 0000000000..569ac2f2c0Binary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/Multiple selection_image.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/Note tree contextual menu.md b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/Note tree contextual menu.mdnew file mode 100644index 0000000000..4a7cef7d88--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/Note tree contextual menu.md@@ -0,0 +1,98 @@+# Note tree contextual menu+<figure class="image image-style-align-right"><img style="aspect-ratio:269/608;" src="1_Note tree contextual menu_image.png" width="269" height="608"></figure>++The _note tree menu_ can be accessed by right-clicking in the <a class="reference-link" href="../Note%20Tree.md">Note Tree</a>.++## Interaction++The contextual menu can operate:++* On a single note, by right clicking it in the note tree.+* On multiple notes, by selecting them first. See <a class="reference-link" href="Multiple%20selection.md">Multiple selection</a> on how to do so.+ * When right clicking, do note that usually the note being right clicked is also included in the affected notes, regardless of whether it was selected or not.++## Available options++> [!NOTE]+> When multiple notes are selected, only a subset of notes will be active. The ones that do support multiple notes will mention this in the list below.++* **Open in a new tab**+ * Will open a single note in a new [tab](../Tabs.md).+* **Open in a new split**+ * Will open a split to the right with the given note within the current tab.+* **Hoist note**+ * Will focus the note tree on this note. See <a class="reference-link" href="../../Navigation/Note%20Hoisting.md">Note Hoisting</a> for more information.+* **Insert note after**+ * Allows easy creation of a note with a specified [note type](../../../Note%20Types.md).+ * <a class="reference-link" href="../../../Advanced%20Usage/Templates.md">Templates</a> will also be present (if any) at the end of the list.+ * The note will be added on the same level of hierarchy as the note selected.+* **Insert child note**+ * Same as _Insert note after_, but the note will be created as a child of the selected note.+* **Protect subtree**+ * Will mark this note and all of its descendents as protected. See <a class="reference-link" href="../../Notes/Protected%20Notes.md">Protected Notes</a> for more information.+* **Unprotect subtree**+ * Will unprotect this note and all of its descendents.+* **Cut**+ * Will place the given notes in clipboard.+ * Use one of the two paste functions (or the keyboard shortcuts) to move them to the desired location.+* **Copy / clone**+ * Will place the given notes in clipboard.+ * Use one of the two paste functions (or the keyboard shortcuts) to copy them to the desired location.+ * Note that the copy function here works according to the <a class="reference-link" href="../../Notes/Cloning%20Notes.md">Cloning Notes</a> functionality (i.e. the note itself will be present in two locations at once, and editing it in one place will edit it everywhere).+ * To simply create a duplicate note that can be modified independently, look for _Duplicate subtree_.+* **Paste into**+ * If there are any notes in clipboard, they will be pasted as child notes to the right-clicked one.+* **Paste after**+ * If there are any notes in clipboard, they will be pasted underneath the right-clicked one.+* **Move to…**+ * Will display a modal to specify where to move the desired notes.+* **Clone to…**+ * Will display a modal to specify where to [clone](../../Notes/Cloning%20Notes.md) the desired notes.+* **Duplicate**+ * Creates a copy of the note and its descendants.+ * This process is different from <a class="reference-link" href="../../Notes/Cloning%20Notes.md">Cloning Notes</a> since the duplicated note can be edited independently from the original.+ * An alternative to this, if done regularly, would be <a class="reference-link" href="../../../Advanced%20Usage/Templates.md">Templates</a>.+* **Archive/Unarchive**+ * Marks a note as [archived](../../Notes/Archived%20Notes.md).+ * If the note is already archived, it will be unarchived instead.+ * Multiple notes can be selected as well. However, all the selected notes must be in the same state (archived or not), otherwise the option will be disabled.+* **Delete**+ * Will delete the given notes, asking for confirmation first.+ * In the dialog, the following options can be configured:+ * _Delete also all clones_ to ensure that the note will be deleted everywhere if it has been placed into multiple locations (see <a class="reference-link" href="../../Notes/Cloning%20Notes.md">Cloning Notes</a>).+ * _Erase notes permanently_ will ensure that the note cannot be recovered from <a class="reference-link" href="../Recent%20Changes.md">Recent Changes</a>.+* **Import into note**+ * Opens the [import](../../Import%20%26%20Export.md) dialog and places the imported notes as child notes of the selected one.+* **Export**+ * Opens the [export](../../Import%20%26%20Export.md) dialog for the selected notes.+* **Search in subtree**+ * Opens a full <a class="reference-link" href="../../Navigation/Search.md">Search</a> with it preconfigured to only look into this note and its descendants (the _Ancestor_ field).++## Advanced options++<figure class="image image-style-align-right"><img style="aspect-ratio:231/263;" src="Note tree contextual menu_image.png" width="231" height="263"></figure>++The advanced options menu offers some of the less frequently used actions for notes.++To access these options, first look for the _Advanced_ option in the contextual menu to reveal a sub-menu with:++* **Apply bulk actions**+ * Opens the <a class="reference-link" href="../../../Advanced%20Usage/Bulk%20Actions.md">Bulk Actions</a> dialog, to apply actions such as adding labels or moving notes to multiple notes at once (see <a class="reference-link" href="Multiple%20selection.md">Multiple selection</a>).+* **Edit branch prefix**+ * Opens a dialog to assign a name to be able to distinguish [clones](../../Notes/Cloning%20Notes.md), see <a class="reference-link" href="../../Notes/Cloning%20Notes/Branch%20prefix.md">Branch prefix</a> for more information.+* **Convert to attachment**+ * Converts the selected notes to <a class="reference-link" href="../../Notes/Attachments.md">Attachments</a> of their parent notes.+ * This functional is most useful when dealing with image <a class="reference-link" href="../../../Note%20Types/File.md">File</a> notes that were imported from an external source or an older version of Trilium.+* **Expand subtree**+ * Expands all the child notes in the <a class="reference-link" href="../Note%20Tree.md">Note Tree</a>.+* **Collapse subtree**+ * Collapses all the child notes in the note tree.+* **Sort by…**+ * Opens a dialog to sort all the child notes of the selected note.+ * The sorting is done only once, there is an automatic sorting mechanism as well that can be set using <a class="reference-link" href="../../../Advanced%20Usage/Attributes.md">Attributes</a>.+ * See <a class="reference-link" href="../../Notes/Sorting%20Notes.md">Sorting Notes</a> for more information.+* **Copy note path to clipboard**+ * Copies a URL fragment representing the full path to this branch for a note, such as `#root/Hb2E70L7HPuf/4sRFgMZhYFts/2IVuShedRJ3U/LJVMvKXOFv7n`.+ * The URL to manually create <a class="reference-link" href="../../../Note%20Types/Text/Links.md">Links</a> within notes, or for note <a class="reference-link" href="../../Navigation">Navigation</a>.+* **Recent changes in subtree**+ * This will open <a class="reference-link" href="../Recent%20Changes.md">Recent Changes</a>, but filtered to only the changes related to this note or one of its descendants.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/Note tree contextual menu_image.png b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/Note tree contextual menu_image.pngnew file mode 100644index 0000000000..51683bdc0fBinary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/Note tree contextual menu_image.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree_drag-and-drop.gif b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree_drag-and-drop.gifnew file mode 100644index 0000000000..64cea383fbBinary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree_drag-and-drop.gif differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree_image.png b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree_image.pngnew file mode 100644index 0000000000..74a2060c72Binary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree_image.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree_move-note-with-keyboard.gif b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree_move-note-with-keyboard.gifnew file mode 100644index 0000000000..4f42279533Binary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree_move-note-with-keyboard.gif differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note contextual menu.md b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note contextual menu.mdnew file mode 100644index 0000000000..878bd955f1--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note contextual menu.md@@ -0,0 +1,22 @@+# Note contextual menu+<figure class="image image-style-align-right image_resized" style="width:44.65%;"><img style="aspect-ratio:514/291;" src="Note contextual menu_image.png" width="514" height="291"></figure>++Right-clicking the content of some note types such as <a class="reference-link" href="../../Note%20Types/Text.md">Text</a> or <a class="reference-link" href="../../Note%20Types/Code.md">Code</a> reveals a contextual menu.++## Features++* On the <a class="reference-link" href="../../Installation%20%26%20Setup/Desktop%20Installation.md">Desktop Installation</a>, the <a class="reference-link" href="../../Note%20Types/Text/Spell%20Check.md">Spell Check</a> suggestions are shown when right clicking on a misspelled word.+* The selected text can be searched either with a search engine (configured from <a class="reference-link" href="Options.md">Options</a>) or [inside Trilium](../Navigation/Search.md).+* Basic clipboard functionality (cut, copy, paste).+* Copying the selected text as <a class="reference-link" href="../Import%20%26%20Export/Markdown.md">Markdown</a>.+* Performing quick operations using the <a class="reference-link" href="../../Note%20Types/Text/In-editor%20AI%20assistant.md">In-editor AI assistant</a>.++## Differences between desktop and web++The [web version](../../Installation%20%26%20Setup/Server%20Installation.md) behaves slightly different due to limitations imposed by web browsers:++* When no text is selected or a word is right-clicked, the browser's default contextual menu is displayed.+ * This is intentional since it preserves the <a class="reference-link" href="../../Note%20Types/Text/Spell%20Check.md">Spell Check</a> functionality.+* When a text is selected, a reduced menu is displayed instead which features only the functionality that is available within the browser version+ * _Paste_ is not available since the browser doesn't expose it, use <kbd>Ctrl</kbd>+<kbd>V</kbd> instead.+ * The browser menu can be triggered anyway by pressing <kbd>Shift</kbd> + <kbd>Right click</kbd>.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note contextual menu_image.png b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note contextual menu_image.pngnew file mode 100644index 0000000000..2c8676ff9eBinary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note contextual menu_image.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note types with split view.md b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note types with split view.mdnew file mode 100644index 0000000000..6595e897fd--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note types with split view.md@@ -0,0 +1,21 @@+# Note types with split view+Split view is a feature of <a class="reference-link" href="../../Note%20Types/Mermaid%20Diagrams.md">Mermaid Diagrams</a> and <a class="reference-link" href="../../Note%20Types/Markdown.md">Markdown</a> notes which displays both the source code on one side and the preview of the content on the other.++<a class="reference-link" href="../../Note%20Types/Mermaid%20Diagrams.md">Mermaid Diagrams</a> also allow changing between a horizontal or a vertical split, to accommodate for the various sizes of diagrams.++## Display modes and interaction++The split comes with three different display modes:++* _Split view_, in which both the source code is available on one side and can be edited, and the preview is available on the other side.+ * In this mode, the size of either the source pane or the preview pane can be adjusted by dragging the small border between them.+* _Source view_ which shows the source code on the entire screen for a more focused editing experience.+* _Preview_ which displays only the rendering of the diagram or text in full screen, especially useful for read-only notes.++These buttons can be found near the <a class="reference-link" href="Note%20buttons.md">Note buttons</a> section on the <a class="reference-link" href="New%20Layout.md">New Layout</a>, or in the <a class="reference-link" href="Floating%20buttons.md">Floating buttons</a> on the old layout.++The display node is stored at note level.++## Relation to read-only notes++If a note is marked as [read-only](../Notes/Read-Only%20Notes.md), the source view will not be editable. While in preview mode, marking a note as read-only has no effect since the preview itself is not editable.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Options_image.png b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Options_image.pngnew file mode 100644index 0000000000..1c583ecfa1Binary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Options_image.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Ribbon.md b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Ribbon.mdnew file mode 100644index 0000000000..0b8d0e2337--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Ribbon.md@@ -0,0 +1,66 @@+# Ribbon+++The ribbon allows changing options, attributes and viewing information about the current note.++## Settings++It is possible to change whether some ribbon items will be automatically open when navigating to a new note. To do so, in [Settings](Options.md), go to _Appearance_ and look for the _Ribbon widgets_ section.++## Formatting++If you are using the _Fixed_ formatting toolbar, all the formatting buttons for text notes will appear here. See [Formatting toolbar](../../Note%20Types/Text/Formatting%20toolbar.md) for more information.++## Tabs++### Basic Properties++* _**Note type**_ allows changing the [note type](../../Note%20Types.md) of a note.+ * Generally this is desirable only if the note is empty.+ * As a more advanced use, it's possible to change the note type in order to modify the [source code](../../Advanced%20Usage/Note%20source.md) of a note.+* _**Protect the note**_ toggles whether the current note is encrypted and accessible only by entering the protected session. See [Protected Notes](../Notes/Protected%20Notes.md) for more information.+* _**Editable**_ changes whether the current note:+ * Enters [read-only mode](../Notes/Read-Only%20Notes.md) automatically if the note is too big (default behavior).+ * Is always in read-only mode (however it can still be edited temporarily).+ * Is always editable, regardless of its size.+* _**Bookmark**_ toggles the display of the current note into the [Launch Bar](Launch%20Bar.md) for easy access. See [Bookmarks](../Navigation/Bookmarks.md) for more information.+* _**Shared**_ toggles whether the current note is publicly accessible if you have a [server instance](../../Installation%20%26%20Setup/Server%20Installation.md) set up. See [Sharing](../../Advanced%20Usage/Sharing.md) for more information.+* _**Template**_ toggles whether the current note is considered a template and can be used to easily create notes with the same content. See [Template](../../Advanced%20Usage/Templates.md) for more information.+* _**Language**_ changes the main language of the current note, mostly useful for spell checking or right-to-left support. See [Content language & Right-to-left support](../../Note%20Types/Text/Content%20language%20%26%20Right-to-left%20support.md) for more information.++### Owned Attributes++This section allows editing the labels and relations of a note. For more information, see [Attributes](../../Advanced%20Usage/Attributes.md).++The plus button to the right offers a simplified way to insert labels and relations, via a graphical input. From this menu, it's also possible to define label and relation definitions (see [Promoted Attributes](../../Advanced%20Usage/Attributes/Promoted%20Attributes.md)).++### Inherited Attributes++This section displays the attributes which are applied to this note via [Attribute Inheritance](../../Advanced%20Usage/Attributes/Attribute%20Inheritance.md). It is not possible to alter the attributes from this section.++### Note Paths++This section displays all the places where the current note has been cloned to. Here the current note can also be cloned to a new location (similar to the [Note Tree](Note%20Tree.md)) See [Cloning Notes](../Notes/Cloning%20Notes.md) for more information.++### Note Map++The note map displays all the relations of the current note to other notes, as well as the subtree structure. See [Note Tree](Note%20Tree.md) for more information.++### Similar Notes++This section lists all the notes that are similar to the current one. See [Similar Notes](../Navigation/Similar%20Notes.md) for more information.++### Note Info++This section displays information about the current note:++* The [internal ID](../../Advanced%20Usage/Note%20ID.md) of the note.+* The [type of the note](../../Note%20Types.md), as well as its MIME type (used mostly for exporting notes).+* The created and modification dates.+* The estimated size of the note in the [Database](../../Advanced%20Usage/Database.md), as well as its children count and size.++### Edited notes++This section pops automatically when entering a [day note](../../Advanced%20Usage/Advanced%20Showcases/Day%20Notes.md) and shows the notes that were edited that day.++It is possible to disable this behavior from settings, by going to <a class="reference-link" href="#root/_hidden/_options/_optionsAppearance">Appearance</a> settings and looking for the _Ribbon widgets_ section.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Ribbon_image.png b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Ribbon_image.pngnew file mode 100644index 0000000000..95fc8e6648Binary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Ribbon_image.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Right Sidebar/1_Outline tab_image.png b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Right Sidebar/1_Outline tab_image.pngnew file mode 100644index 0000000000..af8f47d658Binary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Right Sidebar/1_Outline tab_image.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Right Sidebar/AI chat tab.md b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Right Sidebar/AI chat tab.mdnew file mode 100644index 0000000000..c891bd4600--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Right Sidebar/AI chat tab.md@@ -0,0 +1,12 @@+# AI chat tab+Once the <a class="reference-link" href="../../../AI.md">AI</a> integration is activated, a _Chat_ entry will appear in the <a class="reference-link" href="../Right%20Sidebar.md">Right Sidebar</a>.++* Unlike the dedicated note type, the side bar has optional access to the current note, making it easy to ask for information or modifications to a note without having to search for the note first.+ * To toggle whether the current note is visible to the AI, simply click on the file icon at the bottom of the chat interface.+* On the top-right of the sidebar there are three buttons:+ * Create a new conversation.+ * Go to a previous conversation+ * Save the current conversation as a dedicated note in the <a class="reference-link" href="../../../Advanced%20Usage/Advanced%20Showcases/Day%20Notes.md">Day Notes</a>, which turns it into a dedicated chat note.++> [!NOTE]+> The sidebar chats are stored in the <a class="reference-link" href="../../../Advanced%20Usage/Hidden%20Notes.md">Hidden Notes</a> and can be seen in the _AI Chat History_ section.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Right Sidebar/Attributes tab.md b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Right Sidebar/Attributes tab.mdnew file mode 100644index 0000000000..cd853e2103--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Right Sidebar/Attributes tab.md@@ -0,0 +1,69 @@+# Attributes tab+<figure class="image image-style-align-right image_resized" style="width:34.71%;"><img style="aspect-ratio:596/1688;" src="Attributes tab_image.png" width="596" height="1688"></figure>++The attributes tab provides a more graphical way to view and edit [attributes](../../../Advanced%20Usage/Attributes.md).++## Sections++The following information is displayed in sections:++* _Owned attributes_, contains a list of the attributes that belong to this note.+* _Inherited attributes_ are attributes that apply to the current note but come through <a class="reference-link" href="../../../Advanced%20Usage/Attributes/Attribute%20Inheritance.md">Attribute Inheritance</a>.+* _Definitions_ describe the type of attributes and are used in <a class="reference-link" href="../../../Advanced%20Usage/Attributes/Promoted%20Attributes.md">Promoted Attributes</a> and <a class="reference-link" href="../../../Collections/Table.md">Table</a> collections.++## Owned attributes++Every item is structured as such:++* The icon of each item indicates whether it's a [label](../../../Advanced%20Usage/Attributes/Labels.md) or a [relation](../../../Advanced%20Usage/Attributes/Relations.md) (link to another note).+* The first text is the name of the label.+* The value of the attribute is displayed after the name, if present.+ * The value is shown in a graphical way: a relation's value is a clickable note link; a color label shows a color chip.++System attributes (that have a special meaning in Trilium) show a small cog near the icon and are grouped separately from the user-defined ones.++Interaction:++* Clicking on the item (apart from the value and links) reveals a dedicated popup where the name, value and <a class="reference-link" href="../../../Advanced%20Usage/Attributes/Attribute%20Inheritance.md">Attribute Inheritance</a> can be defined.+* The value of the attributes can be edited in-place:+ * The input box follows the type defined in a corresponding label definition (date, color, dropdown, numbers), as well as for system attributes that have a specific type (e.g. `color`).+ * For labels, clicking on the value edits its in-place.+ * Press <kbd>Enter</kbd> to confirm or click outside the input box, or <kbd>Esc</kbd> to dismiss.+ * For multi-line text, <kbd>Ctrl</kbd>+<kbd>Enter</kbd> confirms whereas <kbd>Enter</kbd> creates a newline.+ * For boolean values, clicking on the checkbox will toggle its state.+ * For labels without a value, a value can be added by clicking on the _No value_ text which appears while the mouse is hovered on the item.+ * For relations, there is a dedicated pencil button instead.+* An attribute can be deleted by pressing the X button to its right, which only appears while hovered. A confirmation screen is displayed first to ensure the attribute is not accidentally deleted.++Attributes can be added in two ways:++* A new label, relation or attribute definition can be added from the + button near the title of the section. This shows the full detail popup.+* To quickly add a label or a relation directly from the sidebar, click the _Add attribute_ item at the end of the list.+ * The name field will be focused first. By default, a label will be created instead but it can be toggled to a relation by typing <kbd>~</kbd> or pressing the icon (similarly, typing `#` will switch back to a label instead of a relation).+ * Once the name is filled, press <kbd>Enter</kbd> to continue to the value. Type in a value if desired and then press <kbd>Enter</kbd> again to create the attribute.+ * Clicking outside the editor will also create the attribute, but only if a name is specified.++## Inherited attributes++Inherited labels or relations are shown in the same fashion as _Owned attributes_.++The only differences are:++* To the right of the inherited attribute there is a link to the note where the attribute comes from, as well as an icon to indicate that it's inheritable.+* Clicking on an inherited attribute will reveal the same popup as owned attributes, but it is not editable. To edit it, first navigate to the note where the attribute is defined.++## Definitions++For attribute definition (see <a class="reference-link" href="../../../Advanced%20Usage/Attributes/Promoted%20Attributes.md">Promoted Attributes</a>):++* The icon indicates the type of the attribute (text, number).+ * If an attribute is promoted, it has a small chevron icon overlaid on top of it.+* The name indicates the name of the attribute it defines (without the `label:` or `relation:` prefix).+* To the right of the name a short summary is displayed which indicates the display name (alias), whether it has multiple values or an inverse relation.+* Clicking on a definition reveals a popup, where the name, type, display name and other aspects can be configured.+* A new label or relation definition can be added from the + button near the title of the section.+* For inherited definition, there is a link to the note where the definition comes from, as well as an icon to indicate that it's inherited.++## Mobile++The attributes can also be edited visually on mobile, but not as part of the sidebar. Go to <a class="reference-link" href="../Note%20buttons.md">Note buttons</a> and select _Note attributes_.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Right Sidebar/Attributes tab_image.png b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Right Sidebar/Attributes tab_image.pngnew file mode 100644index 0000000000..603c206b4cBinary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Right Sidebar/Attributes tab_image.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Right Sidebar/Connections tab.md b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Right Sidebar/Connections tab.mdnew file mode 100644index 0000000000..691e76f0b2--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Right Sidebar/Connections tab.md@@ -0,0 +1,41 @@+# Connections tab+<figure class="image image-style-align-right image_resized" style="width:33.35%;"><img style="aspect-ratio:490/1801;" src="Connections tab_image.png" width="490" height="1801"></figure>++The connections tab groups together all the information about the current note and how it relates to other notes, in four different sections.++> [!NOTE]+> It's generally best to keep only the desired sections expanded as each of the sections have to retrieve additional data that might not otherwise be needed. While collapsed, the sections do not retrieve any additional data.++## Note map++The note map displays a graph which shows the relation between the current notes and other notes on the hierarchy. There are two types of visualizations, which can be selected from the top-right part of the section:++* The _Link map_, which displays the [relations](../../../Advanced%20Usage/Attributes/Relations.md) between notes.+* The _Tree map_, which displays the hierarchical structure.++The sidebar will remember which visualization is selected, as a global option. Note that note maps also have a `#mapType` which describes which visualization to use, but the sidebar deliberately ignores that to keep consistency when switching between notes.++The map can also be expanded by pressing the button in the top-right of the section. When expanded, the map is displayed in a separate dialog. Alternatively, all other sections can be collapsed, which will make the note map taller and the sidebar can be dragged to make for more lateral space.++The note map view inside the sidebar is deliberately more compact in order to fit the space: the link map would also show notes that don't have a link to the current note from the hierarchy (creating a cloud of dots) but this is only shown while the map is expanded. Similarly, the link strength and pin configuration buttons are not displayed here.++See also:++* The <a class="reference-link" href="../../../Note%20Types/Note%20Map.md">Note Map</a> note type+* <a class="reference-link" href="../../../Advanced%20Usage/Note%20Map%20(Link%20map%2C%20Tree%20map).md">Note Map (Link map, Tree map)</a> for more information on the concept as a whole.++## Note paths++The note paths section displays the locations in which the current note is [cloned](../../Notes/Cloning%20Notes.md). Each segment of the note path is clickable, in order to navigate to that note or clone.++A new clone can be created from the top-right button.++## Backlinks++Backlinks list the notes that refer to the current note, as well as a preview of the content where the reference to the note is made.++For more information, see <a class="reference-link" href="../../../Note%20Types/Text/Links/Backlinks.md">Backlinks</a>.++## Similar notes++Displays a list of notes that appear similar based on the content of the notes and their attributes. For more information, see <a class="reference-link" href="../../Navigation/Similar%20Notes.md">Similar Notes</a>.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Right Sidebar/Connections tab_image.png b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Right Sidebar/Connections tab_image.pngnew file mode 100644index 0000000000..9e336829a3Binary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Right Sidebar/Connections tab_image.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Right Sidebar/Outline tab.md b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Right Sidebar/Outline tab.mdnew file mode 100644index 0000000000..f6d9d797a0--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Right Sidebar/Outline tab.md@@ -0,0 +1,84 @@+# Outline tab+The Outline tab appears in the <a class="reference-link" href="../Right%20Sidebar.md">Right Sidebar</a> and displays the headings and highlights for the current note.++## Table of contents++The table of contents displays the titles / headings in the current note and allows easy navigation.++The following note types are supported:++* <a class="reference-link" href="../../../Note%20Types/Text.md">Text</a>+* <a class="reference-link" href="../../../Note%20Types/Markdown.md">Markdown</a>+* <a class="reference-link" href="../../../Note%20Types/File/PDFs.md">PDFs</a>+* <a class="reference-link" href="../../../AI.md">AI</a> chat notes+* The pages of the in-app documentation++<figure class="image image-style-align-right image_resized" style="width:47%;"><img style="aspect-ratio:556/205;" src="1_Outline tab_image.png" width="556" height="205"></figure>++### Interaction++* Clicking on a heading will scroll the document to the position of the heading.+* As the document is scrolled, the heading being read is highlighted and the list scrolls to keep it in view. If that heading is hidden inside a collapsed section, the collapsed heading is highlighted instead.+* Pressing the close button will dismiss the table of contents but it can be shown again from the <a class="reference-link" href="../Floating%20buttons.md">Floating buttons</a> section.++### Configuration++> [!NOTE]+> This section is relevant only for the old layout, the <a class="reference-link" href="../New%20Layout.md">New Layout</a> shows the table of contents regardless of the number of headings.++* To change the option globally, go to <a class="reference-link" href="#root/_hidden/_options/_optionsTextNotes">Text Notes</a> options, look for the _Table of Contents_ section and configure the minimum amount of headings that need to be present in the current note in order for the table of contents to show:+ * To always hide it, set the value to a really large number (e.g. 10000).+ * To always display it if there's at least a single heading, set the value to 1.+* Use <a class="reference-link" href="../../../Advanced%20Usage/Attributes.md">Attributes</a> to configure the table of contents for a particular note:+ * `#toc=show` will show the table of contents for that note regardless of the global settings.+ * Similarly, `#toc=hide` will always hide the table of contents for that note.++## Highlights++<figure class="image image-style-align-right image_resized" style="width:46.04%;"><img style="aspect-ratio:489/240;" src="Outline tab_image.png" width="489" height="240"></figure>++Similar to the table of contents, but instead of headings this feature will list highlighted text from a text note and allow easy navigation to them.++Unlike table of contents which supports multiple note types, the highlights are specific to the <a class="reference-link" href="../../../Note%20Types/Text.md">Text</a> notes.++Highlighted text is defined as:++* Bold text.+* Italic text.+* Underlined text.+* Text with a foreground color set.+* Text with a background color/highlight set.++### Interaction++* Clicking on a highlighted text will scroll the document to its position.+* For the old layout only, pressing the close button will dismiss the list of highlights but it can be shown again from the <a class="reference-link" href="../Floating%20buttons.md">Floating buttons</a> section.++### Configuration++* Globally, it's possible to toggle the display of each category of highlighted text (as defined above)+ * For the new layout, pressing the gear button in the top-right part of the section will reveal a menu to toggle between the highlight categories.+ * Alternatively, they can be changed by going to <a class="reference-link" href="#root/_hidden/_options/_optionsTextNotes">Text Notes</a> settings and looking for the _Highlights List_ section.+* For the old layout only, to suppress the display of highlighted text for one specific note, use <a class="reference-link" href="../../../Advanced%20Usage/Attributes.md">Attributes</a> to add the `#hideHighlightWidget` label.++## PDF-specific outline++When <a class="reference-link" href="../../../Note%20Types/File/PDFs.md">PDFs</a> are opened in Trilium, the <a class="reference-link" href="../Right%20Sidebar.md">Right Sidebar</a> is augmented with PDF-specific navigation, with the following features:++* Table of contents/outline+ * All the headings and “bookmarks” will be displayed hierarchically.+ * The heading on the current page is also highlighted (note that it can be slightly offset depending on how many headings are on the same page).+ * Clicking on a heading will jump to the corresponding position in the PDF.+* Pages+ * A preview of all the pages with a small thumbnail.+ * Clicking on a page will automatically navigate to that page.+* Annotations+ * Highlight and comment annotations are listed here.+ * For the old layout, this feature is not directly available, however there is a listing of comments directly in the PDF toolbar.+* Attachments+ * If the PDF has its own attachments (not to be confused with Trilium's <a class="reference-link" href="../../Notes/Attachments.md">Attachments</a>), they will be displayed in a list.+ * Some information such as the name and size of the attachment are displayed.+ * It's possible to download the attachment by clicking on the download button.+* Layers+ * A less common feature, if the PDF has toggle-able layers, these layers will be displayed in a list here.+ * It's possible to toggle the visibility for each individual layer.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Right Sidebar/Outline tab_image.png b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Right Sidebar/Outline tab_image.pngnew file mode 100644index 0000000000..ac66326822Binary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Right Sidebar/Outline tab_image.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Split View_2_Split View_image.png b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Split View_2_Split View_image.pngnew file mode 100644index 0000000000..7a74de6a2dBinary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Split View_2_Split View_image.png differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Tabs_IMG_1767.PNG b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Tabs_IMG_1767.PNGnew file mode 100644index 0000000000..dd5a7ab1e5Binary files /dev/null and b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Tabs_IMG_1767.PNG differdiff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Zoom.md b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Zoom.mdnew file mode 100644index 0000000000..88404cac32--- /dev/null+++ b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Zoom.md@@ -0,0 +1,10 @@+# Zoom+Zoom applies to the entire UI, including text.++On the desktop application, use the <a class="reference-link" href="Global%20menu.md">Global menu</a> to zoom in/out.++On both web browser and the desktop, the keyboard shortcuts <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>+</kbd> and <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>-</kbd> can be used.++## Adjusting the text size instead++As an alternative to the zoom, the text size can be individually adjusted by going to <a class="reference-link" href="Options.md">Options</a> → _Appearance_.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Collections/1_Calendar_image.png b/docs/User Guide/User Guide/Collections/1_Calendar_image.pngnew file mode 100644index 0000000000..e2743dd637Binary files /dev/null and b/docs/User Guide/User Guide/Collections/1_Calendar_image.png differdiff --git a/docs/User Guide/User Guide/Collections/1_Geo Map_image.png b/docs/User Guide/User Guide/Collections/1_Geo Map_image.pngnew file mode 100644index 0000000000..27eeb4b4ebBinary files /dev/null and b/docs/User Guide/User Guide/Collections/1_Geo Map_image.png differdiff --git a/docs/User Guide/User Guide/Collections/1_Presentation_image.png b/docs/User Guide/User Guide/Collections/1_Presentation_image.pngnew file mode 100644index 0000000000..83b0c01af7Binary files /dev/null and b/docs/User Guide/User Guide/Collections/1_Presentation_image.png differdiff --git a/docs/User Guide/User Guide/Collections/2_Calendar_image.png b/docs/User Guide/User Guide/Collections/2_Calendar_image.pngnew file mode 100644index 0000000000..3db9e775e6Binary files /dev/null and b/docs/User Guide/User Guide/Collections/2_Calendar_image.png differdiff --git a/docs/User Guide/User Guide/Collections/2_Geo Map_image.png b/docs/User Guide/User Guide/Collections/2_Geo Map_image.pngnew file mode 100644index 0000000000..d1d58e2defBinary files /dev/null and b/docs/User Guide/User Guide/Collections/2_Geo Map_image.png differdiff --git a/docs/User Guide/User Guide/Collections/3_Calendar_image.png b/docs/User Guide/User Guide/Collections/3_Calendar_image.pngnew file mode 100644index 0000000000..b147a7991eBinary files /dev/null and b/docs/User Guide/User Guide/Collections/3_Calendar_image.png differdiff --git a/docs/User Guide/User Guide/Collections/3_Geo Map_image.png b/docs/User Guide/User Guide/Collections/3_Geo Map_image.pngnew file mode 100644index 0000000000..f46ae8a641Binary files /dev/null and b/docs/User Guide/User Guide/Collections/3_Geo Map_image.png differdiff --git a/docs/User Guide/User Guide/Collections/4_Calendar_image.png b/docs/User Guide/User Guide/Collections/4_Calendar_image.pngnew file mode 100644index 0000000000..920ffc6075Binary files /dev/null and b/docs/User Guide/User Guide/Collections/4_Calendar_image.png differdiff --git a/docs/User Guide/User Guide/Collections/5_Calendar_image.png b/docs/User Guide/User Guide/Collections/5_Calendar_image.pngnew file mode 100644index 0000000000..e89fee4d02Binary files /dev/null and b/docs/User Guide/User Guide/Collections/5_Calendar_image.png differdiff --git a/docs/User Guide/User Guide/Collections/6_Calendar_image.png b/docs/User Guide/User Guide/Collections/6_Calendar_image.pngnew file mode 100644index 0000000000..ae9c9a3c18Binary files /dev/null and b/docs/User Guide/User Guide/Collections/6_Calendar_image.png differdiff --git a/docs/User Guide/User Guide/Collections/7_Calendar_image.png b/docs/User Guide/User Guide/Collections/7_Calendar_image.pngnew file mode 100644index 0000000000..875127df2eBinary files /dev/null and b/docs/User Guide/User Guide/Collections/7_Calendar_image.png differdiff --git a/docs/User Guide/User Guide/Collections/8_Calendar_image.png b/docs/User Guide/User Guide/Collections/8_Calendar_image.pngnew file mode 100644index 0000000000..7bdf27a6f4Binary files /dev/null and b/docs/User Guide/User Guide/Collections/8_Calendar_image.png differdiff --git a/docs/User Guide/User Guide/Collections/Calendar.md b/docs/User Guide/User Guide/Collections/Calendar.mdnew file mode 100644index 0000000000..981c8c198e--- /dev/null+++ b/docs/User Guide/User Guide/Collections/Calendar.md@@ -0,0 +1,294 @@+# Calendar+<figure class="image"><img style="aspect-ratio:2016/1413;" src="1_Calendar_image.png" width="2016" height="1413"></figure>++The Calendar view will display each child note in a calendar that has a start date and optionally an end date, as an event.++The Calendar view has multiple display modes:++* Month view, where the entire month is displayed and all-day events can be inserted. Both time-specific events and all-day events are listed.+* Week view, where all the 7 days of the week (or 5 if the weekends are hidden) are displayed in columns. This mode allows entering and displaying time-specific events, not just all-day events.+* Day view, which views only a single day. Especially useful for heavy agendas or mobile views.+* List view, which displays all the events of a given month in sequence.+* Year view, which displays the entire year for quick reference.++Unlike other Collection view types, the Calendar view also allows some kind of interaction, such as moving events around as well as creating new ones.++## Creating a calendar++Right click on an existing note in the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.md">Note Tree</a> and select _Insert child note_ and look for _Calendar_.++## Creating a new event/note++To create a new event:++* First, click the desired day (month & year views) or the desired timeslot (day view).+* Alternatively, drag across multiple days (or time slots) to set both the start and end date.++In either cases, a small popup will show with a prompt for a title and the date & time of the event that will be created.++At this point, the event hasn't been created yet to protect against accidental clicks. Add a title optionally and press the _Create_ button. If no title is provided, the event will follow the <a class="reference-link" href="../Advanced%20Usage/Default%20Note%20Title.md">Default Note Title</a> rules.++After creating the event, it will show up on the calendar. To edit the content of the event (including recurrence), click on it to bring it into the popup view.++> [!NOTE]+> Creating new notes from the calendar will respect the `~child:template` relation if set on the Collection note.++## Interacting with events++* Hovering the mouse over an event will display information about the note.+ +* Left clicking the event will open a dedicated popup to quickly configure the event or edit its note content.+* Right click will offer more options including opening the note in a new split or window.+* Drag and drop an event on the calendar to move it to another day.+* The length of an event can be changed by placing the mouse to the right edge of the event and dragging the mouse around.++### Popup view++When an event is clicked, a popup will show near the event which contains the following inforamtion:++* The title and icon of the event, both editable.+* Buttons to interact with the event:+ * Open the event in the same pane, new tab, etc.+ * Color picker to change the color of the event.+ * Button to remove the event from the calendar, which can optionally delete its corresponding note.+* Calendar-specific features:+ * A toggle for all-day events.+ * A start/end date & time selector.+ * A full recurrence editor, to have the same event show up weekly, monthly, etc.+* The <a class="reference-link" href="../Advanced%20Usage/Attributes/Promoted%20Attributes.md">Promoted Attributes</a> of the marker, if any.+* The note's content which can be edited directly from the panel.++To dismiss the popup:++* Press the X button at the top-right of the popup.+* In the calendar, press anywhere outside the popup.+* Or simply press the <kbd>Escape</kbd> key.++It is possible to switch between events by clicking on them even when the popup view is already open.++Events can have <a class="reference-link" href="../Note%20Types/Text/Links/Internal%20(reference)%20links.md">Internal (reference) links</a> between them and clicking on such a link will automatically navigate the calendar to the right date and the popup view to the new note.++## Interaction on mobile++When Trilium is on mobile, the interaction with the calendar is slightly different:++* Clicking on an event displays the popup view, which allows editing the event.+* Long-presing an event triggers the contextual menu, including the option to open in <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Navigation/Quick%20edit.md">Quick edit</a>.+* To insert a new event, touch and hold the empty space. When successful, the empty space will become colored to indicate the selection.+ * Before releasing, drag across multiple spaces to create multi-day events.+ * When released, a prompt will appear to enter the note title.+* To move an existing event, touch and hold the event until the empty space near it will become colored.+ * At this point the event can be dragged across other days on the calendar.+ * Or the event can be resized by tapping on the small circle to the right end of the event.+ * To exit out of editing mode, simply tap the empty space anywhere on the calendar.++## Configuring the calendar view++In the _Collections_ tab in the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Ribbon.md">Ribbon</a>, it's possible to adjust the following:++* Hide weekends from the week view.+* Display week numbers on the calendar.+* Set the slot duration (the length of each time row in day/week view).+* Set the slot label interval (how often time labels appear on the axis in day/week view).++## Configuring the calendar using attributes++The following attributes can be added to the Collection type:++<table>+ <thead>+ <tr>+ <th>Name</th>+ <th>Description</th>+ </tr>+ </thead>+ <tbody>+ <tr>+ <td><code>#calendar:hideWeekends</code></td>+ <td>When present (regardless of value), it will hide Saturday and Sundays from the calendar.</td>+ </tr>+ <tr>+ <td><code>#calendar:weekNumbers</code></td>+ <td>When present (regardless of value), it will show the number of the week on the calendar.</td>+ </tr>+ <tr>+ <td><code>#calendar:initialDate</code></td>+ <td>Change the date the calendar opens on. When not present, the calendar opens on the current date.</td>+ </tr>+ <tr>+ <td><code>#calendar:view</code></td>+ <td><p>Which view to display in the calendar:</p><ul><li><code>timeGridDay</code> for the <em>day</em> view;</li><li><code>timeGridWeek</code> for the <em>week</em> view;</li><li><code>dayGridMonth</code> for the <em>month</em> view;</li><li><code>multiMonthYear</code> for the <em>year</em> view;</li><li><code>listMonth</code> for the <em>list</em> view.</li></ul><p>Any other value will be dismissed and the default view (month) will be used instead.</p><p>The value of this label is automatically updated when changing the view using the UI buttons.</p></td>+ </tr>+ <tr>+ <td><code>#calendar:slotDuration</code></td>+ <td>Sets how long each timeslot is on the calendar. Defaults to <code>00:15:00</code> (15 minutes). Must have the format "HH:MM:SS". For example, to create timeslots for every 10 minutes, you would set <code>#calendar:slotDuration="00:10:00"</code>.</td>+ </tr>+ <tr>+ <td><code>#calendar:slotLabelInterval</code></td>+ <td>Sets how often the timeslots on the calendar should be labeled. Defaults to <code>01:00:00</code> (1 hour). Must have the format "HH:MM:SS". For example, to label timeslots every 30 minutes, you would set <code>#calendar:slotLabelInterval="00:30:00"</code>.</td>+ </tr>+ <tr>+ <td><code>~child:template</code></td>+ <td>Defines the template for newly created notes in the calendar (via dragging or clicking).</td>+ </tr>+ </tbody>+</table>++In addition, the first day of the week can be either Sunday or Monday and can be adjusted from the application settings.++## Configuring the calendar events using attributes++For each note of the calendar, the following attributes can be used:++| Name | Description |+| --- | --- |+| `#startDate` | The date the event starts, which will display it in the calendar. The format is `YYYY-MM-DD` (year, month and day separated by a minus sign). |+| `#endDate` | Similar to `startDate`, mentions the end date if the event spans across multiple days. The date is inclusive, so the end day is also considered. The attribute can be missing for single-day events. |+| `#startTime` | The time the event starts at. If this value is missing, then the event is considered a full-day event. The format is `HH:MM` (hours in 24-hour format and minutes). |+| `#endTime` | Similar to `startTime`, it mentions the time at which the event ends (in relation with `endDate` if present, or `startDate`). |+| `#recurrence` | This is an optional CalDAV `RRULE` string that if present, determines whether a task should repeat or not. Note that it does not include the `DTSTART` attribute, which is derived from the `#startDate` and `#startTime` directly. For examples of valid `RRULE` strings see [https://icalendar.org/rrule-tool.html](https://icalendar.org/rrule-tool.html) |+| `#color` | Displays the event with a specified color (named such as `red`, `gray` or hex such as `#FF0000`). This will also change the color of the note in other places such as the note tree. |+| `#calendar:color` | **❌️ Removed since v0.100.0. Use** `#color` **instead.** <br> <br>Similar to `#color`, but applies the color only for the event in the calendar and not for other places such as the note tree. |+| `#iconClass` | If present, the icon of the note will be displayed to the left of the event title. |+| `#calendar:title` | Changes the title of an event to point to an attribute of the note other than the title, can either a label or a relation (without the `#` or `~` symbol). See _Use-cases_ for more information. |+| `#calendar:displayedAttributes` | Allows displaying the value of one or more attributes in the calendar like this: <br> <br> <br> <br>`#weight="70" #Mood="Good" #calendar:displayedAttributes="weight,Mood"` <br> <br>It can also be used with relations, case in which it will display the title of the target note: <br> <br>`~assignee=@My assignee #calendar:displayedAttributes="assignee"` |+| `#calendar:startDate` | Allows using a different label to represent the start date, other than `startDate` (e.g. `expiryDate`). The label name **must not be** prefixed with `#`. If the label is not defined for a note, the default will be used instead. |+| `#calendar:endDate` | Similar to `#calendar:startDate`, allows changing the attribute which is being used to read the end date. |+| `#calendar:startTime` | Similar to `#calendar:startDate`, allows changing the attribute which is being used to read the start time. |+| `#calendar:endTime` | Similar to `#calendar:startDate`, allows changing the attribute which is being used to read the end time. |++## How the calendar works++++The calendar displays all the child notes of the Collection that have a `#startDate`. An `#endDate` can optionally be added.++The start date & end date can easily be edited from the calendar collection itself by clicking on the event. To edit the date while in the event note itself, the following attributes can be added to the Collection note:++```+#viewType=calendar #label:startDate(inheritable)="promoted,alias=Start Date,single,date"+#label:endDate(inheritable)="promoted,alias=End Date,single,date"+#hidePromotedAttributes+```++This will result in:++++When not used in a Journal, the calendar is recursive. That is, it will look for events not just in its child notes but also in the children of these child notes.++## Recurrence++The built in calendar view also supports repeating tasks (e.g. every week, every month as well as more complex recurrency rules).++Starting with v0.105.0, recurrence can be directly edited from the calendar by clicking on an event and then selecting the _Repeats_ option.++### Custom recurrence using a subset of RRULE++If the existing recurrence editor from the event popup is not sufficient, more complex rules can be manually set via the `#recurrence` label.++For example, to make a note repeat on the calendar:++* Every Day - `#recurrence="FREQ=DAILY;INTERVAL=1"`+* Every 3 days - `#recurrence="FREQ=DAILY;INTERVAL=3"`+* Every week - `#recurrence="FREQ=WEEKLY;INTERVAL=1"`+* Every 2 weeks on Monday, Wednesday and Friday - `#recurrence="FREQ=WEEKLY;INTERVAL=2;BYDAY=MO,WE,FR"`+* Every 3 months - `#recurrence="FREQ=MONTHLY;INTERVAL=3"`+* Every 2 months on the First Sunday - `#recurrence="FREQ=MONTHLY;INTERVAL=2;BYDAY=1SU"`+* Every month on the Last Friday - `#recurrence="FREQ=MONTHLY;INTERVAL=1;BYDAY=-1FR"`++For other examples of valid `RRULE` strings see [https://icalendar.org/rrule-tool.html](https://icalendar.org/rrule-tool.html)++Note that the recurrence string does not include the `DTSTART` attribute as defined in the iCAL specifications. This is derived directly from the `startDate` and `startTime` attributes++If you want to override the label the calendar uses to fetch the recurrence string, you can use the `#calendar:recurrence` attribute. For example, you can set `#calendar:recurrence=taskRepeats`. Then you can set your recurrence string like `#taskRepeats="FREQ=DAILY;INTERVAL=1"`++Also note that the recurrence label can be made promoted as with the start and end dates.++> [!WARNING]+> If the recurrence string is not valid, a toast will be shown with the note ID and title of the note with the erroneous recurrence message. This note will not be added to the calendar++## Slot Duration & Slot Label Interval++Trilium's calendar view is powered by FullCalendar, which gives you fine-grained control over how the time grid looks and behaves for day and week views. Two labels you can use to configure these views are `#calendar:slotDuration` and `#calendar:slotLabelInterval`. Understanding what each one does — and how they interact — lets you tailor the calendar to match your workflow, whether you're scheduling in 15-minute increments or planning out your day in broad hourly blocks.++These settings can also be adjusted from the _Collections_ tab in the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Ribbon.md">Ribbon</a>.++### Slot duration++Controls how tall each time slot is on the calendar — essentially the smallest unit of time the grid is divided into. A shorter duration means more rows and finer granularity; a longer one means fewer, chunkier rows. The default is one row every 15 minutes.++**Examples:**++| Value | Result |+| --- | --- |+| `#calendar:slotDuration="00:15:00"` | One row every 15 minutes |+| `#calendar:slotDuration="00:30:00"` | One row every 30 minutes |+| `#calendar:slotDuration="01:00:00"` | One row every hour |++### Label interval++Controls how often a time label appears on the left-hand axis. This is independent of the slot size — you can have very small slots but only label every hour to keep the axis readable. The default is a time label shown every hour.++**Examples:**++| Value | Result |+| --- | --- |+| `#calendar:slotLabelInterval="00:30:00"` | Show a time label every 30 minutes |+| `#calendar:slotLabelInterval="01:00:00"` | Show a time label every hour |++### Useful combinations++| `#calendar:slotDuration` | `#calendar:slotLabelInterval` | Result |+| --- | --- | --- |+| `00:15:00` | `01:00:00` | Fine grid, clean axis — good for busy schedules |+| `00:30:00` | `01:00:00` | Standard calendar feel |+| `01:00:00` | `01:00:00` | Simple hourly grid — good for day planning |+| `00:15:00` | `00:30:00` | Fine grid, labels every 30 min — balanced detail |++### Format++Both values use `HH:mm:ss` format. Hours can go up to `24` (`24:00:00`), while minutes and seconds must be between `00` and `59`. The minimum meaningful duration is 1 minute (`00:01:00`).++## Use-cases++### Using with the Journal / calendar++It is possible to integrate the calendar view into the Journal with day notes. In order to do so change the note type of the Journal note (calendar root) to Collection and then select the Calendar View.++While in journal mode, the popup editor will not show dates, recurrence, colors or removal, since day notes aren't editable events.++Based on the `#calendarRoot` (or `#workspaceCalendarRoot`) attribute, the calendar will know that it's in a calendar and apply the following:++* The calendar events are now rendered based on their `dateNote` attribute rather than `startDate`.+* Interactive editing such as dragging over an empty era or resizing an event is no longer possible.+* Clicking on the empty space on a date will automatically open that day's note or create it if it does not exist.+* Direct children of a day note will be displayed on the calendar despite not having a `dateNote` attribute. Children of the child notes will not be displayed.++<img src="5_Calendar_image.png" width="1217" height="724">++### Using a different attribute as event title++<img class="image-style-align-right" src="2_Calendar_image.png" width="445" height="124">By default, events are displayed on the calendar by their note title. However, it is possible to configure a different attribute to be displayed instead.++To do so, assign `#calendar:title` to the child note (not the calendar/Collection note), with the value being `name` where `name` can be any label (make not to add the `#` prefix). The attribute can also come through inheritance such as a template attribute. If the note does not have the requested label, the title of the note will be used instead.++```+#startDate=2025-02-11 #endDate=2025-02-13 #name="My vacation" #calendar:title="name"+```++### Using a relation attribute as event title++<img class="image-style-align-right image_resized" style="aspect-ratio:294/151;width:21.22%;" src="3_Calendar_image.png" width="294" height="151">Similarly to using an attribute, use `#calendar:title` and set it to `name` where `name` is the name of the relation to use.++Moreover, if there are more relations of the same name, they will be displayed as multiple events coming from the same note.++```+#startDate=2025-02-14 #endDate=2025-02-15 ~for=@John Smith ~for=@Jane Doe #calendar:title="for"+```++<img class="image-style-align-left" src="Calendar_image.png" width="296" height="150">Note that it's even possible to have a `#calendar:title` on the target note (e.g. “John Smith”) which will try to render an attribute of it. Note that it's not possible to use a relation here as well for safety reasons (an accidental recursion of attributes could cause the application to loop infinitely).++```+#calendar:title="shortName" #shortName="John S."+```\ No newline at end of filediff --git a/docs/User Guide/User Guide/Collections/Calendar_image.png b/docs/User Guide/User Guide/Collections/Calendar_image.pngnew file mode 100644index 0000000000..10ac2bb3d9Binary files /dev/null and b/docs/User Guide/User Guide/Collections/Calendar_image.png differdiff --git a/docs/User Guide/User Guide/Collections/Collection Properties.md b/docs/User Guide/User Guide/Collections/Collection Properties.mdnew file mode 100644index 0000000000..adafd77a75--- /dev/null+++ b/docs/User Guide/User Guide/Collections/Collection Properties.md@@ -0,0 +1,14 @@+# Collection Properties+<figure class="image"><img style="aspect-ratio:1177/98;" src="Collection Properties_image.png" width="1177" height="98"></figure>++The _Collection Properties_ is a toolbar that is displayed at the top of every [collection note](../Collections.md).++For versions prior to v0.102.0, this feature was only available for the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/New%20Layout.md">New Layout</a>. Starting with this version, the collection properties are enabled for the Old layout as well, and <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Ribbon.md">Ribbon</a> no longer contains a dedicated tab for collection properties.++The collection properties has:++* A quick selector for the view type (e.g. grid, calendar, board).+* A settings button with:+ * Settings for the current view, for example hiding the weekends in a calendar.+ * Generic settings for the collection, such as [hiding the child notes](../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree/Hiding%20the%20subtree.md) or showing [archived notes](../Basic%20Concepts%20and%20Features/Notes/Archived%20Notes.md).+* Specific interactions for the current view, for example month selector and view switcher for the calendar.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Collections/Collection Properties_image.png b/docs/User Guide/User Guide/Collections/Collection Properties_image.pngnew file mode 100644index 0000000000..c1955ce8b1Binary files /dev/null and b/docs/User Guide/User Guide/Collections/Collection Properties_image.png differdiff --git a/docs/User Guide/User Guide/Collections/Dashboard.md b/docs/User Guide/User Guide/Collections/Dashboard.mdnew file mode 100644index 0000000000..e1a61fed2a--- /dev/null+++ b/docs/User Guide/User Guide/Collections/Dashboard.md@@ -0,0 +1,34 @@+# Dashboard+<figure class="image"><img style="aspect-ratio:1406/1030;" src="Dashboard_image.png" width="1406" height="1030"></figure>++> [!NOTE]+> The dashboard is currently considered beta. This means that it might face some changes in behavior until it is stabilized.++The dashboard is a collection introduced in Trilium v0.104.0. It is similar to the <a class="reference-link" href="Grid%20View.md">Grid View</a> collection, but with some key differences:++* The grid layout is not fixed, allowing for tiles of varying widths and heights. The grid has 12 columns and an unlimited number of rows.+* Each widget represents a child note of the collection and can be reordered or resized.+* The grid will distribute the columns evenly to fill the entire screen.+ * If the available space is too low (e.g. in a split or in mobile), the columns are collapsed so that all widgets are displayed one under the other.+ * While the columns are collapsed, the widgets cannot be reordered or resized.+* Unlike the <a class="reference-link" href="Grid%20View.md">Grid View</a>, the widgets are not clickable which allows them to be interactive.++## Types of widgets++The dashboard uses the same rendering mechanism as the <a class="reference-link" href="Grid%20View.md">Grid View</a> or the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Notes/Note%20List.md">Note List</a>, which means every note can be rendered, such as:++* Static content, via <a class="reference-link" href="../Note%20Types/Text.md">Text</a> or <a class="reference-link" href="../Note%20Types/Code.md">Code</a>.+* Images via <a class="reference-link" href="../Note%20Types/File.md">File</a>, <a class="reference-link" href="../Note%20Types/Mermaid%20Diagrams.md">Mermaid Diagrams</a>, <a class="reference-link" href="../Note%20Types/Mind%20Map.md">Mind Map</a>.+* Interactive widgets via <a class="reference-link" href="../Note%20Types/Render%20Note.md">Render Note</a>.+* Web pages can be displayed via <a class="reference-link" href="../Note%20Types/Web%20View.md">Web View</a> and refreshed via the context menu.+* <a class="reference-link" href="../Collections.md">Collections</a> render interactively inside the dashboard++> [!TIP]+> Interactive widgets through the use of <a class="reference-link" href="../Note%20Types/Render%20Note.md">Render Note</a> is the highlighted use case of the dashboard. Using the <a class="reference-link" href="../AI.md">AI</a> chat, these widgets can be easily created as the AI is instructed in how to write them.++## Adding new widgets++There are two ways to add widgets to a dashboard:++* Create a child note of any type, the dashboard will automatically pick it up and add it onto the grid.+* From the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.md">Note Tree</a>, drag an existing note onto the dashboard and it will be placed there. This will [clone](../Basic%20Concepts%20and%20Features/Notes/Cloning%20Notes.md) the note into the collection.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Collections/Dashboard_image.png b/docs/User Guide/User Guide/Collections/Dashboard_image.pngnew file mode 100644index 0000000000..6b02e70ca9Binary files /dev/null and b/docs/User Guide/User Guide/Collections/Dashboard_image.png differdiff --git a/docs/User Guide/User Guide/Collections/Geo Map.md b/docs/User Guide/User Guide/Collections/Geo Map.mdnew file mode 100644index 0000000000..a781f472f1--- /dev/null+++ b/docs/User Guide/User Guide/Collections/Geo Map.md@@ -0,0 +1,390 @@+# Geo Map+<figure class="image"><img style="aspect-ratio:1561/1149;" src="Geo Map_image.png" width="1561" height="1149"></figure>++This note type displays the children notes on a geographical map, based on an attribute. It is also possible to add new notes at a specific location using the built-in interface.++## Features++* Add markers on the map, which can be customized with icons, colors and text.+* Search the notes already on the map, and look up places anywhere in the world.+* Turn a place the map already shows into a marker by clicking it.+* Draw paths, areas, rectangles and circles onto the map.+* Display tracks on the map using `.gpx` files.+* Show your own location on the map and follow it as you move.+* 3D view of the map, which displays buildings when using a vector map.++## System requirements++Starting with v0.105.0, the geomap uses MapLibre GL which requires WebGL v1 support. In general, most devices will support it because browsers/Electron can render it in software if needed.++If the map could not be drawn because WebGL could not be initialized, an error message will appear instead of the map (_This map can't be drawn because WebGL isn't available…_).++The button that shows your location is offered only when Trilium is reached over HTTPS, in the desktop application or in the mobile application. Browsers refuse to share the location of a device with a page served over plain HTTP, so on such a server the button does not appear.++## Interaction++* At the top-left there is the search bar. It searches the notes already on the map, and it can also search for places online when you ask it to. While you move through the results of a search, a counter with previous and next buttons appears under it.+* At the bottom-center there is a central toolbar which provides editing features: adding new markers on the map and importing GPX tracks.+* At the bottom-right there are the viewport items:+ * Zoom in/out+ * On mobile these are hidden, use pinch to zoom instead.+ * On desktop, alternatively use the scroll wheel to adjust the zoom.+ * A button that shows your location on the map and follows it (see _Going to your location_ below).+ * Full screen button which focuses the entire map onto the screen, while still allowing for edits.+* At the top-center (on desktop, or left-center on mobile and in split views) there are the drawing tools such as paths, areas, rectangles and circles.+ * When the map is read-only, the toolbar is not shown.++## Creating a new geo map++Right click on an existing note in the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.md">Note Tree</a> and select _Insert child note_ → _Geo Map_.++By default the map will be empty and will show the entire world.++## Repositioning the map++* Click and drag the map in order to move across the map.+* Use the mouse wheel, two-finger gesture on a touchpad or the +/- buttons on the bottom-right to adjust the zoom.++The position on the map and the zoom are saved inside the map note and restored when visiting again the note.++A map that has no position saved yet is framed around the markers it contains when you open it, so they are all in view without having to go looking for them. A map that contains no markers shows the whole world instead.++In practice this applies to maps whose markers were added externally, by a script or through <a class="reference-link" href="../Advanced%20Usage/ETAPI%20(REST%20API).md">ETAPI (REST API)</a>. When you add markers yourself you have already moved the map to reach the place you are marking, and that movement saves a position.++## Going to your location++Press the _Show your location_ button at the bottom-right of the map, beside the zoom buttons. The first time, the browser or the operating system asks whether Trilium may know where the device is. In the desktop application the operating system's location settings decide.++The map then moves to where the device is and marks it with a blue dot. A lighter circle around the dot shows how accurate the position is: a phone with GPS gives a dot on the street, while a computer located through its network connection can give a circle that covers a neighbourhood. The map follows the dot as it moves, and the button stays pressed while it does.++Dragging the map stops it from following. The dot stays and keeps moving, and pressing the button again brings the map back to it. Pressing the button while the map is following turns the dot off.++Click the dot to see its coordinates in the panel a searched place is shown in. From there the position can be kept as a marker (see _Keeping a place as a marker_). Clicking the lighter circle around the dot is a click on the map.++If the position cannot be found, a message says so and the button keeps waiting for one; press it again to stop. If you refuse the permission, the button is disabled until the map is opened again. To allow it after all, change the permission for Trilium in the browser or in the system's location settings.++Your position is not stored in the note, and Trilium does not send it anywhere on its own. Moving the map there does what any other pan or zoom does: the tile provider behind the map's style sees the coordinates of the area now on screen. The map does remember where you left it, as it does after any other movement, so a map you have taken to your location opens there the next time.++## Searching the map++The search bar at the top-left of the map searches in two places. It always searches the notes that are already on the map. It can also search for places online, but only when you ask it to.++### Searching the notes already on the map++Type in the search bar, and the notes on the map are matched by their title as you type. Accents are ignored, both in what you type and in the titles, so `zurich` finds _Zürich Hauptbahnhof_. Each word is searched for on its own, so `hotel paris` finds _Paris Hotel_. Notes without a `#geolocation` attribute are not offered, since there would be nowhere to go. Drawn shapes and GPS tracks are offered, even though they carry no such attribute: selecting one brings the whole shape or route into view.++If more notes match than the list can show, you are offered the ones closest to the area you are viewing.++### Searching for places online++Looking up a place sends what you typed to a third-party service. For this reason, it never happens while you type. Instead, the last row of the result list offers the search. That row reads _Search online for "…"_, with the name of the service below it. The search runs only when you press that row or select it with Enter.++Trilium uses Nominatim, the place search run by the OpenStreetMap Foundation. It needs no account and no API key. Its name is shown on every row that belongs to it: the row that offers the search, the row that says a search is running, and the row that reports that nothing was found or that the service could not be reached.++The search prefers the area you are viewing. Places inside the current view are searched for first and listed above the others. If you search for a shop while looking at your own town, you therefore find the branch in that town, and not one with the same name on another continent. The view is always treated as at least 25 km across, so a search made while zoomed into a single street still covers the town around it.++### Going to a point++If you type or paste coordinates into the search bar, a _Go to_ row is offered above all the other results. Selecting it moves the map to that exact spot and marks it. You can then keep it as a marker, in the same way you keep a place found by searching.++Points are untitled by default; the corresponding note opens with the default name selected so it can be easily replaced. If the map has a <a class="reference-link" href="../Advanced%20Usage/Default%20Note%20Title.md">Default Note Title</a> label, the marker is named by that template instead.++The supported forms are:++* A plain pair, such as `45.9432, 24.9668`. This is what Google Maps and OpenStreetMap both give you when you ask for the coordinates of a place, and it is also what the `#geolocation` attribute holds.+* The `geo:` link that the map itself offers for a place, through the _Open location_ action.+* The address of a place on Google Maps or OpenStreetMap, pasted whole.++A pair that is not a place on Earth, such as `1234, 5678`, is not offered.++### Reading the results++Results are gathered under headings, and each group is ordered by distance from the middle of the map:++* _On this map_: notes that are already on the map, whatever their distance.+* _Nearby_: places found within about 25 km of the view.+* _Far away_: all the other places.++The headings only appear when at least two of the three groups contain something. Every row that has a position shows how far away it is, in kilometres or miles according to your locale. A place found online shows its name on the first line and its address on the second.++### Selecting a result++Selecting a note already on the map moves to its marker and opens the note beside the map, as clicking the marker would.++Selecting a place found online moves the map to it and marks it with a temporary pin. The pin has a different color from the map's own markers. The map is fitted to the area that the place covers, so a country fills the view, while a house is shown at street level. Some places have a boundary, such as a country, a county or a park. When the service reports one, that boundary is outlined under the pin.++A panel then opens with the place's full address and its coordinates: in the top-right corner on desktop, and at the bottom of the map on mobile, where the top is kept for the search bar and the result counter. Pressing the coordinates copies them to the clipboard.++### Keeping a place as a marker++Press _Add as marker_ in that panel to keep the place. A child note is created under the map. It takes the name of the place, as well as the icon, which matches the kind of place it is. Its `#geolocation` attribute is already set. The note opens beside the map, so you can edit it straight away. The temporary pin disappears, because the place is now a marker like any other.++The button is not offered on a map that cannot be edited, where the panel can still be read.++Press the panel's close button, or the Escape key, to send the place away without keeping it. The pin goes with it.++### Stepping through the results++Once you select a result, a counter appears under the search bar, with a previous and a next button. These buttons move through everything the search offered, in the order it was listed. You can therefore compare several results without opening the list again. Pressing the counter itself moves the map back to the current result, which is useful after you have moved the map away from it.++### The keyboard++* **Enter** runs the online search when its row is the one selected, and otherwise moves to the highlighted result. Pressed after a result has been taken, it brings the list back.+* **Escape** closes the result list, and closes the place panel.+* Returning to the search bar reopens the list it was showing.+* The **X** at the end of the bar empties it, which also takes a searched place, its pin and its panel off the map.++## Adding a marker using the map++### Adding a new note using the plus button++1. To create a marker, first navigate to the desired point on the map. Then press the _Add marker_ button at the center-bottom of the map.+2. Once pressed, the map will enter in the insert mode, as illustrated by the notification. Additionally, a preview of the marker will be shown at the cursor position.++ Simply click the point on the map where to place the marker. To cancel, press either the Escape key or press again the _Add marker_ button.+3. Once clicked, the marker will show up on the map and a popup will show to the right with the title already selected to be changed.++### Adding a new note using the contextual menu++1. Right click anywhere on the map, where to place the newly created marker (and corresponding note).+2. Select _Add a marker at this location_.+3. Once clicked on a position on the map, the marker will show up on the map and a popup will show to the right with the title already selected to be changed.++### Adding an existing note from the note tree++1. Select the desired note in the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.md">Note Tree</a>.+2. Hold the mouse on the note and drag it to the map to the desired location.+3. The map should be updated with the new marker.++This works for:++* Notes that are not part of the geo map, case in which a [clone](../Basic%20Concepts%20and%20Features/Notes/Cloning%20Notes.md) will be created.+* Notes that are a child of the geo map but not yet positioned on the map.+* Notes that are a child of the geo map and also positioned, case in which the marker will be relocated to the new position.++> [!NOTE]+> Dragging existing notes only works if the map is in editing mode. See the _Read-only_ section for more information.++### Adding a note from a place the map already shows++When a vector map style is used, the map itself draws the shops, cafés, museums and other places around the area being viewed. Once the map is zoomed in far enough for these to be drawn, they can be clicked:++1. Look for the places drawn in orange. This is the same color used for a place found by searching. These are the places you can click. They are drawn almost solid, while the other places on the map stay a faint grey.+2. Rest the mouse on one of them. Its name appears above it, and the mouse cursor changes to a pointer. The map draws these places as icons without names, so you read a name by hovering over it. If all the names were shown at once, they would crowd out the titles of your own markers.+3. Click it. The same panel used for a place found by searching appears. It shows the name of the place and its coordinates, and a pin is placed on the map.+4. Press _Add as marker_ to keep it. The note is created with the name of the place as its title, and with the icon that matches the kind of place it is.++Places are read from the map data that has already been downloaded, so clicking one does not send anything to the internet.++Some things to keep in mind:++* Places with no name in the map data, such as benches or parking spaces, show no name and cannot be clicked. Clicking them does nothing, just like clicking an empty part of the map.+* The map's own markers come first. If a marker covers a place, clicking it opens the note and not the place.+* This does not work with the raster (OpenStreetMap) style, because its places are part of the map image. It also does not work with the _Neutrino_ style, which draws no places.+* In read-only mode you can still click a place and read it, but you cannot keep it as a marker.++## How the location of the markers is stored++The location of a marker is stored in the `#geolocation` attribute of the child notes:++This value can be added manually if needed. The value of the attribute is made up of the latitude and longitude separated by a comma.++## Repositioning markers++Once a marker is set, it can be repositioned using one of the two ways:++* By right clicking the marker and selecting _Move to another location_.+* By clicking the marker to open the popup and selecting the _Move to another location_ button underneath the title bar.++After clicking the button to move the marker, click at the desired position on the map to replace it. To cancel the operation, press Escape.++> [!NOTE]+> If the map is locked for editing (see below), the map needs to be unlocked before moving the marker.++## Interaction with the markers, tracks or shapes++* Hovering over a marker will display a <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tooltip.md">Note Tooltip</a> with the content of the note it belongs to.+ * Clicking on the note title in the tooltip will navigate to the note in the current view.+* Right-clicking the marker will open a contextual menu (as described below).+* Clicking a marker will focus on the marker and display a dedicated popup with the details. This works regardless of whether the map is editable or not.++### Popup view++When a marker, a [shape](Geo%20Map/Drawing%20shapes.md), or track is clicked, a popup will open to the right which contains the following information:++* The title and icon of the marker, both editable.+* An indicator for the coordinates; clicking it will copy the coordinates to clipboard.+* A button to maximize the popup.+* Buttons to interact with the current item:+ * Open the marker in the same pane, new tab, etc.+ * A button to open the location in a dedicated application (e.g. Google Maps on mobile).+ * Color picker to change the color of the marker.+ * Markers can also be moved, unlike tracks or shapes (which need to be redrawn).+ * Button to remove the marker from the map, which can optionally delete its corresponding note.+ * Removing a marker without deleting the note will only remove its `#geolocation` attribute (case in which the coordinates have to be manually added back in in order to get the note to show on the map again).+ * Similarly, removing a shape will remove its `#geoShape` attribute.+* The <a class="reference-link" href="../Advanced%20Usage/Attributes/Promoted%20Attributes.md">Promoted Attributes</a> of the marker, if any.+* The note's content which can be edited directly from the panel.++To dismiss the popup:++* Press the X button at the top-right of the popup.+* In the map, press anywhere outside the popup.+* Or simply press the Escape key.++When a marker is clicked, the map will automatically adjust the viewport so that the marker is still visible with the popup open. The currently selected marker is shown slightly bigger.++It is possible to switch between markers by clicking on them even when the popup view is already open.++Markers can have <a class="reference-link" href="../Note%20Types/Text/Links/Internal%20(reference)%20links.md">Internal (reference) links</a> between them and clicking on such a link will automatically adjust the viewport and the popup view to the new note.++### Contextual menu++It's possible to press the right mouse button to display a contextual menu.++1. If right-clicking an empty section of the map (not on a marker), it allows to:+ 1. Displays the latitude and longitude. Clicking this option will copy them to the clipboard.+ 2. Open the location using an external application (if the operating system supports it).+ 3. Adding a new marker at that location.+2. If right-clicking on a marker, it allows to:+ 1. Displays the latitude and longitude. Clicking this option will copy them to the clipboard.+ 2. Open the location using an external application (if the operating system supports it).+ 3. Open the note in a new tab, split or window.+ 4. Button to remove the marker from the map, which can optionally delete its corresponding note. Removing a marker without deleting the note will only remove its `#geolocation` attribute (case in which the coordinates have to be manually added back in in order to get the note to show on the map again).+3. Shapes can also be right-clicked and the menu is similar to markers except they cannot be moved.++### Icon and color++<figure class="image image-style-align-right image_resized" style="width:47.42%;"><img style="aspect-ratio:885/321;" src="3_Geo Map_image.png" width="885" height="321"></figure>++The markers will have the same icon as the note.++It's possible to add a custom color to a marker by assigning them a `#color` attribute such as `#color=green`.++This also applies to tracks and [shapes](Geo%20Map/Drawing%20shapes.md).++> [!NOTE]+> The color as it will be displayed on the map might be slightly tinted in order to make the text or icon more legible.++### Adding the coordinates manually++Searching for the place is usually quicker (see _Searching the map_ above). The steps below remain useful for a coordinate that is already to hand, or for a place the search cannot find.++In a nutshell, create a child note and set the `#geolocation` attribute to the coordinates.++The value of the attribute is made up of the latitude and longitude separated by a comma.++#### Adding from Google Maps++1. In Google Maps, on the web:+ 1. Look for a desired location, right click on it and a context menu will show up.+ 2. Simply click on the first item displaying the coordinates and they will be copied to clipboard.+2. In Trilium, create a child note under the map.+3. Then paste the value inside the text box into the `#geolocation` attribute of a child note of the map (don't forget to surround the value with a `"` character).++#### Adding from OpenStreetMap++Similarly to the Google Maps approach:++1. Go to any location on openstreetmap.org and right click to bring up the context menu. Select the _Show address_ item.+2. The address will be visible in the top-left of the screen, in the place of the search bar. Select the coordinates and copy them into the clipboard.+3. Simply paste the value inside the text box into the `#geolocation` attribute of a child note of the map and then it should be displayed on the map.++## Drawing shapes on the map++See the dedicated <a class="reference-link" href="Geo%20Map/Drawing%20shapes.md">Drawing shapes</a> page.++## Adding GPS tracks (.gpx)++<figure class="image"><img style="aspect-ratio:1566/1155;" src="1_Geo Map_image.png" width="1566" height="1155"></figure>++Trilium can display GPS tracks on the geo map, in the form of `.gpx` files.++To add a track, either:++1. Drag & drop a `.gpx` file inside the geo map in the note tree.+ 1. In order for the file to be recognized as a GPS track, it needs to show up as `application/gpx+xml` in the _File type_ field.+2. Press the _Add a GPS track from a GPX file_ which will directly prompt for a GPX file and import it as a subnote of the collection.++When going back to the map, the track should now be visible.++The starting point of the track will be displayed as a marker, with the name of the note underneath. The start marker will also respect the icon and the `color` of the note. The end marker is displayed with a distinct icon.++If the track file contains multiple tracks, they will all be displayed as well as markers. Trilium will also split a single track that happens to have non-continuous points.++If the GPX contains waypoints, they will also be displayed, including their names.++When the track is clicked, the entire route is brought into view, as well as the right popup will indicate details about the track such as distance, duration and the elevation map. This information is also displayed when clicking the `.gpx` note itself.++When clicking on the markers of a track (whether it's the start or stop builtin markers, or custom markers that are part of the track), only that marker is brought into view, as opposed to the entire route.++## Read-only mode++When a map is [read-only](../Basic%20Concepts%20and%20Features/Notes/Read-Only%20Notes.md) all editing features will be disabled such as:++* The add button at the bottom of the map.+* Repositioning markers.+* Editing from the contextual menu (removing locations or adding new items).+* Keeping a place as a marker, whether you found it by searching or clicked it on the map. You can still search and click, and you can still look at a place and copy its coordinates.+* Drawing [shapes](Geo%20Map/Drawing%20shapes.md).++To set a map as read-only, go to <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20buttons.md">Note buttons</a> → _Editable_ → _Read-only_ (on the new layout, or in Basic Properties on the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Ribbon.md">Ribbon</a> for the old layout).++## Configuration++### Map Style++The styling of the map can be adjusted in the <a class="reference-link" href="Collection%20Properties.md">Collection Properties</a> or manually via the `#map:style` attribute.++The geo map comes with two different types of styles:++* Raster styles+ * For these styles the map is represented as a grid of images at different zoom levels. This is the traditional way OpenStreetMap used to work.+ * Zoom is slightly restricted.+ * Currently, the only raster theme is the original OpenStreetMap style.+* Vector styles+ * Vector styles are not represented as images, but as geometrical shapes. This makes the rendering much smoother, especially when zooming and looking at the building edges, for example.+ * The map can be zoomed in much further.+ * These come in various styles that are both light (Colorful, Graybeard, Neutrino) and dark (Eclipse, Shadow).+ * The vector styles come from [VersaTiles](https://versatiles.org/), a free and open-source project providing map tiles based on OpenStreetMap.+ * The VersaTiles layers also provide 3D building information (see below).++The default theme is Versatiles Colorful (vector).++#### 3D view with buildings++<figure class="image"><img style="aspect-ratio:2727/1642;" src="2_Geo Map_image.png" width="2727" height="1642"></figure>++Trilium v0.105.0 introduces a 3D view, courtesy of MapLibre GL. To enter 3D mode, simply press the corresponding button at the bottom-right of the map or press Ctrl and drag across the map.++The buildings will only appear from zoom 14 onwards to avoid lag.++> [!NOTE]+> To get 3D buildings, make sure you are using the _VersaTiles_ styles which provide the building informatia via the `versatiles-shortbread` source.++### Custom map style / tiles++Starting with v0.102.0 it is possible to use custom tile sets, but only in raster format.++To do so, manually set the `#map:style` [label](../Advanced%20Usage/Attributes/Labels.md) to the URL of the tile set. For example, to use Esri.NatGeoWorldMap, set the value to [`https://server.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/tile/{z}/{y}/{x}`.](https://server.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/tile/%7Bz%7D/%7By%7D/%7Bx%7D.)++Additionally:++* Hi-DPI tiles are supported via the `{r}` placeholder.+* To mark the custom style as dark (which affects the styling of the UI), apply the `map:darkStyle` label. This attribute also overrides builtin themes.++> [!NOTE]+> For a list of tile sets, see the [Leaflet Providers preview](https://leaflet-extras.github.io/leaflet-providers/preview/) page. Select a desired tile set and just copy the URL from the _Plain JavaScript_ example.++Custom vector map support is planned, but not yet implemented.++### Other options++The following options can be configured either via the <a class="reference-link" href="Collection%20Properties.md">Collection Properties</a>, by clicking on the settings (Gear icon). Alternatively, each of these options also have a corresponding [label](../Advanced%20Usage/Attributes/Labels.md) that can be set manually.++* Scale, which illustrates the scale of the map in either kilometers or miles in the bottom-left of the map.+ * The unit is determined by the _Formatting locale_ option in _Language & Region_.+* The name of the markers is displayed by default underneath the pin on the map. Since v0.102.0, it is possible to hide these labels which increases the performance and decreases clutter when there are many markers on the map.+* v0.105.0 also introduces a feature called _Group nearby markers_ which will cluster multiple markers together at low zoom.+ * The clusters display the number of items they contain. The color also changes based on the count.+ * Clicking on a cluster will automatically zoom in so that the individual markers that make up the cluster are now visible.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Collections/Geo Map/Drawing shapes.md b/docs/User Guide/User Guide/Collections/Geo Map/Drawing shapes.mdnew file mode 100644index 0000000000..3280e4e6db--- /dev/null+++ b/docs/User Guide/User Guide/Collections/Geo Map/Drawing shapes.md@@ -0,0 +1,43 @@+# Drawing shapes+The following shapes can be drawn on the map: a path, an area, a rectangle or a circle.++Unlike markers, the title of the shape is not displayed directly on the map but it will be displayed when hovered.++The shape will also be drawn in the [color of the note](../../Basic%20Concepts%20and%20Features/Notes/Note%20Icons%20%26%20Colors.md), if set.++## Drawing a shape on the map++To draw a shape, use the toolbar that appears in the top-center area on desktop and on the left-center on mobile and in split view.++Once a shape is drawn, it cannot be moved or modified. To do so, simply remove the shape and draw another one instead.++### Drawing a path or an area++1. Press the _Draw a path on the map_ or _Draw an area on the map_ button. The button stays held down while the tool is armed, and a notification describes what to do.+2. Click on the map once for each point. The shape is previewed as it grows.+3. Finish it by pressing <kbd>Enter</kbd>. A path can also be finished by clicking its last point again, and an area by clicking the corner it started from. A path needs at least two points and an area at least three.++### Drawing a rectangle or a circle++1. Press the _Draw a rectangle on the map_ or _Draw a circle on the map_ button.+2. Click once to set the first corner, or the center of the circle. Click a second time at the opposite corner, or at the distance the circle should reach.+3. Instead of two clicks you can drag from one to the other. This also works on mobile and other touch-based apps.++### Finishing and cancelling++To give up on a shape while drawing it, press <kbd>Escape</kbd> or press the tool's button again. Whatever has been drawn so far is discarded.++The tool is deactivated once a shape is finished, so drawing a second shape requires another button press.++## Interaction++Once a shape is created:++* Clicking a shape opens the standard panel which allows changing the title, the content and with buttons to open the note or remove it.+ * When clicking, a marker takes priority over the shape.+* Right-clicking a shape opens a contextual menu similar to the one for markers, which allows opening the corresponding note or removing the shape.+* Typing in the map's search bar finds shapes by their title, as it does markers. Selecting one brings the whole shape into view.++## How shapes are represented++Shapes are represented quite similarly to markers, which means each shape is a note. The information about the same is stored using a [label](../../Advanced%20Usage/Attributes/Labels.md) called `geoShape`.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Collections/Geo Map_image.png b/docs/User Guide/User Guide/Collections/Geo Map_image.pngnew file mode 100644index 0000000000..d6df259bf2Binary files /dev/null and b/docs/User Guide/User Guide/Collections/Geo Map_image.png differdiff --git a/docs/User Guide/User Guide/Collections/Grid View.md b/docs/User Guide/User Guide/Collections/Grid View.mdnew file mode 100644index 0000000000..4b98b50454--- /dev/null+++ b/docs/User Guide/User Guide/Collections/Grid View.md@@ -0,0 +1,27 @@+# Grid View+<figure class="image"><img style="aspect-ratio:990/590;" src="Grid View_image.png" width="990" height="590"></figure>++This view presents the child notes in a grid format, allowing for a more visual navigation experience.++Each tile contains:++* The title of a note.+* A snippet of the content.+* For empty notes, the sub-children are also displayed, allowing for quick navigation.++Depending on the type of note:++* For <a class="reference-link" href="../Note%20Types/Text.md">Text</a> notes, the text can be slightly scrollable via the mouse wheel to reveal more context.+* For <a class="reference-link" href="../Note%20Types/Code.md">Code</a> notes, syntax highlighting is applied.+* For <a class="reference-link" href="../Note%20Types/File.md">File</a> notes, a preview is made available for audio, video and PDF notes.+* If the note does not have a content, a list of its child notes will be displayed instead.++The grid view is also used by default in the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Notes/Note%20List.md">Note List</a> of every note, making it easy to navigate to children notes.++### Creating a new table++Right click on an existing note in the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.md">Note Tree</a> and select _Insert child note_ and look for _Grid View_.++## Configuration++Unlike most other view types, the grid view is not actually configurable.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Collections/Grid View_image.png b/docs/User Guide/User Guide/Collections/Grid View_image.pngnew file mode 100644index 0000000000..8de2914c1cBinary files /dev/null and b/docs/User Guide/User Guide/Collections/Grid View_image.png differdiff --git a/docs/User Guide/User Guide/Collections/Kanban Board.md b/docs/User Guide/User Guide/Collections/Kanban Board.mdnew file mode 100644index 0000000000..48ad38d081--- /dev/null+++ b/docs/User Guide/User Guide/Collections/Kanban Board.md@@ -0,0 +1,446 @@+# Kanban Board+The Board view lets you arrange subnotes as cards on a Kanban board.++## Creating a Kanban board++Right-click an existing note in the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.md">Note Tree</a>, select **Insert child note**, and look for **Kanban Board**.++## How it works++When you first create a collection of the _Board_ type, a few subnotes are created, each with a `#status` label set. The board then groups each note by the value of its status attribute.++Notes are displayed recursively, so even grandchildren and more deeply nested notes will be displayed. However, unlike the <a class="reference-link" href="Table.md">Table</a>, the notes are not displayed hierarchically.++## Working with columns++### Creating columns++You can create a new column by pressing the <span class="tn-icon bx bx-plus"></span>**Add column** button located after the last column.++Enter the new name (which must not match another column), optionally select an icon by pressing the circle at the start of the text box, and then press the (+) button or <kbd>Enter</kbd>. Click or tap outside the text box, or press <kbd>Esc</kbd>, to dismiss it.++### Reordering columns++The order of the columns can be changed at any time. There are several ways to do this:++* **Using touch or a mouse:** Touch and hold the column header, or click and hold it with the mouse. Drag the column left or right until it reaches the desired location, and then release it.+* **Using the keyboard:** While the keyboard focus is anywhere inside the column, you can use these key combinations. If the column header itself is focused, you can omit <kbd>Alt</kbd>:+ * <kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>Right</kbd>: Move the column to the right.+ * <kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>Left</kbd>: Move the column to the left.+ * <kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>Home</kbd>: Make it the first column.+ * <kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>End</kbd>: Make it the last column.+* **Using the column menu:** Open the column menu and use the <span class="tn-icon bx bx-horizontal-left"></span> **Move column** submenu.++### Renaming and recoloring columns++To change the name of a column, open the column menu and select <span class="tn-icon bx bx-edit-alt"></span> **Rename column**, or press <kbd>F2</kbd> while the column header is selected.++From the same menu, you can tint the column with a different color by using the color palette at the bottom of the menu.++### Collapsing and expanding columns++#### Collapsing++A column can be collapsed (minimized) to occupy less space on the screen and make the board look less cluttered. This is particularly useful for columns that are not frequently used, or when you want to focus on only a few columns and keep the rest out of sight.++To collapse a column:++* **Using a mouse:** Double-click the column header.+* **Using touch:** Tap the column header, and then press the <span class="tn-icon bx bx-collapse-horizontal"></span> button on the side toolbar.+* **Using the keyboard:** Focus the column header, and then press <kbd>Space</kbd>.++Alternatively, you can use the <span class="tn-icon bx bx-collapse-horizontal"></span> **Collapse column** command from the column menu.++Once a column is collapsed, its cards are no longer visible, but the column can still receive cards from other columns:++* **Drop cards onto a collapsed column:** The cards will be moved to the column (at the bottom if manual sorting is enabled).+* **Hold cards over a collapsed column for a few seconds:** The column will expand, allowing you to drop the cards at the desired position (if manual sorting is enabled) or peek at the other cards before deciding whether to drop them.+* **Move a card to a collapsed column using the keyboard:** The column will temporarily expand to reveal the moved card. You can then continue moving the selected cards up or down, or to another column.++Collapsed columns can still be reordered, and their menus remain available.++#### Expanding++You can restore a collapsed column so that its content is visible again in the following ways:++* **Using a mouse:** Click the collapsed column.+* **Using touch:** Tap the collapsed column, and then press the <span class="tn-icon bx bx-expand-horizontal"></span> button on the side toolbar.+* **Using the keyboard:** Move the focus to the collapsed column, and then press <kbd>Space</kbd>.++#### Keeping a column collapsed++By default, once a column is expanded, it remains expanded. However, you can configure a column to collapse again after you finish working with it. To activate this behavior, open the column menu and check <span class="tn-icon bx bx-lock-alt"></span> **Keep the column collapsed**.++A column configured to remain collapsed will expand like any other collapsed column, but only temporarily, until another column is focused.++#### Collapsing and expanding all columns++You can expand or collapse all columns at once by using the <span class="tn-icon bx bx-collapse-alt"></span> (collapse) and <span class="tn-icon bx bx-expand-alt"></span> (expand) buttons. On the desktop, these buttons are located at the bottom of the screen; on the mobile interface, they are in the header.++### Sorting cards within a column++By default, the cards in a column are sorted manually by moving them up and down. You can also keep them sorted automatically, using customizable criteria for each column. To customize the sorting options, open the **column menu** → **Sort**. The following options are available:++* <span class="tn-icon bx bx-collection"></span> **Board's default**: Use the default sorting order (initially manual for new boards).+* <span class="tn-icon bx bx-move-vertical"></span> **Manually**: Sort cards by manually moving them up and down.+* <span class="tn-icon bx bx-text"></span> **Title**: Sort cards by title.+* <span class="tn-icon bx bx-calendar-plus"></span> **Creation date & time**: Sort cards by the creation date and time of the note represented by each card. If a card was created from an existing note, the date and time will match the original creation date and time of that note, not when the card was added to the board.+* **Any custom attribute**: Any card attribute (see <a class="reference-link" href="../Advanced%20Usage/Attributes.md">Attributes</a>) can be used as a sorting criterion.+* <span class="tn-icon bx bx-sort-up"></span> **Ascending**: Sort from smallest to largest (A to Z, 0 to 9, or oldest to newest).+* <span class="tn-icon bx bx-sort-down"></span> **Descending**: Sort in reverse order, from largest to smallest.++> [!IMPORTANT]+> The card order you set is preserved after you switch away from manual sorting. When you switch back to manual sorting, the cards will be in the same order in which you arranged them.++#### How card attributes are sorted++When cards are sorted by an attribute, they are ordered according to the following rules:++| Attribute type | Sort order (ascending) |+| --- | --- |+| Text, Multi-line text, URL, Email, Phone | A to Z, 0 to 9 |+| Number | lowest → greatest |+| Date, Date & time | oldest → newest |+| Time | earliest hour (closest to 0) → latest hour (closest to 24) |+| Boolean | unchecked → checked |+| Select | The order in which the options are declared. <br>For example, a select attribute declared with “Low”, “Medium”, and “High” options will be sorted as follows: Low → Medium → High. |+| Color | Grays → colors. Colors are ordered by their color-wheel [hue](https://en.wikipedia.org/wiki/Hue) angle (from 0° to 360°). |++Relation attributes are ordered according to the title of the target note.++Cards with attributes that have no value set are always sorted at the end of the column, regardless of whether the sort order is ascending or descending. If an attribute holds more than one value, only the first value is used for sorting.++#### Configuring the default sorting options++Every new column uses the **Board's default** sorting option, which is initially set to manual sorting on new boards. However, the default can be changed to any other sorting criterion and direction. To configure it, go to **Note menu** → **Board properties** → **Default card order** (under the **General** section).++Once the default is changed, all columns set to the **Board's default** sorting option will follow the new sorting options.++Columns using a sorting option other than **Board's default** will not be affected by the new default. To override all columns so that they use the default sorting options, use the **Reset sorting options to default for all columns** command in Board properties.++> [!WARNING]+> Using the `#sorted` attribute on Kanban boards **is no longer recommended**, because it applies to every column and prevents manual sorting. Instead, use `#sortColumns`, which is designed exclusively for board collections and can take one of the following values: `title`, `creationDate`, or `attr:_<attribute name>_`, for example, `#sortColumns=attr:dueDate`. Using the `#sortColumnsDescending` label will switch to descending order.++### Setting a limit++For each column, you can limit the number of cards it contains (also known as a WIP limit). Once the limit is exceeded, the column displays a visual warning to indicate that it is over its limit.++To enable the limit, go to the column menu → <span class="tn-icon bx bx-tachometer"></span> **Set limit**, and then:++* Turn on the **Warn for exceeding the column capacity** toggle.+* Enter the desired limit in the **Maximum number of cards in the column** text box.+* Press the **Set limit** button.++A column that has reached its limit can still accept new cards. Blocking new cards is not supported and most likely never will be, due to the way Trilium works: cards are regular notes, and the attributes used to group them into columns can be set from anywhere in the app, outside the board control. As a result, enforcing the limit would not be consistent.++### Archiving a column++If you want to hide a column from the board without deleting it, you can archive it by opening the **column menu** → <span class="tn-icon bx bx-archive-in"></span> **Archive column**. Archiving a column does not set the archived flag (see <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Notes/Archived%20Notes.md">Archived Notes</a>) on the notes corresponding to its cards.++To show archived columns again, go to <span class="tn-icon bx bx-cog"></span> **Collection options** and toggle <span class="tn-icon bx bx-archive-in"></span> **Show archived notes**. Archived columns will appear faded. To restore one, open its column menu and select <span class="tn-icon bx bx-archive-out"></span> **Unarchive column**.++### Deleting a column++You can delete a column by opening the **column menu** → <span class="tn-icon bx bx-trash"></span> **Delete column**, or by pressing <kbd>Delete</kbd> when a column header is focused, and then confirming. This removes the column from the board and unsets the grouping attribute for each note represented by a card in that column. If the column contains cards, the confirmation also offers to delete their notes instead of keeping them.++The inbox column is not deleted this way. Its menu entry is <span class="tn-icon bx bx-trash"></span> **Remove inbox column**, and <kbd>Delete</kbd> on its header hides the inbox without changing any card.++### The inbox column++The inbox column is a special column containing cards that are not assigned to another column. It is particularly useful when you switch an existing collection containing child notes to a board collection. The inbox column turns all child notes into cards that you can quickly distribute among the other columns. It can also act as a backlog where you can keep new cards that might eventually become part of the board.++The inbox column is hidden by default. To show it, go to <span class="tn-icon bx bx-cog"></span> **Collection options** and toggle **Show inbox column**. The inbox column is distinguishable by its transparent background. It is always the first column and cannot be moved. It does not support a card limit. Otherwise, it operates like a regular column: its title, icon, and color can be changed; it can be sorted manually or automatically; and it can be collapsed.++You can also show the inbox column by applying the `#enableInboxColumn` label (read more about <a class="reference-link" href="../Advanced%20Usage/Attributes.md">Attributes</a>) to the board note.++Optionally, the inbox column can also list nested notes from the board collection's subtree. To enable this, open the **column menu** and check <span class="tn-icon bx bx-subdirectory-right"></span> **Include nested notes**.++### Changing the width of columns++There are three predefined widths for board columns: narrow (default), medium, and wide. To change the width, open the **Note menu** → **Board properties** → **Column width** (under the **General** section). This option applies to every column on the board, except in the mobile version.++The same option is also available through the `#boardCardWidth` label (read more about <a class="reference-link" href="../Advanced%20Usage/Attributes.md">Attributes</a>) on the board note, which accepts “`narrow`”, “`medium`”, or “`wide`” as its value.++You can also redefine these three widths by using custom app CSS (read more about <a class="reference-link" href="../Theme%20development/Custom%20app-wide%20CSS.md">Custom app-wide CSS</a>) and assigning the desired pixel values as follows:++```+#trilium-app {+ --board-column-width-narrow: 275px;+ --board-column-width-medium: 325px;+ --board-column-width-wide: 400px;+}+```++## Working with cards++### Creating a new card++To create a new card, press the <span class="tn-icon bx bx-plus"></span>**New card** button located at the bottom of each column. To create a new card above or below a specific card, right-click or hold that card, and then select <span class="tn-icon bx bx-list-plus bx-flip-vertical"></span> **Insert new above** or <span class="tn-icon bx bx-list-plus"></span> **Insert new below** from the context menu. Alternatively, press <kbd>Shift</kbd> + <kbd>Enter</kbd> to create a new card above the focused card, or <kbd>Enter</kbd> to create one below it.++Next, type the title of the new card, and then press the <span class="tn-icon bx bx-plus-circle"></span> button or <kbd>Enter</kbd> to complete it. Tap or click anywhere outside the text box to dismiss it. You can also select a different icon and card template. To learn more about card templates, see Card templates (learn more about <a class="reference-link" href="../Advanced%20Usage/Templates.md">Templates</a>).++After the card is created, you can tap or click it, or press <kbd>Space</kbd>, to edit the note content.++When using the <span class="tn-icon bx bx-plus"></span> **New card** button, cards are always created at the end of the column. To create the card at the top of the column, right-click or hold the <span class="tn-icon bx bx-plus-circle"></span> button and select <span class="tn-icon bx bx-vertical-top"></span> **Create at top**. When using keyboard shortcuts, focus the column header and press <kbd>Enter</kbd> to create a new card at the start of the column, or <kbd>Shift</kbd> + <kbd>Enter</kbd> to create one at the end.++### Adding an existing note as a card++Any note in your knowledge base can be represented as a card on a board. To add an existing note to your board, create a new card but do not enter a title. Instead, press the <span class="tn-icon bx bx-folder-open"></span> button. Alternatively, use the <span class="tn-icon bx bx-folder-open"></span> **Add an existing note as a card** command from the column menu.++In the dialog that opens, search for the note by name, and then press the **Add to column** button to insert it. Alternatively, you can drag any note from the tree and drop it at the desired position on the board.++If the target note is already in the board collection's subtree, it will already be listed in the **inbox column**.++> [!IMPORTANT]+> Notes added to the board are cloned, not duplicated. This means that changes to their titles, content, and attributes on the board are reflected in their original locations as well. Learn more about cloned notes.++### Selecting multiple cards++When working with a board, you may need to perform operations on multiple cards at once, such as moving them to another column, setting attributes or colors, deleting them, or archiving them.++You can select multiple cards in the following ways:++* **Using a mouse and keyboard:**+ * To add a card to the selection, hold <kbd>Ctrl</kbd> and click the card. Repeat this for other cards until all the desired cards are selected. Clicking a selected card again while holding <kbd>Ctrl</kbd> will deselect it.+ * If the cards you want to select form a continuous sequence within a column, hold <kbd>Shift</kbd>, click the first card in the sequence, and then click the last card.+ * Press <kbd>Esc</kbd> to clear the selection.+* **On mobile:**+ 1. To enter selection mode, tap the <span class="tn-icon bx bx-select-multiple"></span> button at the top of the screen. A selection toolbar will appear in the header, displaying “0 cards selected”.+ 2. Tap the cards you want to select. If you tap a selected card again, it will be deselected. To select all cards in a column, press the <span class="tn-icon bx bx-list-check"></span> button on the selection toolbar. To clear the selection, press the <span class="tn-icon bx bx-x"></span> button.+ 3. Use the side toolbar to apply actions to the selected cards.+* **Using only the keyboard:**+ * To add the currently focused card to the selection, press <kbd>Ctrl</kbd> + <kbd>Space</kbd>. Repeat this for the other cards you want to select. Pressing <kbd>Ctrl</kbd> + <kbd>Space</kbd> again on a selected card will deselect it.+ * To select a continuous sequence of cards within a column, hold <kbd>Shift</kbd> and use the <kbd>Up</kbd> and <kbd>Down</kbd> arrow keys to expand or shrink the selection.+ * Press <kbd>Esc</kbd> to clear the selection.++### Moving cards between columns++To move one or more cards to another column, use one of the following methods:++#### Using touch or a mouse++Touch and hold the card, or click and hold it with the mouse, and then drag it to the desired column. If the column uses manual sorting, you can also position the card relative to the other cards.++> [!TIP]+> To drag a card outside the board, for example to the note tree, another split, or another window, hold <kbd>Ctrl</kbd> and then start dragging.++If the target column is collapsed, you can drop the card onto its header to move it into that column (at the end if manually sorted), without expanding it. However, if you want to reveal its cards before dropping, hold the card over the column for a few seconds; the column will then expand.++> [!TIP]+> **You can quickly drop a card at the start or end of a column.**+>+> Drop the card above the column while the “Drop as the first card” hint is displayed to make it the first card in that column. Alternatively, drop it below the column while the “Drop as the last card” hint is displayed to make it the last card.++#### Using the keyboard++You can also use keyboard shortcuts to move the selected card or cards between columns:++* <kbd>Ctrl</kbd> + <kbd>Right</kbd>: Move to the next column.+* <kbd>Ctrl</kbd> + <kbd>Left</kbd>: Move to the previous column.+* <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Right</kbd>: Move to the last column.+* <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Left</kbd>: Move to the first column.++#### Using the context menu++To quickly move a card to another column, open the card's context menu and select the destination column. The menu lists the first seven columns; on a wider board, the remaining ones are grouped under **More…**.++### Reordering cards within a column++Cards within a column can be freely reordered unless the column uses a sorting option other than manual. To reposition a card, drag it as described in the **Moving cards between columns** section and drop it at the desired position.++Alternatively, you can use keyboard shortcuts to move the selected card or cards:++* <kbd>Ctrl</kbd> + <kbd>Up</kbd>: Move up.+* <kbd>Ctrl</kbd> + <kbd>Down</kbd>: Move down.+* <kbd>Ctrl</kbd> + <kbd>Home</kbd>: Move to the top of the column.+* <kbd>Ctrl</kbd> + <kbd>End</kbd>: Move to the end of the column.++If multiple cards are selected, the keyboard shortcuts work only if the selection consists of a continuous sequence of cards.++### Editing a card++Every card on a board is a regular note. To edit the note associated with a card, click or tap the card, or press <kbd>Space</kbd> when the card is selected. The note will open in a Quick Edit dialog, where you can modify it. You can also open the note in a new tab, split, or window by using the <span class="tn-icon bx bx-link-external"></span> **Open note** submenu in the card's context menu. To open the note in a new tab on the desktop version, you can also click or tap the <span class="tn-icon bx bx-link-external"></span> **Open note** menu item directly, without opening its submenu.++To change the title or icon of a card, use one of the following methods:++* **Using a mouse:** Place the mouse pointer over the card, and then click the <span class="tn-icon bx bx-rename"></span> button.+* **On mobile:** Hold the card until the side toolbar appears, and then tap the <span class="tn-icon bx bx-rename"></span> button.+* **Using the keyboard:** Select a card, and then press <kbd>F2</kbd>.+* **Using the context menu:** Open the card's context menu and select <span class="tn-icon bx bx-rename"></span> **Edit title & icon**.++You can then enter a new name and select another icon. Click or tap anywhere outside the card, or press <kbd>Enter</kbd>, to apply the change. Press <kbd>Esc</kbd> to discard the changes.++Each card can be tinted with a different color. Open the card's context menu and select the desired color. If no color is assigned, the card inherits the column color.++> [!IMPORTANT]+> The title, icon, and color of a card are the same as those of the corresponding note. If that note exists in multiple locations in the tree, any change to its title, icon, or color on the board will apply in those locations as well, not only on the board.++### Archiving a card++A card can be hidden from the board without deleting it by using the <span class="tn-icon bx bx-archive-in"></span> **Archive note** command from the card's context menu.++To show archived cards again, go to <span class="tn-icon bx bx-cog"></span> **Collection options** and toggle <span class="tn-icon bx bx-archive-in"></span> **Show archived notes**. Archived cards will appear faded. To restore one, open its context menu and select <span class="tn-icon bx bx-archive-out"></span> **Unarchive note**.++> [!WARNING]+> Archiving a card sets the `#archived` flag on its note. If the note exists in multiple locations in the tree, it will appear archived in those locations as well. Read more about <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Notes/Archived%20Notes.md">Archived Notes</a>.++### Deleting a card++You can remove one or more cards from the board and delete their associated notes by using the <span class="tn-icon bx bx-trash"></span> **Delete note…** command from the card's context menu, or by pressing <kbd>Shift</kbd> + <kbd>Delete</kbd>. On mobile, hold the card until the side toolbar appears, and then tap the <span class="tn-icon bx bx-trash"></span> button.++#### Removing a card from the board without deleting the note++To remove a card from the board's columns while keeping its note, open the card's context menu and select <span class="tn-icon bx bx-task-x"></span> **Remove from board**, or press <kbd>Delete</kbd>. On mobile, hold the card until the side toolbar appears, and then tap the <span class="tn-icon bx bx-task-x"></span> button.++This command is not available when the inbox column is enabled. Instead, drag the card to the inbox column to achieve the same result.++The note remains in the board collection but is not assigned to any column. To see it on the board again, enable the inbox column.++> [!NOTE]+> Under the hood, removing a card simply unsets the note's grouping attribute.++### Working with custom card attributes++By default, the face of a card displays a minimal set of information: the title, icon, and color. In some cases, this may not provide enough useful information at a glance. You can extend the card to display extra information, called card attributes, such as a due date, priority, completion status, or any other information you need. Card attributes use the same principles as <a class="reference-link" href="../Advanced%20Usage/Attributes/Promoted%20Attributes.md">Promoted Attributes</a>.++#### Creating a new attribute++To create a new attribute, follow these steps:++1. Go to **Note menu** → **Board properties**, find the **Card attributes** section, and then press the <span class="tn-icon bx bx-plus"></span> **Create a new attribute** button.+2. Enter a name for the attribute. This is the internal name used by Trilium, so do not use spaces or special characters.+3. Select a type (text, number, boolean, and so on).+4. Set the display name. This is the name shown on the card.+5. Press **Save & close**.++> [!NOTE]+> For each newly created attribute, Trilium creates an attribute definition on the board collection note. For an attribute to be displayed on the face of a card, it must be declared as inheritable and promoted on the board note.++Here is an example of the attributes you can define for a typical Kanban board used to track tasks:++| Attribute name | Attribute type | Attribute display name |+| --- | --- | --- |+| dueDate | Date & Time | Due date |+| priority | Select (options: Low, Medium, High, Urgent) | Priority |+| done | Boolean | Done |++#### Modifying the values of custom attributes++To set the value of a custom attribute, click or tap the card, and then enter or select the desired value in the dialog header.++For attributes of the “select” or “boolean” type, you can quickly change the value by using the card's context menu under the **Attributes** section.++#### Reordering, hiding, redefining, and deleting custom attributes++Go to **Note menu** → **Board properties**. Under the **Card attributes** section, you can:++* Hold the **\=** handle shown beside an attribute, and then drag the item up or down to reorder the attributes. This determines the order in which the attributes are displayed on the card.+* Turn off the toggle to hide an attribute from the card's face. The attribute remains available when you edit the card. For the current grouping attribute, the toggle is disabled.+* Press the <span class="tn-icon bx bxs-edit"></span> button to modify the definition of an attribute.+* Press the <span class="tn-icon bx bx-trash"></span> button to delete the attribute and all its values from every note in the board collection.++### Managing card templates++When you create a new card, Trilium offers four templates by default: **Text**, **Markdown**, **Canvas**, and **Spreadsheet**. You can customize this list to include other note types or custom templates with predefined placeholder content and prefilled card attributes.++To customize the card templates, go to **Note menu** → **Board properties** and find **Card templates**. Here you can:++* Include a note type or note template already created in your knowledge base by pressing the <span class="tn-icon bx bx-list-plus"></span> **Add existing template** button and then selecting the desired note type or template.+* Create a new template by pressing the <span class="tn-icon bx bx-plus"></span> **Create a new template** button. The template editor will open, where you can define the icon, title, default attribute values, and default content. The note template will be created as a child of the board collection.+* Press the <span class="tn-icon bx bx-x"></span> button to remove a template from the list. The template is removed only from the list, not deleted from your knowledge base. You can add it again using <span class="tn-icon bx bx-list-plus"></span> **Add existing template**.+* Press the <span class="tn-icon bx bx-dots-vertical-rounded"></span> button to open a dropdown that lets you edit, open in a new window, duplicate, or delete a template. This button is visible only for custom note templates.+* Hold the **\=** handle shown beside a template, and then drag the item up or down to reorder the templates. This determines the order in which templates are listed in the template dropdown when you create a new card. You can move the most frequently used templates to the top for faster access.++### Grouping cards++On a board, cards are grouped into columns. The column to which a card belongs is determined by the value of the **grouping attribute**, which is a regular attribute of the card's note.++By default, boards use the **Status** attribute as the grouping attribute. When you move a card to a column called “Waiting on Customer”, the card's Status attribute is set to “Waiting on Customer”.++> [!NOTE]+> Under the hood, the Status attribute is declared on the board collection note with the name `status`. It is a select-type attribute that is inheritable and promoted. Each select option becomes a column, and each new column created on the board extends the list of options.++#### Creating a new grouping attribute++To quickly create a new grouping attribute:++1. Open the <span class="tn-icon bx bx-category-alt"></span> **Group by** dropdown in the board header and select <span class="tn-icon bx bx-plus"></span> **Create a new attribute**.+2. Fill in the **Name** field. This is used internally by Trilium, so do not use spaces or special characters.+3. Enter the **Display name**. This is the attribute name shown in the dropdown list.+4. Press **Save & close**.++> [!TIP]+> Because the grouping attribute is a regular card attribute, you can also create it in **Board properties**. Make sure you set the attribute type to “select”.++#### Switching the grouping attribute++Switching the grouping attribute lets you view your cards by priority, category, or any other custom grouping attribute. You can switch the grouping attribute at any time by using the <span class="tn-icon bx bx-category-alt"></span> **Group by** dropdown in the board header. You can also change it using the `#board:groupBy=<_attribute name_>` label.++> [!WARNING]+> The order of cards in manually sorted columns corresponds to their positions within the board collection subtree. This means that the card order is shared across all views, regardless of the grouping attribute. Reordering notes in one view will also reorder them in other views that use a different grouping attribute.++#### Deleting a grouping attribute++To delete a grouping attribute, go to **Note menu** → **Board properties**, find the attribute under the **Card attributes** section, and press the corresponding <span class="tn-icon bx bx-trash"></span> button.++#### Grouping by relations++A more advanced use case is grouping by [Relations](../Advanced%20Usage/Attributes/Relations.md).++In this mode:++* The columns represent the _target notes_ of a relation.+* When creating a new column, you select a note instead of entering a column name.+* The column icon matches the target note.+* Moving notes between columns changes their relations.+* Renaming an existing column changes the target note for all notes in that column.++Using relations instead of labels has several benefits:++* The status or grouping of notes is visible outside the Kanban board, for example, on the <a class="reference-link" href="../Note%20Types/Note%20Map.md">Note Map</a>.+* A column takes its title and icon from the target note, so renaming that note anywhere in the tree renames the column.++To use relations for grouping:++1. Create a Kanban board from scratch rather than from a template.+2. Assign `#viewType=board #hidePromotedAttributes` to emulate the default template.+3. Set `#board:groupBy` to the name of a relation, **including the** `~` **prefix** (for example, `~status`).+4. Optionally, use <a class="reference-link" href="../Advanced%20Usage/Attributes/Promoted%20Attributes.md">Promoted Attributes</a> to make changing the status within the note easier:++ ```+ #relation:status(inheritable)="promoted,alias=Status,single"+ ```++## Searching and filtering the board++You can search for cards using the search box at the top of the board. Enter your keywords, and then press the <span class="tn-icon bx bx-search"></span> button in the search field or press <kbd>Enter</kbd>. Only cards whose titles, content, or attribute values match the query will be displayed. Columns without results will be temporarily collapsed to make room for the matching cards. Press the <span class="tn-icon bx bx-x"></span> button in the search field to clear the search and display all cards again.++### Advanced filtering++If you need to refine the view to display only cards matching specific criteria beyond a regular text search, you can use Trilium's search query syntax. Here are some example queries:++Display only cards whose **Priority** attribute is set to “Low”:++```+#priority=Low+```++Display only cards whose **Issue Category** is set to “Software” and whose **Site** is set to either “Office” or “Factory”:++```+#issueCategory="Software" AND (#site="Office" OR #site="Factory")+```++Display only cards with a **Due Date** in the next seven days that are not yet marked as **Done**:++```+#dueDate >= TODAY AND #dueDate <= TODAY+7 AND #!done+```++The filter persists even after you close the tab. When you reopen the collection, the filter remains active until you clear the search query by using the <span class="tn-icon bx bx-x"></span> button.++## Linking to a column or a card++You can create a link that opens the board and points out a specific column or card. Open the **column menu** or the card’s context menu, select <span class="tn-icon bx bx-copy"></span> **Copy reference**, and then paste the link where you need it.++In a text note, the pasted link displays the title, icon, and color of the column or card it points to. In a Markdown or code note, the plain link address is pasted instead. Opening the link scrolls the board to the column or card and focuses it. If the column belongs to a different grouping attribute, the board switches to that attribute first.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Collections/List View.md b/docs/User Guide/User Guide/Collections/List View.mdnew file mode 100644index 0000000000..900fc92c19--- /dev/null+++ b/docs/User Guide/User Guide/Collections/List View.md@@ -0,0 +1,40 @@+# List View+<figure class="image"><img style="aspect-ratio:1387/758;" src="List View_image.png" width="1387" height="758"></figure>++List view is similar to <a class="reference-link" href="Grid%20View.md">Grid View</a>, but in the list view mode, each note is displayed in a single row with only the title and the icon of the note being visible by the default. By pressing the expand button it's possible to view the content of the note, as well as the children of the note (recursively).++In the example above, the "Node.js" note on the left panel contains several child notes. The right panel displays the content of these child notes as a single continuous document.++### Creating a new table++Right click on an existing note in the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.md">Note Tree</a> and select _Insert child note_ and look for _List View_.++## Interaction++* Each note can be expanded or collapsed by clicking on the arrow to the left of the title.+* In the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Ribbon.md">Ribbon</a>, in the _Collection_ tab there are options to expand and to collapse all notes easily.++## Printing and exporting to PDF++Since v0.100.0, list collections can be [printed or exported to PDF](../Basic%20Concepts%20and%20Features/Notes/Printing%20%26%20Exporting%20as%20PDF.md).++A printed list collection will print all the notes in the collection, in the right order and preserving the full hierarchy.++If exported to PDF within the desktop application, there is additional functionality:++* The table of contents of the PDF will reflect the structure of the notes.+* Reference and inline links to other notes within the same hierarchy will be functional (will jump to the corresponding page). If a link refers to a note that is not in the printed hierarchy, it will be unlinked.++## Expanding and collapsing multiple notes at once++Apart from individually expanding or collapsing notes, it's also possible to expand or collapse them all at once. To do so, go to the <a class="reference-link" href="Collection%20Properties.md">Collection Properties</a> and look for the corresponding button.++By default, the _Expand_ button will only expand the direct children (first level) of the collection. Starting with v0.100.0, it's possible to expand multiple levels of notes using the arrow button next to the button.++Manually expanded notes will reset if the application/tab is closed and then the collection is visited again. Automatically expanded notes, using the ribbon configuration will persist.++> [!TIP]+> By design, the UI provides only a handful of levels of depth for expanding notes (direct children, 2-5, all levels). It's also possible to specify any desired depth by manually setting the [corresponding label](../Advanced%20Usage/Attributes/Labels.md). For example: `#expanded=100` to expand up to 100 levels of depth.++> [!NOTE]+> From a performance standpoint, the List collection is efficient since it does not load child notes unless the notes are actually expanded. Expanding the list for a significantly large hierarchy can cause slow-downs.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Collections/List View_image.png b/docs/User Guide/User Guide/Collections/List View_image.pngnew file mode 100644index 0000000000..61a9d82496Binary files /dev/null and b/docs/User Guide/User Guide/Collections/List View_image.png differdiff --git a/docs/User Guide/User Guide/Collections/Presentation.md b/docs/User Guide/User Guide/Collections/Presentation.mdnew file mode 100644index 0000000000..adb7667ccc--- /dev/null+++ b/docs/User Guide/User Guide/Collections/Presentation.md@@ -0,0 +1,89 @@+# Presentation+<figure class="image"><img style="aspect-ratio:1120/763;" src="Presentation_image.png" width="1120" height="763"></figure>++The Presentation view allows the creation of slideshows directly from within Trilium.++### Creating a new presentation++Right click on an existing note in the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.md">Note Tree</a> and select _Insert child note_ and look for _Presentation_.++## How it works++* Each slide is a child note of the collection.+* The order of the child notes determines the order of the slides.+* Unlike traditional presentation software, slides can be laid out both horizontally and vertically (see belwo for more information).+* Direct children will be laid out horizontally and the children of those will be laid out vertically. Children deeper than two levels of nesting are ignored.++## Interaction and navigation++In the floating buttons section (top-right):++* Edit button to go to the corresponding note of the current slide.+* Press Overview button (or the <kbd>O</kbd> key) to show a birds-eye view of the slides. Press the button again to disable it.+* Press the “Start presentation” button to show the presentation in full-screen.++The following keyboard shortcuts are supported:++* Press <kbd>←</kbd> and <kbd>→</kbd> (or <kbd>H</kbd> and <kbd>L</kbd>) to go to the slide on the left or on the right (horizontal).+* Press <kbd>↑</kbd> and <kbd>↓</kbd> (or <kbd>K</kbd> and <kbd>J</kbd>) to go to the upward or downward slide (vertical).+* Press <kbd>Space</kbd> and <kbd>Shift</kbd> + <kbd>Space</kbd> or to go to the next/previous slide in order.+* And a few more, press <kbd>?</kbd> to display a popup with all the supported keyboard combinations.++## Vertical slides and nesting++Unlike traditional presentation software such as Microsoft PowerPoint, the slides in Trilium can be laid out horizontally or vertically in order to create depth or better organize the slides by topic.++This horizontal/vertical organization affects transitions (especially on the “slide” transition), however it is most noticeable in navigation.++* Pressing <kbd>←</kbd> and <kbd>→</kbd> will navigate through slides horizontally, thus skipping vertical notes under the current slide. This is useful to skip entire chapters/related slides.+* Pressing <kbd>↑</kbd> and <kbd>↓</kbd> will navigate through the vertical slides at the current level.+* Pressing <kbd>Space</kbd> and <kbd>Shift</kbd> + <kbd>Space</kbd> will go to the next/previous slide in order, regardless of the direction. This is generally the key combination to use when presenting.+* The arrows on the bottom-right of the slide will also reflect this navigation scheme.++<figure class="image image-style-align-right image_resized" style="width:55.57%;"><img style="aspect-ratio:890/569;" src="1_Presentation_image.png" width="890" height="569"></figure>++All direct children of the collection will be laid out horizontally. If a direct child also has children, those children will be placed as vertical slides.++In the following example, the note structure is as follows:++* Presentation collection+ * Trilium Notes (demo page)+ * “Introduction” slide+ * “The challenge of personal knowledge management”+ * “Note-taking structures”+ * “Demo & Feature highlights” slide+ * “Really fast installation process”+ * Video slide++## Customization++At collection level, it's possible to adjust:++* The theme of the entire presentation to one of the predefined themes by going to the <a class="reference-link" href="Collection%20Properties.md">Collection Properties</a> and looking for the _Theme_ option.+* It's currently not possible to create custom themes, although it is planned.+* Note that it is note possible to alter the CSS via <a class="reference-link" href="../Theme%20development/Custom%20app-wide%20CSS.md">Custom app-wide CSS</a> because the slides are rendered isolated (in a shadow DOM).++At slide level:++* It's possible to adjust the background color of a slide by using the [predefined promoted attribute](../Advanced%20Usage/Attributes/Promoted%20Attributes.md) for the color or manually setting `#slide:background` to a hex color.+* More complex backgrounds can be achieved via gradients. There's no UI for it; it has to be set via `#slide:background` to a CSS gradient definition such as: `linear-gradient(to bottom, #283b95, #17b2c3)`.++## Tips and tricks++* Text notes generally respect the formatting (bold, italic, foreground and background colors) and font size. Code blocks and tables also work.+* Try using more than just text notes, the presentation uses the same mechanism as [shared notes](../Advanced%20Usage/Sharing.md) and <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Notes/Note%20List.md">Note List</a> so it should be able to display <a class="reference-link" href="../Note%20Types/Mermaid%20Diagrams.md">Mermaid Diagrams</a>, <a class="reference-link" href="../Note%20Types/Canvas.md">Canvas</a> and <a class="reference-link" href="../Note%20Types/Mind%20Map.md">Mind Map</a> in full-screen (without the interactivity).+ * Consider using a transparent background for <a class="reference-link" href="../Note%20Types/Canvas.md">Canvas</a>, if the slides have a custom background (go to the hamburger menu in the Canvas, press the button select a custom color and write `transparent`).+ * For <a class="reference-link" href="../Note%20Types/Mermaid%20Diagrams.md">Mermaid Diagrams</a>, some of them have a predefined background which can be changed via the frontmatter. For example, for XY-charts:++ ```+ ---+ config:+ themeVariables:+ xyChart:+ backgroundColor: transparent+ ---+ ```++## Under the hood++The Presentation view uses [Reveal.js](https://revealjs.com/) to handle the navigation and layout of the slides.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Collections/Presentation_image.png b/docs/User Guide/User Guide/Collections/Presentation_image.pngnew file mode 100644index 0000000000..b87b47a4b5Binary files /dev/null and b/docs/User Guide/User Guide/Collections/Presentation_image.png differdiff --git a/docs/User Guide/User Guide/Collections/Table.md b/docs/User Guide/User Guide/Collections/Table.mdnew file mode 100644index 0000000000..27b5a6e4fc--- /dev/null+++ b/docs/User Guide/User Guide/Collections/Table.md@@ -0,0 +1,151 @@+# Table+<figure class="image"><img style="aspect-ratio:1050/259;" src="Table_image.png" width="1050" height="259"></figure>++The table view displays information in a grid, where the rows are individual notes and the columns are <a class="reference-link" href="../Advanced%20Usage/Attributes/Promoted%20Attributes.md">Promoted Attributes</a>. In addition, values are editable.++## How it works++The tabular structure is represented as such:++* Each child note is a row in the table.+* If child rows also have children, they will be displayed under an expander (nested notes).+* Each column is a [promoted attribute](../Advanced%20Usage/Attributes/Promoted%20Attributes.md) that is defined on the Collection note.+ * Actually, both promoted and unpromoted attributes are supported, but it's a requirement to use a label/relation definition.+ * The promoted attributes are usually defined as inheritable in order to show up in the child notes, but it's not a requirement.+* If there are multiple attribute definitions with the same `name`, only one will be displayed.+* If an attribute definition has multiple values, they will all be grouped under a single column, with chips indicating individual values.++There are also a few predefined columns:++* The current item number, identified by the `#` symbol.+ * This simply counts the note and is affected by sorting.+* <a class="reference-link" href="../Advanced%20Usage/Note%20ID.md">Note ID</a>, representing the unique ID used internally by Trilium+* The title of the note.++## Interaction++### Creating a new table++Right click on an existing note in the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.md">Note Tree</a> and select _Insert child note_ and look for _Table_.++### Adding columns++Each column is a [promoted or unpromoted attribute](../Advanced%20Usage/Attributes/Promoted%20Attributes.md) that is defined on the Collection note.++To create a new column, either:++* Press _Add new column_ at the bottom of the table.+* Right click on an existing column and select Add column to the left/right.+* Right click on the empty space of the column header and select _Label_ or _Relation_ in the _New column_ section.++### Adding new rows++Each row is actually a note that is a child of the Collection note.++To create a new note, either:++* Press _Add new row_ at the bottom of the table.+* Right click on an existing row and select _Insert row above, Insert child note_ or _Insert row below_.++By default it will try to edit the title of the newly created note.++Alternatively, the note can be created from the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.md">Note Tree</a> or [scripting](../Scripting.md).++### Context menu++There are multiple menus:++* Right clicking on a column, allows:+ * Sorting by the selected column and resetting the sort.+ * Hiding the selected column or adjusting the visibility of every column.+ * Adding new columns to the left or the right of the column.+ * Editing the current column.+ * Deleting the current column.+* Right clicking on the space to the right of the columns, allows:+ * Adjusting the visibility of every column.+ * Adding new columns.+* Right clicking on a row, allows:+ * Opening the corresponding note of the row in a new tab, split, window or quick editing it.+ * Inserting a new note above or below the selected row. These options are only enabled if the table is not sorted.+ * Inserting a new child note for the selected row.+ * Deleting the row.++### Editing data++Simply click on a cell within a row to change its value. The change will not only reflect in the table, but also as an attribute of the corresponding note.++* The editing will respect the type of the promoted attribute, by presenting a normal text box, a number selector or a date selector for example.+* It also possible to change the title of a note.+* Editing relations is also possible+ * Simply click on a relation and it will become editable. Enter the text to look for a note and click on it.+ * To remove a relation, remove the title of the note from the text box and click outside the cell.++### Editing columns++It is possible to edit a column by right clicking it and selecting _Edit column._ This will basically change the label/relation definition at the collection level.++If the _Name_ field of a column is changed, this will trigger a batch operation in which the corresponding label/relation will be renamed in all the children.++## Working with the data++### Sorting by column++By default, the order of the notes matches the order in the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.md">Note Tree</a>. However, it is possible to sort the data by the values of a column:++* To do so, simply click on a column.+* To switch between ascending or descending sort, simply click again on the same column. The arrow next to the column will indicate the direction of the sort.+* To disable sorting and fall back to the original order, right click any column on the header and select _Clear sorting._++### Reordering and hiding columns++* Columns can be reordered by dragging the header of the columns.+* Columns can be hidden or shown by right clicking on a column and clicking the item corresponding to the column.++### Reordering rows++Notes can be dragged around to change their order. To do so, move the mouse over the three vertical dots near the number row and drag the mouse to the desired position.++This will also change the order of the note in the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.md">Note Tree</a>.++Reordering does have some limitations:++* If the parent note has `#sorted`, reordering will be disabled.+* If using nested tables, then reordering will also be disabled.+* Currently, it's possible to reorder notes even if column sorting is used, but the result might be inconsistent.++### Nested trees++If the child notes of the collection also have their own child notes, then they will be displayed in a hierarchy.++Next to the title of each element there will be a button to expand or collapse. By default, all items are expanded.++Since nesting is not always desirable, it is possible to limit the nesting to a certain number of levels or even disable it completely. To do so, either:++* Go to <a class="reference-link" href="Collection%20Properties.md">Collection Properties</a> and look for the _Max nesting depth_ section.+ * To disable nesting, type 0 and press Enter.+ * To limit to a certain depth, type in the desired number (e.g. 2 to only display children and sub-children).+ * To re-enable unlimited nesting, remove the number and press Enter.+* Manually set `maxNestingDepth` to the desired value.++Limitations:++* While in this mode, it's not possible to reorder notes.++## Limitations++* There is no support to filter the rows by a certain criteria. Consider using the table view in search for that use case.++## Use in search++The table view can be used in a <a class="reference-link" href="../Note%20Types/Saved%20Search.md">Saved Search</a> by adding the `#viewType=table` attribute.++Unlike when used in a Collection, saved searches are not limited to the sub-hierarchy of a note and allows for advanced queries thanks to the power of the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Navigation/Search.md">Search</a>.++However, there are also some limitations:++* It's not possible to reorder notes.+* It's not possible to add a new row.++Columns are supported, by being defined as <a class="reference-link" href="../Advanced%20Usage/Attributes/Promoted%20Attributes.md">Promoted Attributes</a> to the <a class="reference-link" href="../Note%20Types/Saved%20Search.md">Saved Search</a> note.++Editing is also supported.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Collections/Table_image.png b/docs/User Guide/User Guide/Collections/Table_image.pngnew file mode 100644index 0000000000..7750b698c5Binary files /dev/null and b/docs/User Guide/User Guide/Collections/Table_image.png differdiff --git a/docs/User Guide/User Guide/Collections_collection_board.webp b/docs/User Guide/User Guide/Collections_collection_board.webpnew file mode 100644index 0000000000..6ed49dd449Binary files /dev/null and b/docs/User Guide/User Guide/Collections_collection_board.webp differdiff --git a/docs/User Guide/User Guide/Collections_collection_calendar.webp b/docs/User Guide/User Guide/Collections_collection_calendar.webpnew file mode 100644index 0000000000..34b7961e0fBinary files /dev/null and b/docs/User Guide/User Guide/Collections_collection_calendar.webp differdiff --git a/docs/User Guide/User Guide/Collections_collection_geomap.webp b/docs/User Guide/User Guide/Collections_collection_geomap.webpnew file mode 100644index 0000000000..e564fbfc6fBinary files /dev/null and b/docs/User Guide/User Guide/Collections_collection_geomap.webp differdiff --git a/docs/User Guide/User Guide/Collections_collection_presentation.webp b/docs/User Guide/User Guide/Collections_collection_presentation.webpnew file mode 100644index 0000000000..f7ae75cc3aBinary files /dev/null and b/docs/User Guide/User Guide/Collections_collection_presentation.webp differdiff --git a/docs/User Guide/User Guide/Collections_collection_table.webp b/docs/User Guide/User Guide/Collections_collection_table.webpnew file mode 100644index 0000000000..2113caf65fBinary files /dev/null and b/docs/User Guide/User Guide/Collections_collection_table.webp differdiff --git a/docs/User Guide/User Guide/FAQ.md b/docs/User Guide/User Guide/FAQ.mdnew file mode 100644index 0000000000..48a79cf212--- /dev/null+++ b/docs/User Guide/User Guide/FAQ.md@@ -0,0 +1,90 @@+# FAQ+## Inspiration for the name “Trilium”++> Naming software is hard. I lived in Ontario when I first started the project and Trillium (the flower) is sort of a provincial logo, many institutions in Ontario are named "Trillium \[something\]". So I kept hearing/reading it almost everyday, I liked the sound of it and its nature motif, so I just reused it.+>+> _– Zadam (original Trilium maintainer)_++> [!NOTE]+> Despite the fact that the Trillium flower has two “l"s, the Trilium application only has one.++## macOS support++Originally, Trilium Notes considered the macOS build unsupported. TriliumNext commits to make the experience on macOS as good as possible.++if you find any platform-specific issues, feel free to [report them](Troubleshooting/Reporting%20issues.md).++## Translation / localisation support++The original Trilium Notes application did not support multiple languages. Since we believe that internationalisation is a core part of an application, we have added support for it.++Contributions to translations are welcome.++## Multi-user support++Common request is to allow multiple users collaborate, share notes etc. So far I'm resisting this because of these reasons:++* it's a huge feature, or rather a Pandora's box of collaboration features like user management, permissions, conflict resolution, real-time editing of a note by multiple people etc. This would be a huge amount of work. Trilium Notes is project made mostly by one person in free time and that's unlikely to change in the future.+* given its size it would probably pivot the attention away from my main focus which is a personal note-taking+* the assumption that only single person has access to the app simplifies many things, or just outright makes them possible. In multi-user app, our [scripting](Scripting.md)support would be a XSS security hole, while with the single user assumption it's an endless customizable tool.++## How to open multiple documents in one Trilium instance++This is normally not supported - one Trilium process can open only a single instance of a [database](Advanced%20Usage/Database.md). However, you can run two Trilium processes (from one installation), each connected to a separate document. To achieve this, you need to set a location for the [data directory](Installation%20%26%20Setup/Data%20directory.md) in the `TRILIUM_DATA_DIR` environment variable and separate port on `TRILIUM_PORT` environment variable. How to do that depends on the platform, in Unix-based systems you can achieve that by running command such as this:++```sh+TRILIUM_DATA_DIR=/home/me/path/to/data/dir TRILIUM_PORT=12345 trilium+```++You can save this command into a `.sh` script file or make an alias. Do this similarly for a second instance with different data directory and port.++## Can I use Dropbox / Google Drive / OneDrive to sync data across multiple computers.++No.++These general purpose sync apps are not suitable to sync database files which are open and being worked on by another application. The result is that they will corrupt the database file, resulting in data loss and this message in the Trilium logs:++```+SqliteError: database disk image is malformed+```++The only supported way to sync Trilium's data across the network is to use a [sync/web server](Installation%20%26%20Setup/Synchronization.md).++## Why database instead of flat files?++Trilium stores notes in a [database](Advanced%20Usage/Database.md) which is an SQLite database. People often ask why doesn't Trilium rather use flat files for note storage - it's fair question since flat files are easily interoperable, work with SCM/git etc.++Short answer is that file systems are simply not powerful enough for what we want to achieve with Trilium. Using filesystem would mean fewer features with probably more problems.++More detailed answer:++* [clones](Basic%20Concepts%20and%20Features/Notes/Cloning%20Notes.md) are what you might call "hard directory link" in filesystem lingo, but this concept is not implemented in any filesystem+* filesystems make a distinction between directory and file while there's intentionally no such difference in Trilium+* files are stored in no particular order and user can't change this+* Trilium allows storing note [attributes](Advanced%20Usage/Attributes.md) which could be represented in extended user attributes but their support differs greatly among different filesystems / operating systems+* Trilium makes links / relations between different notes which can be quickly retrieved / navigated (e.g. for [note map](Advanced%20Usage/Note%20Map%20\(Link%20map%2C%20Tree%20map\).md)). There's no such support in file systems which means these would have to be stored in some kind of side-car files (mini-databases).+* Filesystems are generally not transactional. While this is not completely required for a note-taking application, having transactions make it way easier to keep notes and their metadata in predictable and consistent state.++## Search-related Questions++### Why does search sometimes find results with typos?++Trilium uses a progressive search strategy that includes fuzzy matching when exact matches return fewer than 5 results. This finds notes despite minor typos in your search query. You can use fuzzy search operators (`~=` for fuzzy exact match and `~*` for fuzzy contains). See the <a class="reference-link" href="Basic%20Concepts%20and%20Features/Navigation/Search.md">Search</a> documentation for details.++### How can I search for notes when I'm not sure of the exact spelling?++Use the fuzzy search operators:++* `#title ~= "projct"` - finds notes with titles like "project" despite the typo+* `note.content ~* "algoritm"` - finds content containing "algorithm" or similar words++### Why do some search results appear before others with lower scores?++Trilium places exact matches before fuzzy matches. When you search for "project", notes containing exactly "project" appear before notes with variations like "projects" or "projection", regardless of other scoring factors.++### How can I make my searches faster?++1. Use the "Fast search" option to search only titles and attributes (not content)+2. Limit search scope using the "Ancestor" field+3. Set a result limit to prevent loading too many results+4. For large databases, consider archiving old notes to reduce search scope\ No newline at end of filediff --git a/docs/User Guide/User Guide/Feature Highlights.md b/docs/User Guide/User Guide/Feature Highlights.mdnew file mode 100644index 0000000000..ddfc2e58e2--- /dev/null+++ b/docs/User Guide/User Guide/Feature Highlights.md@@ -0,0 +1,36 @@+# Feature Highlights+This section presents the most important changes by version. For a full set of changes, please consult the change log of each release. For purposes of brevity, beta versions are skipped and the features gathered to the nearest stable version.++* v0.105.0:+ * Text notes now have a <a class="reference-link" href="Note%20Types/Text/In-editor%20AI%20assistant.md">In-editor AI assistant</a> for quick proof-reading and other text-based operations that don't require a full chat.+* v0.101.0:+ * A <a class="reference-link" href="Basic%20Concepts%20and%20Features/UI%20Elements/New%20Layout.md">New Layout</a> has been introduced, making significant modifications to the UI/UX such as integrating the ribbon and the floating buttons into other UI elements and introducing new functionality such as the <a class="reference-link" href="Basic%20Concepts%20and%20Features/UI%20Elements/New%20Layout/Breadcrumb.md">Breadcrumb</a>.+* v0.97.0:+ * Books are now <a class="reference-link" href="Collections.md">Collections</a>.+ * <a class="reference-link" href="Collections/Table.md">Table</a> is a new collection type displaying notes and attributes in an editable grid.+ * <a class="reference-link" href="Basic%20Concepts%20and%20Features/Navigation/Quick%20edit.md">Quick edit</a> is introduced, adding a new way to edit notes in a popup instead of opening a new tab. It also integrates well with <a class="reference-link" href="Collections.md">Collections</a>.+* v0.96.0:+ * <a class="reference-link" href="Note%20Types/Text.md">Text</a> gain premium features thanks to a collaboration with the CKEditor team:+ * <a class="reference-link" href="Note%20Types/Text/Slash%20Commands.md">Slash Commands</a>+ * <a class="reference-link" href="Note%20Types/Text/Text%20Snippets.md">Text Snippets</a>+* v0.95.0:+ * A more friendly theme was introduced for <a class="reference-link" href="Advanced%20Usage/Sharing.md">Sharing</a>, with search, expandable tree, night mode and more.+* v0.94.0:+ * Added integration with <a class="reference-link" href="AI.md">AI</a> (using self-hosted LLMs such as Ollama or industry standards such as ChatGPT).+* v0.92.5:+ * Windows binaries are now signed.+ * <a class="reference-link" href="Installation%20%26%20Setup/Server%20Installation/Multi-factor%20authentication%20with%20TOTP.md">Multi-factor authentication with TOTP</a> was introduced.+* v0.92.4:+ * macOS binaries are now signed.+ * <a class="reference-link" href="Note%20Types/Text.md">Text</a> notes can now have adjustable <a class="reference-link" href="Note%20Types/Text/Content%20language%20%26%20Right-to-left%20support.md">Content language & Right-to-left support</a>.+ * <a class="reference-link" href="Basic%20Concepts%20and%20Features/Notes/Printing%20%26%20Exporting%20as%20PDF.md">Printing & Exporting as PDF</a>+ * <a class="reference-link" href="Basic%20Concepts%20and%20Features/Zen%20mode.md">Zen mode</a>+ * <a class="reference-link" href="Collections/Calendar.md">Calendar</a>, allowing notes to be displayed in a monthly grid based on start and end dates.+* v0.91.5:+ * Significant improvements for mobile.+ * <a class="reference-link" href="Note%20Types/Text/Footnotes.md">Footnotes</a> are now supported in <a class="reference-link" href="Note%20Types/Text.md">Text</a> notes.+ * Mermaid diagrams can now be inserted inline within <a class="reference-link" href="Note%20Types/Text.md">Text</a> notes.+ * The TriliumNext theme is introduced, bringing a more modern design to the application.+ * <a class="reference-link" href="Collections/Geo%20Map.md">Geo Map</a>, displaying notes as markers on a geographical map for easy trip planning.+* v0.90.8:+ * A new note type was introduced: <a class="reference-link" href="Note%20Types/Mind%20Map.md">Mind Map</a>\ No newline at end of filediff --git a/docs/User Guide/User Guide/Installation & Setup/Backup.md b/docs/User Guide/User Guide/Installation & Setup/Backup.mdnew file mode 100644index 0000000000..d3381b1cd8--- /dev/null+++ b/docs/User Guide/User Guide/Installation & Setup/Backup.md@@ -0,0 +1,124 @@+# Backup+Trilium supports simple backup scheme where it saves copy of the <a class="reference-link" href="../Advanced%20Usage/Database.md">Database</a> on these events:++* once a day+* once a week+* once a month+* before DB migration to newer version++So in total you'll have at most 4 backups from different points in time which should protect you from various problems. These backups are stored by default in `backup` directory placed in the [data directory](Data%20directory.md).++This is only very basic backup solution, and you're encouraged to add some better backup solution - e.g. backing up the <a class="reference-link" href="../Advanced%20Usage/Database.md">Database</a> to cloud / different computer etc.++Note that <a class="reference-link" href="Synchronization.md">Synchronization</a> provides also some backup capabilities by its nature of distributing the data to other computers.++## Creating a backup++### On the desktop application and web client:++1. Go to **Settings → Backup** and press the **Backup Now** button.+2. The backup creation process may take a few moments, especially for larger databases. A notification will inform you when the backup is complete.+3. The backup will be saved as **backup-now** in the **Existing Backups** list, where you can download it.++### On the standalone client++1. **Go to Settings → Backup** and press the "**Download backup**" button.+2. You will be prompted to **restart the app**. Confirm, and the app will restart automatically.+3. Set a **backup name** or **password** (both optional), then press "**Continue**".+4. Press the "**Generate and download"** button and wait for the download to complete.+5. Once you confirm the download is saved on your device, press **"Finish"** to complete++## Downloading a backup++* **Desktop and web client**: to download an existing backup, navigate to **Settings → Backup → Existing backups** and select **Download**.+* **Standalone client**: automatic backups are not supported in this version. You can manually create and download a backup by going to **Settings → Backup → Download backup.**++## Restoring a backup++* **For a new Trilium instance**: When setting up a new Trilium instance, use the "Restore from backup" option in the setup menu to guide you through restoring your existing backup.+* **For an existing Trilium instance**: To restore a backup and replace your current database, go to **Settings → Backup** and click **Restore a backup**. You will be prompted to restart the app for the restoration process to begin. After restarting, you can choose to back up the existing database before overwriting it. Note: For the web client, use the Start Over feature (**Settings → Database → Start over**) to switch to the setup screen and restore a backup.++Next, select the backup file (.db or .tnbackup) from your device. The web client is optimized for handling large backups and is resilient to unstable network conditions, similar to the desktop application.++If your database is encrypted, you will be prompted to enter the password used for encrypting the backup file. Without the correct password, decryption and restoration cannot proceed.++Restoring a backup may take some time, depending on its size. Once it completes, Trilium will open the freshly restored database.++### The alternative way for restoring a backup++Let's assume you want to restore the weekly backup (only in .db format, .tnbackup files are not supported by this method), here's how to do it:++* find [data directory](Data%20directory.md) Trilium uses - easy way is to open "About Trilium Notes" from "Menu" in upper left corner and looking at "data directory"+ * I'll refer to `~/trilium-data` as data directory from now on+* find `~/trilium-data/backup/backup-weekly.db` - this is the <a class="reference-link" href="../Advanced%20Usage/Database.md">Database</a> backup.+* at this point stop/kill Trilium+* delete `~/trilium-data/document.db`, `~/trilium-data/document.db-wal` and `~/trilium-data/document.db-shm` (latter two files are auto generated)+* copy and rename this `~/trilium-data/backup/backup-weekly.db` to `~/trilium-data/document.db`+* make sure that the file is writable, e.g. with `chmod 600 document.db`+* start Trilium again++> [!WARNING]+> If you have configured sync then you need to do it across all members of the sync cluster, otherwise older version (restored backup) of the document will be detected and synced to the newer version.++## Changing the backup location in Trilium (desktop only)++Starting with version 0.105, the Trilium desktop client allows users to change the directory where backups are stored. Follow these steps to specify a custom backup directory:++1. Navigate to **Settings** → **Backup Location**.+2. Click the **Select Location** button.+3. Choose any writable directory on your file system. This could include network shares, depending on your operating system.++Once you set a custom directory, all manual and automatic backups will be saved there. If the selected directory becomes unavailable, backups may fail or revert to the default location.++> [!TIP]+> For better privacy when using unsafe backup locations, you can enable backup encryption, which makes the backup file unreadable without the correct password.++## Backup encryption++Trilium can secure the entire content of the database backup, ensuring it remains unreadable unless the correct password is provided. This is particularly useful for storing backups in unsecured locations, like network shares, unencrypted external drives, or cloud services.++Encrypted database backups use the Trilium Backup Container (.tnbackup) format, which relies on AES-256-GCM. This authenticated encryption mode scrambles the data and generates a tag confirming it hasn't been altered. The password itself isn't directly used as the key; it's processed through scrypt, a key derivation function designed to be slow and memory-intensive, making brute-force password guessing difficult even with powerful hardware. Each backup also receives a random 16-byte salt, ensuring that the same password never produces the same encryption key twice. Additionally, critical metadata such as chunk order, length, and header flags are cryptographically bound into the encryption (via "additional authenticated data"), preventing undetected tampering like reorder, truncate, or splice operations.++### Enabling backup encryption++To enable encryption for automatic backups in the Desktop application:++1. Go to **Settings → Backup → Backup Options**.+2. Click on **Turn on Encryption** and set a password.++Once encryption is enabled, all newly created backups (both automatic and manual) will be encrypted with the specified password. Backups created prior to enabling encryption will remain unsecured.++You can change the password anytime using the **Change Password** button. The new password will apply to backups created after the change.++To disable encryption, uncheck **Settings → Backup → Enable Encryption**.++> [!NOTE]+> On some systems, a keyring may not be available for Trilium to securely store the encryption password. In such cases, the encryption option is disabled.++## Backup compression++Database backups can be optionally compressed to minimize storage footprint. This method is effective primarily when the database consists largely of text content. However, media files (images, videos, audio), along with PDF, ODF, and DOCX files, are already compressed in their original formats and won't benefit from further compression.++Compressed backups are stored using the Trilium Backup Container (.tnbackup), employing RFC 1952 GZIP compression.++> [!WARNING]+> **Note:** Compression increases the time required for backup creation and restoration. It may also lead to higher CPU usage during automatic backups, potentially draining the battery faster on battery-powered devices. Enable this option only if necessary.++### Enabling Backup Compression (Desktop Only)++To enable compression for new automatic and manual backups, navigate to **Settings → Backup → Backup Options** and toggle **Enable Compression** to on.++## Disabling backup++Although this is not recommended, it is possible to disable backup in `config.ini` in the [data directory](Data%20directory.md):++```+[General]+... some other configs+# set to true to disable backups (e.g. because of limited space on server)+noBackup=true+```++You can also review the [configuration](../Advanced%20Usage/Configuration%20\(config.ini%20or%20environment%20variables\).md) file to provide all `config.ini` values as environment variables instead.++See [sample config](https://github.com/TriliumNext/Trilium/blob/master/config-sample.ini).\ No newline at end of filediff --git a/docs/User Guide/User Guide/Installation & Setup/Data directory.md b/docs/User Guide/User Guide/Installation & Setup/Data directory.mdnew file mode 100644index 0000000000..3b84301d29--- /dev/null+++ b/docs/User Guide/User Guide/Installation & Setup/Data directory.md@@ -0,0 +1,98 @@+# Data directory+Data directory contains:++* `document.db` - [database](../Advanced%20Usage/Database.md)+* `config.ini` - instance level settings like port on which the Trilium application runs+* `backup` - contains automatically [backup](Backup.md) of documents+* `log` - contains application log files++## Location of the data directory++Easy way how to find out which data directory Trilium uses is to look at the "About Trilium Notes" dialog (from "Menu" in upper left corner):++++Here's how the location is decided:++Data directory is normally named `trilium-data` and it is stored in:++* `/home/[user]/.local/share` for Linux+* `C:\Users\[user]\AppData\Roaming` for Windows Vista and up+* `/Users/[user]/Library/Application Support` for Mac OS+* user's home is a fallback if some of the paths above don't exist+* user's home is also a default setup for \[\[docker|Docker server installation\]\]++If you want to back up your Trilium data, just backup this single directory - it contains everything you need.++### Changing the location of data directory++If you want to use some other location for the data directory than the default one, you may change it via `TRILIUM_DATA_DIR` environment variable to some other location:++### Windows++1. Press the Windows key on your keyboard.+2. Search and select “Edit the system variables”.+3. Press the “Environment Variables…” button in the bottom-right of the newly opened screen.+4. On the top section ("User variables for \[user\]"), press the “New…” button.+5. In the _Variable name_ field insert `TRILIUM_DATA_DIR`.+6. Press the _Browse Directory…_ button and select the new directory where to store the database.+7. Close all the windows by pressing the _OK_ button for each of them.++#### Linux++```+export TRILIUM_DATA_DIR=/home/myuser/data/my-trilium-data+```++#### Mac OS X++You need to create a `.plist` file under `~/Library/LaunchAgents` to load it properly each login.++To load it manually, you need to use `launchctl setenv TRILIUM_DATA_DIR <yourpath>`++Here is a pre-defined template, where you just need to add your path to:++```+ Label+ set.trilium.env+ RunAtLoad++ ProgramArguments++ launchctl+ setenv+ TRILIUM_DATA_DIR+ /Users/YourUserName/Library/Application Support/trilium-data+```++### Create a script to run with specific data directory++An alternative to globally setting environment variable is to run only the Trilium Notes with this environment variable. This then allows for different setup styles like two [database](../Advanced%20Usage/Database.md) instances or "portable" installation.++To do this in Unix-based systems simply run `trilium` like this:++```+TRILIUM_DATA_DIR=/home/myuser/data/my-trilium-data trilium+```++You can then save the above command as a shell script on your path for convenience.++## Electron user data directory (desktop only)++When running the desktop application, Electron stores internal data (caches, spell-check dictionaries, session storage, etc.) separately from the Trilium data directory. By default this goes to the system's application data folder (e.g. `%APPDATA%` on Windows), which may be undesirable in corporate environments with roaming profiles or when running in portable mode.++To keep Electron data out of the system's roaming profile, set the `TRILIUM_ELECTRON_DATA_DIR` environment variable to an explicit path. The `trilium-portable` script does this automatically, pointing it to `trilium-electron-data/` next to the application.++## Fine-grained directory/path location++Apart from the data directory, some of the subdirectories of it can be moved elsewhere by changing an environment variable:++| Environment variable | Default value | Description |+| --- | --- | --- |+| `TRILIUM_DOCUMENT_PATH` | `${TRILIUM_DATA_DIR}/document.db` | Path to the <a class="reference-link" href="../Advanced%20Usage/Database.md">Database</a> (storing all notes and metadata). |+| `TRILIUM_BACKUP_DIR` | `${TRILIUM_DATA_DIR}/backup` | Directory where automated <a class="reference-link" href="Backup.md">Backup</a> databases are stored. |+| `TRILIUM_LOG_DIR` | `${TRILIUM_DATA_DIR}/log` | Directory where daily <a class="reference-link" href="../Troubleshooting/Error%20logs/Backend%20(server)%20logs.md">Backend (server) logs</a> are stored. |+| `TRILIUM_TMP_DIR` | `${TRILIUM_DATA_DIR}/tmp` | Directory where temporary files are stored (for example when opening in an external app). |+| `TRILIUM_ANONYMIZED_DB_DIR` | `${TRILIUM_DATA_DIR}/anonymized-db` | Directory where a <a class="reference-link" href="../Troubleshooting/Anonymized%20Database.md">Anonymized Database</a> is stored. |+| `TRILIUM_CONFIG_INI_PATH` | `${TRILIUM_DATA_DIR}/config.ini` | Path to <a class="reference-link" href="../Advanced%20Usage/Configuration%20(config.ini%20or%20environment%20variables).md">Configuration (config.ini or environment variables)</a> file. |+| `TRILIUM_ELECTRON_DATA_DIR` | System appData | Directory for Electron internal data (caches, spell-check dictionaries, etc.). Set this in portable mode to avoid writing to the system profile (desktop only). |\ No newline at end of filediff --git a/docs/User Guide/User Guide/Installation & Setup/Data directory_image.png b/docs/User Guide/User Guide/Installation & Setup/Data directory_image.pngnew file mode 100644index 0000000000..823c6ceac6Binary files /dev/null and b/docs/User Guide/User Guide/Installation & Setup/Data directory_image.png differdiff --git a/docs/User Guide/User Guide/Installation & Setup/Desktop Installation.md b/docs/User Guide/User Guide/Installation & Setup/Desktop Installation.mdnew file mode 100644index 0000000000..b39241c459--- /dev/null+++ b/docs/User Guide/User Guide/Installation & Setup/Desktop Installation.md@@ -0,0 +1,19 @@+# Desktop Installation+To install Trilium on your desktop, follow these steps:++1. **Download the Latest Release**: Obtain the appropriate binary release for your operating system from the [latest release page](https://github.com/TriliumNext/Trilium/releases/latest) on GitHub.+2. **Extract the Package**: Unzip the downloaded package to a location of your choice.+3. **Run the Application**: Launch Trilium by executing the `trilium` executable found within the unzipped folder.++## Startup Scripts++Trilium offers various startup scripts to customize your experience:++* `trilium-no-cert-check`: Starts Trilium without validating [TLS certificates](Server%20Installation/HTTPS%20\(TLS\).md), useful if connecting to a server with a self-signed certificate.+ * Alternatively, set the `NODE_TLS_REJECT_UNAUTHORIZED=0` environment variable before starting Trilium.+* `trilium-portable`: Launches Trilium in portable mode, where the [data directory](Data%20directory.md) is created within the application's directory, making it easy to move the entire setup. Electron's internal data (caches, dictionaries, etc.) is also stored within the data directory, so no files are written to the system's roaming profile.+* `trilium-safe-mode`: Boots Trilium in "safe mode," disabling any startup scripts that might cause the application to crash.++## Synchronization++For Trilium desktop users who wish to synchronize their data with a server instance, refer to the <a class="reference-link" href="Synchronization.md">Synchronization</a> guide for detailed instructions.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Installation & Setup/Desktop Installation/Network Access.md b/docs/User Guide/User Guide/Installation & Setup/Desktop Installation/Network Access.mdnew file mode 100644index 0000000000..1d17055cb1--- /dev/null+++ b/docs/User Guide/User Guide/Installation & Setup/Desktop Installation/Network Access.md@@ -0,0 +1,14 @@+# Network Access+Prior to v0.104.0, the [desktop application](../Desktop%20Installation.md) would also open a network port so that it can offer access to <a class="reference-link" href="../../Advanced%20Usage/ETAPI%20(REST%20API).md">ETAPI (REST API)</a> or even use it as a web server (see <a class="reference-link" href="Using%20the%20desktop%20application%20as%20a%20server.md">Using the desktop application as a server</a>).++In order to reduce the attack surface, Trilium now enables these services only for the local device (e.g. `localhost`) instead of serving them over the LAN.++To better understand what is affected, refer to the following table:++| Feature | Network access OFF | Network access ON |+| --- | --- | --- |+| <a class="reference-link" href="../Web%20Clipper.md">Web Clipper</a> | 🔒️ `localhost` only (still accessible to the browser extension on the same device) | 🌐 `localhost` + LAN |+| <a class="reference-link" href="../../Advanced%20Usage/ETAPI%20(REST%20API).md">ETAPI (REST API)</a> | 🔒️ `localhost` only | 🌐 `localhost` + LAN |+| [LLM MCP](../../AI.md) (only if enabled in settings) | 🔒️ `localhost` only (needs auth) | 🌐 `localhost` + LAN (needs auth) |+| [Web app](Using%20the%20desktop%20application%20as%20a%20server.md) | ❌️ completely disabled (403), only the desktop app is usable. | 🌐 `localhost` + LAN |+| <a class="reference-link" href="../../Advanced%20Usage/Sharing.md">Sharing</a> notes | ❌️ completely disabled (403), if you are using <a class="reference-link" href="../Synchronization.md">Synchronization</a> this will still work as part of the [server](../Server%20Installation.md). | 🌐 `localhost` + LAN |\ No newline at end of filediff --git a/docs/User Guide/User Guide/Installation & Setup/Desktop Installation/Nix flake.md b/docs/User Guide/User Guide/Installation & Setup/Desktop Installation/Nix flake.mdnew file mode 100644index 0000000000..b1bfb2ebba--- /dev/null+++ b/docs/User Guide/User Guide/Installation & Setup/Desktop Installation/Nix flake.md@@ -0,0 +1,76 @@+# Nix flake+Since TriliumNext 0.94.1, the desktop and server applications can be built using [Nix](https://nixos.org/).++## System requirements++Installation of Nix on Mac or Linux ([download page](https://nixos.org/download/)). About 3-4 gigabytes of additional storage space, for build artifacts.++## Run directly++Using [nix run](https://nix.dev/manual/nix/stable/command-ref/new-cli/nix3-run.html), the desktop app can be started as: `nix run github:TriliumNext/Trilium/v0.95.0`++Running the server requires explicitly specifying the desired package: `nix run github:TriliumNext/Trilium/v0.95.0#server`++Instead of a version (`v0.95.0` above), you can also specify a commit hash (or a branch name). This makes it easy to test development builds.++## Install on NixOS++Add to your `flake.nix`:++```+{+ inputs = {+ nixpkgs.url = # ...;+ trilium-notes = {+ url = "github:TriliumNext/Trilium/v0.95.0";+ inputs.nixpkgs.follows = "nixpkgs";+ };+ };++ outputs =+ {+ self,+ # ...+ trilium-notes,+ ...+ }:+ {+ nixosConfigurations = {+ "nixos" = nixpkgs.lib.nixosSystem {+ system = "x86_64-linux";+ modules = [+ ./configuration.nix+ ];+ specialArgs = {+ inherit+ trilium-notes+ ;+ };+ };+ };+ };+}++```++Add to your `configuration.nix`:++```+{+ # ...+ trilium-notes,+ ...+}:++{+ # ...++ services.trilium-server.package = trilium-notes.packages.x86_64-linux.server;++ environment.systemPackages = [+ trilium-notes.packages.x86_64-linux.desktop+ ];+}+```++The flake aims to be compatible with the latest NixOS stable and unstable.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Installation & Setup/Desktop Installation/System Requirements.md b/docs/User Guide/User Guide/Installation & Setup/Desktop Installation/System Requirements.mdnew file mode 100644index 0000000000..587993f505--- /dev/null+++ b/docs/User Guide/User Guide/Installation & Setup/Desktop Installation/System Requirements.md@@ -0,0 +1,12 @@+# System Requirements+The desktop version of Trilium supports all three main operating systems:++* Windows+ * Windows 11 is officially supported.+ * Windows on ARM is also supported+* Linux:+ * Most modern distributions are supported, including NixOS.+ * ARM is supported in `aarch64` (no ARM v7 support).+* macOS+ * Minimum supported operating system: macOS Ventura+ * Both Intel and Apple Silicon devices are supported.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Installation & Setup/Desktop Installation/Tray icon & automatic startup.md b/docs/User Guide/User Guide/Installation & Setup/Desktop Installation/Tray icon & automatic startup.mdnew file mode 100644index 0000000000..47e210eeb4--- /dev/null+++ b/docs/User Guide/User Guide/Installation & Setup/Desktop Installation/Tray icon & automatic startup.md@@ -0,0 +1,37 @@+# Tray icon & automatic startup+> [!NOTE]+> Automatic startup and better integration with the system tray was introduced in v0.104.0. Versions prior to that only have the system tray option which could be found in <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Options.md">Options</a> → _Others_.++## Tray icon++<figure class="image image-style-align-right"><img style="aspect-ratio:332/71;" src="Tray icon & automatic startup_image.png" width="332" height="71"></figure>++The desktop application has native integration with the system tray on all operating systems.++The tray icon is enabled by default, but it can be toggled from <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Options.md">Options</a> → _Desktop_.++The tray icon has the following functionality:++* When clicked, the last window is hidden (minimized to the tray icon). Clicking it again will reveal that window.+* Right clicking reveals the following options:+ * Each window can be individually shown or hidden, identified by their active note.+ * New windows can be opened.+ * A new note can be created directly, which will be created in the <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/Notes/Note%20Inbox.md">Note Inbox</a> (or <a class="reference-link" href="../../Advanced%20Usage/Advanced%20Showcases/Day%20Notes.md">Day Notes</a> if an inbox is not available).+ * Today's day note can be opened.+ * Bookmarks and recent notes are displayed in a sub-menu and clicking them navigates to that note.+ * Quitting the application.++### Closing to system tray++This is an option which is not enabled by default and it allows a specific behavior: instead of exiting the application when the last window has been closed, the last window is instead hidden with the tray icon remaining available.++This option requires the tray icon to be enabled, otherwise it has no effect.++## Automatic startup++Two options control the automatic startup functionality in <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Options.md">Options</a> → _Startup_:++* When _Launch on startup_ is enabled, the application will automatically start up when logging into the current user.+ * Note that on Linux support depends on the desktop environment. Feel free to [report](../../Troubleshooting/Reporting%20issues.md) any issues.+* If _Start minimized to tray_ is also enabled, the application will start up in the background and can be revealed from the tray icon.+ * This only applies if _Launch on startup_ is enabled, manual starts are not impacted by this option.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Installation & Setup/Desktop Installation/Tray icon & automatic startup_image.png b/docs/User Guide/User Guide/Installation & Setup/Desktop Installation/Tray icon & automatic startup_image.pngnew file mode 100644index 0000000000..e21d7d53e4Binary files /dev/null and b/docs/User Guide/User Guide/Installation & Setup/Desktop Installation/Tray icon & automatic startup_image.png differdiff --git a/docs/User Guide/User Guide/Installation & Setup/Desktop Installation/Troubleshooting.md b/docs/User Guide/User Guide/Installation & Setup/Desktop Installation/Troubleshooting.mdnew file mode 100644index 0000000000..26c0f65540--- /dev/null+++ b/docs/User Guide/User Guide/Installation & Setup/Desktop Installation/Troubleshooting.md@@ -0,0 +1,17 @@+# Troubleshooting+## Trilium only shows a blank window++Trilium uses Electron which is based on Chromium (the open-source alternative to Google Chrome); in order to improve performance it makes use of _GPU acceleration_. In some cases, a GPU incompatibility (especially on older models of integrated graphics) can cause nothing to render at all, resulting in a blank window.++To bypass this, try running Trilium with the following command line argument:++```+trilium --disable-gpu+```++If that doesn't work, try the following commands as well:++* `trilium --disable-gpu-compositing`+* `ELECTRON_OZONE_PLATFORM_HINT=x11 trilium` (this one forces the rendering to X11 on Wayland)++If Trilium renders fine after this, Trilium offers a built-in option to disable GPU acceleration: go to <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Options.md">Options</a> → _Appearance_, look for the _Performance_ section and then uncheck _Hardware acceleration (GPU)_.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Installation & Setup/Desktop Installation/Using the desktop application as a server.md b/docs/User Guide/User Guide/Installation & Setup/Desktop Installation/Using the desktop application as a server.mdnew file mode 100644index 0000000000..3c6179c662--- /dev/null+++ b/docs/User Guide/User Guide/Installation & Setup/Desktop Installation/Using the desktop application as a server.md@@ -0,0 +1,30 @@+# Using the desktop application as a server+Sometimes, setting up a [dedicated server installation](../Server%20Installation.md) is not feasible. The desktop application ships with a fully functional server instance by default.++For security reasons, this feature is **not enabled** by default. To enable it, enable _Network access_ in <a class="reference-link" href="../../Scripting/Security.md">Security</a>.++After enabling network access and restarting the application, you can access this web interface locally by navigating to [http://localhost:37840/login](http://localhost:37840/login).++> [!NOTE]+> The server embedded in the desktop application will only run as long as the desktop application itself is running. So closing the application will also close the server. To overcome this, you can try hiding the application in the system tray.++## Mobile interface++By default, this will display the desktop user interface, even on mobile. To switch to the mobile version, simply go to the <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Global%20menu.md">Global menu</a> and select “Switch to the mobile version”.++## Allowing the port externally on Windows with Windows Defender Firewall++First, find out the IP of your desktop server by running `ipconfig` in your local terminal. Then try accessing `http://<ip>:37840/login` on another device. If it doesn't work, then most likely the port is blocked by your operating system's firewall.++If you use Windows Defender Firewall:++1. Go to Windows's start menu and look for “Windows Defender Firewall with Advanced Security”.+2. Go to “Inbound Rules” on the left tree, and select “New Rule” in the “Actions” sidebar on the right.+3. Select “Port” and press “Next”.+4. Type in `37840` in the “Specific local ports” section and then press “Next”.+5. Leave “Allow the connection” checked and press “Next”.+6. Configure the networks to apply to (check all if unsure) and then press “Next”.+7. Add an appropriate name to the rule (e.g. “Trilium Notes”) and press “Finish”.++> [!WARNING]+> Since v0.104.0, the port used by Trilium is accessible only on `localhost`. To enable across the local network, see <a class="reference-link" href="Network%20Access.md">Network Access</a>.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Installation & Setup/Mobile Frontend.md b/docs/User Guide/User Guide/Installation & Setup/Mobile Frontend.mdnew file mode 100644index 0000000000..c0d0712fdc--- /dev/null+++ b/docs/User Guide/User Guide/Installation & Setup/Mobile Frontend.md@@ -0,0 +1,85 @@+# Mobile Frontend+<figure class="image image_resized image-style-align-right" style="width:33.52%;"><img style="aspect-ratio:1242/2688;" src="Mobile Frontend_IMG_1765.PNG" width="1242" height="2688"></figure>++Trilium has a mobile web frontend which is optimized for touch based devices - smartphones and tablets. It is activated automatically during login process based on browser detection.++Mobile frontend is limited in features compared to the full desktop version. See below for more details on this.++## Layout basics++Unlike the desktop version, the mobile version has a slightly different UI meant to better fit the constrained screens of a mobile phone.++Here is a non-exhaustive list of differences between the desktop version and the mobile one:++* The <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.md">Note Tree</a> is displayed as a sidebar. To display the sidebar, press the button in the top-left of the screen.++ * There is also a swipe gesture that can be done from the left of the screen, but the browser's navigation gesture interferes with it most of the time (depending on the platform).+ * Press and hold a note to display the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree/Note%20tree%20contextual%20menu.md">Note tree contextual menu</a>.+* The <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Navigation/Quick%20search.md">Quick search</a> bar is also displayed at the top of the note tree.+* The full <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Navigation/Search.md">Search</a> function can be triggered either from either the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Global%20menu.md">Global menu</a> or from the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Launch%20Bar.md">Launch Bar</a>, if configured.+* The <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Launch%20Bar.md">Launch Bar</a> is displayed at the bottom of the screen.++ * The launch bar uses a different configuration for icons than the desktop version. See the dedicated page for more information on how to configure it.+* Most of the note-related actions are grouped in the horizontal dots icon on the top-right of the note.+* The <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Tabs.md">Tabs</a> are grouped under a tab switcher in the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Launch%20Bar.md">Launch Bar</a>, where the tabs are displayed in a full-screen grid with preview for easy switching, as well as additional options such as reopening closed tabs.+* Since v0.100.0, <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Split%20View.md">Split View</a> can also be used in mobile view, but with a maximum of two panes at once. The splits are displayed vertically instead of horizontally.+* Starting with v0.102.0, the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/New%20Layout.md">New Layout</a> is enforced on mobile. This brings features such as the note badges, note type switcher or collection properties which would otherwise not be available.++## Installing as a PWA++The mobile view can be set up as a PWA. While this does not offer any offline capabilities, it will display the application in full-screen and makes it easy to access via your mobile phone's home screen.++### On iOS with Safari++1. Open your default web browser and access your Trilium instance.+2. Login.+3. Press the \[…\] button in the bottom-right of the screen and select Share.+4. Scroll down to reveal the full list of items and choose “Add to Home Screen”.+5. Press “Add” and the web app will be available.++### On Android with Google Chrome++> [!IMPORTANT]+> Google Chrome requires the server to be served over HTTPS in order to display in full-screen. If using HTTP, the app will appear like a normal web page (similar to a bookmark).++1. Open your default web browser and access your Trilium instance.+2. Login.+3. Press the three vertical dots icon in the top-right of the screen and select _Add to Home screen._+4. Select the _Install_ option.+5. Select an appropriate name.+6. The web app will appear as an application, not on the home screen.++### On Android with Brave++> [!IMPORTANT]+> Brave requires the server to be served over HTTPS in order to display in full-screen. If using HTTP, the app will appear like a normal web page (similar to a bookmark).++1. Open your default web browser and access your Trilium instance.+2. Login.+3. Press the three vertical dots icon in the bottom-right of the screen and select _Add to Home screen_.+4. Press the _Install_ option.+5. The web app will appear as an application, not on the home screen.++### On Samsung Browser++1. Open your default web browser and access your Trilium instance.+2. Login.+3. Press the hamburger menu in the bottom-right of the screen.+4. Select _Add to_, followed by _Home screen_.+5. Press _Add_ and the web app will appear on the home page.++## Testing via the desktop application++If you are running Trilium without a dedicated [server installation](Server%20Installation.md), you can still test the mobile application using the desktop application. For more information, see <a class="reference-link" href="Desktop%20Installation/Using%20the%20desktop%20application%20as%20a%20server.md">Using the desktop application as a server</a>. To access it go to `http://<ip>:37840/login?mobile` .++## Forcing mobile/desktop frontend++Trilium decides automatically whether to use mobile or desktop front-end. If this is not appropriate, you can use `?mobile` or `?desktop` query param on **login** page (Note: you might need to log out).++Alternatively, simply select _Switch to Mobile/Desktop Version_ in the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Global%20menu.md">Global menu</a>.++## Scripting++You can alter the behavior with <a class="reference-link" href="../Scripting.md">Scripting</a>, just like for normal frontend. For script notes to be executed, they need to have labeled `#run=mobileStartup`.++Custom <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Launch%20Bar.md">Launch Bar</a> widgets are also supported.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Installation & Setup/Mobile Frontend_IMG_1765.PNG b/docs/User Guide/User Guide/Installation & Setup/Mobile Frontend_IMG_1765.PNGnew file mode 100644index 0000000000..5536b5ffbdBinary files /dev/null and b/docs/User Guide/User Guide/Installation & Setup/Mobile Frontend_IMG_1765.PNG differdiff --git a/docs/User Guide/User Guide/Installation & Setup/Server Installation.md b/docs/User Guide/User Guide/Installation & Setup/Server Installation.mdnew file mode 100644index 0000000000..a2a1b04d2d--- /dev/null+++ b/docs/User Guide/User Guide/Installation & Setup/Server Installation.md@@ -0,0 +1,65 @@+# Server Installation+This guide outlines the steps to install Trilium on your own server. You might consider this option if you want to set up [synchronization](Synchronization.md) or use Trilium in a browser - accessible from anywhere.++## Installation Options++There are several ways to install Trilium on a server, each with its own advantages:++* **Recommended**: [Docker Installation](Server%20Installation/1.%20Installing%20the%20server/Using%20Docker.md) - Available for **AMD64** and **ARM** architectures.+* [Packaged Server Installation](Server%20Installation/1.%20Installing%20the%20server/Packaged%20version%20for%20Linux.md)+* [PikaPods managed hosting](https://www.pikapods.com/pods?run=trilium-next)+* [Manual Installation](Server%20Installation/1.%20Installing%20the%20server/Manually.md)+* [Kubernetes](Server%20Installation/1.%20Installing%20the%20server/Using%20Kubernetes.md)+* [Cloudron](https://www.cloudron.io/store/com.github.trilium.cloudronapp.html)+* [HomelabOS](https://homelabos.com/docs/software/trilium/)+* [NixOS Module](Server%20Installation/1.%20Installing%20the%20server/On%20NixOS.md)++The server installation includes both web and [mobile frontends](Mobile%20Frontend.md).++## Configuration++After setting up your server installation, you may want to configure settings such as the port or enable [TLS](Server%20Installation/HTTPS%20\(TLS\).md). Configuration is managed via the Trilium `config.ini` file, which is located in the [data directory](Data%20directory.md) by default. To begin customizing your setup, copy the provided `config-sample.ini` file with default values to `config.ini`.++You can also review the [configuration](../Advanced%20Usage/Configuration%20\(config.ini%20or%20environment%20variables\).md) file to provide all `config.ini` values as environment variables instead.++### Config Location++By default, `config.ini`, the [database](../Advanced%20Usage/Database.md), and other important Trilium data files are stored in the [data directory](Data%20directory.md). If you prefer a different location, you can change it by setting the `TRILIUM_DATA_DIR` environment variable:++```+export TRILIUM_DATA_DIR=/home/myuser/data/my-trilium-data+```++### Disabling Authentication++See <a class="reference-link" href="Server%20Installation/Authentication.md">Authentication</a>.++## Reverse Proxy Setup++To configure a reverse proxy for Trilium, you can use either **nginx** or **Apache**. You can also check out the documentation stored in the Reverse proxy folder.++### nginx++Add the following configuration to your `nginx` setup to proxy requests to Trilium:++```+location /trilium/ {+ proxy_pass http://127.0.0.1:8080/;+ proxy_http_version 1.1;+ proxy_set_header Upgrade $http_upgrade;+ proxy_set_header Connection 'upgrade';+ proxy_set_header Host $host;+ proxy_cache_bypass $http_upgrade;+}+```++To avoid limiting the size of payloads, include this in the `server {}` block:++```+# Set to 0 for unlimited. Default is 1M.+client_max_body_size 0;+```++### Apache++For an Apache setup, refer to the [Apache proxy setup](Server%20Installation/2.%20Reverse%20proxy/Apache%20using%20Docker.md) guide.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Manually.md b/docs/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Manually.mdnew file mode 100644index 0000000000..afc7661e6a--- /dev/null+++ b/docs/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Manually.md@@ -0,0 +1,65 @@+# Manually+> [!WARNING]+> This page describes manually installing Trilium on your server. **Note that this is a not well supported way to install Trilium, problems may appear, information laid out here is quite out of date. It is recommended to use either** <a class="reference-link" href="Using%20Docker.md">Docker Server Installation</a> **or** <a class="reference-link" href="Packaged%20version%20for%20Linux.md">Packaged server installation</a>**.**++## Requirements++Trilium is a node.js application. Supported (tested) version of node.js is latest 14.X.X and 16.X.X. Trilium might work with older versions as well.++You can check your node version with this command (node.js needs to be installed):++```+node --version+```++If your Linux distribution has only an outdated version of node.js, you can take a look at the installation instruction on node.js website, which covers most popular distributions.++### Dependencies++There are some dependencies required. You can see command for Debian and its derivatives (like Ubuntu) below:++```+sudo apt install libpng16-16 libpng-dev pkg-config autoconf libtool build-essential nasm libx11-dev libxkbfile-dev+```++## Installation++### Download++You can either download source code zip/tar from [https://github.com/TriliumNext/Trilium/releases/latest](https://github.com/TriliumNext/Trilium/releases/latest).++For the latest version including betas, clone Git repository **from** `main` **branch** with:++```+git clone -b main https://github.com/triliumnext/trilium.git+```++## Installation++```+cd trilium++# download all node dependencies+npm install++# make sure the better-sqlite3 binary is there+npm rebuild++# bundles & minifies frontend JavaScript+npm run webpack+```++## Run++```+cd trilium++# using nohup to make sure trilium keeps running after user logs out+nohup TRILIUM_ENV=dev node src/www &+```++The application by default starts up on port 8080, so you can open your browser and navigate to [http://localhost:8080](http://localhost:8080) to access Trilium (replace "localhost" with your hostname).++## TLS++Don't forget to [configure TLS](../HTTPS%20\(TLS\).md) which is required for secure usage!\ No newline at end of filediff --git a/docs/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Multiple server instances.md b/docs/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Multiple server instances.mdnew file mode 100644index 0000000000..939f4b2db6--- /dev/null+++ b/docs/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Multiple server instances.md@@ -0,0 +1,22 @@+# Multiple server instances+Trilium does not support multiple users. In order to have two or more persons with their own set of notes, multiple server instances must be set up. It is also not possible to use multiple [sync](../../Synchronization.md) servers.++To allow multiple server instances on a single physical server:++* For <a class="reference-link" href="Packaged%20version%20for%20Linux.md">Packaged version for Linux</a> or <a class="reference-link" href="Manually.md">Manually</a>, if starting the server manually just specify a different port and data directory per instance:++ ```+ TRILIUM_NETWORK_PORT=8080 TRILIUM_DATA_DIR=/path/to/your/data-dir-A /opt/trilium/trilium.sh+ ```++ For a second instance:++ ```+ TRILIUM_NETWORK_PORT=8081 TRILIUM_DATA_DIR=/path/to/your/data-dir-B /opt/trilium/trilium.sh+ ```++ If using `systemd`, then set the [environment variables in the service configuration](https://serverfault.com/questions/413397/how-to-set-environment-variable-in-systemd-service).+* For <a class="reference-link" href="Using%20Docker.md">Using Docker</a>, simply use two different containers, each with their own port binding and data directory.+* For <a class="reference-link" href="On%20NixOS.md">On NixOS</a>, the only possible way is to use Docker OCI containers or at least one NixOS container with its own service definition.++For support or additional context, see the related [GitHub Discussion](https://github.com/orgs/TriliumNext/discussions/1642#discussioncomment-12768808).\ No newline at end of filediff --git a/docs/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/On NixOS.md b/docs/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/On NixOS.mdnew file mode 100644index 0000000000..a101ee5373--- /dev/null+++ b/docs/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/On NixOS.md@@ -0,0 +1,25 @@+# On NixOS+This page describes configuring the Trilium module included in NixOS.++## Requirements++[NixOS](https://nixos.org/) installation.++## Configuration++Add this to your `configuration.nix`:++```+services.trilium-server.enable = true;++# default data directory: /var/lib/trilium+#services.trilium-server.dataDir = "/var/lib/trilium-sync-server";++# default bind address: 127.0.0.1, port 8080+#services.trilium-server.host = "0.0.0.0";+#services.trilium-server.port = 12783;+```++Uncomment any option you would like to change.++See the [NixOS options list](https://search.nixos.org/options?channel=unstable&from=0&size=50&sort=relevance&type=packages&query=trilium-server) for more options (including nginx reverse proxy configuration).\ No newline at end of filediff --git a/docs/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Packaged version for Linux.md b/docs/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Packaged version for Linux.mdnew file mode 100644index 0000000000..39dcc85619--- /dev/null+++ b/docs/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Packaged version for Linux.md@@ -0,0 +1,181 @@+# Packaged version for Linux+This is essentially Trilium sources + node modules + node.js runtime packaged into one 7z file.++## Steps++* SSH into your server+* use `wget` (or `curl`) to download latest `TriliumNotes-Server-[VERSION]-linux-x64.tar.xz` (copy link from [release page](https://github.com/TriliumNext/Trilium/releases), notice `-Server` suffix) on your server.+* unpack the archive, e.g. using `tar -xf -d TriliumNotes-Server-[VERSION]-linux-x64.tar.xz`+* `cd trilium-linux-x64-server`+* `./trilium.sh`+* you can open the browser and open http://\[your-server-hostname\]:8080 and you should see Trilium initialization page++The problem with above steps is that once you close the SSH connection, the Trilium process is terminated. To avoid that, you have two options:++* Kill it (with e.g. <kbd>Ctrl</kbd> + <kbd>C</kbd>) and run again like this: `nohup ./trilium.sh &`. (nohup keeps the process running in the background, `&` runs it in the background)+* Configure systemd to automatically run Trilium in the background on every boot++## Configure Trilium to auto-run on boot with systemd++* After downloading, extract and move Trilium:++```+tar -xvf TriliumNotes-Server-[VERSION]-linux-x64.tar.xz+sudo mv trilium-linux-x64-server /opt/trilium+```++* Create the service:++```+sudo nano /etc/systemd/system/trilium.service+```++* Paste this into the file (replace the user and group as needed):++```+[Unit]+Description=Trilium Daemon+After=syslog.target network.target++[Service]+User=xxx+Group=xxx+Type=simple+ExecStart=/opt/trilium/trilium.sh+WorkingDirectory=/opt/trilium/++TimeoutStopSec=20+# KillMode=process leads to error, according to https://www.freedesktop.org/software/systemd/man/systemd.kill.html+Restart=always++[Install]+WantedBy=multi-user.target+```++* Save the file (CTRL-S) and exit (CTRL-X)+* Enable and launch the service:++```+sudo systemctl enable --now -q trilium+```++* You can now open a browser to http://\[your-server-hostname\]:8080 and you should see the Trilium initialization page.++## Simple Autoupdate for Server++Run as the same User Trilium runs++if you run as root please remove 'sudo' from the commands++requires "jq" `apt install jq`++It will stop the service above, overwrite everything (i expect no config.ini), and start service It also creates a version file in the Trilium directory so it updates only with a newer Version++```+#!/bin/bash++# Configuration+REPO="TriliumNext/Trilium"+PATTERN="TriliumNotes-Server-.*-linux-x64.tar.xz"+DOWNLOAD_DIR="/var/tmp/trilium_download"+OUTPUT_DIR="/opt/trilium"+SERVICE_NAME="trilium"+VERSION_FILE="$OUTPUT_DIR/version.txt"++# Ensure dependencies are installed+command -v curl >/dev/null 2>&1 || { echo "Error: curl is required"; exit 1; }+command -v jq >/dev/null 2>&1 || { echo "Error: jq is required"; exit 1; }+command -v tar >/dev/null 2>&1 || { echo "Error: tar is required"; exit 1; }++# Create download directory+mkdir -p "$DOWNLOAD_DIR" || { echo "Error: Cannot create $DOWNLOAD_DIR"; exit 1; }++# Get the latest release version+LATEST_VERSION=$(curl -sL https://api.github.com/repos/$REPO/releases/latest | jq -r '.tag_name')+if [ -z "$LATEST_VERSION" ]; then+ echo "Error: Could not fetch latest release version"+ exit 1+fi++# Check current installed version (from version.txt or existing tarball)+CURRENT_VERSION=""+if [ -f "$VERSION_FILE" ]; then+ CURRENT_VERSION=$(cat "$VERSION_FILE")+elif [ -f "$DOWNLOAD_DIR/TriliumNotes-Server-$LATEST_VERSION-linux-x64.tar.xz" ]; then+ CURRENT_VERSION="$LATEST_VERSION"+fi++# Compare versions+if [ "$CURRENT_VERSION" = "$LATEST_VERSION" ]; then+ echo "Latest version ($LATEST_VERSION) is already installed"+ exit 0+fi++# Download the latest release+LATEST_URL=$(curl -sL https://api.github.com/repos/$REPO/releases/latest | jq -r ".assets[] | select(.name | test(\"$PATTERN\")) | .browser_download_url")+if [ -z "$LATEST_URL" ]; then+ echo "Error: No asset found matching pattern '$PATTERN'"+ exit 1+fi++FILE_NAME=$(basename "$LATEST_URL")+FILE_PATH="$DOWNLOAD_DIR/$FILE_NAME"++# Download if not already present+if [ -f "$FILE_PATH" ]; then+ echo "Latest release $FILE_NAME already downloaded"+else+ curl -LO --output-dir "$DOWNLOAD_DIR" "$LATEST_URL" || { echo "Error: Download failed"; exit 1; }+ echo "Downloaded $FILE_NAME to $DOWNLOAD_DIR"+fi++# Extract the tarball+EXTRACT_DIR="$DOWNLOAD_DIR/extracted"+mkdir -p "$EXTRACT_DIR"+tar -xJf "$FILE_PATH" -C "$EXTRACT_DIR" || { echo "Error: Extraction failed"; exit 1; }++# Find the extracted directory (e.g., TriliumNotes-Server-0.97.2-linux-x64)+INNER_DIR=$(find "$EXTRACT_DIR" -maxdepth 1 -type d -name "TriliumNotes-Server-*-linux-x64" | head -n 1)+if [ -z "$INNER_DIR" ]; then+ echo "Error: Could not find extracted directory matching TriliumNotes-Server-*-linux-x64"+ exit 1+fi++# Stop the trilium-server service+if systemctl is-active --quiet "$SERVICE_NAME"; then+ echo "Stopping $SERVICE_NAME service..."+ sudo systemctl stop "$SERVICE_NAME" || { echo "Error: Failed to stop $SERVICE_NAME"; exit 1; }+fi++# Copy contents to /opt/trilium, overwriting existing files+echo "Copying contents from $INNER_DIR to $OUTPUT_DIR..."+sudo mkdir -p "$OUTPUT_DIR"+sudo cp -r "$INNER_DIR"/* "$OUTPUT_DIR"/ || { echo "Error: Copy failed"; exit 1; }+echo "$LATEST_VERSION" | sudo tee "$VERSION_FILE" >/dev/null+echo "Files copied to $OUTPUT_DIR"++# Start the trilium-server service+echo "Starting $SERVICE_NAME service..."+sudo systemctl start "$SERVICE_NAME" || { echo "Error: Failed to start $SERVICE_NAME"; exit 1; }++# Clean up+rm -rf "$EXTRACT_DIR"+echo "Cleanup complete. Trilium updated to $LATEST_VERSION."+```++## Common issues++### Outdated glibc++```+Error: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /var/www/virtual/.../node_modules/@mlink/scrypt/build/Release/scrypt.node)+ at Object.Module._extensions..node (module.js:681:18)+ at Module.load (module.js:565:32)+ at tryModuleLoad (module.js:505:12)+```++If you get an error like this, you need to either upgrade your glibc (typically by upgrading to up-to-date distribution version) or use some other [server installation](../../Server%20Installation.md) method.++## TLS++Don't forget to [configure TLS](../HTTPS%20\(TLS\).md), which is required for secure usage!\ No newline at end of filediff --git a/docs/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Using Docker.md b/docs/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Using Docker.mdnew file mode 100644index 0000000000..f059d9a9ab--- /dev/null+++ b/docs/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Using Docker.md@@ -0,0 +1,241 @@+# Using Docker+Official docker images are published on docker hub for **AMD64**, **ARMv7** and **ARM64/v8**: [https://hub.docker.com/r/triliumnext/trilium/](https://hub.docker.com/r/triliumnext/trilium/)++## Prerequisites++Ensure Docker is installed on your system.++If you need help installing Docker, reference the [Docker Installation Docs](https://docs.docker.com/engine/install/)++**Note:** Trilium's Docker container requires root privileges to operate correctly.++> [!WARNING]+> If you're using a SMB/CIFS share or folder as your Trilium data directory, [you'll need](https://github.com/TriliumNext/Notes/issues/415#issuecomment-2344824400) to add the mount options of `nobrl` and `noperm` when mounting your SMB share.++## Running with Docker Compose++### Grab the latest docker-compose.yml:++```+wget https://raw.githubusercontent.com/TriliumNext/Trilium/master/docker-compose.yml+```++Optionally, edit the `docker-compose.yml` file to configure the container settings prior to starting it. Unless configured otherwise, the data directory will be `~/trilium-data` and the container will be accessible at port 8080.++### Start the container:++Run the following command to start the container in the background:++```+docker compose up -d+```++## Running without Docker Compose / Further Configuration++### Pulling the Docker Image++To pull the image, use the following command, replacing `[VERSION]` with the desired version or tag, such as `v0.91.6` or just `latest`. (See published tag names at [https://hub.docker.com/r/triliumnext/trilium/tags](https://hub.docker.com/r/triliumnext/trilium/tags).):++```+docker pull triliumnext/trilium:v0.91.6+```++**Warning:** Avoid using the "latest" tag, as it may automatically upgrade your instance to a new minor version, potentially disrupting sync setups or causing other issues.++### Preparing the Data Directory++Trilium requires a directory on the host system to store its data. This directory must be mounted into the Docker container with write permissions.++### Running the Docker Container++#### Local Access Only++Run the container to make it accessible only from the localhost. This setup is suitable for testing or when using a proxy server like Nginx or Apache.++```+sudo docker run -t -i -p 127.0.0.1:8080:8080 -v ~/trilium-data:/home/node/trilium-data triliumnext/trilium:[VERSION]+```++1. Verify the container is running using `docker ps`.+2. Access Trilium via a web browser at `127.0.0.1:8080`.++#### Local Network Access++To make the container accessible only on your local network, first create a new Docker network:++```+docker network create -d macvlan -o parent=eth0 --subnet 192.168.2.0/24 --gateway 192.168.2.254 --ip-range 192.168.2.252/27 mynet+```++Then, run the container with the network settings:++```+docker run --net=mynet -d -p 127.0.0.1:8080:8080 -v ~/trilium-data:/home/node/trilium-data triliumnext/trilium:-latest+```++To set a different user ID (UID) and group ID (GID) for the saved data, use the `USER_UID` and `USER_GID` environment variables:++```+docker run --net=mynet -d -p 127.0.0.1:8080:8080 -e "USER_UID=1001" -e "USER_GID=1001" -v ~/trilium-data:/home/node/trilium-data triliumnext/trilium:-latest+```++Find the local IP address using `docker inspect [container_name]` and access the service from devices on the local network.++```+docker ps+docker inspect [container_name]+```++#### Global Access++To allow access from any IP address, run the container as follows:++```+docker run -d -p 0.0.0.0:8080:8080 -v ~/trilium-data:/home/node/trilium-data triliumnext/trilium:[VERSION]+```++Stop the container with `docker stop <CONTAINER ID>`, where the container ID is obtained from `docker ps`.++### Custom Data Directory++For a custom data directory, use:++```+-v ~/YourOwnDirectory:/home/node/trilium-data triliumnext/trilium:[VERSION]+```++If you want to run your instance in a non-default way, please use the volume switch as follows: `-v ~/YourOwnDirectory:/home/node/trilium-data triliumnext/trilium:<VERSION>`. It is important to be aware of how Docker works for volumes, with the first path being your own and the second the one to virtually bind to. [https://docs.docker.com/storage/volumes/](https://docs.docker.com/storage/volumes/) The path before the colon is the host directory, and the path after the colon is the container's path. More details can be found in the [Docker Volumes Documentation](https://docs.docker.com/storage/volumes/).++## Reverse Proxy++1. [Nginx](../2.%20Reverse%20proxy/Nginx.md)+2. [Apache](../2.%20Reverse%20proxy/Apache%20using%20Docker.md)++### Note on --user Directive++The `--user` directive is unsupported. Instead, use the `USER_UID` and `USER_GID` environment variables to set the appropriate user and group IDs.++### Note on timezones++If you are having timezone issues and you are not using docker-compose, you may need to add a `TZ` environment variable with the [TZ identifier](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) of your local timezone.++## Rootless Docker Image++> [!NOTE]+> Please keep in mind that the data directory is at `/home/trilium/trilium-data` instead of the typical `/home/node/trilium-data`. This is because a new user is created and used to run Trilium within the rootless containers.++If you would prefer to run Trilium without having to run the Docker container as `root`, you can use either of the provided Debian (default) and Alpine-based images with the `rootless` tag.++_**If you're unsure, stick to the “rootful” Docker image referenced above.**_++Below are some commands to pull the rootless images:++```+# For Debian-based image+docker pull triliumnext/trilium:rootless++# For Alpine-based image+docker pull triliumnext/trilium:rootless-alpine+```++### Why Rootless?++Running containers as non-root is a security best practice that reduces the potential impact of container breakouts. If an attacker manages to escape the container, they'll only have the permissions of the non-root user instead of full root access to the host.++### How It Works++The rootless Trilium image:++1. Creates a non-root user (`trilium`) during build time+2. Configures the application to run as this non-root user+3. Allows runtime customization of the user's UID/GID via Docker's `--user` flag+4. Does not require a separate Docker `entrypoint` script++### Usage++#### **Using docker-compose (Recommended)**++```+# Run with default UID/GID (1000:1000)+docker-compose -f docker-compose.rootless.yml up -d++# Run with custom UID/GID (e.g., match your host user)+TRILIUM_UID=$(id -u) TRILIUM_GID=$(id -g) docker-compose -f docker-compose.rootless.yml up -d++# Specify a custom data directory+TRILIUM_DATA_DIR=/path/to/your/data TRILIUM_UID=$(id -u) TRILIUM_GID=$(id -g) docker-compose -f docker-compose.rootless.yml up -d++```++#### **Using Docker CLI**++```+# Build the image+docker build -t triliumnext/trilium:rootless -f apps/server/Dockerfile.rootless .++# Run with default UID/GID (1000:1000)+docker run -d --name trilium -p 8080:8080 -v ~/trilium-data:/home/trilium/trilium-data triliumnext/trilium:rootless++# Run with custom UID/GID+docker run -d --name trilium -p 8080:8080 --user $(id -u):$(id -g) -v ~/trilium-data:/home/trilium/trilium-data triliumnext/trilium:rootless++```++### Environment Variables++* `TRILIUM_UID`: UID to use for the container process (passed to Docker's `--user` flag)+* `TRILIUM_GID`: GID to use for the container process (passed to Docker's `--user` flag)+* `TRILIUM_DATA_DIR`: Path to the data directory inside the container (default: `/home/node/trilium-data`)++For a complete list of configuration environment variables (network settings, authentication, sync, etc.), see <a class="reference-link" href="../../../Advanced%20Usage/Configuration%20(config.ini%20or%20environment%20variables).md">Configuration (config.ini or environment variables)</a>.++### Volume Permissions++If you encounter permission issues with the data volume, ensure that:++1. The host directory has appropriate permissions for the UID/GID you're using+2. You're setting both `TRILIUM_UID` and `TRILIUM_GID` to match the owner of the host directory++```+# For example, if your data directory is owned by UID 1001 and GID 1001:+TRILIUM_UID=1001 TRILIUM_GID=1001 docker-compose -f docker-compose.rootless.yml up -d++```++### Considerations++* The container starts with a specific UID/GID which can be customized at runtime+* Unlike the traditional setup, this approach does not use a separate entrypoint script with `usermod`/`groupmod` commands+* The container cannot modify its own UID/GID at runtime, which is a security feature of rootless containers++### Available Rootless Images++Two rootless variants are provided:++1. **Debian-based** (default): Uses the Debian Bullseye Slim base image+ * Dockerfile: `apps/server/Dockerfile.rootless`+ * Recommended for most users+2. **Alpine-based**: Uses the Alpine base image for smaller size+ * Dockerfile: `apps/server/Dockerfile.alpine.rootless`+ * Smaller image size, but may have compatibility issues with some systems++### Building Custom Rootless Images++If you would prefer, you can also customize the UID/GID at build time:++```+# For Debian-based image with custom UID/GID+docker build --build-arg USER=myuser --build-arg UID=1001 --build-arg GID=1001 \+ -t triliumnext/trilium:rootless-custom -f apps/server/Dockerfile.rootless .++# For Alpine-based image with custom UID/GID+docker build --build-arg USER=myuser --build-arg UID=1001 --build-arg GID=1001 \+ -t triliumnext/trilium:alpine-rootless-custom -f apps/server/Dockerfile.alpine.rootless .++```++Available build arguments:++* `USER`: Username for the non-root user (default: trilium)+* `UID`: User ID for the non-root user (default: 1000)+* `GID`: Group ID for the non-root user (default: 1000)\ No newline at end of filediff --git a/docs/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Using Kubernetes.md b/docs/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Using Kubernetes.mdnew file mode 100644index 0000000000..e6d34e9f82--- /dev/null+++ b/docs/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Using Kubernetes.md@@ -0,0 +1,36 @@+# Using Kubernetes+As Trilium can be run in Docker it also can be deployed in Kubernetes. You can either use our Helm chart, a community Helm chart, or roll your own Kubernetes deployment.++The recommended way is to use a Helm chart.++## Root privileges++> [!NOTE]+> The Trilium container at this time needs to be run with root privileges. It will swap to UID and GID `1000:1000` to run the `node` process after execution though, so the main process doesn't run with root privileges.++The Trilium docker container needs to be run with root privileges. The node process inside the container will be started with reduced privileges (uid:gid 1000:1000) after some initialization logic. Please make sure that you don't use a security context (PodSecurityContext) which changes the user ID. To use a different uid:gid for file storage and the application, please use the `USER_UID` & `USER_GID` environment variables.++The docker image will also fix the permissions of `/home/node` so you don't have to use an init container.++## Helm Charts++[Official Helm chart](https://github.com/TriliumNext/helm-charts) from TriliumNext Unofficial helm chart by [ohdearaugustin](https://github.com/ohdearaugustin): [https://github.com/ohdearaugustin/charts](https://github.com/ohdearaugustin/charts)++## Adding a Helm repository++Below is an example of how++```+helm repo add trilium https://triliumnext.github.io/helm-charts+"trilium" has been added to your repositories+```++## How to install a chart++After reviewing the [`values.yaml`](https://github.com/TriliumNext/helm-charts/blob/main/charts/trilium/values.yaml) from the Helm chart, modifying as required and then creating your own:++```+helm install --create-namespace --namespace trilium trilium trilium/trilium -f values.yaml+```++For more information on using Helm, please refer to the Helm documentation, or create a Discussion in the TriliumNext GitHub Organization.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Installation & Setup/Server Installation/2. Reverse proxy.md b/docs/User Guide/User Guide/Installation & Setup/Server Installation/2. Reverse proxy.mdnew file mode 100644index 0000000000..5c07ca8e04--- /dev/null+++ b/docs/User Guide/User Guide/Installation & Setup/Server Installation/2. Reverse proxy.md@@ -0,0 +1,73 @@+# 2. Reverse proxy+Trilium is typically exposed to the internet behind a **reverse proxy**, which handles TLS termination, presents a single public entry point, and (optionally) lets you host multiple instances under one domain. Trilium itself keeps running on plain HTTP on its local port; the proxy sits in front of it.++This section collects provider-specific guides and the configuration that applies regardless of which proxy you use.++## Provider guides++* <a class="reference-link" href="2.%20Reverse%20proxy/Nginx.md">Nginx</a>+* <a class="reference-link" href="2.%20Reverse%20proxy/Traefik.md">Traefik</a>+* <a class="reference-link" href="2.%20Reverse%20proxy/Apache%20using%20Docker.md">Apache using Docker</a>++## Applies to every proxy++Regardless of the proxy you choose, make sure of the following:++* **Forward the WebSocket upgrade.** Trilium uses a WebSocket for synchronization and live UI updates. Your proxy must pass the `Upgrade` and `Connection` headers through, otherwise the client will appear to load but never receive updates.+* **Configure the trusted proxy.** So that Trilium sees the real client IP (for rate limiting, logging, and secure cookies) rather than the proxy's address. See <a class="reference-link" href="2.%20Reverse%20proxy/Trusted%20proxy.md">Trusted proxy</a>.+* **Terminate TLS at the proxy.** See <a class="reference-link" href="HTTPS%20(TLS).md">HTTPS (TLS)</a>.++## Putting an authentication proxy in front of Trilium++Some setups place a **forward-auth / SSO layer** (Authelia, Authentik, oauth2-proxy, or an OIDC plugin) at the proxy so that _every_ request must pass an interactive login first.++This **breaks synchronization and initial setup.** Sync is a machine-to-machine process that runs unattended in the background — it has no browser and cannot complete an interactive login challenge. When the proxy intercepts a sync request, it returns its HTML login page instead of the expected JSON, and the client fails with an error such as:++```+Sync failed: Request to GET https://trilium.example.com/api/setup/status failed,+error: Unexpected token '<', "<!doctype "... is not valid JSON++```++There are two ways to resolve this:++* **Preferred, use Trilium's built-in authentication.** Don't gate Trilium at the proxy at all. Trilium can authenticate the web interface itself, including via [OpenID Connect](Signing%20in%20with%20OpenID%20Connect.md). This leaves the sync endpoints free to authenticate the way they're designed to.+* **Exempt the sync endpoints from the proxy's authentication.** If you must keep auth at the proxy, exclude these paths from the forward-auth check:+ * `/api/setup/*`+ * `/api/login/sync`+ * `/api/sync/*`++> [!NOTE]+> This is safe: Trilium authenticates these endpoints itself. Sync uses a challenge-free HMAC handshake based on a shared secret, and the one-time setup seed request is password-protected — so exempting them at the proxy does not expose unauthenticated access to your data.++An example for Nginx, where `/auth` is your forward-auth endpoint:++```+server {+ # ... TLS, server_name, etc. ...++ # Sync and setup endpoints authenticate themselves — skip forward-auth.+ location ~ ^/api/(sync|login/sync|setup) {+ auth_request off;+ proxy_set_header Host $host;+ proxy_set_header X-Real-IP $remote_addr;+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;+ proxy_set_header X-Forwarded-Proto $scheme;+ proxy_set_header Upgrade $http_upgrade;+ proxy_set_header Connection "upgrade";+ proxy_pass http://trilium;+ }++ # Everything else goes through forward-auth.+ location / {+ auth_request /auth;+ proxy_set_header Host $host;+ proxy_set_header X-Real-IP $remote_addr;+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;+ proxy_set_header X-Forwarded-Proto $scheme;+ proxy_set_header Upgrade $http_upgrade;+ proxy_set_header Connection "upgrade";+ proxy_pass http://trilium;+ }+}+```\ No newline at end of filediff --git a/docs/User Guide/User Guide/Installation & Setup/Server Installation/2. Reverse proxy/Apache using Docker.md b/docs/User Guide/User Guide/Installation & Setup/Server Installation/2. Reverse proxy/Apache using Docker.mdnew file mode 100644index 0000000000..12121d1225--- /dev/null+++ b/docs/User Guide/User Guide/Installation & Setup/Server Installation/2. Reverse proxy/Apache using Docker.md@@ -0,0 +1,91 @@+# Apache using Docker+This tutorial assumes that you have created a DNS A record for `trilium.yourdomain.com` that you want to use for your Trilium server.++## Docker setup++Download docker image and create container++```+ docker pull triliumnext/trilium:[VERSION]+ docker create --name trilium -t -p 127.0.0.1:8080:8080 -v ~/trilium-data:/home/node/trilium-data triliumnext/trilium:[VERSION]+```++## Configuring the Apache proxy++1. Enable apache proxy modules++ ```+ a2enmod ssl+ a2enmod proxy+ a2enmod proxy_http+ a2enmod proxy_wstunnel+ ```+2. Create a new let's encrypt certificate++ ```+ sudo certbot certonly -d trilium.mydomain.com+ ```++ Choose standalone (2) and note the location of the created certificates (typically /etc/letsencrypt/live/...)+3. Create a new virtual host file for apache (you may want to use `apachectl -S` to determine the server root location, mine is /etc/apache2)++ ```+ sudo nano /etc/apache2/sites-available/trilium.yourdomain.com.conf+ ```++ Paste (and customize) the following text into the configuration file++ ```++ ServerName http://trilium.yourdomain.com+ RewriteEngine on+ RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]+++ ServerName https://trilium.yourdomain.com+ RewriteEngine On+ RewriteCond %{HTTP:Connection} Upgrade [NC]+ RewriteCond %{HTTP:Upgrade} websocket [NC]+ RewriteRule /(.*) ws://localhost:8080/$1 [P,L]+ AllowEncodedSlashes NoDecode+ ProxyPass / http://localhost:8080/ nocanon+ ProxyPassReverse / http://localhost:8080/+ SSLCertificateFile /etc/letsencrypt/live/trilium.yourdomain.com/fullchain.pem+ SSLCertificateKeyFile /etc/letsencrypt/live/trilium.yourdomain.com/privkey.pem+ Include /etc/letsencrypt/options-ssl-apache.conf++ ```+4. Enable the virtual host with `sudo a2ensite trilium.yourdomain.com.conf`+5. Reload apache2 with `sudo systemctl reload apache2`++## Configuring the trusted proxy++After setting up a reverse proxy, make sure to configure the <a class="reference-link" href="Trusted%20proxy.md">Trusted proxy</a>.++## Setup the systemd service to start up the server++Create and enable a systemd service to start the docker container on boot++1. Create a new empty file called `/lib/systemd/system/trilium.service` with the contents++ ```+ [Unit]+ Description=Trilium Server+ Requires=docker.service+ After=docker.service++ [Service]+ Restart=always+ ExecStart=/usr/bin/docker start -a trilium+ ExecStop=/usr/bin/docker stop -t 2 trilium++ [Install]+ WantedBy=local.target+ ```+2. Install, enable and start service++ ```+ sudo systemctl daemon-reload+ sudo systemctl enable trilium.service+ sudo systemctl start trilium.service+ ```\ No newline at end of filediff --git a/docs/User Guide/User Guide/Installation & Setup/Server Installation/2. Reverse proxy/Nginx.md b/docs/User Guide/User Guide/Installation & Setup/Server Installation/2. Reverse proxy/Nginx.mdnew file mode 100644index 0000000000..7bb33a9ef6--- /dev/null+++ b/docs/User Guide/User Guide/Installation & Setup/Server Installation/2. Reverse proxy/Nginx.md@@ -0,0 +1,87 @@+# Nginx+Configure Nginx proxy and HTTPS. The operating system here is Ubuntu.++## Installing Nginx++Download Nginx and remove Apache2++```+sudo apt-get install nginx+sudo apt-get remove apache2+```++## Build the configuration file++1. First, create the configuration file:++ ```+ cd /etc/nginx/conf.d+ vim default.conf+ ```+2. Fill the file with the context shown below, part of the setting show be changed. Then you can enjoy your web with HTTPS forced and proxy.++ ```+ # This part configures, where your Trilium server is running+ upstream trilium {+ zone trilium 64k;+ server 127.0.0.1:8080; # change it to a different hostname and port if non-default is used+ keepalive 2;+ }++ # This part is for proxy and HTTPS configure+ server {+ listen 443 ssl;+ server_name trilium.example.net; #change trilium.example.net to your domain without HTTPS or HTTP.+ ssl_certificate /etc/ssl/note/example.crt; #change /etc/ssl/note/example.crt to your path of crt file.+ ssl_certificate_key /etc/ssl/note/example.net.key; #change /etc/ssl/note/example.net.key to your path of key file.+ ssl_session_cache builtin:1000 shared:SSL:10m;+ ssl_protocols TLSv1 TLSv1.1 TLSv1.2;+ ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;+ ssl_prefer_server_ciphers on;+ access_log /var/log/nginx/access.log; #check the path of access.log, if it doesn't fit your file, change it++ location / {+ proxy_set_header Host $host;+ proxy_set_header X-Real-IP $remote_addr;+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;+ proxy_set_header X-Forwarded-Proto $scheme;+ proxy_set_header Upgrade $http_upgrade;+ proxy_set_header Connection "upgrade";+ proxy_pass http://trilium;+ proxy_read_timeout 90;+ }+ }++ # This part is for HTTPS forced+ server {+ listen 80;+ server_name trilium.example.net; # change to your domain+ return 301 https://$server_name$request_uri;+ }+ ```++## Serving under a different path++Alternatively if you want to serve the instance under a different path (useful e.g. if you want to serve multiple instances), update the location block like so:++* update the location with your desired path (make sure to not leave a trailing slash "/", if your `proxy_pass` does not end on a slash as well)+* add the `proxy_cookie_path` directive with the same path: this allows you to stay logged in at multiple instances at the same time.++```+ location /trilium/instance-one {+ rewrite /trilium/instance-one/(.*) /$1 break;+ proxy_set_header Host $host;+ proxy_set_header X-Real-IP $remote_addr;+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;+ proxy_set_header X-Forwarded-Proto $scheme;+ proxy_set_header Upgrade $http_upgrade;+ proxy_set_header Connection "upgrade";+ proxy_pass http://trilium;+ proxy_cookie_path / /trilium/instance-one+ proxy_read_timeout 90;+ }+```++## Configuring the trusted proxy++After setting up a reverse proxy, make sure to configure the <a class="reference-link" href="Trusted%20proxy.md">Trusted proxy</a>.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Installation & Setup/Server Installation/2. Reverse proxy/Traefik.md b/docs/User Guide/User Guide/Installation & Setup/Server Installation/2. Reverse proxy/Traefik.mdnew file mode 100644index 0000000000..59af92a7e9--- /dev/null+++ b/docs/User Guide/User Guide/Installation & Setup/Server Installation/2. Reverse proxy/Traefik.md@@ -0,0 +1,78 @@+# Traefik+The goal of this article is to configure Traefik proxy and HTTPS. See [#7768](https://github.com/TriliumNext/Trilium/issues/7768#issuecomment-3539165814) for reference.++## Breaking change in Traefik 3.6.4++Traefik 3.6.4 introduced a [breaking change](https://doc.traefik.io/traefik/migrate/v3/#encoded-characters-in-request-path) regarding how percent-encoded characters are handled in URLs. More specifically some URLs used by Trilium (such as `search/%23workspace%20%23!template`) are automatically rejected by Traefik, resulting in HTTP 400 errors.++The easiest solution is to update to Traefik 3.6.7 or later which reverts this configuration change. Alternatively, the configuration can be changed according to the section below.++<details>+ <summary>Configuration change</summary>+ <p>To solve this, the Traefik <a href="https://doc.traefik.io/traefik/getting-started/configuration-overview/#the-install-configuration"><strong>static</strong> configuration</a> must be modified in order to allow those characters:</p>+ <pre><code class="language-text-x-yaml">entryPoints:+ web:+ http:+ encodedCharacters:+ allowEncodedSlash: true+ allowEncodedHash: true</code></pre>+ <aside class="admonition tip"><p>If you still have issues, depending on how Trilium is used (especially regarding search), you might need to enable more encoded character groups. For more information, see <a href="https://github.com/TriliumNext/Trilium/issues/7968">the relevant GitHub issue</a>; feel free to report your findings.</p></aside>+</details>++### Build the docker-compose file++Setting up Traefik as reverse proxy requires setting the following labels:++```yaml+ labels:+ - traefik.enable=true+ - traefik.http.routers.trilium.entrypoints=https+ - traefik.http.routers.trilium.rule=Host(`trilium.mydomain.tld`)+ - traefik.http.routers.trilium.tls=true+ - traefik.http.routers.trilium.service=trilium+ - traefik.http.services.trilium.loadbalancer.server.port=8080+ # scheme must be HTTP instead of the usual HTTPS because Trilium listens on HTTP internally+ - traefik.http.services.trilium.loadbalancer.server.scheme=http+ - traefik.docker.network=proxy+ # forward HTTP to HTTPS+ - traefik.http.routers.trilium.middlewares=trilium-headers@docker+ - traefik.http.middlewares.trilium-headers.headers.customrequestheaders.X-Forwarded-Proto=https+```++### Setup needed environment variables++After setting up a reverse proxy, make sure to configure the <a class="reference-link" href="Trusted%20proxy.md">Trusted proxy</a>.++### Example `docker-compose.yaml`++```yaml+services:+ trilium:+ image: triliumnext/trilium+ container_name: trilium+ networks:+ - traefik-proxy+ environment:+ - TRILIUM_NETWORK_TRUSTEDREVERSEPROXY=my-traefik-host-ip # e.g., 172.18.0.0/16+ volumes:+ - /path/to/data:/home/node/trilium-data+ - /etc/timezone:/etc/timezone:ro+ - /etc/localtime:/etc/localtime:ro+ labels:+ - traefik.enable=true+ - traefik.http.routers.trilium.entrypoints=https+ - traefik.http.routers.trilium.rule=Host(`trilium.mydomain.tld`)+ - traefik.http.routers.trilium.tls=true+ - traefik.http.routers.trilium.service=trilium+ - traefik.http.services.trilium.loadbalancer.server.port=8080+ # scheme must be HTTP instead of the usual HTTPS because of how trilium works+ - traefik.http.services.trilium.loadbalancer.server.scheme=http+ - traefik.docker.network=traefik-proxy+ # Tell Trilium the original request was HTTPS+ - traefik.http.routers.trilium.middlewares=trilium-headers@docker+ - traefik.http.middlewares.trilium-headers.headers.customrequestheaders.X-Forwarded-Proto=https++networks:+ traefik-proxy:+ external: true+```\ No newline at end of filediff --git a/docs/User Guide/User Guide/Installation & Setup/Server Installation/2. Reverse proxy/Trusted proxy.md b/docs/User Guide/User Guide/Installation & Setup/Server Installation/2. Reverse proxy/Trusted proxy.mdnew file mode 100644index 0000000000..954577d0d9--- /dev/null+++ b/docs/User Guide/User Guide/Installation & Setup/Server Installation/2. Reverse proxy/Trusted proxy.md@@ -0,0 +1,17 @@+# Trusted proxy+If you are running the Trilium server under a [reverse proxy](../2.%20Reverse%20proxy.md), it's important to configure it as a trusted proxy so that the application can correctly identify the real IP address of the clients (for authentication and rate limiting purposes).++To do so, simply modify <a class="reference-link" href="../../../Advanced%20Usage/Configuration%20(config.ini%20or%20environment%20variables).md">Configuration (config.ini or environment variables)</a> and set:++```+[Network]+trustedReverseProxy=true+```++This will use the left-most IP in the `X-Forwarded-For` header. Alternatively, instead of `true` use the IP address of the reverse proxy or Express.js shortcuts such as:++```+loopback(127.0.0.1/8, ::1/128), linklocal(169.254.0.0/16, fe80::/10), uniquelocal(10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, fc00::/7)+```++For more information, consult [Express behind proxies](https://expressjs.com/en/guide/behind-proxies.html).\ No newline at end of filediff --git a/docs/User Guide/User Guide/Installation & Setup/Server Installation/Authentication.md b/docs/User Guide/User Guide/Installation & Setup/Server Installation/Authentication.mdnew file mode 100644index 0000000000..c9bb752fb4--- /dev/null+++ b/docs/User Guide/User Guide/Installation & Setup/Server Installation/Authentication.md@@ -0,0 +1,38 @@+# Authentication+## Disabling authentication++If you are running Trilium on `localhost` only or if authentication is handled by another component, you can disable Trilium’s authentication by adding the following to `config.ini`:++```+[General]+noAuthentication=true+```++Disabling authentication will bypass even the <a class="reference-link" href="Multi-factor%20authentication%20with%20TOTP.md">Multi-Factor Authentication</a> since v0.94.1.++## Understanding how the session works++Once logged into Trilium, the application will store this information about the login into a cookie on the browser, but also as a session on the server.++If “Remember me” is checked, then the login will expire in 21 days. This period can be adjusted by modifying the `Session.cookieMaxAge` value in `config.ini`. For example, to have the session expire in one day:++```+[Session]+cookieMaxAge=86400+```++When “Remember me” is unchecked, the behavior is different. At client/browser level the authentication does not have any expiration date, but it will be automatically cleared as soon as the user closes the browser. Nevertheless, the server will also dismiss this authentication in around 24 hours from the _last interaction with the application_.++## Viewing active sessions++The login sessions are now stored in the same <a class="reference-link" href="../../Advanced%20Usage/Database.md">Database</a> as the user data. In order to view which sessions are active, open the <a class="reference-link" href="../../Advanced%20Usage/Database/Manually%20altering%20the%20database/SQL%20Console.md">SQL Console</a> and run the following query:++```+SELECT * FROM sessions+```++Expired sessions are periodically cleaned by the server, generally an hourly interval.++## See also++* <a class="reference-link" href="Multi-factor%20authentication%20with%20TOTP.md">Multi-Factor Authentication</a>\ No newline at end of filediff --git a/docs/User Guide/User Guide/Installation & Setup/Server Installation/Authentication/Resetting your password.md b/docs/User Guide/User Guide/Installation & Setup/Server Installation/Authentication/Resetting your password.mdnew file mode 100644index 0000000000..ecd4bd2684--- /dev/null+++ b/docs/User Guide/User Guide/Installation & Setup/Server Installation/Authentication/Resetting your password.md@@ -0,0 +1,37 @@+# Resetting your password+> [!IMPORTANT]+> If you forget your password:+>+> * Protected notes are irretrievable without the password.+> * Unprotected notes can be recovered.++There are two options, both involving access to the device that is running your server.++### By disabling authentication++1. See <a class="reference-link" href="../Authentication.md">Authentication</a> on how to disable the authentication.+2. Restart the server.+3. Go to <a class="reference-link" href="../../../Basic%20Concepts%20and%20Features/UI%20Elements/Options.md">Options</a> → Password → Reset password.+4. Re-enable authentication by following step (1) in reverse.+5. Restart the server.+6. Log in with the new password.++### By altering the database++1. Access the [database](../../../Advanced%20Usage/Database.md) file in the [data directory](../../Data%20directory.md). Open the `document.db` file with an SQLite client (e.g., [DB Browser](https://sqlitebrowser.org/)).+2. Execute the following queries:++ ```+ UPDATE options SET value = '77/twC5O00cuQgNC63VK32qOKKYwj21ev3jZDXoytVU=' WHERE name = 'passwordVerificationSalt';+ UPDATE options SET value = '710BMasZCAgibzIc07X4P9Q4TeBd4ONnqJOho+pWcBM=' WHERE name = 'passwordDerivedKeySalt';+ UPDATE options SET value = 'Eb8af1/T57b89lCRuS97tPEl4CwxsAWAU7YNJ77oY+s=' WHERE name = 'passwordVerificationHash';+ UPDATE options SET value = 'QpC8XoiYYeqHPtHKRtbNxfTHsk+pEBqVBODYp0FkPBa22tlBBKBMigdLu5GNX8Uu' WHERE name = 'encryptedDataKey';+ ```+3. After executing the changes, commit/write the changes. **This sets the password to** `**password**`**, allowing you to log in again.**+4. Go to <a class="reference-link" href="../../../Basic%20Concepts%20and%20Features/UI%20Elements/Options.md">Options</a> → _Password_ → _Change password_ and replace the unsafe password.++## Handling protected notes++When the password is reset, the protected notes are permanently lost due to the fact that they are encrypted with your password so there is no way for Trilium to recover them.++For pre-existing protected notes (now unrecoverable), consider deleting them or exporting the unprotected notes. Then, delete `document.db` and start fresh.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Installation & Setup/Server Installation/HTTPS (TLS).md b/docs/User Guide/User Guide/Installation & Setup/Server Installation/HTTPS (TLS).mdnew file mode 100644index 0000000000..f11a61fecd--- /dev/null+++ b/docs/User Guide/User Guide/Installation & Setup/Server Installation/HTTPS (TLS).md@@ -0,0 +1,54 @@+# HTTPS (TLS)+Configuring TLS is essential for [server installation](../Server%20Installation.md) in Trilium. This guide details the steps to set up TLS within Trilium itself.++> [!TIP]+> While Trilium supports HTTPS on its own, it's generally a good idea to use a [reverse proxy](2.%20Reverse%20proxy.md) instead with TLS termination. You can follow a [guide like this](https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-20-04) for such setups.++## Obtaining a TLS Certificate++You have two options for obtaining a TLS certificate:++* **Recommended**: Obtain a TLS certificate signed by a root certificate authority. For personal use, [Let's Encrypt](https://letsencrypt.org) is an excellent choice. It is free, automated, and straightforward. Certbot can facilitate automatic TLS setup.+* Generate a self-signed certificate. This option is not recommended due to the additional complexity of importing the certificate into all machines connecting to the server.++## Modifying `config.ini`++Once you have your certificate, modify the `config.ini` file in the [data directory](../Data%20directory.md) to configure Trilium to use it:++```+[Network]+port=8080+# Set to true for TLS/SSL/HTTPS (secure), false for HTTP (insecure).+https=true+# Path to the certificate (run "bash bin/generate-cert.sh" to generate a self-signed certificate).+# Relevant only if https=true+certPath=/[username]/.acme.sh/[hostname]/fullchain.cer+keyPath=/[username]/.acme.sh/[hostname]/example.com.key+```++You can also review the [configuration](../../Advanced%20Usage/Configuration%20\(config.ini%20or%20environment%20variables\).md) file to provide all `config.ini` values as environment variables instead. For example, you can configure TLS using environment variables:++```+export TRILIUM_NETWORK_HTTPS=true+export TRILIUM_NETWORK_CERTPATH=/path/to/cert.pem+export TRILIUM_NETWORK_KEYPATH=/path/to/key.pem+```++The above example shows how this is set up in an environment where the certificate was generated using Let's Encrypt's ACME utility. Your paths may differ. For Docker installations, ensure these paths are within a volume or another directory accessible by the Docker container, such as `/home/node/trilium-data/[DIR IN DATA DIRECTORY]`.++After configuring `config.ini`, restart Trilium and access the hostname using "https".++## Self-Signed Certificate++If you opt to use a self-signed certificate for your server instance, note that the desktop instance will not trust it by default.++To bypass this, disable certificate validation by setting the following environment variable (for Linux):++```+export NODE_TLS_REJECT_UNAUTHORIZED=0+trilium+```++Trilium provides scripts to start in this mode, such as `trilium-no-cert-check.bat` for Windows.++**Warning**: Disabling TLS certificate validation is insecure. Proceed only if you fully understand the implications.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Installation & Setup/Server Installation/Multi-factor authentication with TOTP.md b/docs/User Guide/User Guide/Installation & Setup/Server Installation/Multi-factor authentication with TOTP.mdnew file mode 100644index 0000000000..03cfec2df7--- /dev/null+++ b/docs/User Guide/User Guide/Installation & Setup/Server Installation/Multi-factor authentication with TOTP.md@@ -0,0 +1,28 @@+# Multi-factor authentication with TOTP+Multi-factor authentication (MFA) is a security process that requires users to provide two or more verification factors to gain access to a system, application, or account. This adds an extra layer of protection beyond just using a password.++By requiring more than one verification method, MFA helps reduce the risk of unauthorized access, even if someone has obtained your password. It’s highly recommended for securing sensitive information stored in your notes.++## Relationship to OpenID Connect (OIDC)++Multi-factor authentication makes your Trilium login safer by requiring an additional proof of identity apart from your password. <a class="reference-link" href="Signing%20in%20with%20OpenID%20Connect.md">Signing in with OpenID Connect</a> is a different concept which delegates your authentication to an external provider (e.g. your Google provider, or a self-hosted one such as Authelia). These authentication providers might provide their own security features such as TOTP or passkeys.++## Time-based one-time password (TOTP)++TOTP (Time-Based One-Time Password) is a security feature that generates a unique, temporary code on your device, like a smartphone, which changes every 30 seconds. You use this code, along with your password, to log into your account, making it much harder for anyone else to access them.++1. Go to <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Options.md">Options</a> → _Password & Auth._+2. Make sure _Sign-in with_ has _Local password_ selected.+3. In the _Two-factor authentication_ section, press _Set up._+4. Scan the QR code or manually enter the code in your authenticator app.+5. Enter the verification code from your authenticator app to confirm that the setup was successful and press _Verify & continue_.+6. Save the recovery codes, then tick the confirmation and press _Finish setup_.+7. Re-login will be required after TOTP setup is finished (After you refreshing the page).++## Recovery codes++Recovery codes can be used in place of the TOTP if you lose access to your authenticator. Trilium provides 8 different recovery codes, each recovery code can be used once.++To use a recovery code, simply login with your password and use the recovery code as the security token.++The initial set of recovery codes is generated when setting up your TOTP for the first time. They can be regenerated at any time by going to <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Options.md">Options</a> → _Password & Auth_ and pressing the _Regenerate recovery codes_ button. This will generate a new set of recovery codes while at the same time disabling the previous ones.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Installation & Setup/Server Installation/Nix flake.clone.md b/docs/User Guide/User Guide/Installation & Setup/Server Installation/Nix flake.clone.mdnew file mode 100644index 0000000000..1ea9ad9977--- /dev/null+++ b/docs/User Guide/User Guide/Installation & Setup/Server Installation/Nix flake.clone.md@@ -0,0 +1,2 @@+# Nix flake+This is a clone of a note. Go to its [primary location](../Desktop%20Installation/Nix%20flake.md).\ No newline at end of filediff --git a/docs/User Guide/User Guide/Installation & Setup/Server Installation/Signing in with OpenID Connect.md b/docs/User Guide/User Guide/Installation & Setup/Server Installation/Signing in with OpenID Connect.mdnew file mode 100644index 0000000000..adb17d75f8--- /dev/null+++ b/docs/User Guide/User Guide/Installation & Setup/Server Installation/Signing in with OpenID Connect.md@@ -0,0 +1,117 @@+# Signing in with OpenID Connect+OpenID is a standardized way to let you log into websites using an account from another service, like Google or Authelia, to verify your identity.++When OpenID is activated, the password-based authentication in Trilium is replaced with a button that connects using your provider. This means that the configuration of <a class="reference-link" href="Multi-factor%20authentication%20with%20TOTP.md">Multi-factor authentication with TOTP</a> no longer takes effect, since your provider has to handle any multi-factor authentication.++## Setup++Setting up authentication with OpenID connect is a two-step process:++1. First the Trilium server must be configured with information about your authentication provider such as the URL, client ID and secret.+2. Second, the user must connect from options to create a link between the account on the provider and the one Trilium has.++### Configuring the authentication provider++1. First, make sure the authentication provider (e.g. Google, Authelia) is configured properly. See <a class="reference-link" href="Signing%20in%20with%20OpenID%20Connect/Setting%20up%20with%20various%20providers.md">Setting up with various providers</a> for concrete examples.++ 1. The redirect URL of Trilium is `https://<your-trilium-domain>/callback`.+ 2. You should obtain the base URL, client ID and client secret.+2. Set the following information using <a class="reference-link" href="../../Advanced%20Usage/Configuration%20(config.ini%20or%20environment%20variables).md">Configuration (config.ini or environment variables)</a>:++ | Configuration | `config.ini` in `[MultiFactorAuthentication]` section | Environment variable | Description |+ | --- | --- | --- | --- |+ | Base URL\* | `oauthBaseUrl` | `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHBASEURL` | The URL of your Trilium instance (e.g. `https://example.com`). |+ | Client ID\* | `oauthClientId` | `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHCLIENTID` | The client ID from your provider configuration. |+ | Client Secret\* | `oauthClientSecret` | `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHCLIENTSECRET` | The client secret from your provider configuration. |+ | Client auth method | `oauthClientAuthMethod` | `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHCLIENTAUTHMETHOD` | Token-endpoint auth method: `client_secret_basic` or `client_secret_post`. Empty auto-detects. Only needed if sign-in fails with a `WWW-Authenticate` or `invalid_client` error. |+ | ID token algorithm | `oauthIdTokenSigningAlg` | `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHIDTOKENSIGNINGALG` | <span style="color:rgb(32,32,32);">The algorithm your provider signs ID tokens with, e.g.</span> `RS256`<span style="color:rgb(32,32,32);">,</span> `EdDSA`<span style="color:rgb(32,32,32);">,</span> `ES256`<span style="color:rgb(32,32,32);">. Empty auto-detects from the provider. Only needed if sign-in fails with an</span> `unexpected JWT alg` <span style="color:rgb(32,32,32);">error.</span> |++ Asterisk (\*) marks a required field+3. The default OAuth issuer is Google. To use other services such as Authentik or Auth0, you can configure the settings via `oauthIssuerBaseUrl`, `oauthIssuerName`, and `oauthIssuerIcon` in the `config.ini` file. Alternatively, these values can be set using environment variables:++ | Configuration | `config.ini` in `[MultiFactorAuthentication]` section | Environment variable | Description |+ | --- | --- | --- | --- |+ | Issuer base URL | `oauthIssuerBaseUrl` | `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHISSUERBASEURL` | Either the issuer itself (`https://auth.example.com`) or a full discovery URL (`https://auth.example.com/.well-known/openid-configuration`). <br> <br>A URL containing `/.well-known/` is used as-is<span style="color:rgb(32,32,32);">, which is convenient when your provider hands you a discovery URL to copy. A trailing slash may be included or omitted; Trilium matches whichever spelling the provider advertises.</span> <br> <br>Use the full form when your provider advertises an issuer that differs from the path serving its discovery document, such as Authentik in "global" issuer mode. |+ | Issuer name | `oauthIssuerName` | `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHISSUERNAME` | The name of your authentication provider, used for reference on the login screen and in settings. Default is “Google”. |+ | Issuer icon | `oauthIssuerIcon` | `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHISSUERICON` | Optionally, the URL to a logo of the provider. By default it will try to obtain the favicon from the website, so it's optional. |++ All the fields here are optional, since the default OAuth issuer is Google.+4. Optionally, tune the following advanced settings. All are optional and have sensible defaults:++ | Configuration | `config.ini` in `[MultiFactorAuthentication]` section | Environment variable | Description |+ | --- | --- | --- | --- |+ | HTTP timeout | `oauthHttpTimeout` | `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHHTTPTIMEOUT` | Timeout in milliseconds for the provider HTTP requests (discovery, token exchange, userinfo). Defaults to `30000` (30s). Raise this if your provider cold-starts slowly and you are occasionally asked to sign in twice. Minimum accepted value is `500`. |+ | Scopes | `oauthScope` | `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHSCOPE` | Space-separated list of OIDC scopes requested at login. Defaults to `openid profile email`. `openid` is required and is prepended automatically if you omit it. |++ The OIDC session lifetime is automatically bound to Trilium's own session cookie lifetime (the `cookieMaxAge` setting in the `[Session]` section, 21 days by default), so a single sign-in stays valid for as long as your Trilium session does rather than expiring early on the OIDC library's shorter internal defaults.+5. Restart the server so that the changes are applied.++> [!NOTE]+> Legacy environment variables are also supported: `TRILIUM_OAUTH_BASE_URL`, `TRILIUM_OAUTH_CLIENT_ID`, `TRILIUM_OAUTH_CLIENT_SECRET`, and for customizing the provider: `TRILIUM_OAUTH_ISSUER_BASE_URL`, `TRILIUM_OAUTH_ISSUER_NAME`, `TRILIUM_OAUTH_ISSUER_ICON`, `TRILIUM_OAUTH_HTTP_TIMEOUT`, `TRILIUM_OAUTH_SCOPE`, `TRILIUM_OAUTH_CLIENT_AUTH_METHOD`, `TRILIUM_OAUTH_ID_TOKEN_SIGNING_ALG`.++## Connecting to the authentication provider++Once the server has been configured at the previous step, the next step is to create a link between your account on the authentication provider and the Trilium instance. This makes sure that only you can access the Trilium instance, and not just any other valid account.++To do so:++1. Go to <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Options.md">Options</a> → _Password & Auth._+2. In the _Sign-in with_ field, choose _OpenID Connect provider._+3. In the _OpenID Connect_ section, look for the _Connect account_ button.+4. This will redirect you to your authentication provider, where you can sign in or confirm the action if needed.+5. Once you are authenticated you will be redirected back to the Trilium application.++## Logging out++When logging out of Trilium, a request is made to the authentication provider to log out from there as well. This feature depends on the authentication provider, so it may not be honored (Google and Authelia are known cases in which they don't respect the logout feature).++## Switching providers++When switching providers (e.g. going from Google to Authelia), it's important to take the following steps:++1. Go to <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Options.md">Options</a> → _Password & Auth_.+2. In the _OpenID Connect_ section, press the _Disconnect_ button.+3. Wait for the section to indicate that you are disconnected.+4. Change the configuration pointing to the new provider.+5. Restart your server.+6. Repeat the normal steps to connect to the authentication provider.++Failing to disconnect before switching providers might temporarily lock you in, as you will not be able to login (credentials won't match). Should this happen:++1. Modify the server configuration again to your old provider.+2. Restart the server and follow the disconnect instructions above.+3. Modify the server configuration again to your new provider.+4. Restart again the server.++## Deactivating OpenID Connect temporarily++To disable the OpenID Connect authentication and instead rely on the local password temporarily, you must:++1. Modify the `config.ini` or environment variables (depending on how you set up the provider information) and temporarily deactivate the multi-factor authentication section by renaming `[MultiFactorAuthentication]` to something else (e.g. `[MultiFactorAuthentication.bak]`.+2. Restart the server for the changes to take effect.++## Troubleshooting++### Setup fails with a `WWW-Authenticate` or `invalid_client` error++Your provider disagrees with Trilium about how client credentials should be sent to the token endpoint. Set `oauthClientAuthMethod` to `client_secret_post` (or `client_secret_basic` if it's already set to post) and restart. Providers vary: some reject `client_secret_post` outright because the method is fixed when the client is registered (e.g. Authelia), so if one value doesn't work, try the other.++### Setup fails with `invalid user`++If you are running behind a [reverse proxy](2.%20Reverse%20proxy.md), a buffer overflow can also cause this issue. Here is a sample fix for <a class="reference-link" href="2.%20Reverse%20proxy/Nginx.md">Nginx</a>:++```+proxy_buffer_size 128k;+proxy_buffers 4 256k;+proxy_busy_buffers_size 256k;+```++### Setup fails with an `unexpected JWT alg` error++Depending on your version the message reads `unexpected JWT "alg" header parameter` or `unexpected JWT alg received, expected RS256, got: EdDSA`. Both mean the same thing: your provider signs ID tokens with an algorithm other than RS256. Pocket ID (Ed25519) and Kanidm (ES256) do this.++From v0.104.2 Trilium detects the algorithm from your provider automatically, and the log records the outcome (`OAuth: the issuer does not sign ID tokens with RS256; expecting ES256`). If detection can't reach the provider it falls back to RS256, so check that the issuer URL is correct and reachable first. Should it still fail, set `oauthIdTokenSigningAlg` explicitly to the algorithm your provider uses.++### Setup fails with `OAUTH_RESPONSE_IS_NOT_CONFORM`++Make sure the base URL is correct and that the identity provider actually supports OpenID Connect. Some providers such as GitHub offer only OAuth 2.0.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Installation & Setup/Server Installation/Signing in with OpenID Connect/Setting up with various providers.md b/docs/User Guide/User Guide/Installation & Setup/Server Installation/Signing in with OpenID Connect/Setting up with various providers.mdnew file mode 100644index 0000000000..7371c616ef--- /dev/null+++ b/docs/User Guide/User Guide/Installation & Setup/Server Installation/Signing in with OpenID Connect/Setting up with various providers.md@@ -0,0 +1,157 @@+# Setting up with various providers+> [!NOTE]+> This page contains instructions on how to set up <a class="reference-link" href="../Signing%20in%20with%20OpenID%20Connect.md">Signing in with OpenID Connect</a> with various providers such as Authelia, GitLab, Google. Note that while the configuration reference is correct and up to date, the steps to create the OAuth application might differ slightly as providers change their UI.++## Authelia++1. Generate a client secret:++ ```+ authelia crypto hash generate pbkdf2 --variant sha512 --random --random.length 72 --random.charset rfc3986++ ```++ `Random Password` goes to Trilium, `Digest` (the `$pbkdf2-sha512$…` string) goes to Authelia.+2. Add a client under `identity_providers.oidc.clients` in Authelia's `configuration.yml`, replacing `<server>` with the URL of your Trilium instance:++ ```yaml+ identity_providers:+ oidc:+ clients:+ - client_id: 'trilium'+ client_name: 'Trilium'+ client_secret: '<Digest>'+ public: false+ authorization_policy: 'two_factor'+ redirect_uris:+ - 'https://<server>/callback'+ scopes:+ - 'openid'+ - 'profile'+ - 'email'+ ```++ Unlike GitLab, `client_id` is a name you choose rather than one the provider generates.+3. Restart Authelia.++Adjust `config.ini`, using the `Random Password` from step 1:++```+[MultiFactorAuthentication]+oauthBaseUrl=https://<server>+oauthClientId=<ClientId>+oauthClientSecret=<RandomPassword>+oauthIssuerBaseUrl=https://<server>+oauthIssuerName=Authelia+```++> [!IMPORTANT]+> Do **not** set `oauthClientAuthMethod` for Authelia. It defaults confidential clients to `client_secret_basic` and rejects any other method with `invalid_client`, which is the default Trilium already uses. This is the opposite of the GitLab case below.++## GitLab (self-hosted or cloud)++1. Go to user settings on [gitlab.com](https://gitlab.com/-/user_settings/applications) or your own self-hosted instance.+2. Press _Add new application_.+3. Give it a name (e.g. Trilium).+4. Set _Redirect URI_ to `https://<server>/callback`+5. Make sure _Confidential_ is checked and _Device authorization grant_ is unchecked.+6. Under scopes, check _openid_, _profile_ and _email_ (they should be near the end).+7. Save the application and copy the _Application ID_ and _Secret_.++Adjust `config.ini` as follows, replacing `<ApplicationId>` and `<Secret>` with the values from the last step as well as the `<server>` with a URL to your Trilium instance.++```+[MultiFactorAuthentication]+oauthBaseUrl=https://<server>+oauthClientId=<ApplicationId>+oauthClientSecret=<Secret>+oauthIssuerBaseUrl=https://gitlab.com+oauthIssuerName=GitLab+oauthClientAuthMethod=client_secret_post++```++> [!IMPORTANT]+> If you are using a self-hosted instance of GitLab, make sure to also update `oauthIssuerBaseUrl`, and keep the `oauthClientAuthMethod` line above.+>+> GitLab's token endpoint does not decode credentials sent via HTTP Basic, so without `oauthClientAuthMethod`, sign-in fails with a `server responded with a challenge in the WWW-Authenticate HTTP Header` error. Trilium applies this automatically for `gitlab.com`, but a self-hosted issuer URL cannot be detected.++## Kanidm++1. Create the client, add the redirect URL and grant the scopes, replacing `<server>` with the URL of your Trilium instance and `<group>` with an existing Kanidm group whose members may sign in:++ ```+ kanidm system oauth2 create trilium "Trilium" "https://<server>"+ kanidm system oauth2 add-redirect-url trilium "https://<server>/callback"+ kanidm system oauth2 update-scope-map trilium <group> openid profile email+ ```++ The `openid` scope is mandatory; without it Kanidm treats the client as plain OAuth 2.0.+2. Read the client secret:++ ```+ kanidm system oauth2 show-basic-secret trilium+ ```++Adjust `config.ini` as follows, replacing `<idm>` with the URL of your Kanidm instance and `<BasicSecret>` with the value from step 2:++```+[MultiFactorAuthentication]+oauthBaseUrl=https://<server>+oauthClientId=trilium+oauthClientSecret=<BasicSecret>+oauthIssuerBaseUrl=https://<idm>/oauth2/openid/trilium+oauthIssuerName=Kanidm+```++The client name you chose in step 1 is both the client ID and the last path segment of the issuer URL, so the two must match.++> [!IMPORTANT]+> Kanidm signs ID tokens with ES256, not RS256. Trilium detects this from the provider on v0.105.0 and later, so no extra configuration is needed. Do **not** run `kanidm system oauth2 warning-enable-legacy-crypto`, it downgrades the client to RS256 and disables ES256 entirely. On older Trilium versions sign-in fails with an `unexpected JWT alg` error.++## Pocket ID++> [!IMPORTANT]+> Pocket ID is passwordless, signing in requires a passkey. Register one and confirm you can sign in to Pocket ID itself _before_ switching Trilium over to OpenID Connect, otherwise you may find yourself unable to authenticate at either end.++1. Sign in to Pocket ID as an administrator and go to _OIDC Clients_ → _Add OIDC Client_.+2. Give it a name (e.g. Trilium).+3. Set _Callback URLs_ to `https://<server>/callback`, replacing `<server>` with the URL of your Trilium instance.+4. Save, then copy the _Client ID_, _Client Secret_ and _OIDC Discovery URL_.++Adjust `config.ini` as follows, using the values from step 4:++```+[MultiFactorAuthentication]+oauthBaseUrl=https://<server>+oauthClientId=<ClientID>+oauthClientSecret=<ClientSecret>+oauthIssuerBaseUrl=<OIDCDiscoveryURL>+oauthIssuerName=Pocket ID+```++> [!NOTE]+> Pocket ID gives you an _OIDC Discovery URL_ ending in `/.well-known/openid-configuration`. On v0.105.0 and later you can paste it as-is. On earlier versions, remove that suffix and use only the part before it.++> [!IMPORTANT]+> Pocket ID generates an RS256 signing key on first start, which works without further configuration. If you rotate it to Ed25519 (`pocket-id key-rotate --alg EdDSA --crv Ed25519`), ID tokens are signed with EdDSA instead. Trilium detects this automatically on v0.105.0 and later; older versions fail with `unexpected JWT alg received, expected RS256, got: EdDSA`.++## GitHub++GitHub cannot be used as an identity provider because it is plain OAuth 2.0 and not OpenID Connect, so it will fail with `OAUTH_RESPONSE_IS_NOT_CONFORM`.+++1. Go to [Google Cloud's Clients](https://console.cloud.google.com/auth/clients) dashboard and select _Create client_.+2. For _Application type,_ select _Web application_.+3. In _Authorized redirect URIs_, set `https://<server>/callback`.+4. Press _Create_ and copy _Client ID_ and _Client secret_.++Adjust `config.ini` as follows, replacing `<ClientID>` and `<ClientSecret>` with the values from the last step as well as the `<server>` with a URL to your Trilium instance.++```+[MultiFactorAuthentication]+oauthBaseUrl=https://<server>+oauthClientId=<ClientID>+oauthClientSecret=<ClientSecret>+```\ No newline at end of filediff --git a/docs/User Guide/User Guide/Installation & Setup/Server Installation/System Requirements.md b/docs/User Guide/User Guide/Installation & Setup/Server Installation/System Requirements.mdnew file mode 100644index 0000000000..4b0221ee0c--- /dev/null+++ b/docs/User Guide/User Guide/Installation & Setup/Server Installation/System Requirements.md@@ -0,0 +1,11 @@+# System Requirements+* Using Docker, the server can be run on Windows, Linux and macOS devices.+* Native binaries are provided for Linux x64 and ARM (`aarch64`).++## Legacy ARM support++The Docker builds also provide `linux/arm/v7` and `linux/arm/v8` platforms. These platforms are considered legacy since Trilium uses Node.js version 24 which have [officially downgraded support](https://github.com/nodejs/node/commit/6682861d6f) for these platforms to “experimental”.++As a result, Trilium needs to use Node.js 22 for these versions. As soon as soon Node.js 22 will no longer be compatible, support for `armv7` and `armv8` will be dropped entirely.++Regardless of upstream support, these platforms are supported on a best-effort basis and are not officially supported by the Trilium development team. Bug reports are accepted but they will not be treated with priority; contributions are welcome.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Installation & Setup/Server Installation/Third-party cloud hosting.md b/docs/User Guide/User Guide/Installation & Setup/Server Installation/Third-party cloud hosting.mdnew file mode 100644index 0000000000..58e7f72f29--- /dev/null+++ b/docs/User Guide/User Guide/Installation & Setup/Server Installation/Third-party cloud hosting.md@@ -0,0 +1,26 @@+# Third-party cloud hosting+As an alternative to [hosting your own Trilium instance](1.%20Installing%20the%20server), there are two services out there that provide out of the box support for Trilium.++> [!IMPORTANT]+> **Disclaimer**: The Trilium Notes project and maintainers are not directly affiliated with either of the projects.+>+> PikaPods have gracefully offered us free credits for testing purposes.++## Cloud instance providers++### PikaPods++1. Go to [pikapods.com](https://www.pikapods.com) and sign up.+2. In the “Available Apps” section, look for "TriliumNext+ and select “Run your own”.+3. Follow the on-screen instructions to set up your own cloud hosted instance.++PikaPods generally updates their Trilium instances to the latest version within a two-week interval after a new version is released.++## Matching your version with the cloud instance++Please note that once you set up <a class="reference-link" href="../Synchronization.md">Synchronization</a> between a cloud instance and [desktop](../Desktop%20Installation.md) clients, it's important that the version of the desktop application and the server match up.++When setting up a cloud instance, it's best to check the version of the server by accessing it via a web browser and going to the _About_ section. It's best that both the desktop and the server have the same _App version_; however it's generally OK to update the desktop to a newer version than the server if it has the same _Sync version_.++If the _Sync version_ between the server and the desktop application doesn't match, synchronization will not work.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Installation & Setup/Synchronization.md b/docs/User Guide/User Guide/Installation & Setup/Synchronization.mdnew file mode 100644index 0000000000..088d088f5d--- /dev/null+++ b/docs/User Guide/User Guide/Installation & Setup/Synchronization.md@@ -0,0 +1,77 @@+# Synchronization+Trilium is an offline-first note-taking application that stores all data locally on the desktop client. However, it also offers the option to set up synchronization with a server instance, allowing multiple desktop clients to sync with a central server. This creates a star-shaped topology:++++In this setup, a central server (referred to as the _sync server_) and multiple _client_ (or _desktop_) instances synchronize with the sync server. Once configured, synchronization is automatic and ongoing, requiring no manual intervention.++## Setting Up Synchronization++### Security Considerations++Setting up the server securely is critical and can be complex. It is crucial to use a valid [TLS certificate](Server%20Installation/HTTPS%20\(TLS\).md) (HTTPS) rather than an unencrypted HTTP connection to ensure security and avoid potential vulnerabilities.++### Synchronizing a Desktop Instance with a Sync Server++This method is used when you already have a desktop instance of Trilium and want to set up a sync server on your web host.++1. **Server Deployment**: Ensure your server instance is deployed but uninitialized.+2. **Desktop Configuration**: Open your desktop instance, navigate to <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Options.md">Options</a> → _Sync_ → _Sync server_, and set the _Server address_ to your sync server's address.+ * Note that the sync server can also be overridden through <a class="reference-link" href="../Advanced%20Usage/Configuration%20(config.ini%20or%20environment%20variables).md">Configuration (config.ini or environment variables)</a>, case in which that value takes precedence. If that's the case, a field called _Server in use_ indicates it.+3. **Testing Sync**: Click the _Test sync_ button to verify the connection to the sync server.+ * If successful, the client will start pushing all data to the server instance.+ * This process may take some time, but you can continue using Trilium. Periodically check the server instance to confirm when the sync is complete. Once finished, you should see the login screen on the server.++### Synchronizing a Desktop Instance from a Sync Server++This method is used when you already have a sync server and want to configure a new desktop instance to sync with it.++1. **Desktop Setup**: Follow the [desktop installation page](Desktop%20Installation.md).+2. **Initial Configuration**: When prompted, choose the option to set up sync with a sync server.++++1. **Server Details**: Configure the Trilium server address and enter the correct username and password for authentication.+2. **Finish Setup**: Click the "Finish setup" button. If successful, you will see the following screen:++++Once synchronization is complete, you will be automatically redirected to the Trilium application.++### Desktop-to-desktop sync++This method allows two desktop instances to synchronize between each other without requiring a <a class="reference-link" href="Server%20Installation.md">Server Installation</a>.++> [!WARNING]+> Since v0.104.0, LAN access needs to be enabled to allow this sync to function. See <a class="reference-link" href="Desktop%20Installation/Network%20Access.md">Network Access</a> for information on how to do so.++## Proxy Configuration++Two proxy setups are supported:++* **Explicit Proxy Configuration**: Set the proxy server in Options / Sync. Only unauthenticated proxy servers are supported.+* **System Proxy Settings**: If no proxy server is explicitly configured, Trilium will use the system proxy settings.++## Troubleshooting++### Date/Time Synchronization++For successful synchronization, both client and server must have the same date and time, with a tolerance of up to five minutes.++### Certificate Issues++When using TLS, Trilium will verify the server certificate. If verification fails (e.g., due to self-signed certificates or certain corporate proxies), you can run the Trilium client with the `NODE_TLS_REJECT_UNAUTHORIZED` environment variable set to `0`:++```+export NODE_TLS_REJECT_UNAUTHORIZED=0+```++This will disable TLS certificate verification, significantly reducing security and exposing the setup to MITM attacks. It is strongly recommended to use a valid signed server certificate. Newer Trilium versions include a script called `trilium-no-cert-check.sh` for this purpose.++### Conflict Resolution++If you edit the same note on multiple instances before synchronization, Trilium resolves conflicts by retaining the newer change and discarding the older one. The older version remains accessible in [note revisions](../Basic%20Concepts%20and%20Features/Notes/Note%20Revisions.md), allowing data recovery if needed.++### Hash Check++After each synchronization, Trilium computes a hash of all synced data on both the client and the sync server. If there is a discrepancy, Trilium will automatically initiate a recovery mechanism to resolve the issue.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Installation & Setup/Synchronization_image.png b/docs/User Guide/User Guide/Installation & Setup/Synchronization_image.pngnew file mode 100644index 0000000000..344262a9a6Binary files /dev/null and b/docs/User Guide/User Guide/Installation & Setup/Synchronization_image.png differdiff --git a/docs/User Guide/User Guide/Installation & Setup/Synchronization_sync-in-progress.png b/docs/User Guide/User Guide/Installation & Setup/Synchronization_sync-in-progress.pngnew file mode 100644index 0000000000..9eb684b380Binary files /dev/null and b/docs/User Guide/User Guide/Installation & Setup/Synchronization_sync-in-progress.png differdiff --git a/docs/User Guide/User Guide/Installation & Setup/Synchronization_sync-init.png b/docs/User Guide/User Guide/Installation & Setup/Synchronization_sync-init.pngnew file mode 100644index 0000000000..ac9c1e3a67Binary files /dev/null and b/docs/User Guide/User Guide/Installation & Setup/Synchronization_sync-init.png differdiff --git a/docs/User Guide/User Guide/Installation & Setup/Upgrading TriliumNext.md b/docs/User Guide/User Guide/Installation & Setup/Upgrading TriliumNext.mdnew file mode 100644index 0000000000..a98917ba39--- /dev/null+++ b/docs/User Guide/User Guide/Installation & Setup/Upgrading TriliumNext.md@@ -0,0 +1,17 @@+# Upgrading TriliumNext+This document outlines the steps required to upgrade Trilium to a new release version.++## How to Upgrade++Trilium does not support built-in automatic upgrades; all updates must be performed manually. The upgrade process varies depending on the installation method:++* [**Docker Server Installation**](Server%20Installation/1.%20Installing%20the%20server/Using%20Docker.md): Pull the new image and restart the container.+* **Other Installations**: Download the latest version from the [release page](https://github.com/TriliumNext/Trilium/releases/latest) and replace the existing application files.++## Database Compatibility and Migration++Upon startup, Trilium will automatically migrate the [database](../Advanced%20Usage/Database.md) to the new version. Note that after migration, older versions of Trilium will be unable to read the database. If you need to revert to a previous version of Trilium and its database, you can restore the [backup](Backup.md) that is created prior to migration.++## Sync Compatibility++The [synchronization](Synchronization.md) protocol used by Trilium is versioned, requiring all members of the sync cluster to use the same protocol version. Therefore, when upgrading to a new version, you may need to upgrade all instances in the sync cluster. Changes to the sync protocol version are typically indicated on the release page.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Installation & Setup/Web Clipper.md b/docs/User Guide/User Guide/Installation & Setup/Web Clipper.mdnew file mode 100644index 0000000000..b2c25ee65b--- /dev/null+++ b/docs/User Guide/User Guide/Installation & Setup/Web Clipper.md@@ -0,0 +1,90 @@+# Web Clipper+++Trilium Web Clipper is a web browser extension which allows user to clip text, screenshots, whole pages and short notes and save them directly to Trilium Notes.++## Supported browsers++Trilium Web Clipper officially supports the following web browsers:++* Mozilla Firefox, using Manifest v2.+* Google Chrome, using Manifest v3. Theoretically the extension should work on other Chromium-based browsers as well, but they are not officially supported.++## Obtaining the extension++The extension is available from the official browser web stores:++* **Firefox**: [Trilium Web Clipper on Firefox Add-ons](https://addons.mozilla.org/firefox/addon/trilium-notes-web-clipper/)+* **Chrome**: [Trilium Web Clipper on Chrome Web Store](https://chromewebstore.google.com/detail/trilium-web-clipper/ofoiklieachadcaeffficgjaajojpkpi)++## Functionality++* select text and clip it with the right-click context menu+* click on an image or link and save it through context menu+* save whole page from the popup or context menu+* save screenshot (with crop tool) from either popup or context menu+* create short text note from popup++## Location of clippings++Trilium will save these clippings as a new child note under a "clipper inbox" note.++By default, that's the <a class="reference-link" href="../Advanced%20Usage/Advanced%20Showcases/Day%20Notes.md">Day Notes</a> but you can override that by setting the [label](../Advanced%20Usage/Attributes.md) `clipperInbox`, on any other note.++If there's multiple clippings from the same page (and on the same day), then they will be added to the same note.++## Keyboard shortcuts++Keyboard shortcuts are available for most functions:++* Save selected text: <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>S</kbd> (Mac: <kbd>⌘</kbd>+<kbd>⇧</kbd>+<kbd>S</kbd>)+* Save whole page: <kbd>Alt</kbd>+<kbd>Shift</kbd>+<kbd>S</kbd> (Mac: <kbd>⌥</kbd>+<kbd>⇧</kbd>+<kbd>S</kbd>)+* Save screenshot: <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>E</kbd> (Mac: <kbd>⌘</kbd>+<kbd>⇧</kbd>+<kbd>E</kbd>)++To set custom shortcuts, follow the directions for your browser.++* **Firefox**: `about:addons` → Gear icon ⚙️ → Manage extension shortcuts+* **Chrome**: `chrome://extensions/shortcuts`++> [!NOTE]+> On Firefox, the default shortcuts interfere with some browser features. As such, the keyboard combinations will not trigger the Web Clipper action. To fix this, simply change the keyboard shortcut to something that works. The defaults will be adjusted in future versions.++## Configuration++The extension needs to connect to a running Trilium instance. By default, it scans a port range on the local computer to find a desktop Trilium instance.++It's also possible to configure the [server](Server%20Installation.md) address if you don't run the desktop application, or want it to work without the desktop application running.++## Testing development versions++Development versions are version pre-release versions, generally meant for testing purposes. These are not available in the Google or Firefox web stores, but can be downloaded from either:++* [GitHub Releases](https://github.com/TriliumNext/Trilium/releases) by looking for releases starting with _Web Clipper._+* Artifacts in GitHub Actions, by looking for the [_Deploy web clipper extension_ workflow](https://github.com/TriliumNext/Trilium/actions/workflows/web-clipper.yml). Once a workflow run is selected, the ZIP files are available in the _Artifacts_ section, under the name `web-clipper-extension`.++### For Chrome++1. Download `trilium-web-clipper-[x.y.z]-chrome.zip`.+2. Extract the archive.+3. In Chrome, navigate to `chrome://extensions/`+4. Toggle _Developer Mode_ in top-right of the page.+5. Press the _Load unpacked_ button near the header.+6. Point to the extracted directory from step (2).++### For Firefox++> [!WARNING]+> Firefox prevents installation of unsigned packages in the “retail” version. To be able to install extensions from disk, consider using _Firefox Developer Edition_ or a non-branded version of Firefox (e.g. _GNU IceCat_).+>+> One time, go to `about:config` and change `xpinstall.signatures.required` to `false`.++1. Navigate to `about:addons`.+2. Select _Extensions_ in the left-side navigation.+3. Press the _Gear_ icon on the right of the _Manage Your Extensions_ title.+4. Select _Install Add-on From File…_+5. Point it to `trilium-web-clipper-[x.y.z]-firefox.zip`.+6. Press the _Add_ button to confirm.++## Credits++Some parts of the code are based on the [Joplin Notes browser extension](https://github.com/laurent22/joplin/tree/master/Clipper).\ No newline at end of filediff --git a/docs/User Guide/User Guide/Installation & Setup/Web Clipper_image.png b/docs/User Guide/User Guide/Installation & Setup/Web Clipper_image.pngnew file mode 100644index 0000000000..de3c69b819Binary files /dev/null and b/docs/User Guide/User Guide/Installation & Setup/Web Clipper_image.png differdiff --git a/docs/User Guide/User Guide/Miscellaneous/License.md b/docs/User Guide/User Guide/Miscellaneous/License.mdnew file mode 100644index 0000000000..b1471635de--- /dev/null+++ b/docs/User Guide/User Guide/Miscellaneous/License.md@@ -0,0 +1,237 @@+# License+GNU AFFERO GENERAL PUBLIC LICENSE+Version 3, 19 November 2007++Copyright (C) 2007 Free Software Foundation, Inc. [https://fsf.org/](https://fsf.org/)++Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.++## Preamble++The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software.++The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users.++When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.++Developers that use our General Public Licenses protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you legal permission to copy, distribute and/or modify the software.++A secondary benefit of defending all users' freedom is that improvements made in alternate versions of the program, if they receive widespread use, become available for other developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation. However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License permits making a modified version and letting the public access it on a server without ever releasing its source code to the public.++The GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified source code becomes available to the community. It requires the operator of a network server to provide the source code of the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly accessible server, gives the public access to the source code of the modified version.++An older license, called the Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license, not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this license.++The precise terms and conditions for copying, distribution and modification follow.++## TERMS AND CONDITIONS++### 0\. Definitions.++"This License" refers to version 3 of the GNU Affero General Public License.++"Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.++"The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations.++To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work.++A "covered work" means either the unmodified Program or a work based on the Program.++To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.++To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.++An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.++### 1\. Source Code.++The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work.++A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.++The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.++The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.++The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.++The Corresponding Source for a work in source code form is that same work.++### 2\. Basic Permissions.++All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.++You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.++Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.++### 3\. Protecting Users' Legal Rights From Anti-Circumvention Law.++No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.++When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.++### 4\. Conveying Verbatim Copies.++You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.++You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.++### 5\. Conveying Modified Source Versions.++You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:++* a) The work must carry prominent notices stating that you modified it, and giving a relevant date.+* b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices".+* c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.+* d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.++A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.++### 6\. Conveying Non-Source Forms.++You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:++* a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.+* b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.+* c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.+* d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.+* e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.++A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.++A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.++"Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.++If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).++The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.++Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.++### 7\. Additional Terms.++"Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.++When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.++Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:++* a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or+* b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or+* c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or+* d) Limiting the use for publicity purposes of names of licensors or authors of the material; or+* e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or+* f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.++All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.++If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.++Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.++### 8\. Termination.++You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).++However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.++Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.++Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.++### 9\. Acceptance Not Required for Having Copies.++You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.++### 10\. Automatic Licensing of Downstream Recipients.++Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.++An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.++You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.++### 11\. Patents.++A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version".++A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.++Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.++In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.++If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.++If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.++A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.++Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.++### 12\. No Surrender of Others' Freedom.++If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.++### 13\. Remote Network Interaction; Use with the GNU General Public License.++Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. This Corresponding Source shall include the Corresponding Source for any work covered by version 3 of the GNU General Public License that is incorporated pursuant to the following paragraph.++Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License.++### 14\. Revised Versions of this License.++The Free Software Foundation may publish revised and/or new versions of the GNU Affero General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.++Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation.++If the Program specifies that a proxy can decide which future versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.++Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.++### 15\. Disclaimer of Warranty.++THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.++### 16\. Limitation of Liability.++IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.++### 17\. Interpretation of Sections 15 and 16.++If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.++END OF TERMS AND CONDITIONS++## How to Apply These Terms to Your New Programs++If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.++To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.++```+ <one line to give the program's name and a brief idea of what it does.>+ Copyright (C) <year> <name of author>++ This program is free software: you can redistribute it and/or modify+ it under the terms of the GNU Affero General Public License as+ published by the Free Software Foundation, either version 3 of the+ License, or (at your option) any later version.++ This program is distributed in the hope that it will be useful,+ but WITHOUT ANY WARRANTY; without even the implied warranty of+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ GNU Affero General Public License for more details.++ You should have received a copy of the GNU Affero General Public License+ along with this program. If not, see <https://www.gnu.org/licenses/>.+```++Also add information on how to contact you by electronic and paper mail.++If your software can interact with users remotely through a computer network, you should also make sure that it provides a way for users to get its source. For example, if your program is a web application, its interface could display a "Source" link that leads users to an archive of the code. There are many ways you could offer source, and different solutions will be better for different programs; see section 13 for the specific requirements.++You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU AGPL, see [https://www.gnu.org/licenses/](https://www.gnu.org/licenses/).\ No newline at end of filediff --git a/docs/User Guide/User Guide/Miscellaneous/Patterns of personal knowledge.md b/docs/User Guide/User Guide/Miscellaneous/Patterns of personal knowledge.mdnew file mode 100644index 0000000000..4eeecd6e6d--- /dev/null+++ b/docs/User Guide/User Guide/Miscellaneous/Patterns of personal knowledge.md@@ -0,0 +1,155 @@+# Patterns of personal knowledge+> [!NOTE]+> This article is a description of the original author of Trilium (zadam) in regards with his own knowledge base.++This page contains description of some of the patterns I use to organize information in my knowledge base. This is meant to give some inspiration of how one might create and structure their knowledge base in general and also specifically in Trilium Notes. It also gives some background and justification for some of the design decisions.++## Meta patterns++Just to be clear, meta patterns are "patterns of patterns", i.e. patterns appearing in other patterns.++### Hierarchical organization of information++Basic meta pattern is that I sort notes (units of information) into a hierarchy - I have some "top level" notes which represent coarse grained organization, these then split into sub-notes defining finer grained organization and so on. I consider this hierarchical (tree) organization very efficient for organization of large amounts of information. A lot of note taking software (such as Evernote) are frustratingly limited in this regard which limits scalability of the software to large amounts of notes.++#### Scalability++It's important to frame the following (meta) patterns with some idea of how large amount of data are we talking about.++My rule of thumb for estimation of size of personal knowledge base is that you can reasonably produce around 10 notes a day, which is 3650 in a year. I plan to use my knowledge base long term (with or without Trilium Notes), probably decades so you can easily get to number 100 000 or even more. Right now, my personal knowledge base has around 10 000 notes.++100 000 is a number to which most note taking software doesn't scale well (in both performance and UI). Yet I don't think it's really very much considering a lifetime of knowledge.++#### Lazy hierarchy++My approach to creating the hierarchy is being lazy - I don't create the structure first and then fill it with notes, instead I create single note for some specific topic and start using this one note. Once the content starts to grow, and I see how _some_ parts could be split out, I move them out into separate sub notes. As an example I have a book review for _The Fellowship of the Ring_:++* Book reviews+ * The Fellowship of the Ring++The note contains basic book info (author, publisher etc.), book highlights with the comments and then overall review. Now it turns out there's far too many book highlights and overall review is also rather long, so I want to change the structure to the following:++* Book reviews+ * The Fellowship of the Ring _(still contains basic info)_+ * Highlights+ * Review++If I used standard text file stored in a filesystem I would soon run into an annoying problem that in order to split out the Highlights and Review into sub-notes I would also have to convert _The Fellowship of the Ring_ from text file into directory and split out all sections of the note into sub-notes. Instead, Trilium treats all notes as equal - both leaf notes and inner notes can have both text content which allows me to sub-structure only content which needs it.++### Sorting notes into multiple places in the hierarchy++While organizing the notes into the hierarchy, you very quickly run into a dilemma - your note seem to belong to two places in the hierarchy equally. As an example - you want to make a note about [bash](https://en.wikipedia.org/wiki/Bash_\(Unix_shell\)) - does it belong to "OS / Linux" or "Programming / Scripting languages"? This is actually a false dichotomy forced down by the limits of the basic tree hierarchy - the answer is _of course it belongs to both_. This is the reason why Trilium doesn't use standard tree structure (which requires every note to have exactly one parent), but an extension which allows every note to have several parents, thus effectively allowing it to appear in multiple places in the hierarchy. For lack of better term I call this "cloning". The main problem with this term is that it suggests that each clone must have an original, but here all clones are completely equal - effectively there's no original.++In tech lingo, it might be better to describe it as a [hard link](https://en.wikipedia.org/wiki/Hard_link) with an important difference that it is possible to hard link (clone) a directory (inner note).++### Protected notes++I have Trilium Notes opened non-stop. Sometimes I forget to lock my computer when going to the bathroom. Sometimes I let a friend or family member to use my computer for a minute without supervision. They might click on (running) Trilium and inadvertently see a note I really don't want anybody to see (personal diary, credentials). To cover this, Trilium has a concept of "[protected notes](https://github.com/zadam/trilium/wiki/Protected-notes)" - protected note is encrypted and on top of that requires the user to enter the password every 5 minutes which guarantees that such note can be in a readable state only for small amount of time. Working with ordinary (not protected) notes don't require password so you're not bothered by extra security when it's not needed.++### Archiving notes++Notes can lose relevancy with time - let's say I switch jobs - all the notes specific to the former employer immediately lose most of its import. This doesn't mean I want to delete these notes though - typically I just want them to somehow deprioritize - in Trilium I would do that by assigning an [inherited](https://github.com/zadam/trilium/wiki/Attribute-inheritance) [label](https://github.com/zadam/trilium/wiki/Attributes) `archived` to the company root note. The main effect of this label is that all the notes from this sub-tree are filtered out from search results (fast search via note autocomplete is my main [navigation approach](https://github.com/zadam/trilium/wiki/Note-navigation)). Apart from this, I also typically move such outdated notes to some less prominent place in the hierarchy.++I use archivation also for notes which are not very relevant from their creation - an example might be automatically imported reddit comments.++Sometimes there's no clear _category_ split between relevant and non-relevant notes, in that case I just create "_OLD_" note with `archived` label and move all irrelevant notes there. So my credentials note might look something like this:++* Credentials+ * Personal+ * OLD _(contains a bunch of notes with credentials for services I don't use anymore)_+ * Gmail+ * Github+ * ...++## Patterns++### Day note++Every day has its note which contains or references everything related to the given day. Structure looks like this:++* 2018+ * 11 - November+ * 26 - Monday+ * 27 - Tuesday+ * subnote 1++Day note serves as a workspace and note inbox at the same time - it's the default location to create a note when I don't have time to think about proper placement. At the end of the day I typically review my day note and clone the notes into suitable locations in the hierarchy.++Trilium has this pattern partly built-in - Trilium understands and can create this Year / Month / Day structure semi-automatically (on API call). There's also global keyboard shortcut `CTRL-ALT-P` which will create new note in the day note.++What notes do I keep under this day note?++* TODO list for given day (this can be automated - see <a class="reference-link" href="../Advanced%20Usage/Advanced%20Showcases/Task%20Manager.md">Task Manager</a>)+* Personal diary+* [clones](../Basic%20Concepts%20and%20Features/Notes/Cloning%20Notes.md) of notes I created during this day (which kind of represents what I've been working on).+* I often clone notes (or sub-trees) of e.g. projects I'm working on at given day so they are at hand+* I have some [scripts](../Scripting.md) which allow me to track certain daily metrics (like weight). These are saved into one daily "data note" (actually JSON [code note](../Note%20Types/Code.md)).+ * I have other scripts which then help me to visualize these data (see a <a class="reference-link" href="../Advanced%20Usage/Advanced%20Showcases/Weight%20Tracker.md">Weight Tracker</a> example)+ * I have a script which automatically imports all my comments from reddit into the day note.+ * People are sometimes wondering why. The answer is that I usually put some effort and thought into a comment and that's why I feel it's worth preserving, especially if it can be done automatically.++For most notes, this day note placement is _secondary_ and their primary location is somewhere else (e.g. for a book review I've been working on it's _Book / Reviews_, not the day note). So for this pattern to work, ability to [clone](../Basic%20Concepts%20and%20Features/Notes/Cloning%20Notes.md) notes into multiple places is pretty fundamental.++### Projects++_Project_ is pretty self-explanatory, for me specifically it also means being long term (years) - an example of a project might be Trilium Notes or university studies. Given their longevity, projects can be large and deep, but their structure is very domain specific, and I don't see any common patterns. What's pretty clear is they are often widely interconnected with other parts of the knowledge base - e.g. university credentials are cloned from "Credentials / University" top level notes and Trilium related blog posts are in "Blog / \[Name of the blog\] / Trilium".++_Epics_ are the same thing as projects, but differ in scope - they are typically several months long and as such are usually placed into a year note (e.g. _2018 / Epics_). Epics are often of work nature (also cloned into work note) and personal (e.g. currently I have large epic for moving to a different city).++I don't have a term for short term projects (typically several days long), but continuing the scrum analogy I might call them _story_. These are often placed directly into day notes and manually moved from one day to another (or place into a month note, e.g. _2018 / 11 - November_).++### Credentials++I keep all my credentials in the knowledge base, they are sorted into categories - work related, project related, personal per country etc. These notes are of course [protected](../Basic%20Concepts%20and%20Features/Notes/Protected%20Notes.md) and are often cloned into other places (e.g. project credentials are cloned into the project itself). This is a pretty important advantage compared to traditional tools like KeePass - all the relevant information is centralized into one place without compromising security.++### People profiles++This might seem creepy to some, but I keep a profile on most people. It contains pretty standard things like date of birth, contacts, address, but also current and previous employments, their hobbies and worldviews and sometimes even important (IM/mail/meatspace) conversations. Just about everything I find notable. It helps to refresh some basic info before meeting people, especially if you haven't been in touch in a while. It gets pretty awkward to ask for the tenth time where do they work for example, because you keep forgetting it.++Naturally I have a lot of (extended) family members, friends, acquaintances etc. so I need some way to sort them. My main method is to sort them by social circle (work, high school, sports club etc.), sometimes also by their town of residence. Family _circle_ is still too large so the further organization is by _clan_ (as in "Smiths"). Some people are members of several such circles, so they are just cloned into multiple places.++For family specifically it's pretty useful to create a <a class="reference-link" href="../Note%20Types/Relation%20Map.md">Relation Map</a> to visualize relationships:++<figure class="image"><img style="aspect-ratio:941/758;" src="Patterns of personal knowledge_relation-map-family.png" width="941" height="758"></figure>++### Books++Of course, I keep standard "To read" list. I also keep a record on the books I've read - typically one book has one subtree where the root has some basic info like author, page count, publication date, date started, date finished (in the form of <a class="reference-link" href="../Advanced%20Usage/Attributes/Promoted%20Attributes.md">Promoted Attributes</a>). I also write a (private) review and keep list of highlights from Kindle, optionally with some commentary, these are usually stored in sub notes (unless they are pretty short).++To keep the list of books manageable, I sort them per year (of reading them), this also gives me some basic overview of "reading performance" for given year. I plan to create a [script](../Scripting.md) which would show some timeline chart visualizing book attributes `dateStarted` - `dateFinished` to have nicer view of my reading sprints and trends.++Some specific authors also have their own note which contains cloned book reviews, links to interviews and other related resources.++I have similar system for movies and TV shows, but not as sophisticated.++### Personal diary++This is a place to reflect on events, experiences, new findings etc. This can help you get deeper understanding of your inner self, clarify your thinking and make better decisions as a result.++I sort personal diary notes directly under _day note_ (explained above), but it can be cloned also to e.g. "trip note" (if the diary note is about given trip) or to person's profile (if the person plays a role in the diary note). All my diary notes are [protected](../Basic%20Concepts%20and%20Features/Notes/Protected%20Notes.md) since they are usually pretty sensitive.++### Documents++I keep all my personal documents (ID, passport, education certificates ...) scanned in the knowledge base. They are [synchronized](../Installation%20%26%20Setup/Synchronization.md) across every PC which provides decent backup and makes them available everywhere.++Advantage compared to e.g. keeping them in Dropbox or Google Drive is that they are not stored on some 3rd party server and they can be encrypted (see <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Notes/Protected%20Notes.md">Protected Notes</a>).++### Inventory++Inventory contains documents and other relevant importation for my important belongings - e.g. for car you can keep the registration card, maintenance record, related costs etc. I also keep inventory for some items personally important to me - mainly computers, phones, cameras and similar electronics. This can be practical at times but also provides sentimental value.++### Topic knowledge base++This where I store hard "knowledge" - summarized topics and findings from different domains. Topics can range from traditional sciences - physics, history, economy to philosophy, mental models, apps (notes about specific apps I use) etc. Of course this is very subjective - given what I do, my Physics sub-tree is pretty sparse compared to my Programming subtree.++### Work knowledge base++I usually keep top level note for the company I currently work at (past jobs are moved elsewhere). I track basic organization of the company (divisions, business units), who is who (<a class="reference-link" href="../Note%20Types/Relation%20Map.md">Relation Map</a>) are again useful for visualization), projects I work at etc.++There's a number of credentials to various company services I need to use. Companies usually have a bunch of complex processes and tools. I record meeting minutes, link to the company wiki (which is usually difficult to find relevant info). In general there's a lot of company specific information I need to know or need have them at hand in a nice structure I can understand. Often it's just copy pasting and reshuffling of existing information into something more understandable for me.++From my experience, keeping this makes me more productive and even more importantly dramatically reduces frustration and stress.++## Conclusion++I could probably go on with more patterns (e.g. study notes, travelling), but I think you get the idea. Whatever is important in your life, it probably makes sense to document and track it.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Miscellaneous/Patterns of personal knowledge_relation-map-family.png b/docs/User Guide/User Guide/Miscellaneous/Patterns of personal knowledge_relation-map-family.pngnew file mode 100644index 0000000000..39788216a7Binary files /dev/null and b/docs/User Guide/User Guide/Miscellaneous/Patterns of personal knowledge_relation-map-family.png differdiff --git a/docs/User Guide/User Guide/Miscellaneous/Privacy Policy.md b/docs/User Guide/User Guide/Miscellaneous/Privacy Policy.mdnew file mode 100644index 0000000000..fab3346c09--- /dev/null+++ b/docs/User Guide/User Guide/Miscellaneous/Privacy Policy.md@@ -0,0 +1,17 @@+# Privacy Policy+### Trilium Notes++Trilium Notes does not collect/send any data from the user's installation, i.e. no analytics, no telemetry etc. The data flows only between user controlled / installed applications, without any intermediary.++Automatic network activity consists of:++* Trilium periodically queries URL [https://github.com/TriliumNext/Trilium/releases](https://github.com/TriliumNext/Trilium/releases) to see if there's a new stable version released. (check only, there's no automatic download and/or installation).+* Trilium will download spelling dictionaries automatically as needed based on language settings++### Trilium Web Clipper++Trilium Web Clipper does not collect/send any data from the user's installation, i.e. no analytics, no telemetry etc. The data flows only between user controlled / installed applications, without any intermediary.++### Trilium Sender for Android++Trilium Sender for Android does not collect/send any data from the user's installation, i.e. no analytics, no telemetry etc. The data flows only between user controlled / installed applications, without any intermediary.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Note Types.md b/docs/User Guide/User Guide/Note Types.mdnew file mode 100644index 0000000000..fc3612024a--- /dev/null+++ b/docs/User Guide/User Guide/Note Types.md@@ -0,0 +1,42 @@+# Note Types+One of the core features of Trilium is that it supports multiple types of notes, depending on the need.++## Creating a new note with a different type via the note tree++The default note type in Trilium (e.g. when creating a new note) is <a class="reference-link" href="Note%20Types/Text.md">Text</a>, since it's for general use.++To create a new note of a different type, head to the <a class="reference-link" href="Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.md">Note Tree</a> and right click an existing note where to place the new one and select:++* _Insert note after_, to put the new note underneath the one selected.+* _Insert child note_, to insert the note as a child of the selected note.++++## Creating a new note of a different type via add link or new tab++* When adding a [link](Note%20Types/Text/Links.md) in a <a class="reference-link" href="Note%20Types/Text.md">Text</a> note, type the desired title of the new note and press Enter. Afterwards the type of the note will be asked.+* Similarly, when creating a new tab, type the desired title and press Enter.++## Changing the type of a note++It is possible to change the type of a note after it has been created via the _Basic Properties_ tab in the <a class="reference-link" href="Basic%20Concepts%20and%20Features/UI%20Elements/Ribbon.md">Ribbon</a>. Note that it's generally a good idea to change the note type only if the note is empty. Can also be used to edit the [source of a note](Advanced%20Usage/Note%20source.md).++## Supported note types++The following note types are supported by Trilium:++| Note Type | Description |+| --- | --- |+| <a class="reference-link" href="Note%20Types/Text.md">Text</a> | The default note type, which allows for rich text formatting, images, admonitions and right-to-left support. |+| <a class="reference-link" href="Note%20Types/Code.md">Code</a> | Uses a mono-space font and can be used to store larger chunks of code or plain text than a text note, and has better syntax highlighting. |+| <a class="reference-link" href="Note%20Types/Saved%20Search.md">Saved Search</a> | Stores the information about a search (the search text, criteria, etc.) for later use. Can be used for quick filtering of a large amount of notes, for example. The search can easily be triggered. |+| <a class="reference-link" href="Note%20Types/Relation%20Map.md">Relation Map</a> | Allows easy creation of notes and relations between them. Can be used for mainly relational data such as a family tree. |+| <a class="reference-link" href="Note%20Types/Note%20Map.md">Note Map</a> | Displays the relationships between the notes, whether via relations or their hierarchical structure. |+| <a class="reference-link" href="Note%20Types/Render%20Note.md">Render Note</a> | Used in <a class="reference-link" href="Scripting.md">Scripting</a>, it displays the HTML content of another note. This allows displaying any kind of content, provided there is a script behind it to generate it. |+| <a class="reference-link" href="Collections.md">Collections</a> | Displays the children of the note either as a grid, a list, or for a more specialized case: a calendar. <br> <br>Generally useful for easy reading of short notes. |+| <a class="reference-link" href="Note%20Types/Mermaid%20Diagrams.md">Mermaid Diagrams</a> | Displays diagrams such as bar charts, flow charts, state diagrams, etc. Requires a bit of technical knowledge since the diagrams are written in a specialized format. |+| <a class="reference-link" href="Note%20Types/Canvas.md">Canvas</a> | Allows easy drawing of sketches, diagrams, handwritten content. Uses the same technology behind [excalidraw.com](https://excalidraw.com). |+| <a class="reference-link" href="Note%20Types/Web%20View.md">Web View</a> | Displays the content of an external web page, similar to a browser. |+| <a class="reference-link" href="Note%20Types/Mind%20Map.md">Mind Map</a> | Easy for brainstorming ideas, by placing them in a hierarchical layout. |+| <a class="reference-link" href="Collections/Geo%20Map.md">Geo Map</a> | Displays the children of the note as a geographical map, one use-case would be to plan vacations. It even has basic support for tracks. Notes can also be created from it. |+| <a class="reference-link" href="Note%20Types/File.md">File</a> | Represents an uploaded file such as PDFs, images, video or audio files. |\ No newline at end of filediff --git a/docs/User Guide/User Guide/Note Types/1_Code_image.png b/docs/User Guide/User Guide/Note Types/1_Code_image.pngnew file mode 100644index 0000000000..7520e45c18Binary files /dev/null and b/docs/User Guide/User Guide/Note Types/1_Code_image.png differdiff --git a/docs/User Guide/User Guide/Note Types/1_File_image.png b/docs/User Guide/User Guide/Note Types/1_File_image.pngnew file mode 100644index 0000000000..498813236bBinary files /dev/null and b/docs/User Guide/User Guide/Note Types/1_File_image.png differdiff --git a/docs/User Guide/User Guide/Note Types/1_Text_image.png b/docs/User Guide/User Guide/Note Types/1_Text_image.pngnew file mode 100644index 0000000000..278d44dbc4Binary files /dev/null and b/docs/User Guide/User Guide/Note Types/1_Text_image.png differdiff --git a/docs/User Guide/User Guide/Note Types/2_File_image.png b/docs/User Guide/User Guide/Note Types/2_File_image.pngnew file mode 100644index 0000000000..3dd5cebb82Binary files /dev/null and b/docs/User Guide/User Guide/Note Types/2_File_image.png differdiff --git a/docs/User Guide/User Guide/Note Types/2_Text_image.png b/docs/User Guide/User Guide/Note Types/2_Text_image.pngnew file mode 100644index 0000000000..8a68dcb5aeBinary files /dev/null and b/docs/User Guide/User Guide/Note Types/2_Text_image.png differdiff --git a/docs/User Guide/User Guide/Note Types/3_File_image.png b/docs/User Guide/User Guide/Note Types/3_File_image.pngnew file mode 100644index 0000000000..af5bdfd5b2Binary files /dev/null and b/docs/User Guide/User Guide/Note Types/3_File_image.png differdiff --git a/docs/User Guide/User Guide/Note Types/4_File_image.png b/docs/User Guide/User Guide/Note Types/4_File_image.pngnew file mode 100644index 0000000000..1d50d7a826Binary files /dev/null and b/docs/User Guide/User Guide/Note Types/4_File_image.png differdiff --git a/docs/User Guide/User Guide/Note Types/5_File_image.png b/docs/User Guide/User Guide/Note Types/5_File_image.pngnew file mode 100644index 0000000000..14044ba955Binary files /dev/null and b/docs/User Guide/User Guide/Note Types/5_File_image.png differdiff --git a/docs/User Guide/User Guide/Note Types/Canvas.md b/docs/User Guide/User Guide/Note Types/Canvas.mdnew file mode 100644index 0000000000..c877a089bc--- /dev/null+++ b/docs/User Guide/User Guide/Note Types/Canvas.md@@ -0,0 +1,21 @@+# Canvas+<figure class="image"><img src="Canvas_image.png" alt="grafik"></figure>++Available since Trilium v0.52.++Canvas notes use the Excalidraw library to allow handwritten notes with mouse, pen or touch on an infinite canvas. It also supports basic diagramming, text and graphics input.++## Interaction++* The note can be togged [read-only](../Basic%20Concepts%20and%20Features/Notes/Read-Only%20Notes.md) from the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Floating%20buttons.md">Floating buttons</a> section.++## Embedding notes++Since v0.104.0, Canvas supports embedding notes in a similar fashion to the <a class="reference-link" href="Text/Include%20Note.md">Include Note</a> functionality for <a class="reference-link" href="Text.md">Text</a> notes.++To embed a note:++* From the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.md">Note Tree</a>, drag the item onto the canvas.+* Manually, by choosing _More tools_ → _Web Embed_ and pasting the link to the note (e.g. `root/MujWAc9fQ1nj`).++Embedding notes in the canvas follows the same rules as <a class="reference-link" href="Text/Include%20Note.md">Include Note</a>: some notes are rendered as images (e.g. <a class="reference-link" href="Mind%20Map.md">Mind Map</a>), whereas some render fully interactive such as <a class="reference-link" href="../Collections.md">Collections</a>.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Note Types/Canvas_image.png b/docs/User Guide/User Guide/Note Types/Canvas_image.pngnew file mode 100644index 0000000000..9259c84d59Binary files /dev/null and b/docs/User Guide/User Guide/Note Types/Canvas_image.png differdiff --git a/docs/User Guide/User Guide/Note Types/Code.md b/docs/User Guide/User Guide/Note Types/Code.mdnew file mode 100644index 0000000000..0ada2af7b8--- /dev/null+++ b/docs/User Guide/User Guide/Note Types/Code.md@@ -0,0 +1,85 @@+# Code+Trilium supports creating "code" notes, i.e. notes which contain some sort of formal code - be it programming language (C++, JavaScript), structured data (JSON, XML) or other types of codes (CSS etc.).++This can be useful for a few things:++* computer programmers can store code snippets as notes with syntax highlighting+* JavaScript code notes can be executed inside Trilium for some extra functionality+ * we call such JavaScript code notes "scripts" – see <a class="reference-link" href="../Scripting.md">Scripting</a>+* JSON, XML etc. can be used as storage for structured data (typically used in conjunction with scripting)++For shorter snippets of code that can be embedded in [Text](Text.md) notes, see [Code blocks](Text/Developer-specific%20formatting/Code%20blocks.md).++++## Adjusting the language of a code note++In the [Ribbon](../Basic%20Concepts%20and%20Features/UI%20Elements/Ribbon.md), look for the _Note type_ selector and click it to reveal the possible note types. Inside of it there will be a section called _Code_, select any one of the languages.++++## Adjusting the list of languages++Trilium supports syntax highlighting for many languages, but by default displays only some of them. The supported languages can be adjusted by going to [Options](../Basic%20Concepts%20and%20Features/UI%20Elements/Options.md), then _Code Notes_ and looking for the _Available MIME types in the dropdown_ section. Simply check any of the items to add them to the list, or un-check them to remove them from the list.++Note that the list of languages is not immediately refreshed, you'd have to manually [refresh the application](../Troubleshooting/Refreshing%20the%20application.md).++The list of languages is also shared with the [Code blocks](Text/Developer-specific%20formatting/Code%20blocks.md) feature of [Text](Text.md) notes.++## Word wrap++Long lines can be displayed on multiple lines:++* Globally for all code notes, from <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Options.md">Options</a> → _Code Notes._+* For a particular note, by going to the menu in <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20buttons.md">Note buttons</a> and selecting _Word wrap_ and selecting the appropriate option:+ * _Auto_, to respect the global word wrap for code notes.+ * _On_ or _Off_, to change the state of the word wrap for this note regardless of the global option.++> [!NOTE]+> Word wrapping can also be adjusted at note level through the `#wrapLines` [label](../Advanced%20Usage/Attributes/Labels.md), which can also be inherited.++## Adjusting options using the status bar++> [!NOTE]+> This feature is only available for the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/New%20Layout.md">New Layout</a>. For the old layout, the tab width can be adjusted at note level using the `#tabWidth` attribute, but re-indentation is not available.++The status bar at the bottom of the editor shows the current indentation settings and language. Clicking on the indentation indicator opens a menu with three sections:++1. **Indent Using** — switch between Spaces and Tabs (`#indentWithTabs`). If a per-note override is active, a "Reset to default" option appears.+2. **Display Width** — choose from preset widths (1, 2, 3, 4, 6, 8). Changes are saved as a per-note `#tabWidth` label.+3. **Re-indent Content To** — convert existing indentation to a different style. For example, re-indent a file from 4 spaces to 2 spaces, or from spaces to tabs. This rewrites the leading whitespace on every line while preserving alignment remainders.++Clicking the language indicator lets you change the note's MIME type.++### Re-indentation++When you re-indent content, the editor:++* Measures the visual column width of each line's leading whitespace using the current style+* Calculates indent levels and any alignment remainder+* Rebuilds the leading whitespace in the target style+* Preserves non-leading whitespace, blank lines, and content without indentation++## Color schemes++Since Trilium 0.94.0 the colors of code notes can be customized by going <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Options.md">Options</a> → Code Notes and looking for the _Appearance_ section.++> [!NOTE]+> **Why are there only a few themes whereas the code block themes for text notes have a lot?**+> The reason is that Code notes use a different technology than the one used in Text notes, and as such there is a more limited selection of themes. If you find a CodeMirror 6 (not 5) theme that you would like to use, let us know and we might consider adding it to the set of default themes. There is no possibility of adding new themes (at least for now), since the themes are defined in JavaScript and not at CSS level.++## Programming ligatures++If you see `!=` displayed as `≠` or `->` as `→` inside a code note, those are _font ligature_: the default monospace font draws certain character pairs as a single symbol. The underlying text is not changed by Trilium (unlike text notes which have <a class="reference-link" href="Text/Automatic%20replacements.md">Automatic replacements</a>), and copying it out gives you back `!=` and `->`.++This can be turned off with <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Options.md">Options</a>_→ Appearance → Fonts → Programming ligatures_.++## Virtual keyboard behavior++When using a virtual keyboard, keyboard suggestions and corrections are controlled as follows:++* For <a class="reference-link" href="Markdown.md">Markdown</a> and plain text code notes, the autocorrect is **on**, as well as automatic capitalization.+* For all the other code notes, the autocorrect is off in order to avoid issues when typing code.++> [!NOTE]+> Not all browsers and platforms respect this value, so the keyboard suggestions might appear without autocorrecting or the browser might disregard this and autocorrect anyway.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Note Types/Code_image.png b/docs/User Guide/User Guide/Note Types/Code_image.pngnew file mode 100644index 0000000000..f3ebaf6734Binary files /dev/null and b/docs/User Guide/User Guide/Note Types/Code_image.png differdiff --git a/docs/User Guide/User Guide/Note Types/Converting between note types.md b/docs/User Guide/User Guide/Note Types/Converting between note types.mdnew file mode 100644index 0000000000..050815cb92--- /dev/null+++ b/docs/User Guide/User Guide/Note Types/Converting between note types.md@@ -0,0 +1,26 @@+# Converting between note types+A note's type may be converted to another:++* <a class="reference-link" href="Text.md">Text</a> notes to <a class="reference-link" href="Markdown.md">Markdown</a> notes+* Markdown notes to Text notes++Before conversion, a revision is saved automatically, so you can restore the original or recover any missing elements from it if the conversion produces undesired results. Read more about <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Notes/Note%20Revisions.md">Note Revisions</a>.++## Converting individual notes++### Markdown to Text Note++Markdown notes can be converted to Text Notes with negligible loss of formatting fidelity.++To do so, go to the note menu → “**Advanced”** and select "**Convert to Text Note**".++### Text Note to Markdown++> [!WARNING]+> Since Markdown does not support all the capabilities of Text notes, this conversion is lossy in terms of formatting: some formatting may be lost, and some unsupported elements may even be dropped. It's strongly recommended that you inspect the content for any information that might have gone missing after the conversion.++To convert a text note to Markdown, go to the note menu → **“Advanced”** and select **"Convert to Markdown Note"**.++## Converting multiple notes++A note type conversion can also be performed on an entire subtree or a set of multiple notes using <a class="reference-link" href="../Advanced%20Usage/Bulk%20Actions.md">Bulk Actions</a>.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Note Types/File.md b/docs/User Guide/User Guide/Note Types/File.mdnew file mode 100644index 0000000000..657bbe1d5a--- /dev/null+++ b/docs/User Guide/User Guide/Note Types/File.md@@ -0,0 +1,103 @@+# File+The _File_ note type can be used to attach various external files such as images, videos or PDF documents.++## Uploading a file++Since these files come from an external source, it is not possible to create a _File_ note type directly:++* Drag a file into the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.md">Note Tree</a>.+* Right click a note and select _Import into note_ and point it to one of the supported files.++## Supported file types++### PDFs++PDFs can be uploaded to Trilium and they will display a live preview with full support for various features such as table of contents, annotations, as well as remembering the last page read. For more information, see the dedicated <a class="reference-link" href="File/PDFs.md">PDFs</a> page.++## Office documents++Trilium offers previews for Office documents such as Word (`.docx`), Excel (`.xlsx`) and PowerPoint (`.pptx`). For more information, see the dedicated <a class="reference-link" href="File/Office%20documents.md">Office documents</a>.++### Images++<figure class="image image-style-align-center image_resized" style="width:50%;"><img style="aspect-ratio:879/766;" src="2_File_image.png" width="879" height="766"></figure>++Interaction:++* _Copy reference to clipboard_, for embedding the image within <a class="reference-link" href="Text.md">Text</a> notes.+ * See <a class="reference-link" href="Text/Images/Image%20references.md">Image references</a> for more information.+ * Alternatively, press the corresponding button from the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Floating%20buttons.md">Floating buttons</a>.++### Videos++See <a class="reference-link" href="File/Audio%20%26%20Video.md">Audio & Video</a>.++### Audio++<figure class="image image-style-align-center image_resized" style="width:50%;"><img style="aspect-ratio:850/243;" src="1_File_image.png" width="850" height="243"></figure>++Adding a supported audio file will reveal a basic audio player that can be used to play it.++Interactions:++* The audio can be played/paused using the dedicated button.+* Dragging the mouse across, or clicking the progress bar will seek through the song.+* The volume can be set.+* The playback speed can be adjusted via the contextual menu next to the volume.++### Text files++<figure class="image image-style-align-center image_resized" style="width:50%;"><img style="aspect-ratio:926/347;" src="File_image.png" width="926" height="347"></figure>++Files that are identified as containing text will show a preview of their content. One common use case for this type of file is to embed text files whose content is not necessarily of interest to the user, such as third-party libraries or generated content, that can then be downloaded if needed.++Note that generally text files will be [imported](../Basic%20Concepts%20and%20Features/Import%20%26%20Export.md) as either <a class="reference-link" href="Text.md">Text</a> or <a class="reference-link" href="Code.md">Code</a> notes. To bypass this behavior and create a _File_ note type, use the _Import into note_ feature and uncheck _Import HTML, Markdown and TXT as text notes_, as well as _Import recognized code files as code notes_.++Since one of the use cases for having files instead of notes is to display large files, the content preview is limited to a relatively small amount of characters. To view the full file, consider opening it in an external application.++### GPS tracks++Trilium displays information about GPS tracks in `.gpx` format, such as the distance, duration, elevation profile, tracks, markers.++When a `.gpx` note is dropped in a <a class="reference-link" href="../Collections/Geo%20Map.md">Geo Map</a>, the track itself will also be displayed on the map.++<figure class="image"><img style="aspect-ratio:1500/807;" src="4_File_image.png" width="1500" height="807"></figure>++### Fonts++Supported font formats will show an interactive preview of the font:++* A field to type in a custom text.+* A slider to change the font size of the preview.+* A preview of the text at the given size.+* A sampling of various font sizes for this font.+* The Latin alphabet.++Additionally, enabling _In font picker_ will make the font available in the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Options.md">Options</a> → _Appearance_ font selection. See <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Themes/Personalizing%20the%20font.md">Personalizing the font</a> for more information.++### Unknown file types++<figure class="image image-style-align-center image_resized" style="width:50%;"><img style="aspect-ratio:532/240;" src="3_File_image.png" width="532" height="240"></figure>++If the file could not be identified as any of the supported file types from above, it will be treated as an unknown file. In this case, all the default interactions will be available such as downloading or opening the file externally, but there will be no preview of the content.++## Interaction++* Regardless of the file type, a series of buttons will be displayed in the _Image_ or _File_ tab in the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Ribbon.md">Ribbon</a>.+ * _Download_, which will download the file for local use.+ * _Open_, will will open the file with the system-default application.+ * Upload new revision to replace the file with a new one.+* It is **not** possible to change the note type of a _File_ note.+* Convert into an [attachment](../Basic%20Concepts%20and%20Features/Notes/Attachments.md) from the [note menu](../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20buttons.md).++## Relation with other notes++* Files are also displayed in the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Notes/Note%20List.md">Note List</a> based on their type:++ <img class="image_resized" style="aspect-ratio:853/315;width:50%;" src="5_File_image.png" width="853" height="315">+* Non-image files can be embedded into text notes as read-only widgets via the <a class="reference-link" href="Text/Include%20Note.md">Include Note</a> functionality.+* Image files can be embedded into text notes like normal images via <a class="reference-link" href="Text/Images/Image%20references.md">Image references</a>.++## File size limit++An individual file cannot be bigger than 374 MiB. For more information see _Maximum import size_ in <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Import%20%26%20Export.md">Import & Export</a>.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Note Types/File/1_Audio & Video_image.png b/docs/User Guide/User Guide/Note Types/File/1_Audio & Video_image.pngnew file mode 100644index 0000000000..5ad8fe36b5Binary files /dev/null and b/docs/User Guide/User Guide/Note Types/File/1_Audio & Video_image.png differdiff --git a/docs/User Guide/User Guide/Note Types/File/1_PDFs_image.png b/docs/User Guide/User Guide/Note Types/File/1_PDFs_image.pngnew file mode 100644index 0000000000..36e4fd6d82Binary files /dev/null and b/docs/User Guide/User Guide/Note Types/File/1_PDFs_image.png differdiff --git a/docs/User Guide/User Guide/Note Types/File/Audio & Video.md b/docs/User Guide/User Guide/Note Types/File/Audio & Video.mdnew file mode 100644index 0000000000..f905784e7f--- /dev/null+++ b/docs/User Guide/User Guide/Note Types/File/Audio & Video.md@@ -0,0 +1,77 @@+# Audio & Video+<figure class="image image-style-align-right image_resized" style="width:61.8%;"><img style="aspect-ratio:953/587;" src="Audio & Video_image.png" width="953" height="587"></figure>++Starting with v0.103.0, Trilium has a custom media player for both video and audio files, which offers more features than the built-in player.++Versions prior to v0.103.0 also support media, but using the built-in player.++The file is streamed directly, so when accessing the note from a server it doesn't have to download the entire file to start playing it.++## Note on large media files++Although Trilium offers support for media files, it is generally not meant to be used with very large files. Uploading large media will cause the <a class="reference-link" href="../../Advanced%20Usage/Database.md">Database</a> to balloon, as well as any <a class="reference-link" href="../../Installation%20%26%20Setup/Backup.md">Backup</a> of it. In addition, there might be slowdowns when first uploading the files. Otherwise, a large database should not impact the general performance of Trilium significantly.++## Supported formats++Trilium uses the built-in media decoding mechanism of the browser (or Electron/Chromium when running on the desktop). Starting with v0.103.0, a message will be displayed instead when a media format is not supported.++## Interactions++To play/pause, simply click anywhere on the media. For video files, the controls at the bottom will hide automatically after playing, simply move the mouse to show them again.++The bottom bar has the following features:++* A track bar to seek across the media. Audio files up to 60 MB will display a waveform seekbar, to give a visual overview of the track's structure: silences, pauses, and louder segments.+* On the left of the track bar, the current time is indicated.+* On the right of the track bar, the remaining time is indicated.+* On the left side there are buttons to:+ * Adjust the playback speed (e.g. 0.5x, 1x).+ * Play mode (applies to all media from the parent note):+ * Play once — play the media until it ends, then stop.+ * Loop — replay the media automatically once it ends.+ * Play next — when the current item ends, continue with the next one in the same parent note until the last item finishes.+ * Rotate the video by 90 degrees (video only).+* In the center:+ * Previous media — jumps to the previous media: the nearest media note above the current one in the tree (within the same parent note) in the case of media notes, or the previous media attachment.+ * Go back by 10s+ * Play/pause+ * Go forward by 10s+ * Next media — jumps to the next media: the nearest media note below the current one in the tree (within the same parent note) in the case of media notes, or the next media attachment.+* On the right side:+ * Mute button+ * Volume adjustment+ * Full screen (video only)+ * Zoom to fill, which will crop the video so that it fills the entire window (video only).+ * Picture-in-picture, if the browser supports it (video only).++## Including media in notes++<figure class="image"><img style="aspect-ratio:1395/145;" src="1_Audio & Video_image.png" width="1395" height="145"><figcaption>An audio note include (configured to the "Small" size).</figcaption></figure>++<a class="reference-link" href="../Text.md">Text</a> and <a class="reference-link" href="../Markdown.md">Markdown</a> notes can embed an interactive media player directly in the note content. To do so, include the audio or video file:++* **Text notes:** in the formatting toolbar, click “**Insert”** → **“Include”.**+* **Markdown notes:** type `/include` press <kbd>Enter</kbd>.++Then select the audio/video file note to be included.++## Keyboard shortcuts++The following keyboard shortcuts are supported by the media player:++| | |+| --- | --- |+| <kbd>Space</kbd> | Play/pause |+| <kbd>Left arrow key</kbd> | Go back by 10s |+| <kbd>Right arrow key</kbd> | Go forward by 10s |+| <kbd>Ctrl</kbd> + <kbd>Left arrow key</kbd> | Go back by 1 min |+| <kbd>Ctrl</kbd> + <kbd>Right arrow key</kbd> | Go right by 1 min |+| <kbd>Page Up</kbd> | Navigate to the previous media |+| <kbd>Page Down</kbd> | Navigate to the next media |+| <kbd>F</kbd> | Toggle full-screen |+| <kbd>M</kbd> | Mute/unmute |+| <kbd>Home</kbd> | Go to the beginning of the media |+| <kbd>End</kbd> | Go to the end of the media |+| <kbd>Up</kbd> | Increase volume by 5% |+| <kbd>Down</kbd> | Decrease volume by 5% |+| <kbd>Alt+F1</kbd> (customizable) | Show this list of keyboard shortcuts on screen. |\ No newline at end of filediff --git a/docs/User Guide/User Guide/Note Types/File/Audio & Video_image.png b/docs/User Guide/User Guide/Note Types/File/Audio & Video_image.pngnew file mode 100644index 0000000000..29cfb5da79Binary files /dev/null and b/docs/User Guide/User Guide/Note Types/File/Audio & Video_image.png differdiff --git a/docs/User Guide/User Guide/Note Types/File/Office documents.md b/docs/User Guide/User Guide/Note Types/File/Office documents.mdnew file mode 100644index 0000000000..ae4c549de2--- /dev/null+++ b/docs/User Guide/User Guide/Note Types/File/Office documents.md@@ -0,0 +1,40 @@+# Office documents+Since v0.105.0, office documents stored in Trilium display an inline preview of their content, without the need to download them or open them in an external application.++## Supported formats++* Microsoft Office formats: Word (`.docx`), Excel (`.xlsx`) and PowerPoint (`.pptx`).+* The OpenDocument alternatives to the previous formats (Text, Spreadsheet, Presentation), created by editors such as LibreOffice and OpenOffice.+* [Rich Text Format (RTF)](https://en.wikipedia.org/wiki/Rich_Text_Format).+* [EPUB](https://en.wikipedia.org/wiki/EPUB) e-books.++> [!NOTE]+> Older Microsoft Office formats (`.doc`, `.xls`, `.ppt`) are not supported.++## How it works++The document is converted to a simplified representation on the server and rendered as read-only content, similar to a <a class="reference-link" href="../Text.md">Text</a> note.++The preview generally preserves:++* Headings, paragraphs and text alignment.+* Text formatting: bold, italic, underline, strikethrough, subscript/superscript, text and highlight colors, fonts and font sizes.+* Bulleted and numbered lists.+* Tables, including merged cells and cell background colors.+* Embedded images.+* Links and footnotes.++To keep links readable regardless of the theme, the default hyperlink color applied automatically by word processors is ignored; links that were deliberately given a custom color by the author keep it.++## Limitations++* The preview is read-only. To edit the document, download it or open it in an external application; the content of the note is not affected by the preview. Alternatively copy and paste it into a text note.+* The preview is a simplified rendering: complex layouts (columns, text boxes, headers and footers), charts and the precise styling of table borders are not reproduced.+* Documents larger than 20 MB are not previewed, to keep the server responsive. The usual download and open actions remain available.+* If the document cannot be converted, a notice is displayed instead and the file can still be downloaded or opened externally.++## Relation with other features++* The same preview is used when an office document is displayed in the <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/Notes/Note%20List.md">Note List</a> or embedded in a text note via <a class="reference-link" href="../Text/Include%20Note.md">Include Note</a>, as well as for office documents stored as <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/Notes/Attachments.md">Attachments</a>.+* Independently of the preview, the text content of office documents is also extracted in the background so that it can be found with <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/Navigation/Search.md">Search</a> via <a class="reference-link" href="../../Advanced%20Usage/Text%20Extraction%20(OCR).md">Text Extraction (OCR)</a>.+* `.csv` and `.xlsx` files can be converted to <a class="reference-link" href="../Spreadsheets.md">Spreadsheets</a> via the [import](../../Basic%20Concepts%20and%20Features/Import%20%26%20Export.md) function.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Note Types/File/PDFs.md b/docs/User Guide/User Guide/Note Types/File/PDFs.mdnew file mode 100644index 0000000000..e2f9b43d01--- /dev/null+++ b/docs/User Guide/User Guide/Note Types/File/PDFs.md@@ -0,0 +1,91 @@+# PDFs+<figure class="image image_resized" style="width:74.34%;"><img style="aspect-ratio:1360/698;" src="PDFs_image.png" width="1360" height="698"></figure>++PDFs file can be uploaded in Trilium, where they will be displayed without the need to download them first.++Since v0.102.0, PDFs will be rendered using Trilium's built-in PDF viewer, which is a customization of [Mozilla's PDF.js viewer](https://mozilla.github.io/pdf.js/) (also built-in in the Mozilla Firefox browser). Versions prior to that render PDFs using the browser's default PDF viewer.++## Features++* The last page viewed and scroll position is maintained in between restarts or note navigations.+* Annotations (text, highlights) as well as comments. These are saved automatically.+* Forms can be filled.+* Can be printed or downloaded.+* Can be saved as a [template](../../Advanced%20Usage/Templates.md) and the content of the PDF will be copied over to the new note. This is especially useful in combination with annotations or filled forms.+* Integrates with the sidebar in the <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/New%20Layout.md">New Layout</a>, by displaying the list of pages with thumbnails, table of contents and a listing of the annotations.+* Basic support for signatures (the hand-drawn ones, not proper digital signatures), similar to annotations. Signatures are stored and can be reused across multiple documents (up to 5).++## Storing last position and settings++For every PDF, Trilium will remember the following information:++* The current page.+* The scroll position, within the current page.+* The rotation of the page.++This makes it useful when reading large documents since the position is remembered automatically. This happens in the background, however it's recorded only a few seconds after stopping any scroll actions.++> [!TIP]+> Technically, the information about the scroll position and rotation is stored in the <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/Notes/Attachments.md">Attachments</a> section, in a dedicated attachment called `pdfHistory.json`.++## Annotations++Since v0.102.0 it's possible to annotate PDFs. To do so, look for the annotation buttons on the right side of the PDF toolbar (<img src="1_PDFs_image.png" width="120" height="32">).++Since v0.103.0:++* Annotations are disabled if the note is marked as <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/Notes/Read-Only%20Notes.md">Read-Only Notes</a>.+* Comments can also be added, which is similar to highlights but also attach a text.+* The <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Right%20Sidebar.md">Right Sidebar</a> also displays a list of annotations (highlights, comments), but only in the <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/New%20Layout.md">New Layout</a>.++### Supported annotations++The following annotation methods are supported:++* **Highlight**+ Allows highlighting text with one of the predefined colors.+ * The thickness is also adjustable.+ * It's also possible to highlight the blank space, turning the feature more into a thicker pen.+* **Text**+ Allows adding arbitrary text, with a custom color and size.+* **Pen**+ Allows free drawing on the document, with variable color, thickness and opacity.+* **Image**+ Allows inserting images from outside Trilium directly into the document.++### Editing existing annotations++Although annotations are stored in the PDF itself, they can be edited. To edit an annotation, press one of the annotation buttons from the previous section to enter edit mode and click on an existing annotation. This will reveal a toolbar with options to customize the annotation (e.g. to change a color), as well as the possibility to remove it.++### How are annotations stored++Annotations are stored directly in the PDF. When modifications are made, Trilium will replace the PDF with the new one.++Since modifications are automatically saved, there's no need to manually save the document after making modifications to the annotations.++The benefit of “baked-in annotations” is that they are also accessible if downloading (for external use outside Trilium) or sharing the note.++The downside is that the entire PDF needs to be sent back to the server, which can slow down performance for larger documents. If you encounter any issues from this system, feel free to [report it](../../Troubleshooting/Reporting%20issues.md).++## Filling out forms++Similar to annotations, forms are also supported by Trilium since v0.102.0. If the document has fields that can be filled-in, they will be indicated with a colored background.++Simply type text in the forms and they will be automatically saved.++## Sidebar navigation++> [!NOTE]+> This feature is only available if <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/New%20Layout.md">New Layout</a> is enabled. If you are using the old layout, these features are still available by looking for a sidebar button in the PDF viewer toolbar.++See the dedicated section on PDFs in <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Right%20Sidebar/Outline%20tab.md">Outline tab</a>.++## Share functionality++PDFs can also be shared using the <a class="reference-link" href="../../Advanced%20Usage/Sharing.md">Sharing</a> feature. This will also use Trilium's customized PDF viewer.++If you are using a reverse proxy on your server with strict access limitations for the share functionality, make sure that `[host].com/pdfjs` directory is accessible. Note that this directory is outside the `/share` route as it's common with the rest of the application.++## OCR++PDFs are eligible for <a class="reference-link" href="../../Advanced%20Usage/Text%20Extraction%20(OCR).md">Text Extraction (OCR)</a>, which means that their text can be used in <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/Navigation/Search.md">Search</a>.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Note Types/File/PDFs_image.png b/docs/User Guide/User Guide/Note Types/File/PDFs_image.pngnew file mode 100644index 0000000000..cf8d2c109bBinary files /dev/null and b/docs/User Guide/User Guide/Note Types/File/PDFs_image.png differdiff --git a/docs/User Guide/User Guide/Note Types/File_image.png b/docs/User Guide/User Guide/Note Types/File_image.pngnew file mode 100644index 0000000000..04478a3adaBinary files /dev/null and b/docs/User Guide/User Guide/Note Types/File_image.png differdiff --git a/docs/User Guide/User Guide/Note Types/Markdown.md b/docs/User Guide/User Guide/Note Types/Markdown.mdnew file mode 100644index 0000000000..7de9b7f457--- /dev/null+++ b/docs/User Guide/User Guide/Note Types/Markdown.md@@ -0,0 +1,240 @@+# Markdown+Trilium has always supported Markdown through its [import feature](../Basic%20Concepts%20and%20Features/Import%20%26%20Export/Markdown.md), however the file was either transformed to a <a class="reference-link" href="Text.md">Text</a> note (converted to Trilium's internal HTML format) or saved as a <a class="reference-link" href="Code.md">Code</a> note with only syntax highlight.++This note type is a split view, meaning that both the source code and a preview of the document are displayed side-by-side. See <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20types%20with%20split%20view.md">Note types with split view</a> for more information.++## Rationale++The goal of this note type is to fill a gap: rendering Markdown but not altering its structure or its whitespace which would inevitably change otherwise through import/export.++Even if Markdown is now specially treated by having a preview mechanism, Trilium remains at its core a WYSWYG editor so Markdown will not replace text notes.++> [!NOTE]+> Feature requests regarding the Markdown implementation will be considered, but if they are outside the realm of Trilium, they will not be implemented. One of the core aspects of the Markdown integration is that it reuses components that are already available through other features of the application.++## Features++### Source view pane++* Syntax highlighting for the Markdown syntax.+* Nested syntax highlighting for code inside code blocks.+* When editing larger documents, the preview scrolls along with the source editor.++### Preview pane++The following features are supported by Trilium's Markdown format and will show up in the preview pane:++* All standard and GitHub-flavored syntax (basic formatting, tables, blockquotes).+* Basic HTML is also supported (e.g. collapsible blocks using `<details>` and `<summary>`).+* Code blocks with syntax highlight.++ * The language must be specified for syntax highlight to be applied (e.g. ` ```js `).+ * Code blocks will respect the text wrapping from the <a class="reference-link" href="Text.md">Text</a> section in <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Options.md">Options</a>.+* <a class="reference-link" href="Text/Block%20quotes%20%26%20admonitions.md">Block quotes & admonitions</a>+* <a class="reference-link" href="Text/Math%20Equations.md">Math Equations</a> (both inline and block)+* <a class="reference-link" href="Mermaid%20Diagrams.md">Mermaid Diagrams</a> using ` ```mermaid `+* <a class="reference-link" href="Text/Include%20Note.md">Include Note</a> (no built-in Markdown syntax, but HTML syntax works just fine):++ ```html+ <section class="include-note" data-note-id="vJDjQm0VK8Na" data-box-size="expandable">+ + </section>+ ```++ * These can also be quickly created via the `/include` command or via a dedicated keyboard shortcut (not assigned by default).+* <a class="reference-link" href="Text/Links/Internal%20(reference)%20links.md">Internal (reference) links</a> via its HTML syntax, or through a _Wikilinks_\-like format (only <a class="reference-link" href="../Advanced%20Usage/Note%20ID.md">Note ID</a>):++ ```+ [[Hg8TS5ZOxti6]]+ ```+* To-do lists with extended task states:++ <table class="ck-table-resized" style="border-style:none;">+ <colgroup>+ <col style="width:80.6%;">+ <col style="width:19.4%;">+ </colgroup>+ <tbody>+ <tr>+ <td><pre><code class="language-text-x-markdown">- [ ] None+ - [/] Doing+ - [X] Done+ - [?] Maybe+ - [-] Cancelled</code></pre></td>+ <td><figure class="image image-style-align-right"><img style="aspect-ratio:218/221;" src="Markdown_image.png" width="218" height="221"></figure></td>+ </tr>+ </tbody>+ </table>++ Task states are customizable: you can reorder them, create new ones with different colors and symbols, or delete the ones you don't need. See <a class="reference-link" href="../Advanced%20Usage/Customizing%20to-do%20task%20states.md">Customizing to-do task states</a> for more details.++ Note that to-do items with task states other than "None" and "Done" are Trilium-specific and may not work well with other Markdown software.+* <a class="reference-link" href="Text/Footnotes.md">Footnotes</a> are also supported via the corresponding Markdown syntax:++ ```+ This is [^1], while this is [^2].++ [^1]: the first footnote+ [^2]: the second footnote+ ```++ * These can also be quickly created using the `/footnote` command.+* Page breaks for <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Notes/Printing%20%26%20Exporting%20as%20PDF.md">Printing & Exporting as PDF</a>:++ ```+ <div class="page-break"></div>+ ```+* Highlights (background color) are supported both via the `==` Markdown syntax, as well as the canonical HTML representation in Trilium:++ ```+ ==highlighted==+ <span style="background-color:hsl(0,0%,100%);">Highlighted</span>+ ```++### Links++Multiple types of links are supported:++* Web URLs can be written with the standard Markdown syntax:++ ```+ [Wikipedia](https://www.wikipedia.org)+ ```+* [Reference link](Text/Links/Internal%20\(reference\)%20links.md) to other notes with dynamic title, either by manually entering the note ID or via the _Add link_ dialog:++ ```+ [[B9oMG6rFvvfq]]+ ```+* [Reference link](Text/Links/Internal%20\(reference\)%20links.md) to other notes with a custom text:++ ```+ [This is a link](#root/LhtnZxtVsUMp)+ ```++To create a link, either:++* Type it manually using the syntax described above.+* Use the _Add link_ dialog by pressing <kbd>Ctrl</kbd>+<kbd>L</kbd> or typing the `/link` command.++<a class="reference-link" href="Text/Link%20Previews.md">Link Previews</a> are also rendered, but there is no mechanism to insert them automatically as of now, they have to be copied from a <a class="reference-link" href="Text.md">Text</a> note instead.++### Keyboard shortcuts++The Markdown notes share some of the keyboard shortcuts from <a class="reference-link" href="Text.md">Text</a> notes:++* _Cut to note_ (<kbd>Ctrl</kbd>+<kbd>X</kbd>) which cuts the selection into a new child note.+* _Add link_ (<kbd>Ctrl</kbd>+<kbd>L</kbd>) which shows the dialog to create external or reference links.+* _Insert date/time_ (<kbd>Alt</kbd>+<kbd>T</kbd>) which respects the same formatting as text notes.+* _Include note_ (not assigned by default), which triggers the same dialog to insert notes as the one for text notes.++In addition, the following formatting keyboard shortcuts are available:++* <kbd>Ctrl</kbd>+<kbd>B</kbd> to toggle **bold**.+* <kbd>Ctrl</kbd>+<kbd>I</kbd> to toggle _italic_.+* <kbd>Ctrl</kbd>+<kbd>M</kbd> to wrap the current selection in an inline math (`$`).+* <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>X</kbd> to toggle ~~strikethrough~~.++### Images & attachments++Images can be inserted into the document in four different methods:++* Drag & drop directly into the editor area.+* Pasting an image from clipboard.+* Pasting a reference to another [attachment](../Basic%20Concepts%20and%20Features/Notes/Attachments.md) (e.g. _Copy reference to clipboard_ button).+* Use the `/image` slash command.++An image reference to an attachment looks like this:++```++```++### Auto-completion++#### Slash commands++Just like <a class="reference-link" href="Text.md">Text</a> notes, Markdown notes support a selection of slash commands:++* Inserting the current date & time (`/date`).+* [Including](Text/Include%20Note.md) another note (`/include`).+* Uploading and inserting an image (`/image`).+* Inserting a note link (`/link`).+* Inserting a math equation block (`/math`).+* Inserting a [footnote](Text/Footnotes.md) (`/footnote`).+* Inserting a [Mermaid](Mermaid%20Diagrams.md) diagram (`/mermaid`), with one variant per sample template (e.g. `/mermaid:flowchart`).+* Inserting a collapsible block (`/collapsible`).+* Inserting a page break for printing (`/page-break`).+* Inserting a table (`/table`).+* Creating admonitions (e.g. `/tip`, `/note`, `/important`, `/caution`, `/warning`).+* Inserting task items (`/todo:<state>`, e.g. `/todo:done`), one per configured task state.+* Inserting code snippets (`/snippet:<name>`) from your Markdown/plain-text snippet notes.++Note that slash commands only work outside of code blocks and inline code.++#### Code block language auto-completion++Starting with v0.104.0, typing \`\`\` to insert a code block will automatically open a list of suggested language types which have syntax highlighting.++The list of languages matches the one for <a class="reference-link" href="Code.md">Code</a> notes set in <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Options.md">Options</a>, it's not the full list of languages supported by Trilium.++### Other features++* The <a class="reference-link" href="Text/Table%20of%20contents.md">Table of contents</a> will be displayed in the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Right%20Sidebar.md">Right Sidebar</a> based on the Markdown-level headings.+ * This feature is available only on the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/New%20Layout.md">New Layout</a>.++### Shared notes++When a Markdown note is [shared publicly](../Advanced%20Usage/Sharing.md), it will be rendered with extended formatting just like <a class="reference-link" href="Text.md">Text</a> notes.++Most of the features described previously should be supported. If you face any issues, feel free to [report it](../Troubleshooting/Reporting%20issues.md) alongside a sample Markdown file.++## Creating Markdown notes++There are two ways to create a Markdown note:++1. Create a new note (e.g. in the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.md">Note Tree</a>) and select the type _Markdown_, just like all the other note types.+2. Create a note of type <a class="reference-link" href="Code.md">Code</a> and select as the language either _Markdown_ or _GitHub-Flavored Markdown_. This maintains compatibility with your existing notes prior to the introduction of this feature.++> [!NOTE]+> There is no distinction between the new Markdown note type and code notes of type Markdown; internally both are represented as <a class="reference-link" href="Code.md">Code</a> notes with one of the following MIME types:+>+> * `text/markdown`+> * `text/x-markdown`+> * `text/x-gfm` (GitHub Flavored Markdown)++## Import/export++### Import++By default, when importing a single Markdown file it automatically gets converted to a <a class="reference-link" href="Text.md">Text</a> note. To avoid that and have it imported as a Markdown note instead:++* Right click the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.md">Note Tree</a> and select _Import into note_.+* Select the file normally.+* Uncheck _Import HTML, Markdown and TXT as text notes if it's unclear from the metadata_.++When importing a Trilium ZIP, it will preserve the Markdown type without converting to text notes thanks to the meta-information in it.++### Exporting++When exporting Markdown files, the extension is preserved and the content remains the same as in the source view (with some small exceptions such as handling of attachments).++When exporting Markdown files as ZIP, choosing HTML or Markdown as the export format makes no difference as that only affects <a class="reference-link" href="Text.md">Text</a> notes.++If the Markdown note contains attachments, a ZIP export will rewrite the links to attachments so that they are replaced with a relative path to the attachment. On import, the links are re-written back.++## Conversion between text notes and Markdown notes++<a class="reference-link" href="Text.md">Text</a> notes can be converted into Markdown notes and vice versa. See <a class="reference-link" href="Converting%20between%20note%20types.md">Converting between note types</a>.++## Sync-scrolling & block highlight++When scrolling through the editing pane, the preview pane will attempt to synchronize its position to make it easier to see the preview.++In addition, the block in the preview matching the position of the cursor in the source view will appear slightly highlighted.++The sync is currently one-way only, scrolling the preview will not synchronize the position of the editor.++This feature cannot be disabled as of now; if the scrolling feels distracting, consider temporarily switching to the editor mode and then switching to preview mode when ready.++> [!NOTE]+> This feature of synchronizing the scroll is based on blocks but it's provided on a best-effort basis since our underlying Markdown library doesn't support this feature natively, so we had to implement our own algorithm. Feel free to [report issues](../Troubleshooting/Reporting%20issues.md), but always provide a sample Markdown file to be able to reproduce it.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Note Types/Markdown_image.png b/docs/User Guide/User Guide/Note Types/Markdown_image.pngnew file mode 100644index 0000000000..60c9dd2adeBinary files /dev/null and b/docs/User Guide/User Guide/Note Types/Markdown_image.png differdiff --git a/docs/User Guide/User Guide/Note Types/Mermaid Diagrams/ELK layout.md b/docs/User Guide/User Guide/Note Types/Mermaid Diagrams/ELK layout.mdnew file mode 100644index 0000000000..386bc7179a--- /dev/null+++ b/docs/User Guide/User Guide/Note Types/Mermaid Diagrams/ELK layout.md@@ -0,0 +1,15 @@+# ELK layout+Mermaid supports a different layout engine which supports slightly more complex diagrams, called the [Eclipse Layout Kernel (ELK)](https://eclipse.dev/elk/). Trilium has support for these as well, but it's not enabled by default.++In order to activate ELK for any diagram, insert the following YAML frontmatter right at the beginning of the diagram:++```yaml+---+config:+ layout: elk+---+```++| With ELK off | With ELK on |+| --- | --- |+|  |  |\ No newline at end of filediff --git a/docs/User Guide/User Guide/Note Types/Mermaid Diagrams/ELK layout_ELK off.svg b/docs/User Guide/User Guide/Note Types/Mermaid Diagrams/ELK layout_ELK off.svgnew file mode 100644index 0000000000..a6a8a01252--- /dev/null+++ b/docs/User Guide/User Guide/Note Types/Mermaid Diagrams/ELK layout_ELK off.svg@@ -0,0 +1 @@+<svg aria-roledescription="flowchart-v2" role="graphics-document document" viewBox="0 -50 512.90625 442" height="442" class="flowchart" xmlns="http://www.w3.org/2000/svg" width="512.90625" id="mermaid-graph-13"><style>#mermaid-graph-13{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-graph-13 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-graph-13 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-graph-13 .error-icon{fill:#552222;}#mermaid-graph-13 .error-text{fill:#552222;stroke:#552222;}#mermaid-graph-13 .edge-thickness-normal{stroke-width:1px;}#mermaid-graph-13 .edge-thickness-thick{stroke-width:3.5px;}#mermaid-graph-13 .edge-pattern-solid{stroke-dasharray:0;}#mermaid-graph-13 .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-graph-13 .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-graph-13 .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-graph-13 .marker{fill:#333333;stroke:#333333;}#mermaid-graph-13 .marker.cross{stroke:#333333;}#mermaid-graph-13 svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-graph-13 p{margin:0;}#mermaid-graph-13 .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-graph-13 .cluster-label text{fill:#333;}#mermaid-graph-13 .cluster-label span{color:#333;}#mermaid-graph-13 .cluster-label span p{background-color:transparent;}#mermaid-graph-13 .label text,#mermaid-graph-13 span{fill:#333;color:#333;}#mermaid-graph-13 .node rect,#mermaid-graph-13 .node circle,#mermaid-graph-13 .node ellipse,#mermaid-graph-13 .node polygon,#mermaid-graph-13 .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-graph-13 .rough-node .label text,#mermaid-graph-13 .node .label text,#mermaid-graph-13 .image-shape .label,#mermaid-graph-13 .icon-shape .label{text-anchor:middle;}#mermaid-graph-13 .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-graph-13 .rough-node .label,#mermaid-graph-13 .node .label,#mermaid-graph-13 .image-shape .label,#mermaid-graph-13 .icon-shape .label{text-align:center;}#mermaid-graph-13 .node.clickable{cursor:pointer;}#mermaid-graph-13 .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-graph-13 .arrowheadPath{fill:#333333;}#mermaid-graph-13 .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-graph-13 .flowchart-link{stroke:#333333;fill:none;}#mermaid-graph-13 .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-graph-13 .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-graph-13 .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-graph-13 .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-graph-13 .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-graph-13 .cluster text{fill:#333;}#mermaid-graph-13 .cluster span{color:#333;}#mermaid-graph-13 div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-graph-13 .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-graph-13 rect.text{fill:none;stroke-width:0;}#mermaid-graph-13 .icon-shape,#mermaid-graph-13 .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-graph-13 .icon-shape p,#mermaid-graph-13 .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-graph-13 .icon-shape rect,#mermaid-graph-13 .image-shape rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-graph-13 :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;}</style><g><marker orient="auto" markerHeight="8" markerWidth="8" markerUnits="userSpaceOnUse" refY="5" refX="5" viewBox="0 0 10 10" class="marker flowchart-v2" id="mermaid-graph-13_flowchart-v2-pointEnd"><path style="stroke-width: 1; stroke-dasharray: 1, 0;" class="arrowMarkerPath" d="M 0 0 L 10 5 L 0 10 z"></path></marker><marker orient="auto" markerHeight="8" markerWidth="8" markerUnits="userSpaceOnUse" refY="5" refX="4.5" viewBox="0 0 10 10" class="marker flowchart-v2" id="mermaid-graph-13_flowchart-v2-pointStart"><path style="stroke-width: 1; stroke-dasharray: 1, 0;" class="arrowMarkerPath" d="M 0 5 L 10 10 L 10 0 z"></path></marker><marker orient="auto" markerHeight="11" markerWidth="11" markerUnits="userSpaceOnUse" refY="5" refX="11" viewBox="0 0 10 10" class="marker flowchart-v2" id="mermaid-graph-13_flowchart-v2-circleEnd"><circle style="stroke-width: 1; stroke-dasharray: 1, 0;" class="arrowMarkerPath" r="5" cy="5" cx="5"></circle></marker><marker orient="auto" markerHeight="11" markerWidth="11" markerUnits="userSpaceOnUse" refY="5" refX="-1" viewBox="0 0 10 10" class="marker flowchart-v2" id="mermaid-graph-13_flowchart-v2-circleStart"><circle style="stroke-width: 1; stroke-dasharray: 1, 0;" class="arrowMarkerPath" r="5" cy="5" cx="5"></circle></marker><marker orient="auto" markerHeight="11" markerWidth="11" markerUnits="userSpaceOnUse" refY="5.2" refX="12" viewBox="0 0 11 11" class="marker cross flowchart-v2" id="mermaid-graph-13_flowchart-v2-crossEnd"><path style="stroke-width: 2; stroke-dasharray: 1, 0;" class="arrowMarkerPath" d="M 1,1 l 9,9 M 10,1 l -9,9"></path></marker><marker orient="auto" markerHeight="11" markerWidth="11" markerUnits="userSpaceOnUse" refY="5.2" refX="-1" viewBox="0 0 11 11" class="marker cross flowchart-v2" id="mermaid-graph-13_flowchart-v2-crossStart"><path style="stroke-width: 2; stroke-dasharray: 1, 0;" class="arrowMarkerPath" d="M 1,1 l 9,9 M 10,1 l -9,9"></path></marker><g class="root"><g class="clusters"></g><g class="edgePaths"><path marker-end="url(#mermaid-graph-13_flowchart-v2-pointEnd)" style="" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" id="L_A_B_0" d="M77.438,196L87.866,196C98.294,196,119.151,196,139.341,196C159.531,196,179.055,196,188.816,196L198.578,196"></path><path marker-end="url(#mermaid-graph-13_flowchart-v2-pointEnd)" style="" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" id="L_C_B_0" d="M446.26,169L430.798,151.5C415.335,134,384.41,99,353.959,98.5C323.509,98,293.534,132,278.546,149L263.559,166"></path><path marker-end="url(#mermaid-graph-13_flowchart-v2-pointEnd)" style="" class="edge-thickness-normal edge-pattern-dotted edge-thickness-normal edge-pattern-solid flowchart-link" id="L_C_B_2" d="M435.328,169.751L421.688,159.46C408.047,149.168,380.766,128.584,354.016,128.205C327.267,127.825,301.049,147.65,287.94,157.563L274.831,167.476"></path><path marker-end="url(#mermaid-graph-13_flowchart-v2-pointEnd)" style="" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" id="L_C_B_3" d="M435.328,182.876L421.688,177.73C408.047,172.584,380.766,162.292,354.108,162.068C327.45,161.843,301.416,171.686,288.399,176.608L275.382,181.53"></path><path marker-end="url(#mermaid-graph-13_flowchart-v2-pointEnd)" style="" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" id="L_C_B_4" d="M435.328,196L421.688,196C408.047,196,380.766,196,354.151,196C327.536,196,301.589,196,288.615,196L275.641,196"></path><path marker-end="url(#mermaid-graph-13_flowchart-v2-pointEnd)" style="" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" id="L_C_B_5" d="M435.328,209.124L421.688,214.27C408.047,219.416,380.766,229.708,354.108,229.932C327.45,230.157,301.416,220.314,288.399,215.392L275.382,210.47"></path><path marker-end="url(#mermaid-graph-13_flowchart-v2-pointEnd)" style="" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" id="L_C_B_6" d="M435.328,222.249L421.688,232.54C408.047,242.832,380.766,263.416,354.016,263.795C327.267,264.175,301.049,244.35,287.94,234.437L274.831,224.524"></path><path marker-end="url(#mermaid-graph-13_flowchart-v2-pointEnd)" style="" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" id="L_C_B_7" d="M446.26,223L430.798,240.5C415.335,258,384.41,293,353.959,293.5C323.509,294,293.534,260,278.546,243L263.559,226"></path><path marker-end="url(#mermaid-graph-13_flowchart-v2-pointEnd)" style="" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" id="L_C_B_8" d="M452.225,223L435.768,247.833C419.311,272.667,386.398,322.333,353.888,322.889C321.379,323.446,289.274,274.891,273.221,250.614L257.169,226.337"></path><path marker-end="url(#mermaid-graph-13_flowchart-v2-pointEnd)" style="" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" id="L_B_C_0" d="M254.962,169L271.383,144.167C287.803,119.333,320.644,69.667,353.152,69.111C385.661,68.555,417.838,117.11,433.927,141.388L450.015,165.666"></path></g><g class="edgeLabels"><g transform="translate(140.0078125, 196)" class="edgeLabel"><g transform="translate(-37.5703125, -12)" class="label"><foreignObject height="24" width="75.140625"><div style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;" class="labelBkg" xmlns="http://www.w3.org/1999/xhtml"><span class="edgeLabel"><p>Guarantee</p></span></div></foreignObject></g></g><g transform="translate(353.484375, 64)" class="edgeLabel"><g transform="translate(-53.8515625, -12)" class="label"><foreignObject height="24" width="107.703125"><div style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;" class="labelBkg" xmlns="http://www.w3.org/1999/xhtml"><span class="edgeLabel"><p>User attributes</p></span></div></foreignObject></g></g><g transform="translate(353.484375, 108)" class="edgeLabel"><g transform="translate(-42.2109375, -12)" class="label"><foreignObject height="24" width="84.421875"><div style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;" class="labelBkg" xmlns="http://www.w3.org/1999/xhtml"><span class="edgeLabel"><p>Master data</p></span></div></foreignObject></g></g><g transform="translate(353.484375, 152)" class="edgeLabel"><g transform="translate(-52.3828125, -12)" class="label"><foreignObject height="24" width="104.765625"><div style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;" class="labelBkg" xmlns="http://www.w3.org/1999/xhtml"><span class="edgeLabel"><p>Exchange Rate</p></span></div></foreignObject></g></g><g transform="translate(353.484375, 196)" class="edgeLabel"><g transform="translate(-49.7109375, -12)" class="label"><foreignObject height="24" width="99.421875"><div style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;" class="labelBkg" xmlns="http://www.w3.org/1999/xhtml"><span class="edgeLabel"><p>Profit Centers</p></span></div></foreignObject></g></g><g transform="translate(353.484375, 240)" class="edgeLabel"><g transform="translate(-56.84375, -12)" class="label"><foreignObject height="24" width="113.6875"><div style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;" class="labelBkg" xmlns="http://www.w3.org/1999/xhtml"><span class="edgeLabel"><p>Vendor Partners</p></span></div></foreignObject></g></g><g transform="translate(353.484375, 284)" class="edgeLabel"><g transform="translate(-52.2890625, -12)" class="label"><foreignObject height="24" width="104.578125"><div style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;" class="labelBkg" xmlns="http://www.w3.org/1999/xhtml"><span class="edgeLabel"><p>Work Situation</p></span></div></foreignObject></g></g><g transform="translate(353.484375, 328)" class="edgeLabel"><g transform="translate(-33.9765625, -12)" class="label"><foreignObject height="24" width="67.953125"><div style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;" class="labelBkg" xmlns="http://www.w3.org/1999/xhtml"><span class="edgeLabel"><p>Customer</p></span></div></foreignObject></g></g><g transform="translate(353.484375, 372)" class="edgeLabel"><g transform="translate(-49.7109375, -12)" class="label"><foreignObject height="24" width="99.421875"><div style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;" class="labelBkg" xmlns="http://www.w3.org/1999/xhtml"><span class="edgeLabel"><p>Profit Centers</p></span></div></foreignObject></g></g><g transform="translate(353.484375, 20)" class="edgeLabel"><g transform="translate(-37.5703125, -12)" class="label"><foreignObject height="24" width="75.140625"><div style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;" class="labelBkg" xmlns="http://www.w3.org/1999/xhtml"><span class="edgeLabel"><p>Guarantee</p></span></div></foreignObject></g></g></g><g class="nodes"><g transform="translate(42.71875, 196)" id="flowchart-A-0" class="node default"><rect height="54" width="69.4375" y="-27" x="-34.71875" style="" class="basic label-container"></rect><g transform="translate(-4.71875, -12)" style="" class="label"><rect></rect><foreignObject height="24" width="9.4375"><div style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;" xmlns="http://www.w3.org/1999/xhtml"><span class="nodeLabel"><p>A</p></span></div></foreignObject></g></g><g transform="translate(237.109375, 196)" id="flowchart-B-1" class="node default"><rect height="54" width="69.0625" y="-27" x="-34.53125" style="" class="basic label-container"></rect><g transform="translate(-4.53125, -12)" style="" class="label"><rect></rect><foreignObject height="24" width="9.0625"><div style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;" xmlns="http://www.w3.org/1999/xhtml"><span class="nodeLabel"><p>B</p></span></div></foreignObject></g></g><g transform="translate(470.1171875, 196)" id="flowchart-C-2" class="node default"><rect height="54" width="69.578125" y="-27" x="-34.7890625" style="" class="basic label-container"></rect><g transform="translate(-4.7890625, -12)" style="" class="label"><rect></rect><foreignObject height="24" width="9.578125"><div style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;" xmlns="http://www.w3.org/1999/xhtml"><span class="nodeLabel"><p>C</p></span></div></foreignObject></g></g></g></g></g><text class="flowchartTitleText" y="-25" x="256.453125" text-anchor="middle">Interfaces for B</text></svg>\ No newline at end of filediff --git a/docs/User Guide/User Guide/Note Types/Mermaid Diagrams/ELK layout_ELK on.svg b/docs/User Guide/User Guide/Note Types/Mermaid Diagrams/ELK layout_ELK on.svgnew file mode 100644index 0000000000..1a400331d5--- /dev/null+++ b/docs/User Guide/User Guide/Note Types/Mermaid Diagrams/ELK layout_ELK on.svg@@ -0,0 +1 @@+<svg aria-roledescription="flowchart-v2" role="graphics-document document" viewBox="4 -50 530.828125 491" height="491" class="flowchart" xmlns="http://www.w3.org/2000/svg" width="530.828125" id="mermaid-graph-12"><style>#mermaid-graph-12{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-graph-12 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-graph-12 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-graph-12 .error-icon{fill:#552222;}#mermaid-graph-12 .error-text{fill:#552222;stroke:#552222;}#mermaid-graph-12 .edge-thickness-normal{stroke-width:1px;}#mermaid-graph-12 .edge-thickness-thick{stroke-width:3.5px;}#mermaid-graph-12 .edge-pattern-solid{stroke-dasharray:0;}#mermaid-graph-12 .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-graph-12 .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-graph-12 .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-graph-12 .marker{fill:#333333;stroke:#333333;}#mermaid-graph-12 .marker.cross{stroke:#333333;}#mermaid-graph-12 svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-graph-12 p{margin:0;}#mermaid-graph-12 .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-graph-12 .cluster-label text{fill:#333;}#mermaid-graph-12 .cluster-label span{color:#333;}#mermaid-graph-12 .cluster-label span p{background-color:transparent;}#mermaid-graph-12 .label text,#mermaid-graph-12 span{fill:#333;color:#333;}#mermaid-graph-12 .node rect,#mermaid-graph-12 .node circle,#mermaid-graph-12 .node ellipse,#mermaid-graph-12 .node polygon,#mermaid-graph-12 .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-graph-12 .rough-node .label text,#mermaid-graph-12 .node .label text,#mermaid-graph-12 .image-shape .label,#mermaid-graph-12 .icon-shape .label{text-anchor:middle;}#mermaid-graph-12 .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-graph-12 .rough-node .label,#mermaid-graph-12 .node .label,#mermaid-graph-12 .image-shape .label,#mermaid-graph-12 .icon-shape .label{text-align:center;}#mermaid-graph-12 .node.clickable{cursor:pointer;}#mermaid-graph-12 .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-graph-12 .arrowheadPath{fill:#333333;}#mermaid-graph-12 .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-graph-12 .flowchart-link{stroke:#333333;fill:none;}#mermaid-graph-12 .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-graph-12 .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-graph-12 .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-graph-12 .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-graph-12 .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-graph-12 .cluster text{fill:#333;}#mermaid-graph-12 .cluster span{color:#333;}#mermaid-graph-12 div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-graph-12 .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-graph-12 rect.text{fill:none;stroke-width:0;}#mermaid-graph-12 .icon-shape,#mermaid-graph-12 .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-graph-12 .icon-shape p,#mermaid-graph-12 .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-graph-12 .icon-shape rect,#mermaid-graph-12 .image-shape rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-graph-12 :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;}</style><g><marker orient="auto" markerHeight="8" markerWidth="8" markerUnits="userSpaceOnUse" refY="5" refX="5" viewBox="0 0 10 10" class="marker flowchart-v2" id="mermaid-graph-12_flowchart-v2-pointEnd"><path style="stroke-width: 1; stroke-dasharray: 1, 0;" class="arrowMarkerPath" d="M 0 0 L 10 5 L 0 10 z"></path></marker><marker orient="auto" markerHeight="8" markerWidth="8" markerUnits="userSpaceOnUse" refY="5" refX="4.5" viewBox="0 0 10 10" class="marker flowchart-v2" id="mermaid-graph-12_flowchart-v2-pointStart"><path style="stroke-width: 1; stroke-dasharray: 1, 0;" class="arrowMarkerPath" d="M 0 5 L 10 10 L 10 0 z"></path></marker><marker orient="auto" markerHeight="11" markerWidth="11" markerUnits="userSpaceOnUse" refY="5" refX="11" viewBox="0 0 10 10" class="marker flowchart-v2" id="mermaid-graph-12_flowchart-v2-circleEnd"><circle style="stroke-width: 1; stroke-dasharray: 1, 0;" class="arrowMarkerPath" r="5" cy="5" cx="5"></circle></marker><marker orient="auto" markerHeight="11" markerWidth="11" markerUnits="userSpaceOnUse" refY="5" refX="-1" viewBox="0 0 10 10" class="marker flowchart-v2" id="mermaid-graph-12_flowchart-v2-circleStart"><circle style="stroke-width: 1; stroke-dasharray: 1, 0;" class="arrowMarkerPath" r="5" cy="5" cx="5"></circle></marker><marker orient="auto" markerHeight="11" markerWidth="11" markerUnits="userSpaceOnUse" refY="5.2" refX="12" viewBox="0 0 11 11" class="marker cross flowchart-v2" id="mermaid-graph-12_flowchart-v2-crossEnd"><path style="stroke-width: 2; stroke-dasharray: 1, 0;" class="arrowMarkerPath" d="M 1,1 l 9,9 M 10,1 l -9,9"></path></marker><marker orient="auto" markerHeight="11" markerWidth="11" markerUnits="userSpaceOnUse" refY="5.2" refX="-1" viewBox="0 0 11 11" class="marker cross flowchart-v2" id="mermaid-graph-12_flowchart-v2-crossStart"><path style="stroke-width: 2; stroke-dasharray: 1, 0;" class="arrowMarkerPath" d="M 1,1 l 9,9 M 10,1 l -9,9"></path></marker></g><g class="subgraphs"></g><g class="nodes"><g transform="translate(46.859375, 39)" id="flowchart-A-0" class="node default"><rect height="54" width="69.4375" y="-27" x="-34.71875" style="" class="basic label-container"></rect><g transform="translate(-4.71875, -12)" style="" class="label"><rect></rect><foreignObject height="24" width="9.4375"><div style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;" xmlns="http://www.w3.org/1999/xhtml"><span class="nodeLabel"><p>A</p></span></div></foreignObject></g></g><g transform="translate(492.296875, 249.04545454545453)" id="flowchart-B-1" class="node default"><rect height="54" width="69.0625" y="-27" x="-34.53125" style="" class="basic label-container"></rect><g transform="translate(-4.53125, -12)" style="" class="label"><rect></rect><foreignObject height="24" width="9.0625"><div style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;" xmlns="http://www.w3.org/1999/xhtml"><span class="nodeLabel"><p>B</p></span></div></foreignObject></g></g><g transform="translate(46.7890625, 399.9)" id="flowchart-C-2" class="node default"><rect height="54" width="69.578125" y="-27" x="-34.7890625" style="" class="basic label-container"></rect><g transform="translate(-4.7890625, -12)" style="" class="label"><rect></rect><foreignObject height="24" width="9.578125"><div style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;" xmlns="http://www.w3.org/1999/xhtml"><span class="nodeLabel"><p>C</p></span></div></foreignObject></g></g></g><g class="edges edgePaths"><path marker-end="url(#mermaid-graph-12_flowchart-v2-pointEnd)" style="" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" id="L_A_B_0_0" d="M81.578,39L140.526,39C199.474,39,317.37,39,376.789,39.362C436.208,39.724,437.151,40.448,437.985,41.281C438.818,42.114,439.542,43.057,439.904,73.188C440.266,103.318,440.266,162.636,440.628,192.767C440.989,222.897,441.713,223.84,442.547,224.673C443.38,225.507,444.323,226.231,446.211,226.593C448.099,226.955,450.932,226.955,452.349,226.955L453.766,226.955"></path><path marker-end="url(#mermaid-graph-12_flowchart-v2-pointEnd)" style="" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" id="L_C_B_0_0" d="M81.578,383.7L86.578,383.7C91.578,383.7,101.578,383.7,107.05,383.338C112.521,382.976,113.464,382.252,114.297,381.419C115.13,380.586,115.854,379.643,116.216,337.555C116.578,295.467,116.578,212.233,116.94,170.145C117.302,128.057,118.026,127.114,118.859,126.281C119.693,125.448,120.635,124.724,167.555,124.362C214.474,124,307.37,124,354.289,124.362C401.208,124.724,402.151,125.448,402.985,126.281C403.818,127.114,404.542,128.057,404.904,145.657C405.266,163.258,405.266,197.515,405.628,215.115C405.989,232.716,406.713,233.658,407.547,234.492C408.38,235.325,409.323,236.049,417.044,236.411C424.766,236.773,439.266,236.773,446.516,236.773L453.766,236.773"></path><path marker-end="url(#mermaid-graph-12_flowchart-v2-pointEnd)" style="" class="edge-thickness-normal edge-pattern-dotted edge-thickness-normal edge-pattern-solid flowchart-link" id="L_C_B_2_0" d="M81.578,389.1L89.495,389.1C97.411,389.1,113.245,389.1,121.633,388.738C130.021,388.376,130.964,387.652,131.797,386.819C132.63,385.986,133.354,385.043,133.716,349.138C134.078,313.233,134.078,242.367,134.44,206.462C134.802,170.557,135.526,169.614,136.359,168.781C137.193,167.948,138.135,167.224,179.221,166.862C220.307,166.5,301.536,166.5,342.622,166.862C383.708,167.224,384.651,167.948,385.485,168.781C386.318,169.614,387.042,170.557,387.404,181.892C387.766,193.227,387.766,214.955,388.128,226.29C388.489,237.625,389.213,238.567,390.047,239.401C390.88,240.234,391.823,240.958,402.461,241.32C413.099,241.682,433.432,241.682,443.599,241.682L453.766,241.682"></path><path marker-end="url(#mermaid-graph-12_flowchart-v2-pointEnd)" style="" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" id="L_C_B_3_0" d="M81.578,394.5L92.411,394.5C103.245,394.5,124.911,394.5,136.216,394.138C147.521,393.776,148.464,393.052,149.297,392.219C150.13,391.386,150.854,390.443,151.216,360.721C151.578,331,151.578,272.5,151.94,242.779C152.302,213.057,153.026,212.114,153.859,211.281C154.693,210.448,155.635,209.724,190.888,209.362C226.141,209,295.703,209,330.956,209.362C366.208,209.724,367.151,210.448,367.985,211.281C368.818,212.114,369.542,213.057,369.904,218.127C370.266,223.197,370.266,232.394,370.628,237.464C370.989,242.534,371.713,243.477,372.547,244.31C373.38,245.143,374.323,245.867,387.878,246.229C401.432,246.591,427.599,246.591,440.682,246.591L453.766,246.591"></path><path marker-end="url(#mermaid-graph-12_flowchart-v2-pointEnd)" style="" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" id="L_C_B_4_0" d="M81.578,399.9L95.328,399.9C109.078,399.9,136.578,399.9,150.8,399.538C165.021,399.176,165.964,398.452,166.797,397.619C167.63,396.786,168.354,395.843,168.716,372.305C169.078,348.767,169.078,302.633,169.44,279.095C169.802,255.557,170.526,254.614,171.359,253.781C172.193,252.948,173.135,252.224,220.221,251.862C267.307,251.5,360.536,251.5,407.151,251.5L453.766,251.5"></path><path marker-end="url(#mermaid-graph-12_flowchart-v2-pointEnd)" style="" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" id="L_C_B_5_0" d="M81.578,405.3L98.245,405.3C114.911,405.3,148.245,405.3,165.383,404.938C182.521,404.576,183.464,403.852,184.297,403.019C185.13,402.186,185.854,401.243,186.216,383.888C186.578,366.533,186.578,332.767,186.94,315.412C187.302,298.057,188.026,297.114,188.859,296.281C189.693,295.448,190.635,294.724,220.055,294.362C249.474,294,307.37,294,336.789,293.638C366.208,293.276,367.151,292.552,367.985,291.719C368.818,290.886,369.542,289.943,369.904,284.873C370.266,279.803,370.266,270.606,370.628,265.536C370.989,260.466,371.713,259.523,372.547,258.69C373.38,257.857,374.323,257.133,387.878,256.771C401.432,256.409,427.599,256.409,440.682,256.409L453.766,256.409"></path><path marker-end="url(#mermaid-graph-12_flowchart-v2-pointEnd)" style="" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" id="L_C_B_6_0" d="M81.578,410.7L101.161,410.7C120.745,410.7,159.911,410.7,179.966,410.338C200.021,409.976,200.964,409.252,201.797,408.419C202.63,407.586,203.354,406.643,203.716,395.471C204.078,384.3,204.078,362.9,204.44,351.729C204.802,340.557,205.526,339.614,206.359,338.781C207.193,337.948,208.135,337.224,237.555,336.862C266.974,336.5,324.87,336.5,354.289,336.138C383.708,335.776,384.651,335.052,385.485,334.219C386.318,333.386,387.042,332.443,387.404,321.108C387.766,309.773,387.766,288.045,388.128,276.71C388.489,265.375,389.213,264.433,390.047,263.599C390.88,262.766,391.823,262.042,402.461,261.68C413.099,261.318,433.432,261.318,443.599,261.318L453.766,261.318"></path><path marker-end="url(#mermaid-graph-12_flowchart-v2-pointEnd)" style="" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" id="L_C_B_7_0" d="M81.578,416.1L104.078,416.1C126.578,416.1,171.578,416.1,194.55,415.738C217.521,415.376,218.464,414.652,219.297,413.819C220.13,412.986,220.854,412.043,221.216,407.055C221.578,402.067,221.578,393.033,221.94,388.045C222.302,383.057,223.026,382.114,223.859,381.281C224.693,380.448,225.635,379.724,255.055,379.362C284.474,379,342.37,379,371.789,378.638C401.208,378.276,402.151,377.552,402.985,376.719C403.818,375.886,404.542,374.943,404.904,357.343C405.266,339.742,405.266,305.485,405.628,287.885C405.989,270.284,406.713,269.342,407.547,268.508C408.38,267.675,409.323,266.951,417.044,266.589C424.766,266.227,439.266,266.227,446.516,266.227L453.766,266.227"></path><path marker-end="url(#mermaid-graph-12_flowchart-v2-pointEnd)" style="" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" id="L_C_B_8_0" d="M81.578,421.5L137.609,421.5C193.641,421.5,305.703,421.5,362.206,421.138C418.708,420.776,419.651,420.052,420.485,419.219C421.318,418.386,422.042,417.443,422.404,393.577C422.766,369.712,422.766,322.924,423.128,299.059C423.489,275.194,424.213,274.251,425.047,273.417C425.88,272.584,426.823,271.86,431.628,271.498C436.432,271.136,445.099,271.136,449.432,271.136L453.766,271.136"></path><path marker-end="url(#mermaid-graph-12_flowchart-v2-pointEnd)" style="" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" id="L_B_C_0_0" d="M457.766,231.864L452.766,231.864C447.766,231.864,437.766,231.864,432.294,231.502C426.823,231.14,425.88,230.416,425.047,229.583C424.213,228.749,423.489,227.806,423.128,203.941C422.766,180.076,422.766,133.288,422.404,109.423C422.042,85.557,421.318,84.614,420.485,83.781C419.651,82.948,418.708,82.224,365.956,81.862C313.203,81.5,208.641,81.5,155.888,81.862C103.135,82.224,102.193,82.948,101.359,83.781C100.526,84.614,99.802,85.557,99.44,133.829C99.078,182.1,99.078,277.7,98.716,325.971C98.354,374.243,97.63,375.186,96.797,376.019C95.964,376.852,95.021,377.576,93.133,377.938C91.245,378.3,88.411,378.3,86.995,378.3L85.578,378.3"></path></g><g class="edgeLabels"><g transform="translate(295.921875, 38.5)" class="edgeLabel"><g transform="translate(-37.5703125, -12)" class="label"><foreignObject height="24" width="75.140625"><div style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;" class="labelBkg" xmlns="http://www.w3.org/1999/xhtml"><span class="edgeLabel"><p>Guarantee</p></span></div></foreignObject></g></g><g transform="translate(295.921875, 123.5)" class="edgeLabel"><g transform="translate(-53.8515625, -12)" class="label"><foreignObject height="24" width="107.703125"><div style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;" class="labelBkg" xmlns="http://www.w3.org/1999/xhtml"><span class="edgeLabel"><p>User attributes</p></span></div></foreignObject></g></g><g transform="translate(295.921875, 165.99999999999997)" class="edgeLabel"><g transform="translate(-42.2109375, -12)" class="label"><foreignObject height="24" width="84.421875"><div style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;" class="labelBkg" xmlns="http://www.w3.org/1999/xhtml"><span class="edgeLabel"><p>Master data</p></span></div></foreignObject></g></g><g transform="translate(295.921875, 208.49999999999997)" class="edgeLabel"><g transform="translate(-52.3828125, -12)" class="label"><foreignObject height="24" width="104.765625"><div style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;" class="labelBkg" xmlns="http://www.w3.org/1999/xhtml"><span class="edgeLabel"><p>Exchange Rate</p></span></div></foreignObject></g></g><g transform="translate(295.921875, 250.99999999999997)" class="edgeLabel"><g transform="translate(-49.7109375, -12)" class="label"><foreignObject height="24" width="99.421875"><div style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;" class="labelBkg" xmlns="http://www.w3.org/1999/xhtml"><span class="edgeLabel"><p>Profit Centers</p></span></div></foreignObject></g></g><g transform="translate(295.921875, 293.5)" class="edgeLabel"><g transform="translate(-56.84375, -12)" class="label"><foreignObject height="24" width="113.6875"><div style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;" class="labelBkg" xmlns="http://www.w3.org/1999/xhtml"><span class="edgeLabel"><p>Vendor Partners</p></span></div></foreignObject></g></g><g transform="translate(295.921875, 336)" class="edgeLabel"><g transform="translate(-52.2890625, -12)" class="label"><foreignObject height="24" width="104.578125"><div style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;" class="labelBkg" xmlns="http://www.w3.org/1999/xhtml"><span class="edgeLabel"><p>Work Situation</p></span></div></foreignObject></g></g><g transform="translate(295.921875, 378.5)" class="edgeLabel"><g transform="translate(-33.9765625, -12)" class="label"><foreignObject height="24" width="67.953125"><div style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;" class="labelBkg" xmlns="http://www.w3.org/1999/xhtml"><span class="edgeLabel"><p>Customer</p></span></div></foreignObject></g></g><g transform="translate(295.921875, 421)" class="edgeLabel"><g transform="translate(-49.7109375, -12)" class="label"><foreignObject height="24" width="99.421875"><div style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;" class="labelBkg" xmlns="http://www.w3.org/1999/xhtml"><span class="edgeLabel"><p>Profit Centers</p></span></div></foreignObject></g></g><g transform="translate(295.921875, 81)" class="edgeLabel"><g transform="translate(-37.5703125, -12)" class="label"><foreignObject height="24" width="75.140625"><div style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;" class="labelBkg" xmlns="http://www.w3.org/1999/xhtml"><span class="edgeLabel"><p>Guarantee</p></span></div></foreignObject></g></g></g><text class="flowchartTitleText" y="-25" x="269.4140625" text-anchor="middle">Interfaces for B</text></svg>\ No newline at end of filediff --git a/docs/User Guide/User Guide/Note Types/Mermaid Diagrams/Syntax reference.dat b/docs/User Guide/User Guide/Note Types/Mermaid Diagrams/Syntax reference.datnew file mode 100644index 0000000000..e69de29bb2diff --git a/docs/User Guide/User Guide/Note Types/Mermaid Diagrams_image.png b/docs/User Guide/User Guide/Note Types/Mermaid Diagrams_image.pngnew file mode 100644index 0000000000..964dae4915Binary files /dev/null and b/docs/User Guide/User Guide/Note Types/Mermaid Diagrams_image.png differdiff --git a/docs/User Guide/User Guide/Note Types/Mind Map.md b/docs/User Guide/User Guide/Note Types/Mind Map.mdnew file mode 100644index 0000000000..878a4f5447--- /dev/null+++ b/docs/User Guide/User Guide/Note Types/Mind Map.md@@ -0,0 +1,25 @@+# Mind Map+<figure class="image image-style-align-center"><img style="aspect-ratio:892/675;" src="Mind Map_image.png" width="892" height="675"></figure>++The mindmap allows for easy jotting down of ideas and storing them in a hierarchical fashion.++## Terminology++* A **node** is a single idea, represented differently based on depth (filled rounded rectangle for the root note, unfilled rectangles for sub-ideas, lines only for sub-sub-ideas).+* The **root node** is the top-most node from which all other nodes derive, displayed as a filled rectangle. There can only be a single root node.++## Interaction++* To create a new node at the same level as the current one, press <kbd>Enter</kbd>, enter the desired text and then press <kbd>Enter</kbd> once again to confirm.+* Similarly, to create a sub-node, press <kbd>Tab</kbd>, enter the desired text and then press <kbd>Enter</kbd>.+* To create a parent, use <kbd>Ctrl</kbd>+<kbd>Enter</kbd> instead.+* To remove a node, press <kbd>Delete</kbd>.+* To move a node up or down, press <kbd>Page Up</kbd> or <kbd>Page Down</kbd>.+* To adjust the font size, color of the text or background or to add a link, click on a node and use the floating panel that appears to the right.+* To select one or more notes, drag and drop across the map.+* Right click the node to bring a contextual menu with options such as creating new nodes, focusing on a particular notes or creating links between them.+* Use the buttons at the top-left to change the positioning of the nodes relative to the root node (to the left, to the right, or to both sides).+* In the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Floating%20buttons.md">Floating buttons</a> area:+ * An [image reference](Text/Images/Image%20references.md) can be copied, to paste the mind map in a text note.+ * The diagram can be exported either as SVG (vectorial) or PNG (raster).+ * The note can be togged [read-only](../Basic%20Concepts%20and%20Features/Notes/Read-Only%20Notes.md).\ No newline at end of filediff --git a/docs/User Guide/User Guide/Note Types/Mind Map_image.png b/docs/User Guide/User Guide/Note Types/Mind Map_image.pngnew file mode 100644index 0000000000..9e44818621Binary files /dev/null and b/docs/User Guide/User Guide/Note Types/Mind Map_image.png differdiff --git a/docs/User Guide/User Guide/Note Types/Note Map.md b/docs/User Guide/User Guide/Note Types/Note Map.mdnew file mode 100644index 0000000000..265dae4300--- /dev/null+++ b/docs/User Guide/User Guide/Note Types/Note Map.md@@ -0,0 +1,26 @@+# Note Map+<figure class="image image_resized" style="width:72.68%;"><img style="aspect-ratio:1311/1271;" src="Note Map_image.png" width="1311" height="1271"></figure>++A Note map is a note type which displays a standalone version of the feature of the same name: <a class="reference-link" href="../Advanced%20Usage/Note%20Map%20(Link%20map%2C%20Tree%20map).md">Note Map (Link map, Tree map)</a>. Consult that page for more information on how the note map works and what it displays.++Once created, the note map will display the relations between notes. Only the notes that are part of the parent of the note map will be displayed (including their children).++## Root note++The root note defines the starting point of the graph, from which the relations and the hierarchy are derived from.++There are three possible root notes:++* The default root note is the parent note of the note map.+* To use the currently [hoisted note](../Basic%20Concepts%20and%20Features/Navigation/Note%20Hoisting.md) instead, set the `mapRootNoteId` label to `hoisted`.+* To use a specific note instead, set `mapRootNoteId` to the <a class="reference-link" href="../Advanced%20Usage/Note%20ID.md">Note ID</a> of the desired note.++## Customization++The note map can be customized using the following <a class="reference-link" href="../Advanced%20Usage/Attributes/Labels.md">Labels</a>:++| Label | Description |+| --- | --- |+| `#mapIncludeRelation` | Comma-delimited relation names to include from the note map. |+| `#mapExcludeRelation` | Comma-delimited relation names to exclude from the note map. |+| `#mapRootNoteId` | The ID of the note the map roots from, or `hoisted`. See the root note section above for more information. |\ No newline at end of filediff --git a/docs/User Guide/User Guide/Note Types/Note Map_image.png b/docs/User Guide/User Guide/Note Types/Note Map_image.pngnew file mode 100644index 0000000000..43fdd0749cBinary files /dev/null and b/docs/User Guide/User Guide/Note Types/Note Map_image.png differdiff --git a/docs/User Guide/User Guide/Note Types/Relation Map.md b/docs/User Guide/User Guide/Note Types/Relation Map.mdnew file mode 100644index 0000000000..ce15cbe374--- /dev/null+++ b/docs/User Guide/User Guide/Note Types/Relation Map.md@@ -0,0 +1,65 @@+# Relation Map+Relation map is a type of note which visualizes notes and their [relations](../Advanced%20Usage/Attributes.md).++## Interaction++* To create a new note and add it to the board, press the plus button in the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Floating%20buttons.md">Floating buttons</a>.+ * Afterwards, click anywhere on the map to place it there.+ * The note will be placed as a sub-child of the map.+* An existing note can also be dragged from the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.md">Note Tree</a>. It will be placed at the position it's dragged on.+ * Multiple notes can also be dragged via <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree/Multiple%20selection.md">Multiple selection</a>. The notes will be positioned near the dragged position without overlapping.+ * The dragged note can be a sub-child of the map, or it can be at any arbitrary position.+* To create a relationship, hold the mouse on the box on the right of a note and then:+ * Drag it over another note to create a relationship pointing from the first note to the second one.+ * Drag over the same note to create a self-referencing relationship (represented as a loop).+ * Once dragged, enter the name of the relationship to create. To cancel, simply dismiss the dialog or press <kbd>Esc</kbd>.+* To open a note, either click on the note (opening it in the current view) or use the right click menu to open in a new tab.+* To edit the title of a note or to delete it (either from the map, or delete it completely), right click the note.+* To delete a relationship, right click it and select the corresponding option.++## Development process demo++This is a basic example how you can create simple diagram using relation maps:++<img src="Relation Map_relation-map-dev-process.png" width="934" height="667">++And this is how you can create it:++<img src="Relation Map_relation-map-dev-process-demo.gif" width="812" height="585">++We start completely from scratch by first creating new note called "Development process" and changing its type to "Relation map". After that we create new notes one by one and place them by clicking into the map. We also drag [relations](../Advanced%20Usage/Attributes.md)between notes and name them. That's all!++Items on the map - "Specification", "Development", "Testing" and "Demo" are actually notes which have been created under "Development process" note - you can click on them and write some content. Connections between notes are called "[relations](../Advanced%20Usage/Attributes.md)".++## Family demo++This is more complicated demo using some advanced concepts. Resulting diagram is here:++<img src="Relation Map_relation-map-family.png" width="941" height="758">++This is how you get to it:++<img src="Relation Map_relation-map-family-demo.gif" width="812" height="585">++There are several steps here:++* we start with empty relation map and two existing notes representing Prince Philip and Queen Elizabeth II. These two notes already have `isPartnerOf` [relations](../Advanced%20Usage/Attributes.md)defined.+ * There are actually two "inverse" relations (one from Philip to Elizabeth and one from Elizabeth to Philip)+* we drag both notes to relation map and place to suitable position. Notice how the existing `isPartnerOf` relations are displayed.+* now we create new note - we name it "Prince Charles" and place it on the relation map by clicking on the desired position. The note is by default created under the relation map note (visible in the note tree on the left).+* we create two new relations `isChildOf` targeting both Philip and Elizabeth+ * now there's something unexpected - we can also see the relation to display another `hasChild` relation. This is because there's a [relation definition](../Advanced%20Usage/Attributes/Promoted%20Attributes.md) which puts `isChildOf` as an "[inverse](../Advanced%20Usage/Attributes/Promoted%20Attributes.md)" relation of `hasChildOf` (and vice versa) and thus it is created automatically.+* we create another note for Princess Diana and create `isPartnerOf` relation from Charles. Again notice how the relation has arrows both ways - this is because `isPartnerOf` definition specifies its inverse relation as again "isPartnerOf" so the opposite relation is created automatically.+* as the last step we pan & zoom the map to fit better to window dimensions.++Relation definitions mentioned above come from "Person template" note which is assigned to any child of "My Family Tree" relation note. You can play with the whole thing in the [demo notes](../Advanced%20Usage/Database.md).++## Details++You can specify which relations should be displayed with comma delimited names of relations in `displayRelations` label.++Alternatively, you can specify comma delimited list of relation names in `hideRelations` which will display all relations, except for the ones defined in the label.++## See also++* <a class="reference-link" href="Note%20Map.md">Note Map</a> is a similar concept.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Note Types/Relation Map_relation-map-dev-process-demo.gif b/docs/User Guide/User Guide/Note Types/Relation Map_relation-map-dev-process-demo.gifnew file mode 100644index 0000000000..8ff234f4eaBinary files /dev/null and b/docs/User Guide/User Guide/Note Types/Relation Map_relation-map-dev-process-demo.gif differdiff --git a/docs/User Guide/User Guide/Note Types/Relation Map_relation-map-dev-process.png b/docs/User Guide/User Guide/Note Types/Relation Map_relation-map-dev-process.pngnew file mode 100644index 0000000000..fb97d0e998Binary files /dev/null and b/docs/User Guide/User Guide/Note Types/Relation Map_relation-map-dev-process.png differdiff --git a/docs/User Guide/User Guide/Note Types/Relation Map_relation-map-family-demo.gif b/docs/User Guide/User Guide/Note Types/Relation Map_relation-map-family-demo.gifnew file mode 100644index 0000000000..8366855144Binary files /dev/null and b/docs/User Guide/User Guide/Note Types/Relation Map_relation-map-family-demo.gif differdiff --git a/docs/User Guide/User Guide/Note Types/Relation Map_relation-map-family.png b/docs/User Guide/User Guide/Note Types/Relation Map_relation-map-family.pngnew file mode 100644index 0000000000..86ea6477f5Binary files /dev/null and b/docs/User Guide/User Guide/Note Types/Relation Map_relation-map-family.png differdiff --git a/docs/User Guide/User Guide/Note Types/Render Note.md b/docs/User Guide/User Guide/Note Types/Render Note.mdnew file mode 100644index 0000000000..60387ce507--- /dev/null+++ b/docs/User Guide/User Guide/Note Types/Render Note.md@@ -0,0 +1,72 @@+# Render Note+<figure class="image"><img style="aspect-ratio:601/216;" src="Render Note_image.png" width="601" height="216"></figure>++Render Note is a special case of [front-end scripting](../Scripting/Frontend%20Basics.md) which allows rendering custom content inside a note. This makes it possible to create custom dashboards, or to use a custom note editor.++The content can either be a vanilla HTML, or Preact JSX.++## Creating a render note++1. Create a <a class="reference-link" href="Code.md">Code</a> note with the:+ 1. HTML language for the legacy/vanilla method, with what needs to be displayed (for example `<p>Hello world.</p>`).+ 2. JSX for the Preact-based approach (see below).+2. Create a <a class="reference-link" href="Render%20Note.md">Render Note</a>.+3. Assign the `renderNote` [relation](../Advanced%20Usage/Attributes.md) to point at the previously created code note.++## Legacy scripting using jQuery++A static HTML is generally not enough for <a class="reference-link" href="../Scripting.md">Scripting</a>. The next step is to automatically change parts of the note using JavaScript.++For a simple example, we are going to create a render note that displays the current date in a field.++To do so, first create an HTML code note with the following content:++```html+<h1>Current date & time</h1>+The current date & time is <span class="date"></span>+```++Now we need to add the script. Create another <a class="reference-link" href="Code.md">Code</a>, but this time of JavaScript (frontend) language. Make sure the newly created note is a direct child of the HTML note created previously; with the following content:++```javascript+const $dateEl = api.$container.find(".date");+$dateEl.text(new Date());+```++Now create a render note at any place and set its `~renderNote` relation to point to the HTML note. When the render note is accessed it will display:++> **Current date & time**+> The current date & time is Sun Apr 06 2025 15:26:29 GMT+0300 (Eastern European Summer Time)++## Dynamic content using Preact & JSX++As a more modern alternative to jQuery, it's possible to use Preact & JSX to render pages. Since JSX is a superset of JavaScript, there's no need to provide a HTML anymore.++Here are the steps to creating a simple render note:++1. Create a note of type <a class="reference-link" href="Render%20Note.md">Render Note</a>.+2. Create a child <a class="reference-link" href="Code.md">Code</a> note with JSX as the language.+ As an example, use the following content:++ ```+ export default function() {+ return (+ <>+ <p>Hello world.</p>+ </>+ );+ }+ ```+3. In the parent render note, define a `~renderNote` relation pointing to the newly created child.+4. Refresh the render note and it should display a “Hello world” message.++## Refreshing the note++It's possible to refresh the note via:++* The corresponding button in <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Floating%20buttons.md">Floating buttons</a>.+* The “Render active note” [keyboard shortcut](../Basic%20Concepts%20and%20Features/Keyboard%20Shortcuts.md) (not assigned by default).++## Examples++* <a class="reference-link" href="../Advanced%20Usage/Advanced%20Showcases/Weight%20Tracker.md">Weight Tracker</a> which is present in the <a class="reference-link" href="../Advanced%20Usage/Database/Demo%20Notes.md">Demo Notes</a>.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Note Types/Render Note_image.png b/docs/User Guide/User Guide/Note Types/Render Note_image.pngnew file mode 100644index 0000000000..75e246c442Binary files /dev/null and b/docs/User Guide/User Guide/Note Types/Render Note_image.png differdiff --git a/docs/User Guide/User Guide/Note Types/Saved Search.md b/docs/User Guide/User Guide/Note Types/Saved Search.mdnew file mode 100644index 0000000000..cfea153bea--- /dev/null+++ b/docs/User Guide/User Guide/Note Types/Saved Search.md@@ -0,0 +1,8 @@+# Saved Search+Trilium allows you to save common searches as notes within the note tree. The search results will appear as sub-notes under these "saved search" notes. Here is an example of how it works:++<figure class="image image_resized image-style-align-center" style="width:50%;"><img style="aspect-ratio:812/585;" src="Saved Search_saved-search.gif" width="812" height="585"></figure>++## Location++By default, saved searches are stored in the day note. However, you can designate a different note to store saved searches by marking it with the `#searchHome` label. Additionally, for [workspaces](../Basic%20Concepts%20and%20Features/Navigation/Workspaces.md), you can use the `#workspaceSearchHome` label to specify a storage location for saved searches within that workspace.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Note Types/Saved Search_saved-search.gif b/docs/User Guide/User Guide/Note Types/Saved Search_saved-search.gifnew file mode 100644index 0000000000..72864f1cc8Binary files /dev/null and b/docs/User Guide/User Guide/Note Types/Saved Search_saved-search.gif differdiff --git a/docs/User Guide/User Guide/Note Types/Spreadsheets.md b/docs/User Guide/User Guide/Note Types/Spreadsheets.mdnew file mode 100644index 0000000000..755cefe9da--- /dev/null+++ b/docs/User Guide/User Guide/Note Types/Spreadsheets.md@@ -0,0 +1,93 @@+# Spreadsheets+<figure class="image"><img style="aspect-ratio:1102/573;" src="Spreadsheets_image.png" width="1102" height="573"></figure>++> [!IMPORTANT]+> Spreadsheets are a new type of note introduced in v0.103.0 and are currently considered experimental/beta. As such, expect major changes to occur to this note type.++Spreadsheets provide a familiar experience to Microsoft Excel or LibreOffice Calc, with support for formulas, data validation and text formatting.++## Spreadsheets vs. collections++There is a slight overlap between spreadsheets and the <a class="reference-link" href="../Collections/Table.md">Table</a> collection. In general the table collection is useful to track meta-information about notes (for example a collection of people and their birthdays), whereas spreadsheets are quite useful for calculations since they support formulas.++Spreadsheets also benefit from a wider range of features such as data validation, formatting and can work on a relatively large dataset.++## Data intercompatibility (import/export)++Starting with v0.104.0, Trilium provides a level of data intercompatibility between the internal format (Univer) and the following formats:++* Microsoft Excel (.xlsx)+ * Preserves basic formatting (fonts, sizes, borders, backgrounds).+ * Formulas are preserved, but note that not all Excel functions are supported and vice-versa with Univer.+ * Images (cell-bound or floating), without preserving rotation.+ * Supports multi-sheets natively.+* Comma-Separated Values (.csv)+ * Since it's a text-based format, any formatting is lost.+ * Formulas are evaluated and turned into their final value instead.+ * Multi-sheets spreadsheets are exported as a single ZIP containing a CSV file per sheet.++Both [import and export](../Basic%20Concepts%20and%20Features/Import%20%26%20Export.md) are supported, as follows:++* To import a file, simply drag it into the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.md">Note Tree</a> and it will be converted into a spreadsheet note.+ * To avoid this behavior (e.g. to import a .xlsx file as an actual <a class="reference-link" href="File.md">File</a>), uncheck the corresponding option in the [Import dialog](../Basic%20Concepts%20and%20Features/Import%20%26%20Export.md).+ * Multiple files can be imported at the same time, including a mixture of .csv and .xlsx files. Folder structure can be preserved by using a .zip file.+* Unlike importing, exporting is on a per-note basis:+ * In the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20buttons.md">Note buttons</a>, choose the _Export to Excel_ or _Export to CSV_ options for the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/New%20Layout.md">New Layout</a>.+ * For the old layout, choose the corresponding buttons in the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Floating%20buttons.md">Floating buttons</a> area.+ * If exported as a single file via <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Import%20%26%20Export.md">Import & Export</a>, the resulting file will be a custom `.triliumsheet` file that preserves the spreadsheet as-is.+ * The export is intentionally a different process than the normal <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Import%20%26%20Export.md">Import & Export</a> functionality because it does conversion to multiple formats with varying degrees of compatibility.++> [!IMPORTANT]+> Import & export for both .xlsx and .csv files are supported on a best-effort basis. It does not support advanced features (data validation, scripting, etc.). If you notice a particular issue, it can be [reported](../Troubleshooting/Reporting%20issues.md), however all bug reports must contain a sample file in order to be taken into consideration.++## Supported features++The spreadsheet has support for the following features:++* Since v0.104.0, images that can be either inside a cell or floating above.+ * The images are saved as <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Notes/Attachments.md">Attachments</a> for performance reasons.+ * The image upload respects the same compression settings as text <a class="reference-link" href="Text/Images.md">Images</a>.+* Filtering+* Sorting+* Data validation+* Conditional formatting+* Notes / annotations+* Find / replace++We might consider adding [other features](https://docs.univer.ai/guides/sheets/features/filter) from Univer at some point. If there is a particular feature that can be added easily, it can be discussed over [GitHub Issues](../Troubleshooting/Reporting%20issues.md).++### Share functionality++Spreadsheets can be [shared](../Advanced%20Usage/Sharing.md), case in which a best-effort HTML rendering of the spreadsheet is done:++* Preserves basic formatting.+* Cells with formulas display the precalculated value instead of the formula.++Since v0.104.0:++* Numbers and dates are properly formatted.+* Images are shown inside a cell or floating above, including rotation.++For more advanced use cases, this will most likely not work as intended. Feel free to [report issues](../Troubleshooting/Reporting%20issues.md), but keep in mind that we might not be able to have a complete feature parity with all the features of Univer.++## Features not supported yet++### Regarding Pro features++Univer spreadsheets also feature a [Pro plan](https://univer.ai/pro) which adds quite a lot of functionality such as charts, printing, pivot tables, export, etc.++As the Pro plan needs a license, Trilium does not support any of the premium features. Theoretically, pro features can be used in trial mode with some limitations, we might explore this direction at some point.++### Planned features++There are a few features that are already planned but are not supported yet:++* Trilium-specific formulas (e.g. to obtain the title of a note).+* User-defined formulas+* Cross-workbook calculation++If you would like us to work on these features, consider [supporting us](https://triliumnotes.org/en/support-us).++### Mobile support++Versions prior to v0.104.0 have no dedicated mobile support, which means that the interaction is difficult without a mouse and keyboard. Starting with v0.104.0 we integrate Univer's mobile plugin, which introduces feature such as drag to pan which makes the interface more usable on mobile.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Note Types/Spreadsheets_image.png b/docs/User Guide/User Guide/Note Types/Spreadsheets_image.pngnew file mode 100644index 0000000000..6b957c220bBinary files /dev/null and b/docs/User Guide/User Guide/Note Types/Spreadsheets_image.png differdiff --git a/docs/User Guide/User Guide/Note Types/Text.md b/docs/User Guide/User Guide/Note Types/Text.mdnew file mode 100644index 0000000000..cdc25f4188--- /dev/null+++ b/docs/User Guide/User Guide/Note Types/Text.md@@ -0,0 +1,96 @@+# Text+The default note type in Trilium, text notes allow for rich formatting, tables, images, admonitions and a handful of other features.++## Formatting bars++Most of the interaction with text notes is done via the built-in toolbars. Depending on preference, there are two different layouts:++* The _Floating toolbar_ is hidden by default and only appears when needed. In this mode there are actually two different toolbars:+ <img src="1_Text_image.png" width="496" height="91"><img src="2_Text_image.png" width="812" height="114">+* A toolbar that appears when text is selected. This provides text-level formatting such as bold, italic, text colors, inline code, etc.+ _<img src="Text_image.png" width="1109" height="124">_++Fore more information see <a class="reference-link" href="Text/Formatting%20toolbar.md">Formatting toolbar</a>.++## Features and formatting++Here's a list of various features supported by text notes:++<table>+ <thead>+ <tr>+ <th>Dedicated article</th>+ <th>Feature</th>+ </tr>+ </thead>+ <tbody>+ <tr>+ <td><a class="reference-link" href="Text/General%20formatting.md">General formatting</a></td>+ <td><ul><li>Headings (section titles, paragraph)</li><li>Font size</li><li>Bold, italic, underline, strike-through</li><li>Superscript, subscript</li><li>Font color & background color</li><li>Remove formatting</li></ul></td>+ </tr>+ <tr>+ <td><a class="reference-link" href="Text/Lists.md">Lists</a></td>+ <td><ul><li>Bulleted lists</li><li>Numbered lists</li><li>To-do lists</li></ul></td>+ </tr>+ <tr>+ <td><a class="reference-link" href="Text/Block%20quotes%20%26%20admonitions.md">Block quotes & admonitions</a></td>+ <td><ul><li>Block quotes</li><li>Admonitions</li></ul></td>+ </tr>+ <tr>+ <td><a class="reference-link" href="Text/Tables.md">Tables</a></td>+ <td><ul><li>Basic tables</li><li>Merging cells</li><li>Styling tables and cells.</li><li>Table captions</li></ul></td>+ </tr>+ <tr>+ <td><a class="reference-link" href="Text/Developer-specific%20formatting.md">Developer-specific formatting</a></td>+ <td><ul><li>Inline code</li><li>Code blocks</li><li>Keyboard shortcuts</li></ul></td>+ </tr>+ <tr>+ <td><a class="reference-link" href="Text/Footnotes.md">Footnotes</a></td>+ <td><ul><li>Footnotes</li></ul></td>+ </tr>+ <tr>+ <td><a class="reference-link" href="Text/Images.md">Images</a></td>+ <td><ul><li>Images</li></ul></td>+ </tr>+ <tr>+ <td><a class="reference-link" href="Text/Links.md">Links</a></td>+ <td><ul><li>External links</li><li>Internal Trilium links</li></ul></td>+ </tr>+ <tr>+ <td><a class="reference-link" href="Text/Include%20Note.md">Include Note</a></td>+ <td><ul><li>Include note</li></ul></td>+ </tr>+ <tr>+ <td><a class="reference-link" href="Text/Insert%20buttons.md">Insert buttons</a></td>+ <td><ul><li>Symbols</li><li><a class="reference-link" href="Text/Math%20Equations.md">Math Equations</a></li><li>Mermaid diagrams</li><li>Horizontal ruler</li><li>Page break</li></ul></td>+ </tr>+ <tr>+ <td><a class="reference-link" href="Text/Other%20features.md">Other features</a></td>+ <td><ul><li>Indentation<ul><li>Markdown import</li></ul></li><li><a class="reference-link" href="Text/Cut%20to%20subnote.md">Cut to subnote</a></li></ul></td>+ </tr>+ <tr>+ <td><a class="reference-link" href="Text/Premium%20features.md">Premium features</a></td>+ <td><ul><li><a class="reference-link" href="Text/Slash%20Commands.md">Slash Commands</a></li><li><a class="reference-link" href="../Advanced%20Usage/Templates.md">Templates</a></li><li><a class="reference-link" href="Text/Format%20Painter.md">Format Painter</a></li></ul></td>+ </tr>+ </tbody>+</table>++## Read-Only vs. Editing Mode++Text notes are usually opened in edit mode. However, they may open in read-only mode if the note is too big or the note is explicitly marked as read-only. For more information, see <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Notes/Read-Only%20Notes.md">Read-Only Notes</a>.++## Keyboard shortcuts++There are numerous keyboard shortcuts to format the text without having to use the mouse. For a reference of all the key combinations, see <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Keyboard%20Shortcuts.md">Keyboard Shortcuts</a>. In addition, see <a class="reference-link" href="Text/Markdown-like%20formatting.md">Markdown-like formatting</a> as an alternative to the keyboard shortcuts.++## Content width++For readability purposes on wider screens, the width of text notes is limited via a configurable option. See <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Content%20width.md">Content width</a> for more information.++## Converting to a Markdown note++Text notes can be converted to <a class="reference-link" href="Markdown.md">Markdown</a> notes. See <a class="reference-link" href="Converting%20between%20note%20types.md">Converting between note types</a>.++## Technical details++For the text editing functionality, Trilium uses a commercial product (with an open-source base) called <a class="reference-link" href="../Advanced%20Usage/Technologies%20used/CKEditor.md">CKEditor</a>. This brings the benefit of having a powerful WYSIWYG (What You See Is What You Get) editor.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Note Types/Text/1_Formatting toolbar_image.png b/docs/User Guide/User Guide/Note Types/Text/1_Formatting toolbar_image.pngnew file mode 100644index 0000000000..bc6bd96c47Binary files /dev/null and b/docs/User Guide/User Guide/Note Types/Text/1_Formatting toolbar_image.png differdiff --git a/docs/User Guide/User Guide/Note Types/Text/1_Insert buttons_plus.png b/docs/User Guide/User Guide/Note Types/Text/1_Insert buttons_plus.pngnew file mode 100644index 0000000000..723ca82d71Binary files /dev/null and b/docs/User Guide/User Guide/Note Types/Text/1_Insert buttons_plus.png differdiff --git a/docs/User Guide/User Guide/Note Types/Text/1_Link Previews_image.png b/docs/User Guide/User Guide/Note Types/Text/1_Link Previews_image.pngnew file mode 100644index 0000000000..a36b38cdb1Binary files /dev/null and b/docs/User Guide/User Guide/Note Types/Text/1_Link Previews_image.png differdiff --git a/docs/User Guide/User Guide/Note Types/Text/2_Formatting toolbar_image.png b/docs/User Guide/User Guide/Note Types/Text/2_Formatting toolbar_image.pngnew file mode 100644index 0000000000..c7d879eba4Binary files /dev/null and b/docs/User Guide/User Guide/Note Types/Text/2_Formatting toolbar_image.png differdiff --git a/docs/User Guide/User Guide/Note Types/Text/2_Link Previews_image.png b/docs/User Guide/User Guide/Note Types/Text/2_Link Previews_image.pngnew file mode 100644index 0000000000..9d74aab0ddBinary files /dev/null and b/docs/User Guide/User Guide/Note Types/Text/2_Link Previews_image.png differdiff --git a/docs/User Guide/User Guide/Note Types/Text/3_Formatting toolbar_image.png b/docs/User Guide/User Guide/Note Types/Text/3_Formatting toolbar_image.pngnew file mode 100644index 0000000000..3270223e23Binary files /dev/null and b/docs/User Guide/User Guide/Note Types/Text/3_Formatting toolbar_image.png differdiff --git a/docs/User Guide/User Guide/Note Types/Text/Automatic replacements.md b/docs/User Guide/User Guide/Note Types/Text/Automatic replacements.mdnew file mode 100644index 0000000000..27f470df67--- /dev/null+++ b/docs/User Guide/User Guide/Note Types/Text/Automatic replacements.md@@ -0,0 +1,61 @@+# Automatic replacements+## Automatic replacements++As you type in a text note, certain character sequences are replaced with the typographic symbol they represent. Typing `(c)` gives you `©`, `...` gives you `…`, and `"quote"` gives you `“quote”`.++These replacements are not applied inside code blocks or inline code, and pasted text is never affected, only text you type. If you have pasted a code snippet, or written one inside a code block, its characters are left exactly as they are.++### Undoing a replacement++Once an automatic replacement takes place, it can be undone by:++* Pressing <kbd>Backspace</kbd> immediately after a replacement undoes it and restores what you typed.+ * Note that this consumes the undo, so a further <kbd>Ctrl</kbd>+<kbd>Z</kbd> might delete your typed text.+ * Pressing <kbd>Space</kbd> or changing the cursor position disables this functionality.+* Pressing <kbd>Ctrl</kbd>+<kbd>Z</kbd>, which works even after pressing space.++### Replacement groups & configuration++Each group can be turned off in <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Options.md">Options</a> → _Text notes_ → _Automatic replacements_.++| Group | What it replaces |+| --- | --- |+| Punctuation | `...` with an ellipsis (`…`), and `--` and `---` _surrounded by spaces_ with an en dash (`–`) and an em dash (`—`) |+| Mathematical symbols | fractions such as `1/2` with `½`, and the operators `<=`, `>=`, `!=`, `<-` and `->` with `≤`, `≥`, `≠`, `←` and `→` |+| Copyright and trademark | `(c)`, `(r)` and `(tm)` with `©`, `®` and `™` |+| Quotation marks | straight quotes with typographic ones — see below |++## Quotation marks++Quotation marks are configured separately from the rest, with one setting for the **double** quote key and one for the **single** quote key, because which pair belongs on which key differs between conventions: British typography traditionally sets a quotation in `‘…’` where American sets it in `“…”`.++Each offers:++* _Based on the note's content language_ (the default) — English gives `“quote”`, German `„quote“`, French `« quote »`, Japanese `「quote」`. See <a class="reference-link" href="Content%20language%20%26%20Right-to-left%20support.md">Content language & Right-to-left support</a> for how a note's language is decided.+* _Disabled,_ straight quotes stay straight.+* A specific pair\_:\_ `“…”`, `‘…’`, `„…“`, `„…”`, `«…»`, `« … »`, `‹…›`, `「…」`, `『…』`. Choosing one applies it to every note, regardless of its content language.++## Custom replacements++You can add your own under <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Options.md">Options</a> → _Text notes_ → _Automatic replacements_ → _Custom replacements_. Type the text to replace and the replacement, then press Enter. Existing ones are shown as chips and removed with the × on each.++A custom replacement is applied when the text is typed as a whole word and followed by a space, so longer words that begin with it are left alone — a `TN` replacement does not rewrite the end of `BTN`, and `TNT` can still be typed.++Capitalization follows what you type, unless the replacement has capitals of its own:++| **Replacement you defined** | **You type** | **You get** |+| --- | --- | --- |+| `teh` → `the` | `teh` / `Teh` / `TEH` | `the` / `The` / `THE` |+| `TN` → `Trilium Notes` | `TN` or `tn` | `Trilium Notes` (unchanged, it has capitals) |++Of note:++* The text to replace is matched literally; it is not a pattern.+* Typing a "text to replace" that already exists in the list of replacements will update the existing one instead. It's not possible to have multiple replacements for the same text.+* The same “text to replace” with different capitalization (e.g. `TN` and `tn` co-existing) doesn't work because it would interfere with the capitalization rules above.++## Characters that only look replaced (ligatures)++If you see `!=` displayed as `≠` or `->` as `→` inside a code block, that is not a replacement since replacements never run there (unless a code block is applied to an existing text). It is a _font ligature_: the default monospace font draws certain character pairs as a single symbol. The underlying text is unchanged, and copying it out gives you back `!=` and `->`.++This can be turned off with <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Options.md">Options</a>_→ Appearance → Fonts → Programming ligatures._\ No newline at end of filediff --git a/docs/User Guide/User Guide/Note Types/Text/Collapsible blocks.md b/docs/User Guide/User Guide/Note Types/Text/Collapsible blocks.mdnew file mode 100644index 0000000000..ab7f539ac1--- /dev/null+++ b/docs/User Guide/User Guide/Note Types/Text/Collapsible blocks.md@@ -0,0 +1,19 @@+# Collapsible blocks+Collapsible blocks are sections of content that can be expanded and collapsed, letting you hide detail until it's needed.++A collapsible block consists of:++* **An always-visible header**, containing:+ * **An arrow** that expands or collapses the block when clicked.+ * **A summary line** that acts as the block's title. With the cursor in the summary line, press <kbd>Ctrl</kbd>+<kbd>Enter</kbd> to expand or collapse the block.+ * **A drag handle** for repositioning the block within the note.+* **The body**, which is hidden while the block is collapsed. It can hold any kind of content, including nested collapsible blocks. To break out of a collapsible block and continue typing outside it, press <kbd>Enter</kbd> twice at the end of the block.++You can use the arrow keys to move freely with the cursor between the summary line, the block's body, and the text around the block.++## Inserting a collapsible block++In the formatting bar, go to “**Insert” → “Collapsible Block”**.++> [!TIP]+> Place multiple collapsible blocks one after another to create an accordion, where each block can be expanded or collapsed independently.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Note Types/Text/Content language & Right-to-left support.md b/docs/User Guide/User Guide/Note Types/Text/Content language & Right-to-left support.mdnew file mode 100644index 0000000000..9bf5598030--- /dev/null+++ b/docs/User Guide/User Guide/Note Types/Text/Content language & Right-to-left support.md@@ -0,0 +1,26 @@+# Content language & Right-to-left support+++The content language determines:++* The spell-checking of the note, when in a browser. The desktop installation has a dedicated spellchecking section.+* Whether the text is displayed from right-to-left, for languages such as Arabic, Hebrew, etc.+* How typed quotes are [automatically replaced](Automatic%20replacements.md) (e.g. English uses `“text”`, whereas some languages use `«text»`). This applies only if <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Options.md">Options</a> → _Text_ → _Single/Double quotation marks_ is set to _Based on note's content language_.+* Which languages are offered by the <a class="reference-link" href="In-editor%20AI%20assistant.md">In-editor AI assistant</a> for translation.++## Setting the language of a single note++To set the language of the content of a <a class="reference-link" href="../Text.md">Text</a> note:++* On the new layout, there is a language selector in the <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/New%20Layout/Status%20bar.md">Status bar</a>.+* On the old layout, go to the <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Ribbon.md">Ribbon</a> → _Basic Properties_ and look for the _Language_ field.++## Adjusting the list of languages++By default there will be no language configured, they can be configured by going to <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Options.md">Options</a> → Language & Region or by selecting the _Configure languages_ item when setting the language.++## Default content language++Notes that do not have a language of their own follow <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Options.md">Options</a> → _Language & Region_ → _Default content language_. It is set to English initially, and can be set to any content language, or to _Based on the application's language_.++If a note has a language set, it always takes precedence over the default.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Note Types/Text/Content language & Right-to-left support_image.png b/docs/User Guide/User Guide/Note Types/Text/Content language & Right-to-left support_image.pngnew file mode 100644index 0000000000..dee799386cBinary files /dev/null and b/docs/User Guide/User Guide/Note Types/Text/Content language & Right-to-left support_image.png differdiff --git a/docs/User Guide/User Guide/Note Types/Text/Cut to subnote.md b/docs/User Guide/User Guide/Note Types/Text/Cut to subnote.mdnew file mode 100644index 0000000000..5918c1a89a--- /dev/null+++ b/docs/User Guide/User Guide/Note Types/Text/Cut to subnote.md@@ -0,0 +1,10 @@+# Cut to subnote+<figure class="image image_resized image-style-align-right" style="width:64.63%;"><img style="aspect-ratio:812/585;" src="Cut to subnote_cut-to-subnote.gif" width="812" height="585"></figure>++When editing a document that becomes too large, you can split it into sub-notes:++1. Select the desired text and cut it to the clipboard.+2. Create a new sub-note and name it.+3. Paste the content from the clipboard into the sub-note.++Trilium can automate this process. Select some text within the note, and in the selection toolbar, click the scissors icon for the "cut & pasted selection to sub-note" action. The heading is automatically detected and the new sub-note is named accordingly. You can also assign a keyboard shortcut for this action. This functionality is available through the block toolbar icon.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Note Types/Text/Cut to subnote_cut-to-subnote.gif b/docs/User Guide/User Guide/Note Types/Text/Cut to subnote_cut-to-subnote.gifnew file mode 100644index 0000000000..b71afd0bd3Binary files /dev/null and b/docs/User Guide/User Guide/Note Types/Text/Cut to subnote_cut-to-subnote.gif differdiff --git a/docs/User Guide/User Guide/Note Types/Text/Developer-specific formatting_image.png b/docs/User Guide/User Guide/Note Types/Text/Developer-specific formatting_image.pngnew file mode 100644index 0000000000..6ae0fd87aeBinary files /dev/null and b/docs/User Guide/User Guide/Note Types/Text/Developer-specific formatting_image.png differdiff --git a/docs/User Guide/User Guide/Note Types/Text/Format Painter_image.png b/docs/User Guide/User Guide/Note Types/Text/Format Painter_image.pngnew file mode 100644index 0000000000..db5cbbbd11Binary files /dev/null and b/docs/User Guide/User Guide/Note Types/Text/Format Painter_image.png differdiff --git a/docs/User Guide/User Guide/Note Types/Text/Formatting toolbar_image.png b/docs/User Guide/User Guide/Note Types/Text/Formatting toolbar_image.pngnew file mode 100644index 0000000000..85578b78eaBinary files /dev/null and b/docs/User Guide/User Guide/Note Types/Text/Formatting toolbar_image.png differdiff --git a/docs/User Guide/User Guide/Note Types/Text/General formatting_image.png b/docs/User Guide/User Guide/Note Types/Text/General formatting_image.pngnew file mode 100644index 0000000000..1d1cfb3eaeBinary files /dev/null and b/docs/User Guide/User Guide/Note Types/Text/General formatting_image.png differdiff --git a/docs/User Guide/User Guide/Note Types/Text/Highlights list.md b/docs/User Guide/User Guide/Note Types/Text/Highlights list.mdnew file mode 100644index 0000000000..c846c429c2--- /dev/null+++ b/docs/User Guide/User Guide/Note Types/Text/Highlights list.md@@ -0,0 +1,3 @@+# Highlights list+> [!NOTE]+> This page has been relocated to <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Right%20Sidebar/Outline%20tab.md">Outline tab</a>.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Note Types/Text/Images/Image references_image.png b/docs/User Guide/User Guide/Note Types/Text/Images/Image references_image.pngnew file mode 100644index 0000000000..a54daef4a2Binary files /dev/null and b/docs/User Guide/User Guide/Note Types/Text/Images/Image references_image.png differdiff --git a/docs/User Guide/User Guide/Note Types/Text/In-editor AI assistant/Custom AI quick actions.md b/docs/User Guide/User Guide/Note Types/Text/In-editor AI assistant/Custom AI quick actions.mdnew file mode 100644index 0000000000..081d1426ac--- /dev/null+++ b/docs/User Guide/User Guide/Note Types/Text/In-editor AI assistant/Custom AI quick actions.md@@ -0,0 +1,24 @@+# Custom AI quick actions+_Quick actions_ are a feature of the <a class="reference-link" href="../In-editor%20AI%20assistant.md">In-editor AI assistant</a> for <a class="reference-link" href="../../Text.md">Text</a> notes which automatically triggers an LLM suggestion based on a defined prompt. The built-in quick actions come with a predefined prompt, but it is also possible to define your own quick actions.++## Creating a custom quick action++In the <a class="reference-link" href="../../../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.md">Note Tree</a>:++1. Right click a note where to place the text snippet.+2. Select _Insert child note_.+3. Select _AI Quick Action_.++Afterwards, simply type in the content of the note the desired prompt. The text can be formatted in the same manner as a normal text note and it will be passed to the LLM as Markdown.++The title of the note will become the title of the quick action.++Of note:++* <a class="reference-link" href="../../Code.md">Code</a> notes work too.+* An empty note is ignored.+* <a class="reference-link" href="../../../Basic%20Concepts%20and%20Features/Notes/Archived%20Notes.md">Archived Notes</a> are also excluded.++## Using a quick action++Once a quick action is defined, the actoin will appear under the _Quick Actions_ dropdown in a group called _Custom_.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Note Types/Text/In-editor AI assistant_image.png b/docs/User Guide/User Guide/Note Types/Text/In-editor AI assistant_image.pngnew file mode 100644index 0000000000..a9111cc931Binary files /dev/null and b/docs/User Guide/User Guide/Note Types/Text/In-editor AI assistant_image.png differdiff --git a/docs/User Guide/User Guide/Note Types/Text/Insert buttons/Icons.md b/docs/User Guide/User Guide/Note Types/Text/Insert buttons/Icons.mdnew file mode 100644index 0000000000..7675bc9e52--- /dev/null+++ b/docs/User Guide/User Guide/Note Types/Text/Insert buttons/Icons.md@@ -0,0 +1,42 @@+# Icons+Icons just like the [note icons](Icons.md) can be inserted in the content of a note, including from any other [custom icon packs](../../../Basic%20Concepts%20and%20Features/Themes/Icon%20Packs.md).++## Features++* The icon can be formatted through the<a class="reference-link" href="../General%20formatting.md">General formatting</a> tools of the <a class="reference-link" href="../Formatting%20toolbar.md">Formatting toolbar</a>:+ * Foreground/icon color+ * Background color/highlight+ * Font size+* Custom <a class="reference-link" href="../../../Basic%20Concepts%20and%20Features/Themes/Icon%20Packs.md">Icon Packs</a> are also supported.+ * For emojis, prefer the Emoji functionality from <a class="reference-link" href="../Insert%20buttons.md">Insert buttons</a>.+* When an icon is clicked a floating toolbar appears with the following functions:+ * <span class="tn-icon bx bx-sticker"></span> which changes the icon.+ * <span class="tn-icon bx bx-reflect-horizontal"></span> which applies transforms: rotate (90 / 180 / 270) and flip horizontal/vertical. Only one transform can be used per icon.++## Usage++* The in-app help/user guide makes use of these icons in order to illustrate buttons in the UI.+* The <a class="reference-link" href="../../../Basic%20Concepts%20and%20Features/Import%20%26%20Export/Importing%20data%20from%20other%20applications/Microsoft%20OneNote.md">Microsoft OneNote</a> importer also makes use of them for the <a class="reference-link" href="../../../Basic%20Concepts%20and%20Features/Import%20%26%20Export/Importing%20data%20from%20other%20applications/Microsoft%20OneNote/Tags.md">Tags</a>.++## Inserting an icon++There are two ways to insert an icon:++* Via the <a class="reference-link" href="../Formatting%20toolbar.md">Formatting toolbar</a> look for the <span class="tn-icon bx bx-plus"></span> icon and then the <span class="tn-icon bx bx-sticker"></span> icon.+* Via <a class="reference-link" href="../Slash%20Commands.md">Slash Commands</a>, type `/icon`.++An icon picker will appear, search for an icon and click it to insert it in the document.++## Finding notes by their icons++An icon can be [searched](../../../Basic%20Concepts%20and%20Features/Navigation/Search.md). A note containing a <span class="tn-icon bx bx-star"></span> icon can be found by searching for `star`, or its `iconClass` (`bx-star`).++To find the name of the icon, hover the mouse over an icon while in the icon picker.++## Markdown rendering++When exporting to <a class="reference-link" href="../../../Basic%20Concepts%20and%20Features/Import%20%26%20Export/Markdown.md">Markdown</a>, the item will render as raw HTML representation of the icon as is used by Trilium:++```html+<span class="tn-icon bx bx-star"></span>+```\ No newline at end of filediff --git a/docs/User Guide/User Guide/Note Types/Text/Insert buttons_plus.png b/docs/User Guide/User Guide/Note Types/Text/Insert buttons_plus.pngnew file mode 100644index 0000000000..5cd65f1e16Binary files /dev/null and b/docs/User Guide/User Guide/Note Types/Text/Insert buttons_plus.png differdiff --git a/docs/User Guide/User Guide/Note Types/Text/Keyboard shortcuts.md b/docs/User Guide/User Guide/Note Types/Text/Keyboard shortcuts.mdnew file mode 100644index 0000000000..eddb2d9fe5--- /dev/null+++ b/docs/User Guide/User Guide/Note Types/Text/Keyboard shortcuts.md@@ -0,0 +1,89 @@+# Keyboard shortcuts+## Trilium-specific shortcuts++| Action | PC | Mac |+| --- | --- | --- |+| Bring up inline formatting toolbar (arrow keys ←,→ to navigate, Enter to apply) | Alt+F10 | ⌥+F10 |+| Bring up block formatting toolbar | Alt+F10 | ⌥+F10 |+| Create [external link](Links.md) | Ctrl+K | ⌘+K |+| Create [internal (note) link](Links.md) | Ctrl+L | ⌘+L |+| Inserts current date and time at caret position | Alt+T | ⌥+T |+| Increase paragraph indentation | Tab | ⇥ |+| Decrease paragraph indentation | Shift + Tab | ⇧ + ⇥ |+| Mark selected text as [keyboard shortcut](Developer-specific%20formatting.md) | Ctrl + Alt + K | ⌘+ ⌥+ K |+| Insert <a class="reference-link" href="Math%20Equations.md">Math Equations</a> | Ctrl + M | ⌘+ M |+| Move blocks (lists, paragraphs, etc.) up | Ctrl+↑ | ⌘+↑ |+| Alt+↑ | ⌥+↑ | |+| Move blocks (lists, paragraphs, etc.) down | Ctrl+↑ | ⌘+↑ |+| Alt+↓ | ⌥+↓ | |++## Common shortcuts++> [!TIP]+> This section of keyboard shortcuts presents a subset of the keyboard shortcuts as supported by the editor technology we are using, <a class="reference-link" href="../../Advanced%20Usage/Technologies%20used/CKEditor.md">CKEditor</a>. The shortcuts were taken from the [official documentation](https://ckeditor.com/docs/ckeditor5/latest/features/accessibility.html#keyboard-shortcuts). Note that not all the shortcuts in the original documentation are applicable (due to using a different configuration).++### Content editing++| Action | PC | Mac |+| --- | --- | --- |+| Insert a hard break (a new paragraph) | Enter | |+| Insert a soft break (a `<br>` element) | Shift+Enter | ⇧Enter |+| Copy selected content | Ctrl+C | ⌘C |+| Paste content | Ctrl+V | ⌘V |+| Paste content as plain text | Ctrl+Shift+V | ⌘⇧V |+| Undo | Ctrl+Z | ⌘Z |+| Redo | Ctrl+Y, Ctrl+Shift+Z | ⌘Y, ⌘⇧Z |+| Bold text | Ctrl+B | ⌘B |+| Change text case | Shift+F3 | ⇧F3 (may require Fn) |+| Create link | Ctrl+K | ⌘K |+| Move out of a link | ←←, →→ | |+| Move out of an inline code style | ←←, →→ | |+| Select all | Ctrl+A | ⌘A |+| Find in the document | Ctrl+F | ⌘F |+| Copy text formatting | Ctrl+Shift+C | ⌘⇧C |+| Paste text formatting | Ctrl+Shift+V | ⌘⇧V |+| Italic text | Ctrl+I | ⌘I |+| Strikethrough text | Ctrl+Shift+X | ⌘⇧X |+| Underline text | Ctrl+U | ⌘U |+| Revert autoformatting action | Backspace | |++### Interacting with blocks++Blocks are images, tables, blockquotes, annotations.++| Action | PC | Mac |+| --- | --- | --- |+| Insert a new paragraph directly after a widget | Enter | |+| Insert a new paragraph directly before a widget | Shift+Enter | ⇧Enter |+| Move the caret to allow typing directly before a widget | ↑, ← | |+| Move the caret to allow typing directly after a widget | ↓, → | |+| After entering a nested editable, move the selection to the closest ancestor widget. For example: move from an image caption to the whole image widget. | Tab then Esc | |++Specifically for lists:++| Action | PC | Mac |+| --- | --- | --- |+| Increase list item indent | ⇥ | |+| Decrease list item indent | Shift+⇥ | ⇧⇥ |++In tables:++| Action | PC | Mac |+| --- | --- | --- |+| Move the selection to the next cell | ⇥ | |+| Move the selection to the previous cell | Shift+⇥ | ⇧⇥ |+| Insert a new table row (when in the last cell of a table) | ⇥ | |+| Navigate through the table | ↑, →, ↓, ← | |++### General UI shortcuts++| Action | PC | Mac |+| --- | --- | --- |+| Close contextual balloons, dropdowns, and dialogs | Esc | |+| Open the accessibility help dialog | Alt+0 | ⌥0 |+| Move focus between form fields (inputs, buttons, etc.) | ⇥, Shift+⇥ | ⇥, ⇧⇥ |+| Move focus to the toolbar, navigate between toolbars | Alt+F10 | ⌥F10 (may require Fn) |+| Navigate through the toolbar or menu bar | ↑, →, ↓, ← | |+| Navigate to the next focusable field or an element outside the editor | Tab, Shift+Tab | |+| Execute the currently focused button. Executing buttons that interact with the editor content moves the focus back to the content. | Enter, Space | |+| Move focus in and out of an active dialog window | Ctrl+F6 | ⌘F6 (may require Fn) |\ No newline at end of filediff --git a/docs/User Guide/User Guide/Note Types/Text/Link Previews.md b/docs/User Guide/User Guide/Note Types/Text/Link Previews.mdnew file mode 100644index 0000000000..6665510e73--- /dev/null+++ b/docs/User Guide/User Guide/Note Types/Text/Link Previews.md@@ -0,0 +1,79 @@+# Link Previews+Link previews turn a pasted URL into a rich, metadata-aware widget that can be displayed in three visual modes:++## Display modes++A link preview can be displayed in one of three modes:++* **Inline** — a link showing the site's favicon and page title (quite similar to <a class="reference-link" href="Links/Internal%20(reference)%20links.md">Internal (reference) links</a>). Use this when you want the link to flow with the surrounding paragraph.+* **Card** — a block-level preview with thumbnail, title, description, and site name. Use this when the link is the focus of a paragraph.+* **Embed** — a block-level interactive embed.+ * Currently supported for YouTube videos, which render interactively (via an `iframe`).+ * To prevent unwanted remote requests, the video is shown only after clicking on it first.++<table class="ck-table-resized">+ <colgroup>+ <col style="width:21.85%;">+ <col style="width:38.84%;">+ <col style="width:39.31%;">+ </colgroup>+ <tbody>+ <tr>+ <td><figure class="image image_resized" style="width:100%;"><img style="aspect-ratio:251/42;" src="Link Previews_image.png" width="251" height="42"><figcaption><em>Inline</em> link preview</figcaption></figure></td>+ <td><figure class="image image_resized" style="width:100%;"><img style="aspect-ratio:1217/196;" src="2_Link Previews_image.png" width="1217" height="196"><figcaption><em>Card</em> link preview</figcaption></figure></td>+ <td><figure class="image image_resized" style="width:100%;"><img style="aspect-ratio:994/563;" src="1_Link Previews_image.png" width="994" height="563"><figcaption><em>Embed</em> link preview</figcaption></figure></td>+ </tr>+ </tbody>+</table>++## Inserting a link preview++There are two ways to create one:++### 1\. By pasting a URL++A link preview is automatically created:++* By pasting the URL and pressing <kbd>Space</kbd>. This will create an _inline_ link preview.+* When at the start of a new paragraph, pressing <kbd>Enter</kbd> will create a _card_ or an _embed_ for YouTube URLs.++To undo an automatic link preview, press <kbd>Ctrl</kbd>+<kbd>Z</kbd> immediately afterwards which keeps it as a plain link instead. Alternatively, once a link preview was created, click on the link and select _Plain link_ from the link preview toolbar.++This automatic conversion can be disabled by going to <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Options.md">Options</a> → _Text Notes_ and unchecking _Autogenerate link previews_ from the _Features_ section.++If the link is not accessible to the Trilium server (or the network request fails for any other reason), it will not be converted to a link preview.++> [!NOTE]+> A URL is only auto-converted when the pasted text _is_ the URL. Links with a display name (e.g. [Trilium Notes website](https://triliumnotes.org)) are left as plain links.++### 2\. By using the "Link preview" toolbar button++Click **Link preview** in the formatting toolbar to open the _Link preview_ popup. Paste the URL and choose the type of preview.++## Altering an existing link preview++Click on an inserted link preview to select it, and a small toolbar will appear with the following options:++* The normal link operations (opening in a new tab, copying the link, unlinking).+* A button to edit the title of the link preview. This is especially useful if the title is hidden behind a login screen.+* A way to switch between the link preview modes (Inline, Card or Embed) as well as to convert it to a normal link instead.+ * The Embed option is only enabled when the URL points to a supported service (YouTube today).++## Where the preview data comes from++When you insert a link preview, Trilium fetches metadata once and stores it inside the note's HTML:++* **YouTube URLs** — title, channel name, and thumbnail are fetched via YouTube's public oEmbed endpoint.+* **All other URLs** — Trilium fetches the page and reads OpenGraph tags (`og:title`, `og:description`, `og:image`, `og:site_name`), falling back to the page's `<title>` and `<meta name="description">`. The site's favicon is downloaded and inlined.++Because the data is stored in the note itself, link previews continue to render correctly when you reopen the note, share/publish it, or export to HTML — without any further network requests.++The metadata is captured **at insertion time** and is not automatically refreshed. If the linked page later changes its title or thumbnail, you'll need to re-insert the link to pick up the new values. To refresh a link, simply create it again.++When accessing a <a class="reference-link" href="../../Installation%20%26%20Setup/Server%20Installation.md">Server Installation</a>, the data is fetched from the remote URL by the server and not the client.++## Known limitations++* The Embed display mode currently only supports YouTube. Other video and media platforms fall back to a Card preview.+* Pages that block automated fetches may produce a minimal preview (hostname only).+* Link previews require the Trilium server to reach the target URL, so they won't generate previews for pages on networks the server can't see.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Note Types/Text/Link Previews_image.png b/docs/User Guide/User Guide/Note Types/Text/Link Previews_image.pngnew file mode 100644index 0000000000..5a9a57da56Binary files /dev/null and b/docs/User Guide/User Guide/Note Types/Text/Link Previews_image.png differdiff --git a/docs/User Guide/User Guide/Note Types/Text/Links.md b/docs/User Guide/User Guide/Note Types/Text/Links.mdnew file mode 100644index 0000000000..a152cccb86--- /dev/null+++ b/docs/User Guide/User Guide/Note Types/Text/Links.md@@ -0,0 +1,10 @@+# Links+There are two types of links:++* <a class="reference-link" href="Links/External%20links.md">External links</a>, for standard hyperlinks to websites or other resources.+* <a class="reference-link" href="Links/Internal%20(reference)%20links.md">Internal (reference) links</a> for links to other notes within Trilium.+ * The list of notes that refer to a particular note is called <a class="reference-link" href="Links/Backlinks.md">Backlinks</a>.++## Note map++Trilium provides a visualization of incoming and outgoing links for a particular note. See [note map](../../Advanced%20Usage/Note%20Map%20\(Link%20map%2C%20Tree%20map\).md) for details.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Note Types/Text/Links/Backlinks.md b/docs/User Guide/User Guide/Note Types/Text/Links/Backlinks.mdnew file mode 100644index 0000000000..847c6048c1--- /dev/null+++ b/docs/User Guide/User Guide/Note Types/Text/Links/Backlinks.md@@ -0,0 +1,40 @@+# Backlinks+A link points from one note to another; a _backlink_ is that same connection seen from the other end: the list of notes that refer to the current one.++Backlinks are maintained automatically and are read-only from this side. A backlink disappears when the note that created it removes the link; it cannot be deleted from the note being pointed at.++## What counts as a backlink++Any r<a class="reference-link" href="Internal%20(reference)%20links.md">Internal (reference) links</a> pointing at the current note, which covers two rather different cases:++* Relations that Trilium maintains on your behalf.+ * The most common is `internalLink`, created whenever a note refers to another one through <a class="reference-link" href="Internal%20(reference)%20links.md">Internal (reference) links</a> in its text.+ * Embedded images (`imageLink`), relation map connections (`relationMapLink`) and note inclusions (`includeNoteLink`) work the same way.+* Relations you define yourself.+ * If another note has `~author` pointing at the current note, that note is listed here as well.++Relations coming from a <a class="reference-link" href="../../Saved%20Search.md">Saved Search</a> are excluded, since a search stores an `ancestor` relation that would otherwise list every one of its results as a backlink.++> [!NOTE]+> Only some note types have their content scanned for links: <a class="reference-link" href="../../Text.md">Text</a>, <a class="reference-link" href="../../Markdown.md">Markdown</a>, <a class="reference-link" href="../../Relation%20Map.md">Relation Map</a> and <a class="reference-link" href="../../../AI.md">AI</a> chats. A link written inside a <a class="reference-link" href="../../Code.md">Code</a> note is not registered and will not appear as a backlink on the target note. A relation set manually on a code note does still count.++## How entries are displayed++Each entry names the note the reference comes from, followed by one of:++* **An excerpt** of the surrounding content, with the link itself highlighted. This is available for <a class="reference-link" href="../../Text.md">Text</a> notes and for <a class="reference-link" href="../../../AI.md">AI</a> chat notes. Roughly 200 characters of context are quoted around the link, trimmed with an ellipsis where the surrounding text is longer, and images are left out.+* **The name of the relation**, for every other note type where the source cannot be quoted. This is the case for <a class="reference-link" href="../../Relation%20Map.md">Relation Map</a> notes and for any note carrying a relation you defined yourself.++A note is listed once per reference it makes, so a note that links to the current one three times occupies three rows.++Of note:++* For AI chat notes, only the assistant's own prose is quoted. A chat that reached the note purely through tool calls has nothing to quote and is listed by relation name instead.+* Excerpts are only generated for roughly the first 50 sources. On a heavily referenced note, the remaining entries fall back to showing the relation name.++## Where backlinks are shown++* In the <a class="reference-link" href="../../../Basic%20Concepts%20and%20Features/UI%20Elements/Right%20Sidebar/Connections%20tab.md">Connections tab</a> of the <a class="reference-link" href="../../../Basic%20Concepts%20and%20Features/UI%20Elements/Right%20Sidebar.md">Right Sidebar</a>, as a dedicated section.+* As a badge in the <a class="reference-link" href="../../../Basic%20Concepts%20and%20Features/UI%20Elements/New%20Layout/Status%20bar.md">Status bar</a> showing the number of backlinks. The badge only appears when the note is being read normally (not in a revision or attachment view) and when there is at least one backlink; pressing it opens the section above.+* Incoming links are also drawn on the link map, see <a class="reference-link" href="../../../Advanced%20Usage/Note%20Map%20(Link%20map%2C%20Tree%20map).md">Note Map (Link map, Tree map)</a>.+* On the old layout, backlinks are showed as a dedicated button in the <a class="reference-link" href="../../../Basic%20Concepts%20and%20Features/UI%20Elements/Floating%20buttons.md">Floating buttons</a> area.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Note Types/Text/Markdown-like formatting.md b/docs/User Guide/User Guide/Note Types/Text/Markdown-like formatting.mdnew file mode 100644index 0000000000..02cf3c2333--- /dev/null+++ b/docs/User Guide/User Guide/Note Types/Text/Markdown-like formatting.md@@ -0,0 +1,32 @@+# Markdown-like formatting+Markdown-like formatting allows inserting some basic formatting by typing the Markdown equivalent. Note that this does not mean that <a class="reference-link" href="../Text.md">Text</a> notes supports Markdown, these are just some convenience shortcuts.++To import more complex formatting into text notes, consider using the [_Import from Markdown_](Other%20features.md) function. For fully-fleged Markdown notes imports, consider using the dedicated [import](../../Basic%20Concepts%20and%20Features/Import%20%26%20Export/Markdown.md) function.++* For [headings:](General%20formatting.md)+ * `##` for Heading 2 (the first-level heading is reserved for the note title).+ * `###` for Heading 3+ * `####` for Heading 4+ * `#####` for Heading 5+ * `######` for Heading 6+* For <a class="reference-link" href="General%20formatting.md">General formatting</a>:+ * **Bold**: Type `**text**` or `__text__`+ * _Italic_: Type `*text*` or `_text_`+ * ~~Strikethrough~~: Type `~~text~~`+* For <a class="reference-link" href="Lists.md">Lists</a>:+ * Bulleted list: Start a line with `*` or `-` followed by a space;+ * Numbered list: Start a line with `1.` or `1)` followed by a space;+ * To-do list: Start a line with `[ ]` for an unchecked item or `[x]` for a checked item.+* For [block quotes](Block%20quotes%20%26%20admonitions.md), press `>`, followed by a space.+* For <a class="reference-link" href="Developer-specific%20formatting/Code%20blocks.md">Code blocks</a>, type ` ``` `.+* For a [horizontal line](Other%20features.md), type `---`.+* For [admonitions](Block%20quotes%20%26%20admonitions.md):+ * `!!! note`+ * `!!! tip`+ * `!!! important`+ * `!!! caution`+ * `!!! warning`+ * Starting any other text with `!!!` will insert a note admonition with the text inside of it.+* For [emojis](Insert%20buttons.md), type `:` followed by an emoji name to trigger an auto-completion.++If auto-formatting is not desirable, press <kbd>Ctrl</kbd> + <kbd>Z</kbd> to revert the text to its original form.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Note Types/Text/Math Equations_image.png b/docs/User Guide/User Guide/Note Types/Text/Math Equations_image.pngnew file mode 100644index 0000000000..ffd51f4fa9Binary files /dev/null and b/docs/User Guide/User Guide/Note Types/Text/Math Equations_image.png differdiff --git a/docs/User Guide/User Guide/Note Types/Text/Premium features.md b/docs/User Guide/User Guide/Note Types/Text/Premium features.mdnew file mode 100644index 0000000000..2ecdd6fb63--- /dev/null+++ b/docs/User Guide/User Guide/Note Types/Text/Premium features.md@@ -0,0 +1,17 @@+# Premium features+The text editor we are using is called <a class="reference-link" href="../../Advanced%20Usage/Technologies%20used/CKEditor.md">CKEditor</a> which has an open-source core, but it's also a commercial product which offers [premium features](https://ckeditor.com/docs/trial/latest/index.html).++Prior to v0.105.0, Trilium used the following premium features as part of a signed agreement between the CKEditor and the Trilium team:++* <a class="reference-link" href="Slash%20Commands.md">Slash Commands</a>+* <a class="reference-link" href="Text%20Snippets.md">Text Snippets</a>+* <a class="reference-link" href="Format%20Painter.md">Format Painter</a>++Starting with v0.105.0, those features have been completely rewritten as custom CKEditor plugins, licensed under AGPL-3.0.++## Lookalikes++There are some premium CK features that look like Trilium's built-in functionality but they are completely different:++* <a class="reference-link" href="In-editor%20AI%20assistant.md">In-editor AI assistant</a>+* <a class="reference-link" href="Math%20Equations.md">Math Equations</a> which uses a third-party plugin that has been adapted for Trilium.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Note Types/Text/Slash Commands.md b/docs/User Guide/User Guide/Note Types/Text/Slash Commands.mdnew file mode 100644index 0000000000..b6d8ecba7e--- /dev/null+++ b/docs/User Guide/User Guide/Note Types/Text/Slash Commands.md@@ -0,0 +1,20 @@+# Slash Commands+<figure class="image image-style-align-right"><img style="aspect-ratio:419/571;" src="Slash Commands_image.png" width="419" height="571"></figure>++Slash commands is a feature of <a class="reference-link" href="../Text.md">Text</a> notes which allows easily accessing commonly used commands simply by using the keyboard, without having to remember dedicated <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/Keyboard%20Shortcuts.md">Keyboard Shortcuts</a>.++## Interaction++* As the name suggests, to trigger the slash commands simply press the / key to trigger it. Note that this can be anywhere in a paragraph as long as it's not part of the word, if it doesn't show up simply press a space and press the / key again.+* Use ↑ and ↓ keys to navigate between options.+* By default, the full list of commands is displayed.+* To search by title or description, simply start typing for an action.+* To trigger an action, press the Enter key.++## Integration with other features++Apart from the common set of commands, some features are specially integrated with the slash commands:++* For [admonitions](Block%20quotes%20%26%20admonitions.md), each admonition type (e.g. note, tip) will be individually displayed.+* Every <a class="reference-link" href="Text%20Snippets.md">Text Snippets</a> will also appear individually, making it easy to insert them.+* <a class="reference-link" href="In-editor%20AI%20assistant.md">In-editor AI assistant</a>: dedicated _Ask AI_ item as well as all the predefined and [custom quick actions](In-editor%20AI%20assistant/Custom%20AI%20quick%20actions.md).\ No newline at end of filediff --git a/docs/User Guide/User Guide/Note Types/Text/Slash Commands_image.png b/docs/User Guide/User Guide/Note Types/Text/Slash Commands_image.pngnew file mode 100644index 0000000000..b46c1a4c67Binary files /dev/null and b/docs/User Guide/User Guide/Note Types/Text/Slash Commands_image.png differdiff --git a/docs/User Guide/User Guide/Note Types/Text/Spell Check.md b/docs/User Guide/User Guide/Note Types/Text/Spell Check.mdnew file mode 100644index 0000000000..930b956d99--- /dev/null+++ b/docs/User Guide/User Guide/Note Types/Text/Spell Check.md@@ -0,0 +1,71 @@+# Spell Check+Trilium supports spell checking for your notes. How it works depends on whether you're using the **desktop application** (Electron) or accessing Trilium through a **web browser**.++## Desktop++The desktop app uses Chromium's built-in spellchecker. You can configure it from _Options_ → _Spell Check_.++### Enabling spell check++Toggle _Check spelling_ to enable or disable the spellchecker. A restart is required for changes to take effect — use the restart button at the bottom of the section.++### Choosing languages++When spell check is enabled, a _Spell Check Languages_ section appears listing all languages available on your system. Select one or more languages by checking the boxes. The spellchecker will accept words that are valid in _any_ of the selected languages.++The available languages depend on your operating system's installed language packs. For example, on Windows you can add languages through _Options_ → _Time & Language_ → _Language & Region_ → _Add a language_.++> [!NOTE]+> The changes take effect only after restarting the application.++### Custom dictionary++> [!TIP]+> This function is available starting with Trilium v0.103.0.++Words you add to the dictionary (e.g. via the right-click context menu → "Add to dictionary") are stored in a **synced note** inside Trilium. This means your custom dictionary automatically syncs across all your devices.++You can view and edit the dictionary directly from _Settings_ → _Spell Check_ → _Custom Dictionary_ → _Edit dictionary_. This opens the underlying note, which contains one word per line. You can add, remove, or modify entries as you like.++> [!NOTE]+> Changes to the custom dictionary (whether from the editor or the context menu) take effect after restarting the application.++#### How the custom dictionary works++* When you right-click a misspelled word and choose "Add to dictionary", the word is saved both to Electron's local spellchecker and to the synced dictionary note.+* On startup, Trilium loads all words from the dictionary note into the spellchecker session.+* If Trilium detects words in Electron's local dictionary but the dictionary note is empty (e.g. on first use), it performs a **one-time import** of those words into the note.+* Words that are in Electron's local dictionary but _not_ in the note (e.g. you removed them manually) are cleaned up from the local dictionary on startup.++#### Known limitations++On Windows and macOS, Electron delegates "Add to dictionary" to the operating system's user dictionary. This means:++* Words added via the context menu are also written to the OS-level dictionary (e.g. `%APPDATA%\Microsoft\Spelling\<language>\default.dic` on Windows).+* **Removing a word** from the Trilium dictionary note prevents it from being loaded into the spellchecker on next startup, but does _not_ remove it from the OS dictionary. The word may still be accepted by the OS spellchecker until you remove it from the OS dictionary manually.++## Web browser++When accessing Trilium through a web browser, spell checking is handled entirely by the browser itself. Trilium does not control the browser's spellchecker — language selection, dictionaries, and all other settings are managed through your browser's preferences.++The <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20contextual%20menu.md">Note contextual menu</a> has a special behavior in which a right-clicked word (without selection) shows the browser's default contextual menu which allows the spellcheck to function.++The Spell Check settings page in Trilium will indicate that these options apply only to desktop builds.++## Frequently asked questions++### Do I need to restart after every change?++Yes. Spell check language selection and the custom dictionary are loaded once at startup. Any changes require a restart to take effect.++### Can I use multiple spell check languages at the same time?++Yes. Select as many languages as you need from the checklist. The spellchecker will accept words from any of the selected languages.++### My custom words disappeared after syncing to a new device — what happened?++On the first launch of a new device, Trilium may import existing local dictionary words into the note. If the note already has words from another device (via sync), those are preserved. Make sure sync completes before restarting the application on a new device.++### I removed a word from the dictionary note but it's still accepted++This is likely due to the OS-level dictionary retaining the word (see [Known limitations](#known-limitations) above). You can manually remove it from your operating system's user dictionary.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Note Types/Text/Table of contents.md b/docs/User Guide/User Guide/Note Types/Text/Table of contents.mdnew file mode 100644index 0000000000..7c19e619a4--- /dev/null+++ b/docs/User Guide/User Guide/Note Types/Text/Table of contents.md@@ -0,0 +1,3 @@+# Table of contents+> [!NOTE]+> This page has been relocated to <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Right%20Sidebar/Outline%20tab.md">Outline tab</a>.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Note Types/Text/Text Snippets_image.png b/docs/User Guide/User Guide/Note Types/Text/Text Snippets_image.pngnew file mode 100644index 0000000000..90b8fbe958Binary files /dev/null and b/docs/User Guide/User Guide/Note Types/Text/Text Snippets_image.png differdiff --git a/docs/User Guide/User Guide/Note Types/Text/To-do Lists.md b/docs/User Guide/User Guide/Note Types/Text/To-do Lists.mdnew file mode 100644index 0000000000..5d4dfb5286--- /dev/null+++ b/docs/User Guide/User Guide/Note Types/Text/To-do Lists.md@@ -0,0 +1,33 @@+# To-do Lists+## Extended task states++<figure class="image image-style-align-left"><img style="aspect-ratio:303/264;" src="To-do Lists_image.png" width="303" height="264"></figure>++In Trilium, to-do items aren't limited to a simple "done" or "not done." Tasks can also be marked as _in progress_ ("doing"), _under consideration_ ("maybe"), or _cancelled_ ("won't do"), thus giving a more accurate picture of where things actually stand.++Right-click the checkbox and select the desired state. Alternatively, press <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>Enter </kbd> to cycle through the task states. Tapping or left-clicking the checkbox will always toggle between "None" and "Done".++Task states are fully preserved when converting between <a class="reference-link" href="../Text.md">Text</a> and <a class="reference-link" href="../Markdown.md">Markdown</a> notes, in both directions.++### Customizing the extended task states++Task states are customizable: you can reorder them, create new ones with different colors and symbols, or delete the ones you don't need. See <a class="reference-link" href="../../Advanced%20Usage/Customizing%20to-do%20task%20states.md">Customizing to-do task states</a> for more details.++## Keyboard shortcuts++When at the beginning on an empty paragraph, type the following to insert a to-do list:++* `[ ]` for an unchecked item+* `[x]` for a checked item++Extended task states are supported as well, using its corresponding _Markdown symbol_. These are the defaults but they can be changed if needed (see <a class="reference-link" href="../../Advanced%20Usage/Customizing%20to-do%20task%20states.md">Customizing to-do task states</a>):++* `[/]` for “Doing”.+* `[?]` for “Maybe”.+* `[-]` for “Cancelled”.++To reorder the item under the cursor, press <kbd>Alt</kbd>+<kbd>Up</kbd> or <kbd>Alt</kbd>+<kbd>Down</kbd>. To reorder multiple items, select them first.++## See also++* To-do lists are meant for small task lists. For more complicated, day-to-day task tracking consider using a <a class="reference-link" href="../../Collections/Kanban%20Board.md">Kanban Board</a> collection instead.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Note Types/Text/To-do Lists_image.png b/docs/User Guide/User Guide/Note Types/Text/To-do Lists_image.pngnew file mode 100644index 0000000000..69d45905fdBinary files /dev/null and b/docs/User Guide/User Guide/Note Types/Text/To-do Lists_image.png differdiff --git a/docs/User Guide/User Guide/Note Types/Text_image.png b/docs/User Guide/User Guide/Note Types/Text_image.pngnew file mode 100644index 0000000000..6e2befad81Binary files /dev/null and b/docs/User Guide/User Guide/Note Types/Text_image.png differdiff --git a/docs/User Guide/User Guide/Note Types/Web View.md b/docs/User Guide/User Guide/Note Types/Web View.mdnew file mode 100644index 0000000000..d0f7085ce2--- /dev/null+++ b/docs/User Guide/User Guide/Note Types/Web View.md@@ -0,0 +1,35 @@+# Web View+## Configuration++A webview needs to know which URL to render, and it can be provided by setting the `webViewSrc` [label](../Advanced%20Usage/Attributes.md), such as:++```+#webViewSrc="https://www.wikipedia.org"+```++The URL needs to contain the full scheme.++## Web view on the server vs. Electron++When accessing Trilium via a browser instead of the desktop application, the web view will still try to render the content of the desired webpage. However, since it's running in a browser there are quite a few limitations as opposed to the desktop one.++More specifically, quite a few websites oppose being embedded in another website (technically they have a non-permisive `X-Frame-Options` header). This is not bypassable by Trilium so the page will simply fail to render.++You can diagnose this by right clicking the Trilium web page → Inspect (element) and looking in the “Console” tab for errors such as:++* `Refused to display 'https://www.google.com/' in a frame because it set 'X-Frame-Options' to 'sameorigin'.`+* `Refused to frame 'https://duckduckgo.com/' because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'self' https://html.duckduckgo.com".`++There are a few websites that do render such as `wikipedia.org`.++Do note that we are also applying some sandboxing constraints on the server side, so if you have any issues other than the unresolvable `X-Frame-Options` described above, feel free to report them.++On the desktop side, a different technology is used which bypasses the constraints of an `iframe` (`webview`).++## Embedding in other note types++Starting with v0.104.0, web views can be embedded into other note types:++* <a class="reference-link" href="../Collections/Dashboard.md">Dashboard</a>+* <a class="reference-link" href="Canvas.md">Canvas</a>+* <a class="reference-link" href="Text.md">Text</a> notes via <a class="reference-link" href="Text/Include%20Note.md">Include Note</a>.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Note Types_image.png b/docs/User Guide/User Guide/Note Types_image.pngnew file mode 100644index 0000000000..d10e037656Binary files /dev/null and b/docs/User Guide/User Guide/Note Types_image.png differdiff --git a/docs/User Guide/User Guide/Quick Start.md b/docs/User Guide/User Guide/Quick Start.mdnew file mode 100644index 0000000000..b94b0372e4--- /dev/null+++ b/docs/User Guide/User Guide/Quick Start.md@@ -0,0 +1,19 @@+# Quick Start+## Choose the setup++**Local only desktop/laptop** - Allows a single instance on a desktop and will save the notes locally on that desktop.++* <a class="reference-link" href="Installation%20%26%20Setup/Desktop%20Installation.md">Desktop Installation</a>++**Server with web only access** - Installs the application on the server and allows access from any web browser on any device, including mobile.++1. <a class="reference-link" href="Installation%20%26%20Setup/Server%20Installation.md">Server Installation</a>+2. <a class="reference-link" href="Installation%20%26%20Setup/Mobile%20Frontend.md">Mobile Frontend</a> (optional)+3. <a class="reference-link" href="Installation%20%26%20Setup/Server%20Installation/Third-party%20cloud%20hosting.md">Third-party cloud hosting</a>++**Combination of server and desktop/laptop** - Install the application on both a server, for web access and data synchronisation, and desktop instance(s). This allows all the data to be stored on the server and either accessed from the web browser, or the desktop application. The desktop application will sync and store the data locally so that it can be used when offline.++1. <a class="reference-link" href="Installation%20%26%20Setup/Server%20Installation.md">Server Installation</a>+2. <a class="reference-link" href="Installation%20%26%20Setup/Mobile%20Frontend.md">Mobile Frontend</a> (optional)+3. <a class="reference-link" href="Installation%20%26%20Setup/Desktop%20Installation.md">Desktop Installation</a>+4. <a class="reference-link" href="Installation%20%26%20Setup/Synchronization.md">Synchronization</a>\ No newline at end of filediff --git a/docs/User Guide/User Guide/Scripting.md b/docs/User Guide/User Guide/Scripting.mdnew file mode 100644index 0000000000..84eb8c5200--- /dev/null+++ b/docs/User Guide/User Guide/Scripting.md@@ -0,0 +1,61 @@+# Scripting+Trilium supports creating <a class="reference-link" href="Note%20Types/Code.md">Code</a> notes, i.e. notes which allow you to store some programming code and highlight it. Special case is JavaScript code notes which can also be executed inside Trilium which can in conjunction with <a class="reference-link" href="Scripting/Script%20API.md">Script API</a> provide extra functionality.++## Architecture Overview++To go further I must explain basic architecture of Trilium - in its essence it is a classic web application - it has these two main components:++* frontend running in the browser (using HTML, CSS, JavaScript) - this is mainly used to interact with the user, display notes etc.+* backend running JavaScript code in node.js runtime - this is responsible for e.g. storing notes, encrypting them etc.++So we have frontend and backend, each with their own set of responsibilities, but their common feature is that they both run JavaScript code. Add to this the fact, that we're able to create JavaScript <a class="reference-link" href="Note%20Types/Code.md">Code</a> and we're onto something.++## Use cases++* <a class="reference-link" href="Scripting/Frontend%20Basics/Examples/New%20Task%20launcher%20button.md">"New Task" launcher button</a>++## Action handler++Saving the note to the database is backend's responsibility, so we immediately pass control to the backend and ask it to create a note. Once this is done, we show the newly created note so that the user can set the task title and maybe some attributes.++## Script execution++So we have a script which will add the button to the toolbar. But how can we execute it? One possibility is to click on "play" icon (marked by red circle). The problem with this is that this UI change is time bound by Trilium runtime so when we restart Trilium, button won't be there.++We need to execute it every time Trilium starts up, but we probably don't want to have to manually click on play button on every start up.++The solution is marked by red circle at the bottom - this note has [label](Advanced%20Usage/Attributes.md) `#run=frontendStartup` - this is one of the "system" labels which Trilium understands. As you might guess, this will cause all such labeled script notes to be executed once Trilium frontend starts up.++(`#run=frontendStartup` does not work for [Mobile frontend](Installation%20%26%20Setup/Mobile%20Frontend.md) - if you want to have scripts running there, give the script `#run=mobileStartup` label).++### Execute button++Runnable code notes (frontend or backend) and saved SQL consoles can optionally have a dedicated execute button alongside a description.++To do so, apply the following [labels](Advanced%20Usage/Attributes/Labels.md):++* A `#executeButton` with the value of the label being displayed as the label of the button.+* An optional `#executeDescription` which adds explanatory text beside it.++## Autocomplete & linting++Starting with Trilium v0.104.0, frontend scripts, backend scripts and render notes benefit from an autocomplete system.++The autocomplete triggers automatically when typing <kbd>.</kbd> or manually by pressing <kbd>Ctrl</kbd>+<kbd>Space</kbd>.++In addition to that, the editor will also display syntax errors and warnings such as unreachable code.++> [!NOTE]+> If you notice a false positive in regards with the errors/warnings reported or an incorrect or missing API, feel free to [open a issue](Troubleshooting/Reporting%20issues.md) with a code sample.++## More showcases++You can see more scripting with explanation in <a class="reference-link" href="Advanced%20Usage/Advanced%20Showcases.md">Advanced Showcases</a>.++## Events++See <a class="reference-link" href="Scripting/Backend%20scripts/Backend%20Events.md">Events</a>.++## Script API++See <a class="reference-link" href="Scripting/Script%20API.md">Script API</a>.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Scripting/Backend scripts.md b/docs/User Guide/User Guide/Scripting/Backend scripts.mdnew file mode 100644index 0000000000..a548262644--- /dev/null+++ b/docs/User Guide/User Guide/Scripting/Backend scripts.md@@ -0,0 +1,27 @@+# Backend scripts+Unlike [front-end scripts](Frontend%20Basics.md) which run on the client / browser-side, back-end scripts run directly on the Node.js environment of the Trilium server.++Back-end scripts can be used both on a <a class="reference-link" href="../Installation%20%26%20Setup/Server%20Installation.md">Server Installation</a> (where it will run on the device the server is running on), or on the <a class="reference-link" href="../Installation%20%26%20Setup/Desktop%20Installation.md">Desktop Installation</a> (where it will run on the PC).++> [!IMPORTANT]+> Starting with v0.104.0, backend scripts are disabled by default to reduce the attack surface. See <a class="reference-link" href="Security.md">Security</a> for more information.++## Advantages of backend scripts++The benefit of backend scripts is that they can be pretty powerful, for example to have access to the underlying system, for example it can read files or execute processes.++However, the main benefit of backend scripts is that they have easier access to the notes since the information about them is already loaded in memory. Whereas on the client, notes have to be manually loaded first.++## Creating a backend script++Create a new <a class="reference-link" href="../Note%20Types/Code.md">Code</a> note and select the language _JavaScript (Trilium backend)_.++## Running backend scripts++Backend scripts can be either run manually (via the Execute button on the script page), or they can be triggered on certain events.++In addition, scripts can be run automatically when the server starts up, on a fixed time interval or when a certain event occurs (such as an attribute being modified). For more information, see the dedicated <a class="reference-link" href="Backend%20scripts/Backend%20Events.md">Events</a> page.++## Script API++Trilium exposes a set of APIs that can be directly consumed by scripts, under the `api` object. For a reference of this API, see <a class="reference-link" href="Script%20API/Backend%20API.dat">Backend API</a>.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Scripting/Backend scripts/Backend Events.md b/docs/User Guide/User Guide/Scripting/Backend scripts/Backend Events.mdnew file mode 100644index 0000000000..545a347868--- /dev/null+++ b/docs/User Guide/User Guide/Scripting/Backend scripts/Backend Events.md@@ -0,0 +1,73 @@+# Backend Events+[Script](../../Scripting.md) notes can be triggered by events. Note that these are backend events and thus relation need to point to the "JavaScript (Trilium backend)" code note.++## Global events++Global events are attached to the script note via label. Simply create a `run` label with some of these values and script note will be executed once the event occurs.++<table>+ <thead>+ <tr>+ <th>Label</th>+ <th>Description</th>+ </tr>+ </thead>+ <tbody>+ <tr>+ <td><code>run</code></td>+ <td><p>Defines on which events script should run. Possible values are:</p><ul><li><code>backendStartup</code> - when Trilium backend starts up</li><li><code>hourly</code> - run once an hour. You can use additional label <code>runAtHour</code> to specify at which hour, on the back-end.</li><li><code>daily</code> - run once a day, on the back-end</li></ul></td>+ </tr>+ <tr>+ <td><code>runOnInstance</code></td>+ <td>Specifies that the script should only run on a particular <a class="reference-link" href="../../Advanced%20Usage/Configuration%20(config.ini%20or%20environment%20variables)/Trilium%20instance.md">Trilium instance</a>.</td>+ </tr>+ <tr>+ <td><code>runAtHour</code></td>+ <td>On which hour should this run. Should be used together with <code>#run=hourly</code>. Can be defined multiple times for more runs during the day.</td>+ </tr>+ </tbody>+</table>++Frontend scripts also have similar <a class="reference-link" href="../Frontend%20Basics/Frontend%20Events.md">Events</a>, such as when the application starts.++> [!NOTE]+> One script can be triggered on multiple events, this can be done by adding multiple `run` labels. Separating multiple values by commas **is not** supported.++## Entity events++Other events are bound to some entity, these are defined as [relations](../../Advanced%20Usage/Attributes.md) - meaning that script is triggered only if note has this script attached to it through relations (or it can inherit it).++| Relation | Trigger condition | Origin entity (see below) |+| --- | --- | --- |+| `runOnNoteCreation` | executes when note is created on backend. Use this relation if you want to run the script for all notes created under a specific subtree. In that case, create it on the subtree root note and make it inheritable. A new note created within the subtree (any depth) will trigger the script. | The `BNote` that got created. |+| `runOnChildNoteCreation` | executes when new note is created under the note where this relation is defined | The `BNote` of the child that got created. |+| `runOnNoteTitleChange` | executes when note title is changed (includes note creation as well) | The `BNote` of the note whose title got changed. |+| `runOnNoteContentChange` | executes when note content is changed (includes note creation as well). | The `BNote` of the note whose content got changed. |+| `runOnNoteChange` | executes when note is changed (includes note creation as well). Does not include content changes | The `BNote` of the note that got changed. |+| `runOnNoteDeletion` | executes when note is being deleted | The `BNote` of the note that got (soft) deleted. |+| `runOnBranchCreation` | executes when a branch is created. Branch is a link between parent note and child note and is created e.g. when cloning or moving note. | The `BBranch` that got created. |+| `runOnBranchChange` | executes when a branch is updated. (since v0.62) | The `BBranch` that got changed. |+| `runOnBranchDeletion` | executes when a branch is deleted. Branch is a link between parent note and child note and is deleted e.g. when moving note (old branch/link is deleted). | The `BBranch` that got (soft) deleted. |+| `runOnAttributeCreation` | executes when new attribute is created for the note which defines this relation | The `BAttribute` that got created. |+| `runOnAttributeChange` | executes when the attribute is changed of a note which defines this relation. This is triggered also when the attribute is deleted | The `BAttribute` that got changed. |++## Origin entity++When a script is run by an event such as the ones described above, `api.originEntity` will get populated with the note, branch or attribute that triggered the change.++For example, here's a script with `~runOnAttributeChange` which automatically changes the color of a note based on the value of the `mycategory` label:++```javascript+const attr = api.originEntity;+if (attr.name !== "mycategory") return;+const note = api.getNote(attr.noteId);+if (attr.value === "Health") {+ note.setLabel("color", "green");+} else {+ note.removeLabel("color");+}+```++## Safe mode++While [safe mode](../../Advanced%20Usage/Safe%20mode.md) is active, scripts with events won't trigger.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Scripting/Backend scripts/Server-side imports.md b/docs/User Guide/User Guide/Scripting/Backend scripts/Server-side imports.mdnew file mode 100644index 0000000000..ddc795aa08--- /dev/null+++ b/docs/User Guide/User Guide/Scripting/Backend scripts/Server-side imports.md@@ -0,0 +1,11 @@+# Server-side imports+Older versions of Trilium Notes allowed the use of Common.js module imports inside backend scripts, such as:++```+const isBetween = require('dayjs/plugin/isBetween')+api.dayjs.extend(isBetween)+```++For newer versions, Node.js imports are **not officially supported anymore**, since we've added a bundler which makes it more difficult to reuse dependencies.++Theoretically it's still possible to use imports by manually setting up a `node_modules` in the server directory via `npm` or `pnpm`.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Scripting/Breaking changes/v0.102.0 Upgrade to jQuery 4.0.0.md b/docs/User Guide/User Guide/Scripting/Breaking changes/v0.102.0 Upgrade to jQuery 4.0.0.mdnew file mode 100644index 0000000000..5230543ea7--- /dev/null+++ b/docs/User Guide/User Guide/Scripting/Breaking changes/v0.102.0 Upgrade to jQuery 4.0.0.md@@ -0,0 +1,12 @@+# v0.102.0: Upgrade to jQuery 4.0.0+jQuery 4 removes legacy browser support (such as IE11 support), but it also removes some APIs that are considered deprecated such as:++> `jQuery.isArray`, `jQuery.parseJSON`, `jQuery.trim`, `jQuery.type`, `jQuery.now`, `jQuery.isNumeric`, `jQuery.isFunction`, `jQuery.isWindow`, `jQuery.camelCase`, `jQuery.nodeName`, `jQuery.cssNumber`, `jQuery.cssProps`, and `jQuery.fx.interval`.+>+> Use native equivalents like `Array.isArray()`, `JSON.parse()`, `String.prototype.trim()`, and `Date.now()` instead.++This may affect custom scripts if they (or the custom jQuery libraries used) depend on the deprecated APIs.++Note that Trilium polyfills `jQuery.isArray`, `isFunction` and `isPlainObject` because they were required by one of our dependencies (the autocomplete).++For more information, consult [the official blog post](https://blog.jquery.com/2026/01/17/jquery-4-0-0/).\ No newline at end of filediff --git a/docs/User Guide/User Guide/Scripting/Breaking changes/v0.103.0 Removal of axios.md b/docs/User Guide/User Guide/Scripting/Breaking changes/v0.103.0 Removal of axios.mdnew file mode 100644index 0000000000..fbaf7603ac--- /dev/null+++ b/docs/User Guide/User Guide/Scripting/Breaking changes/v0.103.0 Removal of axios.md@@ -0,0 +1,46 @@+# v0.103.0: Removal of axios+The `api.axios` library has been removed from the backend scripting API.++Scripts that attempt to use `api.axios` will now throw an error with migration instructions.++## Reasoning++Axios was marked as deprecated at least since April 2024 in favor of the native `fetch()` API, which is available in both browser and Node.js environments. After two years of deprecation, the library was removed following the [March 2026 npm supply chain compromise](https://www.malwarebytes.com/blog/news/2026/03/axios-supply-chain-attack-chops-away-at-npm-trust), where attackers published malicious versions that deployed a remote access trojan. The Trilium's main developer almost got compromised, but `pnpm` not trusting unknown post-install scripts successfully avoided that.++## Migration++Replace `api.axios` calls with the native `fetch()` API.++### `GET` calls++Before (Axios):++```javascript+const response = await api.axios.get('https://api.example.com/data');+const data = response.data;+```++After (`fetch`):++```javascript+const response = await fetch('https://api.example.com/data');+const data = await response.json();+```++### `POST` calls++Before (Axios):++```javascript+await api.axios.post('https://api.example.com/data', { key: 'value' });+```++After (fetch):++```javascript+await fetch('https://api.example.com/data', {+ method: 'POST',+ headers: { 'Content-Type': 'application/json' },+ body: JSON.stringify({ key: 'value' })+});+```\ No newline at end of filediff --git a/docs/User Guide/User Guide/Scripting/Breaking changes/v0.103.0 `cheerio` is now deprecated.md b/docs/User Guide/User Guide/Scripting/Breaking changes/v0.103.0 `cheerio` is now deprecated.mdnew file mode 100644index 0000000000..e37bdcfe6a--- /dev/null+++ b/docs/User Guide/User Guide/Scripting/Breaking changes/v0.103.0 `cheerio` is now deprecated.md@@ -0,0 +1,27 @@+# v0.103.0: `cheerio` is now deprecated+The `api.cheerio` library is deprecated and will be removed in a future version.++> [!NOTE]+> `cheerio` was removed in v0.106.0. See <a class="reference-link" href="v0.106.0%20Removal%20of%20cheerio.md">v0.106.0: Removal of cheerio</a> for the full migration guide.++## Reasoning++Cheerio is only used for the scripting API while the server internally uses `node-html-parser` for HTML parsing. Removing `cheerio` reduces bundle size and maintenance overhead.++## Migration++Before (`cheerio`):++```javascript+const $ = api.cheerio.load(html);+const title = $('h1').text();+const links = $('a').map((i, el) => $(el).attr('href')).get();+```++After (`htmlParser`):++```javascript+const root = api.htmlParser.parse(html);+const title = root.querySelector('h1')?.textContent;+const links = root.querySelectorAll('a').map(a => a.getAttribute('href'));+```\ No newline at end of filediff --git a/docs/User Guide/User Guide/Scripting/Breaking changes/v0.104.0 Disabling the Node integration in Electron.md b/docs/User Guide/User Guide/Scripting/Breaking changes/v0.104.0 Disabling the Node integration in Electron.mdnew file mode 100644index 0000000000..3dbe4092f7--- /dev/null+++ b/docs/User Guide/User Guide/Scripting/Breaking changes/v0.104.0 Disabling the Node integration in Electron.md@@ -0,0 +1,32 @@+# v0.104.0: Disabling the Node integration in Electron+## Introduction++Before v0.104.0, code executed at renderer level (e.g. front-end scripts) could directly require `@electron/remote` or even Node.js APIs (e.g. `process` or `fs`). While this makes them powerful, it also exposes a significant attack surface — any XSS or untrusted script in a note becomes remote code execution on the host.++To mitigate this, the client-side no longer has access to these APIs and everything must go through the <a class="reference-link" href="../Script%20API/Electron%20API.dat">Electron API</a> instead.++> [!NOTE]+> If this API change is causing issues with some of your front-end scripts, consider:+>+> * Interacting with <a class="reference-link" href="../Backend%20scripts.md">Backend scripts</a> which have a greater degree of freedom.+> * [Reporting](../../Troubleshooting/Reporting%20issues.md) it as a feature request.++## Overview of the API++The Frontend and Backend APIs reside in a global variable, `api`, that can be used anywhere in the script. For example, to display a message to the user the following front-end script can be used:++```javascript+api.showMessage("Hello world.");+```++The Electron API is different: it lives on `window.electronApi` (exposed by the desktop preload script), not on `api`, and is only available in the Electron desktop build. Frontend scripts that use it should guard with `if (window.electronApi)` so they degrade cleanly in the browser and standalone (WASM) builds.++```javascript+window.electronApi?.window.setZoomFactor(1.2);+```++## Additional protection++Some of the APIs have additional safe-guards built in which prevent unauthorized access.++The `shell` group is the most heavily validated: `openExternal` is restricted to an allowlisted set of URL schemes (blocking `file:`, `smb:`, Follina-class schemes, etc.), `openPath` must resolve under the Trilium data directory or temporary directory, and `downloadURL` is locked to the app's own origin. Invalid input throws on the main side rather than being silently passed through.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Scripting/Breaking changes/v0.106.0 Removal of cheerio.md b/docs/User Guide/User Guide/Scripting/Breaking changes/v0.106.0 Removal of cheerio.mdnew file mode 100644index 0000000000..0eff11e477--- /dev/null+++ b/docs/User Guide/User Guide/Scripting/Breaking changes/v0.106.0 Removal of cheerio.md@@ -0,0 +1,70 @@+# v0.106.0: Removal of cheerio+The `api.cheerio` library has been removed from the backend scripting API.++Scripts that attempt to use `api.cheerio` will now throw an error with migration instructions.++## Reasoning++`cheerio` was deprecated in v0.103.0 in favor of `api.htmlParser` ([node-html-parser](https://github.com/taoqf/node-fast-html-parser)), which Trilium already uses for all of its own HTML parsing. The scripting API was the only place that still needed `cheerio`.++Shipping both parsers was costly, because `cheerio` was loaded at startup on every platform. It added roughly 1.35 MB of bundled code to the server and desktop builds, and roughly 370 kB to the in-browser build, where it was loaded into the database worker before the application could start.++## Migration++Replace `api.cheerio` calls with `api.htmlParser`. Note that `api.htmlParser` returns plain elements rather than a wrapped collection, so there is no `$` object and no chaining.++### Reading values++Before (`cheerio`):++```javascript+const $ = api.cheerio.load(html);+const title = $('h1').text();+const links = $('a').map((i, el) => $(el).attr('href')).get();+```++After (`htmlParser`):++```javascript+const root = api.htmlParser.parse(html);+const title = root.querySelector('h1')?.textContent;+const links = root.querySelectorAll('a').map(a => a.getAttribute('href'));+```++### Modifying the document++Before (`cheerio`):++```javascript+const $ = api.cheerio.load(html);+$('a').each((i, el) => {+ $(el).attr('href', '#root/' + noteId);+ $(el).addClass('reference-link');+});+note.setContent($('body').html());+```++After (`htmlParser`):++```javascript+const root = api.htmlParser.parse(html);+for (const el of root.querySelectorAll('a')) {+ el.setAttribute('href', '#root/' + noteId);+ el.classList.add('reference-link');+}+note.setContent(root.toString());+```++### Equivalent operations++| `cheerio` | `htmlParser` |+| --- | --- |+| `api.cheerio.load(html)` | `api.htmlParser.parse(html)` |+| `$('sel')` | `root.querySelectorAll('sel')` |+| `$('sel').first()` | `root.querySelector('sel')` |+| `$el.text()` | `el.textContent` |+| `$el.html()` | `el.innerHTML` |+| `$el.attr('name')` | `el.getAttribute('name')` |+| `$el.attr('name', value)` | `el.setAttribute('name', value)` |+| `$el.addClass('name')` | `el.classList.add('name')` |+| `$('body').html()` | `root.toString()` |\ No newline at end of filediff --git a/docs/User Guide/User Guide/Scripting/Common concepts/Script bundles.md b/docs/User Guide/User Guide/Scripting/Common concepts/Script bundles.mdnew file mode 100644index 0000000000..241dff0b4d--- /dev/null+++ b/docs/User Guide/User Guide/Scripting/Common concepts/Script bundles.md@@ -0,0 +1,48 @@+# Script bundles+For both <a class="reference-link" href="../../Note%20Types/Render%20Note.md">Render Note</a> and more complicated scripts, it's generally useful to split the code into multiple <a class="reference-link" href="../../Note%20Types/Code.md">Code</a> notes.++When a script is run, the sub-children of the script being run (or the <a class="reference-link" href="../../Note%20Types/Render%20Note.md">Render Note</a>) are checked for children. If the children are Code notes of the corresponding type (front-end or backend) as the code being run, they will be evaluated as well.++The collection of a script and its child notes is called a _bundle_. A child note inside a bundle is called a _module_.++As a basic example of dependencies, consider the following note structure:++* _Script with dependency_++ ```javascript+ api.log(MyMath.sum(2, 2));+ ```++ * _MyMath_++ ```javascript+ module.exports = {+ sum(a, b) {+ return a + b;+ }+ };+ ```++When _Script with dependency_ is run, it will detect _MyMath_ as a submodule and provide the result of its `module.exports` object into a global object with the same name as the note.++> [!NOTE]+> If the note contains spaces or special characters, they will be stripped. For example `My Nice Note!` becomes `MyNiceNote`.++## Alternative syntax++Instead of providing an object to `module.exports`, it's also possible to add fields individually:++```javascript+module.exports.sum = (a, b) => a + b;+module.exports.subtract = (a, b) => a - b;+```++## Ignoring a code script from a bundle++To ignore a script from being included in a bundle (e.g. if it's unrelated to the parent script note), apply the `#disableInclusion` label.++## Sharing a module across multiple bundles++Modules can be reused across multiple scripts by simply cloning the shared module between two modules (see <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/Notes/Cloning%20Notes.md">Cloning Notes</a>).++Optionally, a separate note can be used to contain all the different reusable modules for an easy way to discover them.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Scripting/Frontend Basics.md b/docs/User Guide/User Guide/Scripting/Frontend Basics.mdnew file mode 100644index 0000000000..5baeb9bce9--- /dev/null+++ b/docs/User Guide/User Guide/Scripting/Frontend Basics.md@@ -0,0 +1,34 @@+# Frontend Basics+Front-end scripts are custom JavaScript notes that are run on the client (browser environment)++There are four flavors of front-end scripts:++| | |+| --- | --- |+| Regular scripts | These are run with the current app and note context. These can be run either manually or automatically on start-up. |+| <a class="reference-link" href="Frontend%20Basics/Custom%20Widgets.md">Custom Widgets</a> | These can introduce new UI elements in various positions, such as near the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.md">Note Tree</a>, content area or even the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Right%20Sidebar.md">Right Sidebar</a>. |+| <a class="reference-link" href="Frontend%20Basics/Launch%20Bar%20Widgets.md">Launch Bar Widgets</a> | Similar to <a class="reference-link" href="Frontend%20Basics/Custom%20Widgets.md">Custom Widgets</a>, but dedicated to the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Launch%20Bar.md">Launch Bar</a>. These can simply introduce new buttons or graphical elements to the bar. |+| <a class="reference-link" href="../Note%20Types/Render%20Note.md">Render Note</a> | This allows rendering custom content inside a note, using either HTML or Preact JSX. |++For more advanced behaviors that do not require a user interface (e.g. batch modifying notes), see <a class="reference-link" href="Backend%20scripts.md">Backend scripts</a>.++## Scripts++Scripts don't have any special requirements. They can be run manually using the _Execute_ button on the code note or they can be run automatically, see <a class="reference-link" href="Frontend%20Basics/Frontend%20Events.md">Events</a>.++## Widgets++Widgets require a certain format in order for Trilium to be able to integrate them into the UI.++* For legacy widgets, the script note must export a `BasicWidget` or a derived one (see <a class="reference-link" href="Frontend%20Basics/Custom%20Widgets/Note%20context%20aware%20widget.md">Note context aware widget</a> or <a class="reference-link" href="Frontend%20Basics/Custom%20Widgets/Right%20pane%20widget.md">Right pane widget</a>).+* For Preact widgets, a built-in helper called `defineWidget` needs to be used.++For more information, see <a class="reference-link" href="Frontend%20Basics/Custom%20Widgets.md">Custom Widgets</a>.++## Script API++The front-end API of Trilium is available to all scripts running in the front-end context as global variable `api`. For a reference of the API, see <a class="reference-link" href="Script%20API/Frontend%20API">Frontend API</a>.++### Tutorial++For more information on building widgets, take a look at [Widget Basics](Frontend%20Basics/Custom%20Widgets/Widget%20Basics.md).\ No newline at end of filediff --git a/docs/User Guide/User Guide/Scripting/Frontend Basics/Custom Widgets.md b/docs/User Guide/User Guide/Scripting/Frontend Basics/Custom Widgets.mdnew file mode 100644index 0000000000..1a1f900458--- /dev/null+++ b/docs/User Guide/User Guide/Scripting/Frontend Basics/Custom Widgets.md@@ -0,0 +1,174 @@+# Custom Widgets+Custom widgets are a special subset of scripts that render graphical elements in certain parts of the application. These can be used to add new functionality to the Trilium application.++## Preact with JSX vs. vanilla jQuery++In older versions of Trilium, custom widgets were exclusively written in a combination of jQuery with Trilium's internal widget architecture (e.g., `BasicWidget`, `NoteContextAwareWidget`).++Starting with v0.101.0, custom widgets can also be written in JSX using the <a class="reference-link" href="Preact.md">Preact</a> framework. Both legacy and Preact widgets have the same capabilities, with a single difference:++* Preact widgets are content-sized by default whereas legacy widgets need `this.contentSized()` applied in the constructor. For more information, see the corresponding section in <a class="reference-link" href="Custom%20Widgets/Troubleshooting.md">Troubleshooting</a>.++Wherever possible, widget examples will be both in the legacy and Preact format.++## Creating a custom widget++1. Create a <a class="reference-link" href="../../Note%20Types/Code.md">Code</a> note.+2. Set the language to:+ 1. JavaScript (frontend) for legacy widgets using jQuery.+ 2. JSX for Preact widgets. You might need to go to Options → Code to enable the language first.+3. Apply the `#widget` [label](../../Advanced%20Usage/Attributes/Labels.md).++## Getting started with a simple example++Let's start by creating a widget that shows a message near the content area. Follow the previous section to create a code note, and use the following content.++### Legacy version (jQuery)++```+class HelloCenterPane extends api.BasicWidget {++ constructor() {+ super();+ this.contentSized();+ }++ get parentWidget() { return "center-pane" }++ doRender() {+ this.$widget = $("<span>Center pane</span>");+ }++}++module.exports = new HelloCenterPane();+```++[Refresh the application](../../Troubleshooting/Refreshing%20the%20application.md) and the widget should appear underneath the content area.++### Preact version++```+import { defineWidget } from "trilium:preact";++export default defineWidget({+ parent: "center-pane",+ render: () => <span>Center pane from Preact.</span>+});+```++[Refresh the application](../../Troubleshooting/Refreshing%20the%20application.md) and the widget should appear underneath the content area.++## Widget location (parent widget)++A widget can be placed in one of the following sections of the applications:++<table class="ck-table-resized">+ <colgroup>+ <col style="width:15.59%;">+ <col style="width:30.42%;">+ <col style="width:16.68%;">+ <col style="width:37.31%;">+ </colgroup>+ <thead>+ <tr>+ <th>Value for <code>parentWidget</code></th>+ <th>Description</th>+ <th>Sample widget</th>+ <th>Special requirements</th>+ </tr>+ </thead>+ <tbody>+ <tr>+ <th><code>left-pane</code></th>+ <td>Appears within the same pane that holds the <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.md">Note Tree</a>.</td>+ <td>Same as above, with only a different <code>parentWidget</code>.</td>+ <td>None.</td>+ </tr>+ <tr>+ <th><code>center-pane</code></th>+ <td>In the content area. If a split is open, the widget will span all of the splits.</td>+ <td>See example above.</td>+ <td>None.</td>+ </tr>+ <tr>+ <th><code>note-detail-pane</code></th>+ <td><p>In the content area, inside the note detail area. If a split is open, the widget will be contained inside the split.</p><p>This is ideal if the widget is note-specific.</p></td>+ <td><a class="reference-link" href="Custom%20Widgets/Note%20context%20aware%20widget.md">Note context aware widget</a></td>+ <td><ul><li>The widget must export a <code>class</code> and not an instance of the class (e.g. <code>no new</code>) because it needs to be multiplied for each note, so that splits work correctly.</li><li>Since the <code>class</code> is exported instead of an instance, the <code>parentWidget</code> getter must be <code>static</code>, otherwise the widget is ignored.</li></ul></td>+ </tr>+ <tr>+ <th><code>right-pane</code></th>+ <td>In the <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Right%20Sidebar.md">Right Sidebar</a>, as a dedicated section.</td>+ <td><a class="reference-link" href="Custom%20Widgets/Right%20pane%20widget.md">Right pane widget</a></td>+ <td><ul><li>Although not mandatory, it's best to use a <code>RightPanelWidget</code> instead of a <code>BasicWidget</code> or a <code>NoteContextAwareWidget</code>.</li></ul></td>+ </tr>+ </tbody>+</table>++To position the widget somewhere else, just change the value passed to `get parentWidget()` for legacy widgets or the `parent` field for Preact. Do note that some positions such as `note-detail-pane` and `right-pane` have special requirements that need to be accounted for (see the table above).++## Multiple widgets in a single note++A widget note usually returns one widget, but it can also return an array of them. This is useful when several widgets share code or state, since they can all live in the same note instead of being split across notes that need a shared module.++Each widget of the array is registered on its own, so they can have different parents and positions. A widget that is missing its `parentWidget` (or `parent` for Preact) is reported as an error without affecting the other widgets of the note.++### Legacy version (jQuery)++```+class TreeWidget extends api.BasicWidget {+ get parentWidget() { return "left-pane"; }+ doRender() { this.$widget = $("<span>Left pane</span>"); }+}++class SidebarWidget extends api.BasicWidget {+ get parentWidget() { return "right-pane"; }+ doRender() { this.$widget = $("<span>Right pane</span>"); }+}++module.exports = [ new TreeWidget(), new SidebarWidget() ];+```++### Preact version++```+import { defineWidget } from "trilium:preact";++export default [+ defineWidget({+ parent: "left-pane",+ render: () => <span>Left pane from Preact.</span>+ }),+ defineWidget({+ parent: "right-pane",+ render: () => <span>Right pane from Preact.</span>+ })+];+```++## Launch bar widgets++Launch bar widgets are similar to _Custom widgets_ but are specific to the <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Launch%20Bar.md">Launch Bar</a>. See <a class="reference-link" href="Launch%20Bar%20Widgets.md">Launch Bar Widgets</a> for more information.++## Custom position++The position of a custom widget is defined via a `position` integer.++In legacy widgets:++```+class MyWidget extends api.BasicWidget {+ // [..+ get position() { return 10; }+}+```++In Preact widgets:++```+export default defineWidget({+ // [...]+ position: 10+});+```\ No newline at end of filediff --git a/docs/User Guide/User Guide/Scripting/Frontend Basics/Custom Widgets/CSS.md b/docs/User Guide/User Guide/Scripting/Frontend Basics/Custom Widgets/CSS.mdnew file mode 100644index 0000000000..8d01dc238c--- /dev/null+++ b/docs/User Guide/User Guide/Scripting/Frontend Basics/Custom Widgets/CSS.md@@ -0,0 +1,21 @@+# CSS+## Classic widgets++In `doRender()`:<sup><a href="#fn1saoftmefpp">[1]</a></sup>++```+this.cssBlock(`#my-widget {+ position: absolute;+ bottom: 40px;+ left: 60px;+ z-index: 1;+}`);+```++## Preact widgets++See the dedicated page: <a class="reference-link" href="../Preact/CSS.md">CSS</a>.++1. <sup><strong><a href="#fnref1saoftmefpp">^</a></strong></sup>++ Reference: [https://trilium.rocks/X7pxYpiu0lgU](https://trilium.rocks/X7pxYpiu0lgU)\ No newline at end of filediff --git a/docs/User Guide/User Guide/Scripting/Frontend Basics/Custom Widgets/Note context aware widget.md b/docs/User Guide/User Guide/Scripting/Frontend Basics/Custom Widgets/Note context aware widget.mdnew file mode 100644index 0000000000..2ce223d9e5--- /dev/null+++ b/docs/User Guide/User Guide/Scripting/Frontend Basics/Custom Widgets/Note context aware widget.md@@ -0,0 +1,53 @@+# Note context aware widget+Note context-aware widgets are a different type of widget which automatically react to changes in the current note.++Important aspects:++* The widget must export a `class` and not an instance of the class (e.g. `no new`) because it needs to be multiplied for each note, so that splits work correctly.+* Since the `class` is exported instead of an instance, the `parentWidget` getter must be `static`, otherwise the widget is ignored.++## Example displaying the current note title++This is a note context-aware widget that simply displays the name the current note.++### Classic example++```+class HelloNoteDetail extends api.NoteContextAwareWidget {++ constructor() {+ super();+ this.contentSized();+ }++ doRender() {+ this.$widget = $("<div>");+ }++ async refreshWithNote(note) {+ this.$widget.text("Current note: " + note.title);+ }++ static get parentWidget() { return "note-detail-pane" }+ get position() { return 10 }++}++module.exports = HelloNoteDetail;+```++### Preact (v0.101.0+)++```+import { defineWidget, useNoteContext, useNoteProperty } from "trilium:preact";++export default defineWidget({+ parent: "note-detail-pane",+ position: 10,+ render: () => {+ const { note } = useNoteContext();+ const title = useNoteProperty(note, "title");+ return <span>Current note JSX: {title}</span>;+ }+});+```\ No newline at end of filediff --git a/docs/User Guide/User Guide/Scripting/Frontend Basics/Custom Widgets/Right pane widget.md b/docs/User Guide/User Guide/Scripting/Frontend Basics/Custom Widgets/Right pane widget.mdnew file mode 100644index 0000000000..2dbba6d218--- /dev/null+++ b/docs/User Guide/User Guide/Scripting/Frontend Basics/Custom Widgets/Right pane widget.md@@ -0,0 +1,143 @@+# Right pane widget+## Key highlights++* `doRender` must not be overridden, instead `doRenderBody()` has to be overridden.+ * `doRenderBody` can optionally be `async`.+* `parentWidget()` must be set to `“rightPane”`.+* `widgetTitle()` getter can optionally be overriden, otherwise the widget will be displayed as “Untitled widget”.++## Example for new layout++> [!IMPORTANT]+> This section addresses example that are tailored for the <a class="reference-link" href="../../../Basic%20Concepts%20and%20Features/UI%20Elements/New%20Layout.md">New Layout</a> (available starting with v0.101.0) where the right pane widget/sidebar is no longer shown or hidden based on the widgets it has.++### Title widget++This is an example of a context-aware widget which displays the title of the current note:++```+class NoteTitleWidget extends api.RightPanelWidget {++ get widgetTitle() { return "Note title"; }+ get parentWidget() { return "right-pane" }++ doRenderBody() {+ this.$body.empty();+ if (this.note) {+ this.$body.append($("<div>").text(this.note.title));+ }+ }++ async refreshWithNote() {+ this.doRenderBody();+ }+}++module.exports = new NoteTitleWidget();+```++### Clock++A simple widget which will show the current time, as an example on how to dynamically change the content of the widget periodically.++### Legacy widget++```+const template = `<div></div>`;++class ToDoListWidget extends api.RightPanelWidget {++ get widgetTitle() { return "Clock"; }+ get parentWidget() { return "right-pane" }++ async doRenderBody() {+ if (!this.timer) {+ this.timer = setInterval(() => {+ this.$body.empty().append(`The time is: <span>${new Date().toLocaleString()}</span>`);+ }, 1000);+ }++ this.$body.empty().append(`The time is: <span>${new Date().toLocaleString()}</span>`);+ }+}++module.exports = new ToDoListWidget();+```++### Preact widget++```+import { defineWidget, RightPanelWidget, useEffect, useState } from "trilium:preact";++export default defineWidget({+ parent: "right-pane",+ position: 1,+ render() {+ const [ time, setTime ] = useState();+ useEffect(() => {+ const interval = setInterval(() => {+ setTime(new Date().toLocaleString());+ }, 1000);+ return () => clearInterval(interval);+ });+ return (+ <RightPanelWidget id="clock-jsx" title="Clock (JSX)">+ <p>The time is: {time}</p>+ </RightPanelWidget>+ );+ }+});+```++## Example for old layout++Here's a widget that displays a basic message ("Hi"):++```+const template = `<div>Hi</div>`;++class HelloWorldWidget extends api.RightPanelWidget {++ get widgetTitle() {+ return "Title goes here";+ }++ get parentWidget() { return "right-pane" }++ doRenderBody() {+ this.$body.empty().append($(template));+ }++ async refreshWithNote(note) {+ // Do something when the note changes.+ }+}++module.exports = new HelloWorldWidget();+```++### Conditionally changing visibility++In `refreshWithNote`:++```+const visible = true; // replace with your own visibility logic+this.toggleInt(visible);+this.triggerCommand("reEvaluateRightPaneVisibility");+```++## Altering the position within the sidebar++By default, the sidebar items are displayed in the order they are found by the application when searching for `#widget` notes.++It is possible to make a widget appear higher or lower up, by adjusting its `position` property:++```+class MyWidget extends api.RightPanelWidget {+++ get position() { return 20 };++}+```++Generally the default position starts from 10 and increases by 10 with each item, including the default Table of Contents and Highlights list.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Scripting/Frontend Basics/Custom Widgets/Troubleshooting.md b/docs/User Guide/User Guide/Scripting/Frontend Basics/Custom Widgets/Troubleshooting.mdnew file mode 100644index 0000000000..d613a8459e--- /dev/null+++ b/docs/User Guide/User Guide/Scripting/Frontend Basics/Custom Widgets/Troubleshooting.md@@ -0,0 +1,19 @@+# Troubleshooting+## Why is my widget clipped by other UI elements++For performance and layout reasons, the size of widgets in Trilium is independent from its children. At CSS level, this means that the widget container has `contain: size` applied to it.++This works well if the widget has a fixed size (or based on its parent container), however to make a widget resize to fit its content, apply the following change:++```diff+class MyWidget extends api.RightPanelWidget {+++ constructor() {++ super();++ this.contentSized();++ }++}+```++Alternatively apply `contain: none` to its CSS.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Scripting/Frontend Basics/Custom Widgets/Widget Basics.md b/docs/User Guide/User Guide/Scripting/Frontend Basics/Custom Widgets/Widget Basics.mdnew file mode 100644index 0000000000..2cac717a0a--- /dev/null+++ b/docs/User Guide/User Guide/Scripting/Frontend Basics/Custom Widgets/Widget Basics.md@@ -0,0 +1,113 @@+# Widget Basics+This guide will walk you through creating a basic widget inside Trilium. By following these steps, you'll learn how to build a simple UI element that interacts with the user.++### Step 1: The Basic Widget Structure++To start, we'll create the most basic widget possible. Here's a simple example:++```+class MyWidget extends api.BasicWidget {+ get position() { return 1; }+ get parentWidget() { return "left-pane"; }++ doRender() {+ this.$widget = $("<div id='my-widget'>");+ return this.$widget;+ }+}++module.exports = new MyWidget();+```++To implement this widget:++1. Create a new `JS Frontend` note in Trilium and paste in the code above.+2. Assign the `#widget` [attribute](../../../Advanced%20Usage/Attributes.md) to the [note](../../../Basic%20Concepts%20and%20Features/Notes.md).+3. Restart Trilium or reload the window.++To verify that the widget is working, open the developer tools (<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>I</kbd>) and run `document.querySelector("#my-widget")`. If the element is found, the widget is functioning correctly. If `undefined` is returned, double-check that the [note](../../../Basic%20Concepts%20and%20Features/Notes.md) has the `#widget` [attribute](../../../Advanced%20Usage/Attributes.md).++### Step 2: Adding an UI Element++Next, let's improve the widget by adding a button to it.++```+const template = `<div id="my-widget"><button>Click Me!</button></div>`;++class MyWidget extends api.BasicWidget {+ get position() {return 1;}+ get parentWidget() {return "left-pane"}++ doRender() {+ this.$widget = $(template);+ return this.$widget;+ }+}++module.exports = new MyWidget();+```++After making this change, reload Trilium. You should now see a button in the top-left corner of the left pane.++### Step 3: Styling the Widget++To make the button more visually appealing and position it correctly, we'll apply some custom styling. Trilium includes [Box Icons](https://boxicons.com), which we'll use to replace the button text with an icon. For example the `bx bxs-magic-wand` icon.++Here's the updated template:++```+const template = `<div id="my-widget"><button class="tree-floating-button bx bxs-magic-wand tree-settings-button"></button></div>`;+```++Next, we'll adjust the button's position using CSS:++```+class MyWidget extends api.BasicWidget {+ get position() { return 1; }+ get parentWidget() { return "left-pane"; }++ doRender() {+ this.$widget = $(template);+ this.cssBlock(`#my-widget {+ position: absolute;+ bottom: 40px;+ left: 60px;+ z-index: 1;+ }`);+ return this.$widget;+ }+}++module.exports = new MyWidget();+```++After reloading Trilium, the button should now appear at the bottom left of the left pane, alongside other action buttons.++### Step 4: Adding User Interaction++Let’s make the button interactive by showing a message when it’s clicked. We'll use the `api.showMessage` method from the [Script API](../../Script%20API.md).++```+class MyWidget extends api.BasicWidget {+ get position() { return 1; }+ get parentWidget() { return "left-pane"; }++ doRender() {+ this.$widget = $(template);+ this.cssBlock(`#my-widget {+ position: absolute;+ bottom: 40px;+ left: 60px;+ z-index: 1;+ }`);+ this.$widget.find("button").on("click", () => api.showMessage("Hello World!"));+ return this.$widget;+ }+}++module.exports = new MyWidget();+```++For the list of possible values for `parentWidget()`, see <a class="reference-link" href="../Custom%20Widgets.md">Custom Widgets</a>.++[Reload](../../../Troubleshooting/Refreshing%20the%20application.md) the application one last time. When you click the button, a "Hello World!" message should appear, confirming that your widget is fully functional.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Scripting/Frontend Basics/Custom Widgets/Word count widget.md b/docs/User Guide/User Guide/Scripting/Frontend Basics/Custom Widgets/Word count widget.mdnew file mode 100644index 0000000000..15e01bc67f--- /dev/null+++ b/docs/User Guide/User Guide/Scripting/Frontend Basics/Custom Widgets/Word count widget.md@@ -0,0 +1,91 @@+# Word count widget+> [!TIP]+> This widget is also present in new installations in the <a class="reference-link" href="../../../Advanced%20Usage/Database/Demo%20Notes.md">Demo Notes</a>.++Create a <a class="reference-link" href="../../../Note%20Types/Code.md">Code</a> note of type JavaScript (Trilium frontend) and **give it a** `#widget` **label**.++```+/*+ * This defines a custom widget which displays number of words and characters in a current text note.+ * To be activated for a given note, add label 'wordCount' to the note, you can also make it inheritable and thus activate it for the whole subtree.+ *+ * See it in action in "Books" and its subtree.+ */+const TPL = `<div style="padding: 10px; border-top: 1px solid var(--main-border-color); contain: none;">+ <strong>Word count: </strong>+ <span class="word-count"></span>++ ++ <strong>Character count: </strong>+ <span class="character-count"></span>+</div`;++class WordCountWidget extends api.NoteContextAwareWidget {+ get position() { return 100; } // higher value means position towards the bottom/right++ get parentWidget() { return 'center-pane'; }++ doRender() {+ this.$widget = $(TPL);+ this.$wordCount = this.$widget.find('.word-count');+ this.$characterCount = this.$widget.find('.character-count');+ return this.$widget;+ }++ async refreshWithNote(note) {+ if (note.type !== 'text' || !note.hasLabel('wordCount')) {+ // show widget only on text notes and when marked with 'wordCount' label+ this.toggleInt(false); // hide++ return;+ }++ this.toggleInt(true); // display++ const {content} = await note.getNoteComplement();++ const text = $(content).text(); // get plain text only++ const counts = this.getCounts(text);++ this.$wordCount.text(counts.words);+ this.$characterCount.text(counts.characters);+ }++ getCounts(text) {+ const chunks = text+ .split(/[\s-+:,/\\]+/)+ .filter(chunk => chunk !== '');++ let words;++ if (chunks.length === 1 && chunks[0] === '') {+ words = 0;+ }+ else {+ words = chunks.length;+ }++ const characters = chunks.join('').length;++ return {words, characters};+ }++ async entitiesReloadedEvent({loadResults}) {+ if (loadResults.isNoteContentReloaded(this.noteId)) {+ this.refresh();+ }+ }+}++module.exports = new WordCountWidget();+```++After you make changes it is necessary to [restart Trilium](../../../Troubleshooting/Refreshing%20the%20application.md) so that the layout can be rebuilt.++The widget only activates on text notes that have the `#wordCount` label. This label can be a [reference link](../../../Note%20Types/Text/Links/Internal%20\(reference\)%20links.md) to enable the widget for an entire subtree.++At the bottom of the note you can see the resulting widget:++<figure class="image"><img style="aspect-ratio:792/603;" src="Word count widget_image.png" width="792" height="603"></figure>\ No newline at end of filediff --git a/docs/User Guide/User Guide/Scripting/Frontend Basics/Custom Widgets/Word count widget_image.png b/docs/User Guide/User Guide/Scripting/Frontend Basics/Custom Widgets/Word count widget_image.pngnew file mode 100644index 0000000000..2f1e5e5fd3Binary files /dev/null and b/docs/User Guide/User Guide/Scripting/Frontend Basics/Custom Widgets/Word count widget_image.png differdiff --git a/docs/User Guide/User Guide/Scripting/Frontend Basics/Examples/Downloading responses from Google Forms.md b/docs/User Guide/User Guide/Scripting/Frontend Basics/Examples/Downloading responses from Google Forms.mdnew file mode 100644index 0000000000..712f2c0013--- /dev/null+++ b/docs/User Guide/User Guide/Scripting/Frontend Basics/Examples/Downloading responses from Google Forms.md@@ -0,0 +1,45 @@+# Downloading responses from Google Forms+This tutorial showcases a basic integration with Google Forms, where we are able to download the responses of a form using the “Link to Sheets" functionality.++Note that the link will be publicly accessible to everyone (however the link is in a hard-to-guess format such as `https://docs.google.com/spreadsheets/d/e/2PACX-1vTA8NU2_eZFhc8TFadCZPreBfvP7un8IHd6J0SchrLLw3ueGmntNZjwRmsH2ZRcp1pJYDAzMz1FmFaj/pub?output=csv`). Make sure you are not accidentally publishing sensitive information.++## Obtaining the CSV link++1. Open the Google Forms in a browser.+2. Select the “Responses” tab and click on “Link to Sheets”.+3. Select “Create a new spreadsheet” and press “Create”.+4. In Google Sheets, select File → Share → Publish to web.+5. In the “Publish to the web” screen, make sure the “Link” tab is selected and instead of “Web page”, select “Comma-separated values (.csv)”.+6. Copy the given link which will be used for the upcoming script.++## Creating the script++Create a “JS Frontend” script:++```+const CSV_URL = "https://docs.google.com/spreadsheets/d/e/2PACX-1vTiwooLV2whjCSVa49dJ99p_G3_qhqHHRqttMjYCJVfLXVdTgUSNJu5K0rpqmaHYF2k7Vofi3o7gW82/pub?output=csv";++async function fetchData() {+ try {+ const response = await fetch(CSV_URL);+ return await response.text();+ } catch (e) {+ api.showError(e.message);+ }+}++const data = await fetchData();+console.log(data);+// Do something with the data.+```++Note that the data will be received as a string and there is no library to do the CSV parsing for us. To do a very simple parsing of CSV:++```+const content = data+ .split("\n")+ .slice(1)+ .map((row) => row.split(","));+```++This will return the data as an array of arrays.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Scripting/Frontend Basics/Examples/Using promoted attributes to configure scripts.md b/docs/User Guide/User Guide/Scripting/Frontend Basics/Examples/Using promoted attributes to configure scripts.mdnew file mode 100644index 0000000000..90404e56d7--- /dev/null+++ b/docs/User Guide/User Guide/Scripting/Frontend Basics/Examples/Using promoted attributes to configure scripts.md@@ -0,0 +1,61 @@+# Using promoted attributes to configure scripts+A good use case of promoted attributes is to easily define the various parameters a script might need, for example an input and output note if it's processing data, or a checkbox to define a particular change in behavior for the script.++++## Using check boxes to toggle flags++Instead of asking the user to modify a boolean value in the script, it's much more intuitive to use a checkbox for it as a promoted attribute.++To do so, first define the promoted attribute:++```+#label:groupByExtension="promoted,alias=Group by extension,single,boolean"+```++Then use it:++```javascript+const byExtension = api.currentNote.getLabelValue("groupByExtension") === "true";+if (byExtension) {+ // Do something.+}+```++This will work equally well in both front-end and back-end scripts.++## Using relations to select notes++One common use case for a script is to read data from another note and perhaps output its result in another note. To do so we need to define the following promoted attributes:++```+#relation:input="promoted,alias=Input,single" #relation:output="promoted,alias=Output,single"+```++Once we have this, we can add some basic error handling to ensure that the fields are completed by the user:++```javascript+const inputNoteId = api.currentNote.getRelationValue("input");+if (!inputNoteId) {+ api.showError("Missing input.");+ return;+}++const outputNoteId = api.currentNote.getRelationValue("output");+if (!outputNoteId) {+ api.showError("Missing output.");+ return;+}+```++Note that here we are using `api.showError` which is only available for frontend notes. If you are writing a backend note, simply remove `api.showError` but the user will no feedback on why the script did not execute properly.++Afterwards we can simply read the note and do something with it:++```javascript+const note = api.getNote(inputNoteId);+if (!note) {+ return;+}+const content = note.getContent().toString("utf-8");+```\ No newline at end of filediff --git a/docs/User Guide/User Guide/Scripting/Frontend Basics/Examples/Using promoted attributes to configure scripts_image.png b/docs/User Guide/User Guide/Scripting/Frontend Basics/Examples/Using promoted attributes to configure scripts_image.pngnew file mode 100644index 0000000000..a260503562Binary files /dev/null and b/docs/User Guide/User Guide/Scripting/Frontend Basics/Examples/Using promoted attributes to configure scripts_image.png differdiff --git a/docs/User Guide/User Guide/Scripting/Frontend Basics/Frontend Events.md b/docs/User Guide/User Guide/Scripting/Frontend Basics/Frontend Events.mdnew file mode 100644index 0000000000..f9686002f2--- /dev/null+++ b/docs/User Guide/User Guide/Scripting/Frontend Basics/Frontend Events.md@@ -0,0 +1,16 @@+# Frontend Events+Front-end scripts can be run automatically on certain triggering conditions.++To do so, set the `run` [label](../../Advanced%20Usage/Attributes/Labels.md) to either:++* `frontendStartup` - when Trilium frontend starts up (or is refreshed), but not on mobile.+* `mobileStartup` - when Trilium frontend starts up (or is refreshed), on mobile.++> [!NOTE]+> One script can be triggered on multiple events, this can be done by adding multiple `run` labels. Separating multiple values by commas **is not** supported.++Backend scripts have more powerful triggering conditions, for example they can run automatically on a hourly or daily basis, but also on events such as when a note is created or an attribute is modified. See the server-side <a class="reference-link" href="../Backend%20scripts/Backend%20Events.md">Events</a> for more information.++## Safe mode++While [safe mode](../../Advanced%20Usage/Safe%20mode.md) is active, scripts with events won't trigger.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Scripting/Frontend Basics/Launch Bar Widgets.md b/docs/User Guide/User Guide/Scripting/Frontend Basics/Launch Bar Widgets.mdnew file mode 100644index 0000000000..fbe6ac7bae--- /dev/null+++ b/docs/User Guide/User Guide/Scripting/Frontend Basics/Launch Bar Widgets.md@@ -0,0 +1,23 @@+# Launch Bar Widgets+Launch bar widgets are a subset of <a class="reference-link" href="Custom%20Widgets.md">Custom Widgets</a> that can be used to render custom buttons and widgets inside the <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Launch%20Bar.md">Launch Bar</a>.++## Creating a launch bar widget for the desktop layout++Unlike <a class="reference-link" href="Custom%20Widgets.md">Custom Widgets</a>, the process of setting up a launch bar widget is slightly different:++1. Create a Code note of type _JavaScript (front-end)_ or JSX (for Preact-based widgets).+ * The script itself uses the same concepts as <a class="reference-link" href="Custom%20Widgets.md">Custom Widgets</a>, including the use of a `NoteContextAwareWidget` or a `BasicWidget` (according to needs).+ * As examples in both legacy and Preact format, see <a class="reference-link" href="Launch%20Bar%20Widgets/Note%20Title%20Widget.md">Note Title Widget</a> and <a class="reference-link" href="Launch%20Bar%20Widgets/Analog%20Watch.md">Analog Watch</a>.+2. Don't set `#widget`, as that attribute is reserved for <a class="reference-link" href="Custom%20Widgets.md">Custom Widgets</a>.+3. In the <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Global%20menu.md">Global menu</a>, select _Configure launchbar_.+4. In the _Visible Launchers_ section, select _Add a custom widget_.+5. Give the newly created launcher a name (and optionally a name).+6. In the <a class="reference-link" href="../../Advanced%20Usage/Attributes/Promoted%20Attributes.md">Promoted Attributes</a> section, modify the _widget_ field to point to the newly created note.+7. [Refresh](../../Troubleshooting/Refreshing%20the%20application.md) the UI.++## Mobile layout++Custom launch bar widgets are also supported on the <a class="reference-link" href="../../Installation%20%26%20Setup/Mobile%20Frontend.md">Mobile Frontend</a>. To do so:++1. Go to <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Global%20menu.md">Global menu</a> → _Advanced_ → _Show Hidden Subtree_.+2. Look for _Mobile Launch Bar_ and follow the same creation mechanism as in the previous section.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Scripting/Frontend Basics/Launch Bar Widgets/Analog Watch.md b/docs/User Guide/User Guide/Scripting/Frontend Basics/Launch Bar Widgets/Analog Watch.mdnew file mode 100644index 0000000000..a162e52b95--- /dev/null+++ b/docs/User Guide/User Guide/Scripting/Frontend Basics/Launch Bar Widgets/Analog Watch.md@@ -0,0 +1,85 @@+# Analog Watch+<figure class="image"><img style="aspect-ratio:1007/94;" src="Analog Watch_image.png" width="1007" height="94"></figure>++This is a more intricate example of a basic widget, which displays an analog watch in the launch bar. Unlike note-context aware widgets, basic widgets don't react to note navigation.++```javascript+const TPL = `+<div class="analog-watch" style="+ position: relative;+ height: 38px;+ width: 38px;+ border-radius: 50%;+ background: white;+ border: 2px solid #444;+ flex-shrink: 0;+">+ <!-- hour hand -->+ <div class="hand hour" style="+ position: absolute;+ left: 50%;+ top: 50%;+ width: 3px;+ height: 10px;+ background: #333;+ transform-origin: bottom center;+ "></div>++ <!-- minute hand -->+ <div class="hand minute" style="+ position: absolute;+ left: 50%;+ top: 50%;+ width: 2px;+ height: 13px;+ background: #111;+ transform-origin: bottom center;+ "></div>++ <!-- second hand -->+ <div class="hand second" style="+ position: absolute;+ left: 50%;+ top: 50%;+ width: 1px;+ height: 15px;+ background: red;+ transform-origin: bottom center;+ "></div>+</div>+`;++class AnalogWatchWidget extends api.BasicWidget {+ doRender() {+ this.$widget = $(TPL);++ const hourHand = this.$widget.find('.hand.hour')[0];+ const minuteHand = this.$widget.find('.hand.minute')[0];+ const secondHand = this.$widget.find('.hand.second')[0];++ const update = () => {+ const now = new Date();+ const sec = now.getSeconds();+ const min = now.getMinutes();+ const hour = now.getHours();++ const secDeg = sec * 6;+ const minDeg = min * 6 + sec * 0.1;+ const hourDeg = (hour % 12) * 30 + min * 0.5;++ secondHand.style.transform = `translate(-50%, -100%) rotate(${secDeg}deg)`;+ minuteHand.style.transform = `translate(-50%, -100%) rotate(${minDeg}deg)`;+ hourHand.style.transform = `translate(-50%, -100%) rotate(${hourDeg}deg)`;+ };++ update();+ this._interval = setInterval(update, 1000);+ }++ cleanup() {+ if (this._interval) clearInterval(this._interval);+ }+}++module.exports = new AnalogWatchWidget();+```\ No newline at end of filediff --git a/docs/User Guide/User Guide/Scripting/Frontend Basics/Launch Bar Widgets/Analog Watch_image.png b/docs/User Guide/User Guide/Scripting/Frontend Basics/Launch Bar Widgets/Analog Watch_image.pngnew file mode 100644index 0000000000..809488185cBinary files /dev/null and b/docs/User Guide/User Guide/Scripting/Frontend Basics/Launch Bar Widgets/Analog Watch_image.png differdiff --git a/docs/User Guide/User Guide/Scripting/Frontend Basics/Launch Bar Widgets/Note Title Widget.md b/docs/User Guide/User Guide/Scripting/Frontend Basics/Launch Bar Widgets/Note Title Widget.mdnew file mode 100644index 0000000000..c892e33650--- /dev/null+++ b/docs/User Guide/User Guide/Scripting/Frontend Basics/Launch Bar Widgets/Note Title Widget.md@@ -0,0 +1,54 @@+# Note Title Widget+<figure class="image"><img style="aspect-ratio:1007/94;" src="Note Title Widget_image.png" width="1007" height="94"></figure>++This is an example of a note context-aware widget, which reacts to the currently opened note and refreshes automatically as the user navigates through the notes.++## Legacy widget++In this example, the title of the note is displayed. It works best on the [horizontal layout](../../../Basic%20Concepts%20and%20Features/UI%20Elements/Vertical%20and%20horizontal%20layout.md).++```javascript+const TPL = `\+<div style="+ display: flex;+ height: 53px;+ width: fit-content;+ font-size: 0.75em;+ contain: none;+ align-items: center;+ flex-shrink: 0;+ padding: 0 1em;+"></div>`;++class NoteTitleWidget extends api.NoteContextAwareWidget {+ doRender() {+ this.$widget = $(TPL);+ }++ async refreshWithNote(note) {+ this.$widget.text(note.title);+ }+}++module.exports = new NoteTitleWidget();+```++## Preact widget (v0.101.0+)++```jsx+import { defineLauncherWidget, useActiveNoteContext } from "trilium:preact";++export default defineLauncherWidget({+ render: () => {+ const { note } = useActiveNoteContext();+ return <div style={{+ display: "flex",+ height: "53px",+ width: "fit-content",+ fontSize: "0.75em",+ alignItems: "center",+ flexShrink: 0+ }}>{note?.title}</div>;+ }+});+```\ No newline at end of filediff --git a/docs/User Guide/User Guide/Scripting/Frontend Basics/Launch Bar Widgets/Note Title Widget_image.png b/docs/User Guide/User Guide/Scripting/Frontend Basics/Launch Bar Widgets/Note Title Widget_image.pngnew file mode 100644index 0000000000..6320bd8f17Binary files /dev/null and b/docs/User Guide/User Guide/Scripting/Frontend Basics/Launch Bar Widgets/Note Title Widget_image.png differdiff --git a/docs/User Guide/User Guide/Scripting/Frontend Basics/Preact.md b/docs/User Guide/User Guide/Scripting/Frontend Basics/Preact.mdnew file mode 100644index 0000000000..6f05765fce--- /dev/null+++ b/docs/User Guide/User Guide/Scripting/Frontend Basics/Preact.md@@ -0,0 +1,65 @@+# Preact+Since v0.101.0, Trilium integrates Preact for front-end scripting, including support for JSX.++Preact can be used for:++* <a class="reference-link" href="../../Note%20Types/Render%20Note.md">Render Note</a>, where a JSX code note is used instead of a HTML one.+* <a class="reference-link" href="Custom%20Widgets.md">Custom Widgets</a>, where JSX can be used to replace the old, jQuery-based mechanism.++To get started, the first step is to enable JSX in the list of Code languages. Go to Options → Code Notes and check the “JSX” language. Afterwards, proceed with the documentation in either <a class="reference-link" href="../../Note%20Types/Render%20Note.md">Render Note</a> or <a class="reference-link" href="Custom%20Widgets.md">Custom Widgets</a>, which will both have a section on how to use the new Preact integration.++> [!IMPORTANT]+> The documentation assumes prior knowledge with React or Preact. As a starting point, consider the [FreeCodeCamp course on Front End Development Libraries](https://www.freecodecamp.org/learn/front-end-development-libraries-v9/) or the [Preact Tutorial](https://preactjs.com/tutorial/).++## Import/exports++When using Preact with JSX, there is a special syntax which provides ES-like imports. This `import` syntax makes way for a more intuitive that doesn't make use of global objects and paves the way for better auto-completion support that might be introduced in the future.++### API imports++Instead of:++```jsx+api.showMessage("Hello");+```++the JSX version looks like this:++```jsx+import { showMessage } from "trilium:api";+showMessage("hello");+```++### Preact API imports (hooks, components)++There's a new <a class="reference-link" href="../Script%20API.md">Script API</a> dedicated to Preact, which provides shared components that are also used by Trilium internally as well as hooks, for example.++```jsx+import { useState } from "trilium:preact";+const [ myState, setMyState ] = useState("Hi");+```++### Exporting++JSX notes can export a component for use in <a class="reference-link" href="../../Note%20Types/Render%20Note.md">Render Note</a> or for <a class="reference-link" href="Preact/Component%20libraries.md">Component libraries</a>:++```jsx+export default function() {+ return (+ <>+ <p>Hello world.</p>+ </>+ );+}+```++### Import/export are not required++These imports are syntactic sugar meant to replace the usage for the `api` global object (see <a class="reference-link" href="../Script%20API.md">Script API</a>).++> [!NOTE]+> The `import` and `export` syntax work only for JSX notes. Standard/jQuery code notes still need to use the `api` global and `module.exports`.++## Under the hood++Unlike JavaScript, JSX requires pre-processing to turn it into JavaScript (just like TypeScript). To do so, Trilium uses [Sucrase](https://github.com/alangpierce/sucrase), a JavaScript library which processes the JSX to pure JavaScript. The processing is done each time a script is run (for widgets this happens at every program startup). If you notice any performance degradation due to long compilation, consider [reporting the issue](../../Troubleshooting/Reporting%20issues.md) to us.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Scripting/Frontend Basics/Preact/Built-in components.md b/docs/User Guide/User Guide/Scripting/Frontend Basics/Preact/Built-in components.mdnew file mode 100644index 0000000000..db05c92555--- /dev/null+++ b/docs/User Guide/User Guide/Scripting/Frontend Basics/Preact/Built-in components.md@@ -0,0 +1,43 @@+# Built-in components+<figure class="image image_resized" style="width:54.58%;"><img style="aspect-ratio:896/712;" src="Built-in components_image.png" width="896" height="712"><figcaption>A partial screenshot from the Widget showcase example (see below).</figcaption></figure>++Trilium comes with its own set of Preact components, some of which are also available to <a class="reference-link" href="../Custom%20Widgets.md">Custom Widgets</a> and <a class="reference-link" href="../../../Note%20Types/Render%20Note.md">Render Note</a>.++To use these components, simply import them from `trilium:preact`:++```jsx+import { ActionButton, Button, LinkButton } from "trilium:preact";+```++and then use them:++```jsx+export default function MyRenderNote() {+ const onClick = () => showMessage("A button was pressed");++ return (+ <>+ <h2>Buttons</h2>+ <div style={{ display: "flex", gap: "1em", alignItems: "center" }}>+ <ActionButton icon="bx bx-rocket" text="Action button" onClick={onClick} />+ <Button icon="bx bx-rocket" text="Simple button" onClick={onClick} />+ <LinkButton text="Link button" onClick={onClick} />+ </div>+ </>+ )+}+```++## Widget showcase++> [!TIP]+> Starting with v0.101.0, the widget showcase is also available in the <a class="reference-link" href="../../../Advanced%20Usage/Database/Demo%20Notes.md">Demo Notes</a>.++This is a <a class="reference-link" href="../../../Note%20Types/Render%20Note.md">Render Note</a> example with JSX that shows most of the built-in components that are accessible to custom widgets and JSX render notes.++To use it, simply:++1. Create a render note.+2. Create a child code note of JSX type with the content of this file: <a class="reference-link" href="Built-in%20components/Widget%20showcase.jsx">Widget showcase</a>+3. Set the `~renderNote` relation of the parent note to the child note.+4. Refresh the render note to see the results.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Scripting/Frontend Basics/Preact/Built-in components/Widget showcase.jsx b/docs/User Guide/User Guide/Scripting/Frontend Basics/Preact/Built-in components/Widget showcase.jsxnew file mode 100644index 0000000000..934707a34e--- /dev/null+++ b/docs/User Guide/User Guide/Scripting/Frontend Basics/Preact/Built-in components/Widget showcase.jsx@@ -0,0 +1,220 @@+import {+ ActionButton, Button, LinkButton,+ Admonition, Collapsible,+ FormCheckbox, FormDropdownList, FormFileUploadButton, FormGroup, FormRadioGroup, FormTextArea,+ FormTextBox, FormToggle, Slider, RawHtml, LoadingSpinner, Icon,+ ColorPicker,+ Dropdown, FormListItem, FormDropdownDivider, FormDropdownSubmenu,+ NoteAutocomplete, NoteLink, Modal,+ Table,+ CKEditor,+ useEffect, useState+} from "trilium:preact";+import { showMessage } from "trilium:api";++export default function() {+ const [ time, setTime ] = useState();+ const lorem = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam accumsan eu odio non gravida. Pellentesque ornare, arcu condimentum molestie dignissim, nibh turpis ultrices elit, eget elementum nunc erat at erat. Maecenas vehicula consectetur elit, nec fermentum elit venenatis eu.";+ useEffect(() => {+ const interval = setInterval(() => setTime(new Date().toLocaleString()), 1000);+ return () => clearInterval(interval);+ }, []);++ return (+ <div style={{ padding: 20, display: "flex", flexDirection: "column", gap: "1em" }}>+ <h1>Widget showcase</h1>++ <Buttons />+ <Admonition type="note">+ <strong>Admonition</strong><br />+ {lorem}+ </Admonition>++ <Collapsible title="Collapsible" initiallyExpanded>+ {lorem}+ </Collapsible>++ <FormElements />+ <NoteElements />+ <ModalSample />+ <DropdownSample />+ <CollectionViews />+ </div>+ );+}++function Buttons() {+ const onClick = () => showMessage("A button was pressed");++ return (+ <>+ <h2>Buttons</h2>+ <div style={{ display: "flex", gap: "1em", alignItems: "center" }}>+ <ActionButton icon="bx bx-rocket" text="Action button" onClick={onClick} />+ <Button icon="bx bx-rocket" text="Simple button" onClick={onClick} />+ <LinkButton text="Link button" onClick={onClick} />+ </div>+ </>+ )+}++function FormElements() {+ const [ checkboxChecked, setCheckboxChecked ] = useState(false);+ const [ dropdownValue, setDropdownValue ] = useState("key-1");+ const [ radioGroupValue, setRadioGroupValue ] = useState("key-1");+ const [ sliderValue, setSliderValue ] = useState(50);+ const [ color, setColor ] = useState("#43a047");++ return (+ <>+ <h2>Form elements</h2>+ <div style={{ display: "grid", gridTemplateColumns: "1fr 1fr 1fr", gap: "1em" }}>+ <FormGroup name="checkbox" label="Checkbox">+ <FormCheckbox label="Checkbox" currentValue={checkboxChecked} onChange={setCheckboxChecked} />+ </FormGroup>+ <FormGroup name="toggle" label="Toggle">+ <FormToggle switchOnName="Off" switchOffName="On" currentValue={checkboxChecked} onChange={setCheckboxChecked} />+ </FormGroup>+ <FormGroup name="dropdown" label="Dropdown">+ <FormDropdownList+ values={[+ { key: "key-1", name: "First item" },+ { key: "key-2", name: "Second item" },+ { key: "key-3", name: "Third item" },+ ]}+ currentValue={dropdownValue} onChange={setDropdownValue}+ keyProperty="key" titleProperty="name"+ />+ </FormGroup>+ <FormGroup name="radio-group" label="Radio group">+ <FormRadioGroup+ values={[+ { value: "key-1", label: "First item" },+ { value: "key-2", label: "Second item" },+ { value: "key-3", label: "Third item" },+ ]}+ currentValue={radioGroupValue} onChange={setRadioGroupValue}+ />+ </FormGroup>+ <FormGroup name="text-box" label="Text box">+ <FormTextBox+ placeholder="Type something..."+ currentValue="" onChange={(newValue) => {}}+ />+ </FormGroup>+ <FormGroup name="text-area" label="Text area">+ <FormTextArea+ placeholder="Type something bigger..."+ currentValue="" onChange={(newValue) => {}}+ />+ </FormGroup>+ <FormGroup name="color-picker" label="Color picker">+ <ColorPicker currentValue={color} onChange={setColor} />+ </FormGroup>+ <FormGroup name="slider" label="Slider">+ <Slider+ min={1} max={100}+ value={sliderValue} onChange={setSliderValue}+ />+ </FormGroup>+ <FormGroup name="file-upload" label="File upload">+ <FormFileUploadButton+ text="Upload"+ onChange={(files) => {+ const file = files?.[0];+ if (!file) return;+ showMessage(`Got file "${file.name}" of size ${file.size} B and type ${file.type}.`);+ }}+ />+ </FormGroup>+ <FormGroup name="icon" label="Icon">+ <Icon icon="bx bx-smile" />+ </FormGroup>+ <FormGroup name="loading-spinner" label="Loading spinner">+ <LoadingSpinner />+ </FormGroup>+ <FormGroup name="raw-html" label="Raw HTML">+ <RawHtml html="<strong>Hi</strong> <em>there</em>" />+ </FormGroup>+ </div>+ </>+ )+}++function NoteElements() {+ const [ noteId, setNoteId ] = useState("");++ return (+ <div>+ <h2>Note elements</h2>++ <FormGroup name="note-autocomplete" label="Note autocomplete">+ <NoteAutocomplete+ placeholder="Select a note"+ noteId={noteId} noteIdChanged={setNoteId}+ />+ </FormGroup>++ <FormGroup name="note-link" label="Note link">+ {noteId+ ? <NoteLink notePath={noteId} showNoteIcon />+ : <span>Select a note first</span>}+ </FormGroup>+ </div>+ );+}++function ModalSample() {+ const [ shown, setShown ] = useState(false);++ return (+ <>+ <h2>Modal</h2>+ <Button text="Open modal" onClick={() => setShown(true)} />+ <Modal title="Modal title" size="md" show={shown} onHidden={() => setShown(false)}>+ Modal goes here.+ </Modal>+ </>+ )+}++function DropdownSample() {+ return (+ <>+ <h2>Dropdown menu</h2>+ <Dropdown text="Dropdown" hideToggleArrow>+ <FormListItem icon="bx bx-cut">Cut</FormListItem>+ <FormListItem icon="bx bx-copy">Copy</FormListItem>+ <FormListItem icon="bx bx-paste">Paste</FormListItem>+ <FormDropdownDivider />+ <FormDropdownSubmenu title="Submenu">+ <FormListItem>More items</FormListItem>+ </FormDropdownSubmenu>+ </Dropdown>+ </>+ )+}++function CollectionViews() {+ return (+ <>+ <h2>Collection views</h2>+ <p>+ A generic <code>Table</code> (Tabulator) is available. A <code>Calendar</code>+ {" "}(FullCalendar) component is also exposed, but it requires you to pass a+ {" "}<code>plugins</code> array to render a view, so it is not demonstrated here.+ </p>+ <Table+ layout="fitColumns"+ columns={[+ { title: "Name", field: "name" },+ { title: "Progress", field: "progress" }+ ]}+ data={[+ { id: 1, name: "First task", progress: "80%" },+ { id: 2, name: "Second task", progress: "20%" }+ ]}+ />+ </>+ )+}diff --git a/docs/User Guide/User Guide/Scripting/Frontend Basics/Preact/Built-in components_image.png b/docs/User Guide/User Guide/Scripting/Frontend Basics/Preact/Built-in components_image.pngnew file mode 100644index 0000000000..cf59bbefd0Binary files /dev/null and b/docs/User Guide/User Guide/Scripting/Frontend Basics/Preact/Built-in components_image.png differdiff --git a/docs/User Guide/User Guide/Scripting/Frontend Basics/Preact/CSS.md b/docs/User Guide/User Guide/Scripting/Frontend Basics/Preact/CSS.mdnew file mode 100644index 0000000000..3b959261fe--- /dev/null+++ b/docs/User Guide/User Guide/Scripting/Frontend Basics/Preact/CSS.md@@ -0,0 +1,17 @@+# CSS+## Inline styles++```jsx+<div style={{+ display: "flex",+ height: "53px",+ width: "fit-content",+ fontSize: "0.75em",+ alignItems: "center",+ flexShrink: 0+}}>/* [...] */</div>+```++## Custom CSS file++Simply create a <a class="reference-link" href="../../../Theme%20development/Custom%20app-wide%20CSS.md">Custom app-wide CSS</a>. Make sure the class names are unique enough to not intersect with other UI elements, consider adding a prefix (e.g. `x-mywidget-`).\ No newline at end of filediff --git a/docs/User Guide/User Guide/Scripting/Frontend Basics/Preact/Component libraries.md b/docs/User Guide/User Guide/Scripting/Frontend Basics/Preact/Component libraries.mdnew file mode 100644index 0000000000..65807e0fbc--- /dev/null+++ b/docs/User Guide/User Guide/Scripting/Frontend Basics/Preact/Component libraries.md@@ -0,0 +1,69 @@+# Component libraries+Using the concept of <a class="reference-link" href="../../Common%20concepts/Script%20bundles.md">Script bundles</a>, it's possible to create components that are shared for multiple widgets or <a class="reference-link" href="../../../Note%20Types/Render%20Note.md">Render Note</a>.++## Exporting a single component++This is generally useful for big components.++Here's an example child hierarchy using <a class="reference-link" href="../../../Note%20Types/Render%20Note.md">Render Note</a>:++* _My render note_+ Note type: Render Note+ Link `~renderNote` to the child note (_Render note with subcomponents_)+ * _Render note with subcomponents_+ Type: JSX++ ```jsx+ export default function() {+ return (+ <MyComponent />+ );+ }+ ```++ * _MyComponent_+ Type: Code / JSX++ ```jsx+ export default function MyComponent() {+ return <p>Hi</p>;+ }+ ```++## Multiple components per note++To export multiple components, use the `export` keyword next to each of the function components.++Here's how a sub-note called `MyComponents` would look like:++```jsx+export function MyFirstComponent() {+ return <p>First</p>;+}++export function MySecondComponent() {+ return <p>Bar</p>;+}+```++Then in its parent note:++```jsx+const { MyFirstComponent, MySecondComponent } = MyComponents;++export default function() {+ return (+ <>+ <MyFirstComponent />+ <MySecondComponent />+ </>+ );+}+```++Alternatively, it's also possible to use the components directly without assigning them to a `const` first:++```jsx+<MyComponents.MyFirstComponent />+<MyComponents.MySecondComponent />+```\ No newline at end of filediff --git a/docs/User Guide/User Guide/Scripting/Frontend Basics/Preact/Hooks.md b/docs/User Guide/User Guide/Scripting/Frontend Basics/Preact/Hooks.mdnew file mode 100644index 0000000000..a5e1b5aae3--- /dev/null+++ b/docs/User Guide/User Guide/Scripting/Frontend Basics/Preact/Hooks.md@@ -0,0 +1,43 @@+# Hooks+## Standard Preact hooks++All standard Preact hooks are available as an import in `trilium:api`.++For example:++```jsx+import { useState } from "trilium:preact";+const [ myState, setMyState ] = useState("Hi");+```++## Custom hooks++Trilium comes with a large set of custom hooks for Preact, all of which are also available to custom widgets and <a class="reference-link" href="../../../Note%20Types/Render%20Note.md">Render Note</a>.++### `useNoteContext`++As a replacement to <a class="reference-link" href="../Custom%20Widgets/Note%20context%20aware%20widget.md">Note context aware widget</a>, Preact exposes the current note context in the `useNoteContext` hook:++```jsx+import { defineWidget, useNoteContext, useNoteProperty } from "trilium:preact";++export default defineWidget({+ parent: "note-detail-pane",+ position: 10,+ render: () => {+ const { note } = useNoteContext();+ const title = useNoteProperty(note, "title");+ return <span>Current note JSX: {title}</span>;+ }+});+```++Note that the custom widget must be inside the content area (so note detail widget) for this to work properly, especially when dealing with splits.++### `useActiveNoteContext`++`useActiveNoteContext` is an alternative to `useNoteContext` which works even if the widget is not within the note detail section and it automatically switches the note context as the user is navigating around between tabs and splits.++### `useNoteProperty`++This hook allows “listening” for changes to a particular property of a `FNote`, such as the `title` or `type` of a note. The benefit from using the hook is that it actually reacts to changes, for example if the note title or type is changed.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Scripting/Logging.md b/docs/User Guide/User Guide/Scripting/Logging.mdnew file mode 100644index 0000000000..74a33fccb3--- /dev/null+++ b/docs/User Guide/User Guide/Scripting/Logging.md@@ -0,0 +1,19 @@+# Logging+Both front-end and back-end notes can log messages for debugging.++## UI logging via `api.log`++<figure class="image image_resized image-style-align-center" style="width:57.74%;"><img style="aspect-ratio:749/545;" src="Logging_image.png" width="749" height="545"></figure>++The API log feature integrates with the script editor and it displays all the messages logged via `api.log`. This works for both back-end and front-end scripts.++The API log panel will appear after executing a script that uses `api.log` and it can be dismissed temporarily by pressing the close button in the top-right of the panel.++Apart from strings, an object can be passed as well in which case it will be pretty-formatted if possible (e.g. recursive objects are not supported).++## Console logging++For logs that are not directly visible to the user, the standard `console.log` can be used as well.++* For front-end scripts, the log will be shown in the Developer Tools (also known as Inspect).+* For back-end scripts, the log will be shown in the server output while running but **will not** be visible in the <a class="reference-link" href="../Troubleshooting/Error%20logs/Backend%20(server)%20logs.md">Backend (server) logs</a>.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Scripting/Logging_image.png b/docs/User Guide/User Guide/Scripting/Logging_image.pngnew file mode 100644index 0000000000..29933ba172Binary files /dev/null and b/docs/User Guide/User Guide/Scripting/Logging_image.png differdiff --git a/docs/User Guide/User Guide/Scripting/Script API.md b/docs/User Guide/User Guide/Scripting/Script API.mdnew file mode 100644index 0000000000..cb470e28ef--- /dev/null+++ b/docs/User Guide/User Guide/Scripting/Script API.md@@ -0,0 +1,19 @@+# Script API+For [script code notes](../Scripting.md), Trilium offers an API that gives them access to various features of the application.++There are two APIs:++* One for the front-end scripts: <a class="reference-link" href="Script%20API/Frontend%20API">Frontend API</a>+* One for the back-end scripts: <a class="reference-link" href="Script%20API/Backend%20API.dat">Backend API</a>++In both cases, the API resides in a global variable, `api`, that can be used anywhere in the script.++For example, to display a message to the user the following front-end script can be used:++```+api.showMessage("Hello world.");+```++> [!NOTE]+> **Note**+> The Script API is currently experimental and may undergo changes in future updates.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Scripting/Script API/Backend API.dat b/docs/User Guide/User Guide/Scripting/Script API/Backend API.datnew file mode 100644index 0000000000..e69de29bb2diff --git a/docs/User Guide/User Guide/Scripting/Script API/Day.js.md b/docs/User Guide/User Guide/Scripting/Script API/Day.js.mdnew file mode 100644index 0000000000..6974f7e59e--- /dev/null+++ b/docs/User Guide/User Guide/Scripting/Script API/Day.js.md@@ -0,0 +1,31 @@+# Day.js+Day.js is a date manipulation library that's used by Trilium, but it's also shared with both front-end and back-end scripts. For more information about the library itself, consult the [official documentation](https://day.js.org/en/).++## How to use++The `dayjs` method is provided directly in the `api` global:++```javascript+const date = api.dayjs();+api.log(date.format("YYYY-MM-DD"));+```++## Plugins++Day.js uses a modular, plugin-based architecture. Generally these plugins must be imported, but this process doesn't work inside Trilium scripts due to the use of a bundler.++Since v0.100.0, the same set of plugins is available for both front-end and back-end scripts.++The following Day.js plugins are directly integrated into Trilium:++* [AdvancedFormat](https://day.js.org/docs/en/plugin/advanced-format)+* [Duration](https://day.js.org/docs/en/plugin/duration), since v0.100.0.+* [IsBetween](https://day.js.org/docs/en/plugin/is-between)+* [IsoWeek](https://day.js.org/docs/en/plugin/iso-week)+* [IsSameOrAfter](https://day.js.org/docs/en/plugin/is-same-or-after)+* [IsSameOrBefore](https://day.js.org/docs/en/plugin/is-same-or-before)+* [QuarterOfYear](https://day.js.org/docs/en/plugin/quarter-of-year)+* [UTC](https://day.js.org/docs/en/plugin/utc)++> [!NOTE]+> If another Day.js plugin might be needed for scripting purposes, feel free to open a feature request for it. Depending on the size of the plugin and the potential use of it inside the Trilium code base, it has a chance of being integrated.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Scripting/Script API/Electron API.dat b/docs/User Guide/User Guide/Scripting/Script API/Electron API.datnew file mode 100644index 0000000000..e69de29bb2diff --git a/docs/User Guide/User Guide/Scripting/Script API/Frontend API/FNote.dat b/docs/User Guide/User Guide/Scripting/Script API/Frontend API/FNote.datnew file mode 100644index 0000000000..e69de29bb2diff --git a/docs/User Guide/User Guide/Scripting/Security.md b/docs/User Guide/User Guide/Scripting/Security.mdnew file mode 100644index 0000000000..1b7f520099--- /dev/null+++ b/docs/User Guide/User Guide/Scripting/Security.md@@ -0,0 +1,15 @@+# Security+Starting with v0.104.0, some features in Trilium are intentionally disabled in order to reduce the attack surface:++* <a class="reference-link" href="Backend%20scripts.md">Backend scripts</a>, which can run processes on the server, access the file system or bypass security measures.+* <a class="reference-link" href="../Advanced%20Usage/Database/Manually%20altering%20the%20database/SQL%20Console.md">SQL Console</a>, which can be used to exfiltrate important data such as the document secret or cause irreparable damage to the database.+* <a class="reference-link" href="../Installation%20%26%20Setup/Desktop%20Installation/Network%20Access.md">Network Access</a> for the <a class="reference-link" href="../Installation%20%26%20Setup/Desktop%20Installation.md">Desktop Installation</a>.++To activate any of them, there are three variants:++* For the desktop app, go to <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Options.md">Options</a> → _Security_ and toggle the desired option.+ * This will prompt a system dialog confirming the change. Note that scripts could potentially call this confirmation dialog as well, make sure to accept it only if enabling any of these features is required.+ * The settings page will be available for the server-side as well, but the options need to be manually toggled using the other mechanisms described here.+ * This works by setting a separate configuration file in the <a class="reference-link" href="../Installation%20%26%20Setup/Data%20directory.md">Data directory</a>.+* In [config.ini](../Advanced%20Usage/Configuration%20\(config.ini%20or%20environment%20variables\).md), set the corresponding option under the `Security` group.+* Or use environment variables (e.g. `TRILIUM_SECURITY_BACKEND_SCRIPTING_ENABLED=true`).\ No newline at end of filediff --git a/docs/User Guide/User Guide/Theme development/1_Custom app-wide CSS_image.png b/docs/User Guide/User Guide/Theme development/1_Custom app-wide CSS_image.pngnew file mode 100644index 0000000000..225fcc24f5Binary files /dev/null and b/docs/User Guide/User Guide/Theme development/1_Custom app-wide CSS_image.png differdiff --git a/docs/User Guide/User Guide/Theme development/2_Custom app-wide CSS_image.png b/docs/User Guide/User Guide/Theme development/2_Custom app-wide CSS_image.pngnew file mode 100644index 0000000000..97b8fc11dbBinary files /dev/null and b/docs/User Guide/User Guide/Theme development/2_Custom app-wide CSS_image.png differdiff --git a/docs/User Guide/User Guide/Theme development/3_Custom app-wide CSS_image.png b/docs/User Guide/User Guide/Theme development/3_Custom app-wide CSS_image.pngnew file mode 100644index 0000000000..582152fe70Binary files /dev/null and b/docs/User Guide/User Guide/Theme development/3_Custom app-wide CSS_image.png differdiff --git a/docs/User Guide/User Guide/Theme development/Creating a custom theme.md b/docs/User Guide/User Guide/Theme development/Creating a custom theme.mdnew file mode 100644index 0000000000..d3c2c52d6e--- /dev/null+++ b/docs/User Guide/User Guide/Theme development/Creating a custom theme.md@@ -0,0 +1,46 @@+# Creating a custom theme+## Step 1. Find a place to place the themes++Organization is an important aspect of managing a knowledge base. When developing a new theme or importing an existing one it's a good idea to keep them into one place.++As such, the first step is to create a new note to gather all the themes.++++## Step 2. Create the theme++| | |+| --- | --- |+|  | Themes are code notes with a special attribute. Start by creating a new code note. |+|  | Then change the note type to a CSS code. |+|  | In the _Owned Attributes_ section define the `#appTheme` attribute to point to any desired name. This is the name that will show up in the appearance section in settings. |++## Step 3. Define the theme's CSS++As a very simple example we will change the background color of the launcher pane to a shade of blue.++To alter the different variables of the theme:++```css+:root {+ --launcher-pane-background-color: #0d6efd;+}+```++## Step 4. Activating the theme++Refresh the application (Ctrl+Shift+R is a good way to do so) and go to settings. You should see the newly created theme:++++Afterwards the application will refresh itself with the new theme:++++Do note that the theme will be based off of the legacy theme. To override that and base the theme on the new TriliumNext theme, see: [Theme base (legacy vs. next)](Customize%20the%20Next%20theme.md)++## Step 5. Making changes++Simply go back to the note and change according to needs. To apply the changes to the current window, press <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>R</kbd> to refresh.++It's a good idea to keep two windows, one for editing and the other one for previewing the changes.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Theme development/Creating a custom theme_1_Creating a custom theme_im.png b/docs/User Guide/User Guide/Theme development/Creating a custom theme_1_Creating a custom theme_im.pngnew file mode 100644index 0000000000..81a9d35c8cBinary files /dev/null and b/docs/User Guide/User Guide/Theme development/Creating a custom theme_1_Creating a custom theme_im.png differdiff --git a/docs/User Guide/User Guide/Theme development/Creating a custom theme_2_Creating a custom theme_im.png b/docs/User Guide/User Guide/Theme development/Creating a custom theme_2_Creating a custom theme_im.pngnew file mode 100644index 0000000000..d352621496Binary files /dev/null and b/docs/User Guide/User Guide/Theme development/Creating a custom theme_2_Creating a custom theme_im.png differdiff --git a/docs/User Guide/User Guide/Theme development/Creating a custom theme_3_Creating a custom theme_im.png b/docs/User Guide/User Guide/Theme development/Creating a custom theme_3_Creating a custom theme_im.pngnew file mode 100644index 0000000000..743d51c8faBinary files /dev/null and b/docs/User Guide/User Guide/Theme development/Creating a custom theme_3_Creating a custom theme_im.png differdiff --git a/docs/User Guide/User Guide/Theme development/Creating a custom theme_4_Creating a custom theme_im.png b/docs/User Guide/User Guide/Theme development/Creating a custom theme_4_Creating a custom theme_im.pngnew file mode 100644index 0000000000..4f9583c7beBinary files /dev/null and b/docs/User Guide/User Guide/Theme development/Creating a custom theme_4_Creating a custom theme_im.png differdiff --git a/docs/User Guide/User Guide/Theme development/Creating a custom theme_5_Creating a custom theme_im.png b/docs/User Guide/User Guide/Theme development/Creating a custom theme_5_Creating a custom theme_im.pngnew file mode 100644index 0000000000..f2e63f1ec3Binary files /dev/null and b/docs/User Guide/User Guide/Theme development/Creating a custom theme_5_Creating a custom theme_im.png differdiff --git a/docs/User Guide/User Guide/Theme development/Creating a custom theme_Creating a custom theme_im.png b/docs/User Guide/User Guide/Theme development/Creating a custom theme_Creating a custom theme_im.pngnew file mode 100644index 0000000000..94afbf4249Binary files /dev/null and b/docs/User Guide/User Guide/Theme development/Creating a custom theme_Creating a custom theme_im.png differdiff --git a/docs/User Guide/User Guide/Theme development/Creating an icon pack.md b/docs/User Guide/User Guide/Theme development/Creating an icon pack.mdnew file mode 100644index 0000000000..7652458953--- /dev/null+++ b/docs/User Guide/User Guide/Theme development/Creating an icon pack.md@@ -0,0 +1,192 @@+# Creating an icon pack+> [!NOTE]+> This page explains, step‑by‑step, how to create a custom icon pack. For a general description of how to use already existing icon packs, see <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Themes/Icon%20Packs.md">Icon Packs</a>.++First read the quick flow to get the overall steps. After that there is a concrete example (Phosphor) with a small Node.js script you can run to generate the manifest.++## Quick flow (what you need to do)++1. Verify the icon set is a font (one of: .woff2, .woff, .ttf).+2. Obtain a list that maps icon names to Unicode code points (often provided as a JSON like `selection.json` or a CSS file).+3. Create a manifest JSON that maps icon ids to glyphs and search terms.+4. Create a Trilium note of type Code, set language to JSON, paste the manifest as the note content.+5. Upload the font file as an attachment to the same note (MIME type must be `font/woff2`, `font/woff`, or `font/ttf` and role `file`).+6. Add the label `#iconPack=<prefix>` to the note (prefix: letters, digits, hyphen, underscore and non-ASCII characters only).+7. Refresh the client and verify the icon pack appears in the icon selector.++## Verify the icon set++The first step is to analyze if the icon set being packed can be integrated into Trilium.++Trilium only supports **font-based icon sets**, with the following formats:++| Extension | MIME type | Description |+| --- | --- | --- |+| `.woff2` | `font/woff2` | Recommended due to great compression (low size). |+| `.woff` | `font/woff` | Higher compatibility, but the font file is bigger. |+| `.ttf` | `font/ttf` | Most common, but highest font size. |++Trilium **does not** support the following formats:++* SVG-based fonts.+* Individual SVGs.+* `.eot` fonts (legacy and proprietary).+* Duotone icons, since it requires a special CSS format that Trilium doesn't support.+* Any other font format not specified in the _Supported formats_ section.++In this case, the font must be manually converted to one of the supported formats (ideally `.woff2`).++## Manifest format++The manifest is a JSON object with an `icons` map. Each entry key is the CSS/class id you will use (Trilium uses the CSS class when rendering). Value object:++* glyph: the single character (the glyph) — can be the escaped Unicode (e.g. "\\ue9c2") or the literal character.+* terms: array of search aliases; the first term is used as display name in the selector.++Example minimal manifest:++```+{+ "icons": {+ "ph-acorn": {+ "glyph": "\uea3f",+ "terms": ["acorn", "nut"]+ },+ "ph-book": {+ "glyph": "\uea40",+ "terms": ["book", "read"]+ }+ }+}+```++> [!NOTE]+> * You can supply glyph as the escaped `\uXXXX` sequence or as the actual UTF‑8 character. The CSS form (`\ea3f`, as written in a stylesheet's `content`) is accepted too, so glyphs copied out of the font's own CSS work as they stand.+> * It is also possible to use the unescaped glyph inside the JSON. It will appear strange (e.g. ), but it will be rendered properly regardless.+> * The manifest keys (e.g. `ph-acorn`) should match the class names used by the font (prefix + name is a common pattern).+> * Like the prefix, a manifest key becomes a CSS class name, so it can contain only letters, digits, hyphens, underscores and non-ASCII characters. Punctuation and whitespace (e.g. `ph.acorn` or `ph acorn`) are not usable as class names; icons with such a key are skipped and an error is logged in <a class="reference-link" href="../Troubleshooting/Error%20logs/Backend%20(server)%20logs.md">Backend (server) logs</a>, while the rest of the pack still loads.++## Concrete example: Phosphor Icons++[Phosphor Icons](https://phosphoricons.com/) provide a `selection.json` that includes `properties.code` (the codepoint) and `properties.name` (the icon name). The goal: convert that into Trilium's manifest.++Sample `selection.json` excerpt:++```+{+ "icons": [+ {+ "icon": {+ "paths": [ /* [...] */ ],+ "grid": 0,+ "attrs": [{}],+ "isMulticolor": false,+ "isMulticolor2": false,+ "tags": ["acorn"]+ },+ "attrs": [{}],+ "properties": {+ "id": 0,+ "order": 1513,+ "name": "acorn",+ "code": 60314,+ "ligatures": "acorn",+ "prevSize": 16+ },+ "setIdx": 0,+ "setId": 0,+ "iconIdx": 0+ },+ /* [...] */+ ]+}+```++A tiny Node.js script to produce the manifest (place `selection.json` in the same directory and run with Node 20+):++```javascript+import { join } from "node:path";+import { readFileSync, writeFileSync } from "node:fs";++function processIconPack(packName) {+ const path = join(packName);+ const selectionMeta = JSON.parse(readFileSync(join(path, "selection.json"), "utf-8"));+ const icons = {};++ for (const icon of selectionMeta.icons) {+ let name = icon.properties.name;+ if (name.endsWith(`-${packName}`)) {+ name = name.split("-").slice(0, -1).join("-");+ }++ const id = `ph-${name}`;+ icons[id] = {+ glyph: `${String.fromCharCode(icon.properties.code)}`,+ terms: [ name ]+ };+ }++ writeFileSync("manifest.json", JSON.stringify(icons, null, 2), "utf8");+ console.log("manifest.json created");+}++processIconPack("light");+```++What to do with the script:++* Put `selection.json` and `build-manifest.js` in a folder.+* Run: node build-manifest.js+* The script writes `manifest.json` — open it, verify contents, then copy into a Trilium Code note (language: JSON).++> [!TIP]+> **Mind the escape format when processing CSS**+>+> The Unicode escape syntax is different in CSS (`"\ea3f"`) when compared to JSON (`"\uea3f"`). Notice how the JSON escape is `\u` and not `\`. Both forms are accepted: keep the CSS escape by writing the backslash itself as `"\\ea3f"` in the JSON, or convert it to the JSON escape `"\uea3f"`.+>+> As a more compact alternative, provide the un-escaped character directly, as UTF-8 is supported.++### Assigning the prefix++Before an icon pack can be used, it needs to have a prefix defined. This prefix uniquely identifies the icon pack so that it can be used throughout the application.++To do so, Trilium makes use of the same format that was used for the internal icon pack (Boxicons). For example, when an icon from Boxicons is set, it looks like this: `#iconClass="bx bxs-sushi"`. In this case, the icon pack prefix is `bx` and the icon class name is `bxs-sushi`.++In order for an icon pack to be recognized, the prefix must be specified in the `#iconPack` label.++For our example with Phosphor Icons, we can use the `ph` prefix since it also matches the prefix set in the original CSS. So in this case it would be `#iconPack=ph`.++> [!IMPORTANT]+> The prefix must consist of only letters, digits, hyphens, underscores and non-ASCII characters. If the prefix doesn't match these constraints, the icon pack will be ignored and an error will be logged in <a class="reference-link" href="../Troubleshooting/Error%20logs/Backend%20(server)%20logs.md">Backend (server) logs</a>.++## Creating the Trilium icon pack note++1. Create a note of type _Code_.+2. Set the language to _JSON_.+3. Rename the note. The name of the note will also be the name of the icon pack as displayed in the list of icons.+4. Copy and paste the manifest generated in the previous step as the content of this note.+5. Go to the [note attachment](../Basic%20Concepts%20and%20Features/Notes/Attachments.md) and upload the font file (in `.woff2`, `.woff`, `.ttf`) format.+ 1. Trilium identifies the font to use from attachments via the MIME type, make sure the MIME type is displayed correctly after uploading the attachment (for example `font/woff2`).+ 2. Make sure the `role` appears as `file`, otherwise the font will not be identified.+ 3. Multiple attachments are supported, but only one font will actually be used in Trilium's order of preference: `.woff2`, `.woff`, `.ttf`. As such, there's not much reason to upload more than one font per icon pack.+6. Add label: `#iconPack=<prefix>` (for Phosphor example: `#iconPack=ph`).++### Final steps++* [Refresh the client](../Troubleshooting/Refreshing%20the%20application.md)+ * Change the icon of the note and look for the _Filter_ icon in the top-right side.+ * Check if the new icon pack is displayed there and click on it to see the full list of icons.+ * Go through most of the items to look for issues such as missing icon, wrong names (some icons have aliases/terms that can cause issues).+* Optionally, assign an icon from the new icon pack to this note. This icon will be used in the icon pack filter for a visual distinction.+* The icon pack can then be [exported as ZIP](../Basic%20Concepts%20and%20Features/Import%20%26%20Export.md) in order to be distributed to other users.+ * It's important to note that icon packs are considered “unsafe” by default, so “Safe mode” must be disabled when importing the ZIP.+ * Consider linking new users to the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Themes/Icon%20Packs.md">Icon Packs</a> documentation in order to understand how to import and use an icon pack.++### Troubleshooting++If the icon pack doesn't show up, look through the <a class="reference-link" href="../Troubleshooting/Error%20logs/Backend%20(server)%20logs.md">Backend (server) logs</a> for clues.++* One example is if the font could not be retrieved: `ERROR: Icon pack is missing WOFF/WOFF2/TTF attachment: Boxicons v3 400 (dup) (XRzqDQ67fHEK)`.+* Make sure the prefix is unique and not already taken by some other icon pack. When there are two icon packs with the same prefix, only one is used. The server logs will indicate if this situation occurs.+* Make sure the prefix consists only of letters, digits, hyphens, underscores and non-ASCII characters.+* If the pack loads but individual icons are missing, check the logs for `Skipping icon '<key>' of icon pack` — that key uses characters outside the allowed set and needs renaming in the manifest.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Theme development/Custom app-wide CSS.md b/docs/User Guide/User Guide/Theme development/Custom app-wide CSS.mdnew file mode 100644index 0000000000..9530377530--- /dev/null+++ b/docs/User Guide/User Guide/Theme development/Custom app-wide CSS.md@@ -0,0 +1,79 @@+# Custom app-wide CSS+It is possible to provide a CSS file to be used regardless of the theme set by the user.++| | |+| --- | --- |+|  | Start by creating a new note and changing the note type to CSS |+|  | In the ribbon, press the “Owned Attributes” section and type `#appCss`. |+|  | Type the desired CSS. <br> <br>Generally it's a good idea to append `!important` for the styles that are being changed, in order to prevent other |++## Seeing the changes++Adding a new _app CSS note_ or modifying an existing one does not immediately apply changes. To see the changes, press Ctrl+Shift+R to refresh the page first.++## Sample use cases++### Customizing the printing stylesheet++> [!TIP]+> Since v0.99.2, it's no longer possible to use `#appCss` to customize the printing CSS, since the printing is now done in an isolated environment.+>+> However, it's still possible to customize the CSS via `~printCss`; see <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Notes/Printing%20%26%20Exporting%20as%20PDF.md">Printing & Exporting as PDF</a> for more information.++### Per-workspace styles++When using <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Navigation/Workspaces.md">Workspaces</a>, it can be helpful to create a visual distinction between notes in different workspaces.++To do so:++1. In the note with `#workspace`, add an inheritable attribute `#cssClass(inheritable)` with a value that uniquely identifies the workspace (say `my-workspace`).+2. Anywhere in the note structure, create a CSS note with `#appCss`.++#### Change the color of the icons in the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.md">Note Tree</a>++```+.fancytree-node.my-workspace.fancytree-custom-icon {+ color: #ff0000;+}+```++#### Change the color of the note title and the icon++To change the color of the note title and the icon (above the content):++```+.note-split.my-workspace .note-icon-widget button.note-icon,+.note-split.my-workspace .note-title-widget input.note-title {+ color: #ff0000;+}+```++#### Add a watermark to the note content++<figure class="image image-style-align-right image_resized" style="width:39.97%;"><img style="aspect-ratio:641/630;" src="1_Custom app-wide CSS_image.png" width="641" height="630"></figure>++1. Insert an image in any note and take the URL of the image.+2. Use the following CSS, adjusting the `background-image` and `width` and `height` to the desired values.++```+.note-split.my-workspace .scrolling-container:after {+ position: fixed;+ content: "";+ background-image: url("/api/attachments/Rvm3zJNITQI1/image/logo.png");+ background-size: contain;+ background-position: center;+ background-repeat: no-repeat;+ width: 237px;+ height: 44px;+ bottom: 1em;+ right: 1em;+ opacity: 0.5;+ z-index: 0;+}+```++## Limitations++Some parts of the application can't be styled directly via custom CSS because they are rendered in an isolated mode (shadow DOM), more specifically:++* The slides in a <a class="reference-link" href="../Collections/Presentation.md">Presentation</a>.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Theme development/Custom app-wide CSS_image.png b/docs/User Guide/User Guide/Theme development/Custom app-wide CSS_image.pngnew file mode 100644index 0000000000..dc6dcbefefBinary files /dev/null and b/docs/User Guide/User Guide/Theme development/Custom app-wide CSS_image.png differdiff --git a/docs/User Guide/User Guide/Theme development/Customize the Next theme.md b/docs/User Guide/User Guide/Theme development/Customize the Next theme.mdnew file mode 100644index 0000000000..752e6c6243--- /dev/null+++ b/docs/User Guide/User Guide/Theme development/Customize the Next theme.md@@ -0,0 +1,21 @@+# Customize the Next theme+By default, any custom theme will be based on the legacy light theme. To use the TriliumNext theme instead, add the `#appThemeBase=next` attribute onto the existing theme. The `appTheme` attribute must also be present.++++The `appThemeBase` label can be set to one of the following values:++* `next`, for the TriliumNext (auto light or dark mode).+* `next-light`, for the always light mode of the TriliumNext.+* `next-dark`, for the always dark mode of the TriliumNext.+* Any other value is ignored and will use the legacy white theme instead.++## Overrides++Do note that the TriliumNext theme has a few more overrides than the legacy theme. Due to that, it is recommended to use `#trilium-app` with a next theme instead of the `:root` of a legacy theme.++```css+#trilium-app {+ --launcher-pane-background-color: #0d6efd;+}+```\ No newline at end of filediff --git a/docs/User Guide/User Guide/Theme development/Customize the Next theme_image.png b/docs/User Guide/User Guide/Theme development/Customize the Next theme_image.pngnew file mode 100644index 0000000000..e397c87dc0Binary files /dev/null and b/docs/User Guide/User Guide/Theme development/Customize the Next theme_image.png differdiff --git a/docs/User Guide/User Guide/Theme development/Reference.md b/docs/User Guide/User Guide/Theme development/Reference.mdnew file mode 100644index 0000000000..33d9ec2519--- /dev/null+++ b/docs/User Guide/User Guide/Theme development/Reference.md@@ -0,0 +1,200 @@+# Reference+## Detecting mobile vs. desktop++The mobile layout is different than the one on the desktop. Use `body.mobile` and `body.desktop` to differentiate between them.++```css+body.mobile #root-widget {+ /* Do something on mobile */+}++body.desktop #root-widget {+ /* Do something on desktop */+}+```++Do note that there is also a “tablet mode” in the mobile layout. For that particular case media queries are required:++```css+@media (max-width: 991px) {++ #launcher-pane {++ /* Do something on mobile layout */++ }++}++++@media (min-width: 992px) {++ #launcher-pane {++ /* Do something on mobile tablet + desktop layout */++ }++}+```++## Detecting horizontal vs. vertical layout++The user can select between vertical layout (the classical one, where the launcher bar is on the left) and a horizontal layout (where the launcher bar is on the top and tabs are full-width).++Different styles can be applied by using classes at `body` level:++```+body.layout-vertical #left-pane {+ /* Do something */+}++body.layout-horizontal #center-pane {+ /* Do something else */+}+```++The two different layouts use different containers (but they are present in the DOM regardless of the user's choice), for example `#horizontal-main-container` and `#vertical-main-container` can be used to customize the background of the content section.++## Detecting platform (Windows, macOS) or Electron++It is possible to add particular styles that only apply to a given platform by using the classes in `body`:++| Windows | macOS |+| --- | --- |+| `<br>body.platform-win32 {<br> background: red;<br>}<br>` | `<br>body.platform-darwin {<br> background: red;<br>}<br>` |++It is also possible to only apply a style if running under Electron (desktop application):++```+body.electron {+ background: blue;+}+```++### Native title bar++It's possible to detect if the user has selected the native title bar or the custom title bar by querying against `body`:++```+body.electron.native-titlebar {+ /* Do something */+}++body.electron:not(.native-titlebar) {+ /* Do something else */+}+```++### Native window buttons++When running under Electron with native title bar off, a feature was introduced to use the platform-specific window buttons such as the semaphore on macOS.++See [Native title bar buttons by eliandoran · Pull Request #702 · TriliumNext/Notes](https://github.com/TriliumNext/Notes/pull/702) for the original implementation of this feature, including screenshots.++#### On Windows++The colors of the native window button area can be adjusted using a RGB hex color:++```+body {+ --native-titlebar-foreground: #ffffff;+ --native-titlebar-background: #ff0000;+}+```++It is also possible to use transparency at the cost of reduced hover colors using a RGBA hex color:++```+body {+ --native-titlebar-background: #ff0000aa;+}+```++Note that the value is read when the window is initialized and then it is refreshed only when the user changes their light/dark mode preference.++#### On macOS++On macOS the semaphore window buttons are enabled by default when the native title bar is disabled. The offset of the buttons can be adjusted using:++```css+body {+ --native-titlebar-darwin-x-offset: 12;+ --native-titlebar-darwin-y-offset: 14 !important;+}+```++### Background/transparency effects on Windows (Mica)++Windows 11 offers a special background/transparency effect called Mica, which can be enabled by themes by setting the `--background-material` variable at `body` level:++```css+body.electron.platform-win32 {+ --background-material: tabbed;+}+```++The value can be either `tabbed` (especially useful for the horizontal layout) or `mica` (ideal for the vertical layout).++Do note that the Mica effect is applied at `body` level and the theme needs to make the entire hierarchy (semi-)transparent in order for it to be visible. Use the TrilumNext theme as an inspiration.++## Note icons, tab workspace accent color++Theme capabilities are small adjustments done through CSS variables that can affect the layout or the visual aspect of the application.++In the tab bar, to display the icons of notes instead of the icon of the workspace:++```css+:root {+ --tab-note-icons: true;+}+```++When a workspace is hoisted for a given tab, it is possible to get the background color of that workspace, for example to apply a small strip on the tab instead of the whole background color:++```css+.note-tab .note-tab-wrapper {+ --tab-background-color: initial !important;+}++.note-tab .note-tab-wrapper::after {+ content: "";+ position: absolute;+ top: 0;+ left: 0;+ right: 0;+ height: 3px;+ background-color: var(--workspace-tab-background-color);+}+```++## Custom fonts++The recommended way of using customized fonts is to import a font directly in Trilium. See <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Themes/Personalizing%20the%20font.md">Personalizing the font</a> for information on how to do so.++Alternatively, for a theme providing its own font, [Custom resource providers](../Advanced%20Usage/Custom%20Resource%20Providers.md) can be used: Import a font into Trilium and assign it `#customResourceProvider=fonts/myfont.ttf` and then import the font in CSS via `/custom/fonts/myfont.ttf`. Use `../../../custom/fonts/myfont.ttf` if you run your Trilium server on a different path than `/`.++## Dark and light themes++A light theme needs to have the following CSS:++```css+:root {+ --theme-style: light;+}+```++if the theme is dark, then `--theme-style` needs to be `dark`.++If the theme is auto (e.g. supports both light or dark based on `prefers-color-scheme`) it must also declare (in addition to setting `--theme-style` to either `light` or `dark`):++```css+:root {++ --theme-style-auto: true;++}+```++This will affect the behavior of the Electron application by informing the operating system of the color preference (e.g. background effects will appear correct on Windows).\ No newline at end of filediff --git a/docs/User Guide/User Guide/Troubleshooting.md b/docs/User Guide/User Guide/Troubleshooting.mdnew file mode 100644index 0000000000..55453de4eb--- /dev/null+++ b/docs/User Guide/User Guide/Troubleshooting.md@@ -0,0 +1,53 @@+# Troubleshooting+While Trilium is actively maintained and stable, encountering bugs is possible.++## General Quick Fix++The first step in troubleshooting is often a restart.++If you experience an UI issue, the frontend may have entered an inconsistent state. Reload the application by pressing <kbd>Ctrl</kbd> + <kbd>R</kbd>. This will reload the frontend.++If the issue persists or appears to be a backend problem, restart the entire application. For the desktop (Electron) build, simply close and reopen the window. If you're using a Docker build, restart the container.++## Broken Note Crashes Trilium++Certain problems, such as rendering a note with a faulty script, can cause Trilium to crash. If Trilium attempts to reload the problematic note upon restart, it will continue to crash.++To resolve this, use the `TRILIUM_START_NOTE_ID` environment variable to reset the open tabs to a single specified note ID (e.g., `root`). In Linux, you can set it as follows:++```+TRILIUM_START_NOTE_ID=root ./trilium+```++## Broken Script Prevents Application Startup++If a custom script causes Trilium to crash, and it is set as a startup script or in an active [custom widget](Scripting/Frontend%20Basics/Custom%20Widgets.md), start Triliumin "safe mode" to prevent any custom scripts from executing:++```+TRILIUM_SAFE_MODE=true ./trilium+```++Depending on your Trilium distribution, you may have pre-made scripts available: `trilium-safe-mode.bat` and `trilium-safe-mode.sh`.++Once Trilium starts, locate and fix or delete the problematic note.++## Sync and Consistency Checks++Trilium periodically verifies the logical consistency of the database (e.g., ensuring every note has a parent). If inconsistencies are detected, you will be notified via the UI.++In such cases, file a bug report and attach an [anonymized database](Troubleshooting/Anonymized%20Database.md) if necessary.++## Restoring Backup++Trilium makes regular automatic backups. If issues become severe, you can [restore from a backup](Installation%20%26%20Setup/Backup.md).++## Forgotten Password++See <a class="reference-link" href="Installation%20%26%20Setup/Server%20Installation/Authentication/Resetting%20your%20password.md">Resetting your password</a>.++## Reporting Bugs++Reporting bugs is highly valuable. Here are some tips:++* Use GitHub issues for reporting: [https://github.com/TriliumNext/Trilium/issues](https://github.com/TriliumNext/Trilium/issues)+* Refer to the [error logs](Troubleshooting/Error%20logs.md) page for information on providing necessary details.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Troubleshooting/Anonymized Database.md b/docs/User Guide/User Guide/Troubleshooting/Anonymized Database.mdnew file mode 100644index 0000000000..051a28a83d--- /dev/null+++ b/docs/User Guide/User Guide/Troubleshooting/Anonymized Database.md@@ -0,0 +1,18 @@+# Anonymized Database+++In certain scenarios, understanding the structure of a database is crucial for troubleshooting issues. However, sharing your actual [database](../Advanced%20Usage/Database.md) file with personal notes is not advisable. To address this, Trilium offers a feature to anonymize the database. This feature can be accessed via Menu -> Options -> Advanced tab.++This feature creates a copy of your database with all sensitive data removed. Specifically, it strips out note titles, contents, revisions, history, and some non-system attributes while retaining the overall structure and metadata, such as modification dates. After anonymization, the database undergoes a [vacuuming process](https://sqlite.org/lang_vacuum.html) to ensure no sensitive data remnants remain in the file. The anonymized database is saved in the `anonymized` directory within the [data directory](../Installation%20%26%20Setup/Data%20directory.md), making it safe to share with bug reports.++This will create a copy of your document and remove all sensitive data (currently note titles, contents, revisions, history and some of the options, and non-system attributes) while leaving all structure and metadata (e.g. date of last change). After this is done, the database is [VACUUMed](https://sqlite.org/lang_vacuum.html) to make sure there's no stale sensitive data in the document file. The resulting file is stored in `anonymized` directory (placed in the [data directory](../Installation%20%26%20Setup/Data%20directory.md)). You can safely attach it to a bug report.++## Command Line Anonymization++If your [database](../Advanced%20Usage/Database.md) is corrupted to the point where Trilium cannot start, the anonymization process can still be executed via the command line:++```+node src/anonymize.js+```++Run this command from the directory containing Trilium's source files, typically found in the `resources/app` directory for desktop builds.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Troubleshooting/Anonymized Database_image.png b/docs/User Guide/User Guide/Troubleshooting/Anonymized Database_image.pngnew file mode 100644index 0000000000..fb640c0c9aBinary files /dev/null and b/docs/User Guide/User Guide/Troubleshooting/Anonymized Database_image.png differdiff --git a/docs/User Guide/User Guide/Troubleshooting/Error logs.md b/docs/User Guide/User Guide/Troubleshooting/Error logs.mdnew file mode 100644index 0000000000..90168427f2--- /dev/null+++ b/docs/User Guide/User Guide/Troubleshooting/Error logs.md@@ -0,0 +1,21 @@+# Error logs+It's important to provide all available error logs together with bug reports.++There are two types of error logs, both of which are useful when reporting bugs.++* <a class="reference-link" href="Error%20logs/Backend%20(server)%20logs.md">Backend (server) logs</a>+* <a class="reference-link" href="Error%20logs/Frontend%20logs.md">Frontend logs</a>++## Providing sensitive data++If you don't feel comfortable attaching the logs or anything sensitive to the public GitHub issues, feel free to contact the devs in our Matrix [support channel](https://github.com/TriliumNext/Trilium#-discuss-with-us).++Use this email to also provide anything which could assist in analysing the bug - e.g. files/images/ZIPs being imported or [anonymized database](Anonymized%20Database.md).++### Exporting note subtree for reproduction++Often times, bugs manifest themselves in specific notes and having them would greatly ease reproduction and fixing.++In such case, please export the relevant note subtree by right-clicking it on the left tree, choosing Export - HTML as ZIP:++\ No newline at end of filediff --git a/docs/User Guide/User Guide/Troubleshooting/Error logs/Backend (server) logs.md b/docs/User Guide/User Guide/Troubleshooting/Error logs/Backend (server) logs.mdnew file mode 100644index 0000000000..b9884b8104--- /dev/null+++ b/docs/User Guide/User Guide/Troubleshooting/Error logs/Backend (server) logs.md@@ -0,0 +1,39 @@+# Backend (server) logs+## Accessing via the backend log++In the <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Global%20menu.md">Global menu</a>, go to _Advanced_ → _Show backend log_. This will display the current backend log (i.e. today's), with the historical information available only on disk (see below).++Interaction since v0.104.0:++* The file can be downloaded as a text file using the dedicated button in the <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20buttons.md">Note buttons</a> area (<a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/New%20Layout.md">New Layout</a> only).+* The file can also be searched just like a normal <a class="reference-link" href="../../Note%20Types/Code.md">Code</a> note.++## Location on the disk++Backend logs are stored on the file system. To find them, open the <a class="reference-link" href="../../Installation%20%26%20Setup/Data%20directory.md">Data directory</a>, go to the `log` subdirectory and find the latest log file, e.g. `trilium-2022-12-14.log`.++## Reporting backend bugs++You can attach the whole file to the bug report (preferable) or open it and copy-paste only the last lines / lines you believe are relevant.++## Customizing the retention of logs++The backend logs are fully managed by the Trilium server. By default the last 90 days worth of logs are kept; the logs older than that are deleted in order to reduce the space consumption.++It's possible to change the retention period by modifying the <a class="reference-link" href="../../Advanced%20Usage/Configuration%20(config.ini%20or%20environment%20variables).md">Configuration (config.ini or environment variables)</a> via the `.ini` file:++```+[Logging]+retentionDays=7+```++Or via the environment variable `TRILIUM_LOGGING_RETENTION_DAYS`.++Special cases:++* Positive values indicate the number of days worth of logs to keep+* A value of 0 results with the default value (90 days) to be used+* Negative values (e.g. `-1`) result with all logs to be kept, irrespective how ancient and numerous (and++> [!NOTE]+> If you set the retention days to a low number, you might notice that not all the log files are being deleted. This is because a minimum number of logs (7 at the time of writing) is maintained at all times.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Troubleshooting/Error logs/Frontend logs.md b/docs/User Guide/User Guide/Troubleshooting/Error logs/Frontend logs.mdnew file mode 100644index 0000000000..60b724a711--- /dev/null+++ b/docs/User Guide/User Guide/Troubleshooting/Error logs/Frontend logs.md@@ -0,0 +1,15 @@+# Frontend logs+To provide frontend logs, we need to open the Developer Console. Often the easiest way is to press <kbd>Ctrl</kbd>\-<kbd>Shift</kbd>\-<kbd>I</kbd> which should work in most browsers (and desktop app). Make sure that the error producing action happened right before you copy&paste the errors, the console is cleared on app restart.++If that doesn't work, then:++* in Trilium desktop app, go to top-left menu button -> Advanced -> Open Dev Tools+* In Firefox/Chrome right-click anywhere in the page and click Inspect:++++Once you have Dev Tools open, click on "Console" tab:++++Copy-paste (or screenshot) the logs. It's better to provide not just errors, but the whole log, which might provide context while analyzing the bug.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Troubleshooting/Error logs/Frontend logs_error-logs-firefox-context-men.png b/docs/User Guide/User Guide/Troubleshooting/Error logs/Frontend logs_error-logs-firefox-context-men.pngnew file mode 100644index 0000000000..a6c45bb436Binary files /dev/null and b/docs/User Guide/User Guide/Troubleshooting/Error logs/Frontend logs_error-logs-firefox-context-men.png differdiff --git a/docs/User Guide/User Guide/Troubleshooting/Error logs/Frontend logs_image.png b/docs/User Guide/User Guide/Troubleshooting/Error logs/Frontend logs_image.pngnew file mode 100644index 0000000000..62a034e3fdBinary files /dev/null and b/docs/User Guide/User Guide/Troubleshooting/Error logs/Frontend logs_image.png differdiff --git a/docs/User Guide/User Guide/Troubleshooting/Error logs_error-logs-export-subtree.png b/docs/User Guide/User Guide/Troubleshooting/Error logs_error-logs-export-subtree.pngnew file mode 100644index 0000000000..65abe49999Binary files /dev/null and b/docs/User Guide/User Guide/Troubleshooting/Error logs_error-logs-export-subtree.png differdiff --git a/docs/User Guide/User Guide/Troubleshooting/Refreshing the application.md b/docs/User Guide/User Guide/Troubleshooting/Refreshing the application.mdnew file mode 100644index 0000000000..5720ae9e14--- /dev/null+++ b/docs/User Guide/User Guide/Troubleshooting/Refreshing the application.md@@ -0,0 +1,4 @@+# Refreshing the application+Some changes to the application will not take effect immediately and as such it might require to manually reload or refresh the application.++To do so, simply press <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>R</kbd>.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Troubleshooting/Reporting issues.md b/docs/User Guide/User Guide/Troubleshooting/Reporting issues.mdnew file mode 100644index 0000000000..65f2e00818--- /dev/null+++ b/docs/User Guide/User Guide/Troubleshooting/Reporting issues.md@@ -0,0 +1,4 @@+# Reporting issues+Go to [Issues · TriliumNext/Trilium](https://github.com/TriliumNext/Trilium/issues) and press “New issue”.++If you are reporting a bug, select “Bug Report” and fill in the details.\ No newline at end of filediff --git a/docs/User Guide/User Guide/Troubleshooting/Synchronization fails with 504 Gateway Timeout.md b/docs/User Guide/User Guide/Troubleshooting/Synchronization fails with 504 Gateway Timeout.mdnew file mode 100644index 0000000000..f7a5861f1b--- /dev/null+++ b/docs/User Guide/User Guide/Troubleshooting/Synchronization fails with 504 Gateway Timeout.md@@ -0,0 +1,21 @@+# Synchronization fails with 504 Gateway Timeout+Synchronization can sometimes take a long amount of time in order to compute the items that require update. When running behind a reverse proxy, the request can time out.++The solution is to increase the timeout at proxy level.++## Nginx++Add the following to the configuration file:++```nginx+proxy_connect_timeout 300;+proxy_send_timeout 300;+proxy_read_timeout 300;+send_timeout 300;+```++And restart the server.++See [Nginx Proxy Setup](../Installation%20%26%20Setup/Server%20Installation/2.%20Reverse%20proxy/Nginx.md) for more information about the Nginx setup.++If it still doesn't work, try increasing the timeout.\ No newline at end of file