Merge remote-tracking branch 'origin/develop' into calendar

This commit is contained in:
Elian Doran
2025-04-10 21:25:42 +03:00
255 changed files with 7006 additions and 2387 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -15,7 +15,7 @@ New tasks are created in the TODO note which has `~child:template` [relation](..
### Attributes
Task template defines several [promoted attributes](../Attributes/Promoted%20Attributes.md) - todoDate, doneDate, tags, location. Importantly it also defines `~runOnAttributeChange` relation - [event](../../Note%20Types/Code/Events.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.
Task template defines several [promoted attributes](../Attributes/Promoted%20Attributes.md) - todoDate, doneDate, tags, location. Importantly it also defines `~runOnAttributeChange` relation - [event](../../Scripting/Events.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

View File

@@ -1,7 +1,7 @@
# Weight Tracker
![](Weight%20Tracker_image.png)
The `Weight Tracker` is a [Script API](../../Note%20Types/Code/Script%20API.md) showcase present in the [demo notes](../Database.md).
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.

View File

@@ -1,77 +1,28 @@
# 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. **Labels**: Simple key-value text records
2. **Relations**: Named links to other notes
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 behaviour 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, categorising, and enhancing the functionality of notes.
![](Attributes_image.png)
## Viewing the list of attributes
## Labels
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.
Labels in Trilium can be used for a variety of purposes:
* **Metadata**: Assign labels with optional values for categorization, such as `#year=1999`, `#genre="sci-fi"`, or `#author="Neal Stephenson"`
* **Configuration**: Labels can configure advanced features or settings
* **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>.
Labels are also searchable, enhancing note retrieval.
### Common Labels for Advanced Configuration
* `disableVersioning`: Disables automatic versioning, ideal for large, unimportant notes like script libraries
* `versioningLimit`: Used to limit the number of revisions for a single note
* `calendarRoot`: Marks the note as the root for [day notes](Advanced%20Showcases/Day%20Notes.md). Only one note should carry this label
* `archived`: Hides notes from default search results and dialogs
* `excludeFromExport`: Excludes notes and their subtrees from export operations
* `run`: Specifies events to trigger scripts (e.g., `frontendStartup`, `hourly`)
* `runAtHour`: Defines specific hours for scripts to run, used with `#run=hourly`
* `disableInclusion`: Prevents a script from being included in parent script executions
* `sorted`: Automatically sorts child notes alphabetically by title
* `top`: Keeps the note at the top of its parent's list, useful with `sorted`
* `hidePromotedAttributes`: Hides certain attributes in the note's display
* `readOnly`: Sets the note to read-only mode, applicable to text and code notes
* `autoReadOnlyDisabled`: Disables automatic read-only mode for large notes
* `appCss`: Marks CSS notes used to modify Triliums appearance
* `appTheme`: Marks full CSS themes available in Trilium's options
* `cssClass`: Adds a CSS class to the note's representation in the tree
* `iconClass`: Adds a CSS class to the note's icon, useful for distinguishing notes visually. See <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Notes/Note%20Icons.md">Note Icons</a>.
* `pageSize`: Specifies the number of items per page in note listings
* `customRequestHandler` **and** `customResourceProvider`: Refer to <a class="reference-link" href="Custom%20Request%20Handler.md">Custom Request Handler</a>
* `widget`: Marks a note as a custom widget, added to Trilium's component tree
* `workspace` **and related attributes**: See <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Navigation/Workspace.md">Workspace</a> for more details
* `searchHome`: Specifies the parent for new search notes
* `inbox`: Designates a default location for new notes created via the sidebar
* `sqlConsoleHome`: Default location for SQL console notes
* `bookmarked` **and** `bookmarkFolder`: See <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Navigation/Bookmarks.md">Bookmarks</a>
* `share:[…]`: See <a class="reference-link" href="Sharing.md">Sharing</a>
* `keyboardShortcut`: Assigns a keyboard shortcut to open the note
* `displayRelations` **and** `hideRelations`: Manages the display of note relations
* `titleTemplate`: See <a class="reference-link" href="Default%20Note%20Title.md">Default Note Title</a>
* `template`: Makes the note available as a template
* `toc`: Controls the visibility of the table of contents
* `color`: Defines the color of the note in the tree and links
* `hideChildrenOverview`: Hides child notes in the parent note's editor
* `viewType`: Sets the view of child notes (grid or list)
## Relations
Relations define connections between notes, similar to links.
### Uses
* **Metadata Relationships**: For example, linking a book note to an author note
* **Scripting**: Attaching scripts to events or conditions related to the note
### Common Relations
* **Event-based Relations**: Such as `runOnNoteCreation` or `runOnNoteChange`, which trigger scripts on specific actions
* **Other Relations**: Include `template`, `renderNote`, `widget`, and sharing-related relations
In the list of attributes, labels are prefixed with the `#` character whereas relations are prefixed with the `~` character.
## Multiplicity
Attributes in Trilium can be "multivalued", meaning multiple attributes with the same name can coexist.
Attributes in Trilium can be "multi-valued", meaning multiple attributes with the same name can co-exist.
## Attribute Definitions and Promoted Attributes

View File

@@ -1,25 +1,38 @@
# Attribute Inheritance
## 1\. Standard 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.
### Example Use Case
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.
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.
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.
## 2\. Copying Inheritance
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.
### How to Use
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.
* **Syntax:** `#child:attributeName`
* **Chained Inheritance:** You can chain this inheritance, such as `#child:child:attributeName`, where each child down the hierarchy receives the appropriate attribute.
Similarly, for relations use `~child:myRelation`.
### Example
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.
If a parent note has the label `#child:exampleAttribute`, all newly created child notes will inherit the `#exampleAttribute` label. This can be useful for setting default properties for notes in a specific section.
### Chained inheritance
## 3\. Template 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:
Attributes can also be inherited from [templates](../Templates.md). 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.
* `#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.

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,44 @@
# 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.
> [!TIP]
> Some relations presented here end with a `*`. That means that there are multiple relations with the same prefix, consult the specific page linked in the description of that relation for more information.
<figure class="table" style="width:100%;"><table class="ck-table-resized"><colgroup><col style="width:33.95%;"><col style="width:66.05%;"></colgroup><thead><tr><th>Label</th><th>Description</th></tr></thead><tbody><tr><td><code>runOn*</code></td><td>See&nbsp;<a class="reference-link" href="../../Scripting/Events.md">Events</a></td></tr><tr><td><code>template</code></td><td>note's attributes will be inherited even without a parent-child relationship, note's content and subtree will be added to instance notes if empty. See documentation for details.</td></tr><tr><td><code>inherit</code></td><td>note's attributes will be inherited even without a parent-child relationship. See&nbsp;<a class="reference-link" href="../Templates.md">Templates</a>&nbsp;for a similar concept. See&nbsp;<a class="reference-link" href="Attribute%20Inheritance.md">Attribute Inheritance</a>&nbsp;in the documentation.</td></tr><tr><td><code>renderNote</code></td><td>notes of type&nbsp;<a class="reference-link" href="../../Note%20Types/Render%20Note.md">Render Note</a>&nbsp;will be rendered using a code note (HTML or script) and it is necessary to point using this relation to which note should be rendered</td></tr><tr><td><code>widget_relation</code></td><td>target of this relation will be executed and rendered as a widget in the sidebar</td></tr><tr><td><code>shareCss</code></td><td>CSS note which will be injected into the share page. CSS note must be in the shared sub-tree as well. Consider using <code>share_hidden_from_tree</code> and <code>share_omit_default_css</code> as well.</td></tr><tr><td><code>shareJs</code></td><td>JavaScript note which will be injected into the share page. JS note must be in the shared sub-tree as well. Consider using <code>share_hidden_from_tree</code>.</td></tr><tr><td><code>shareTemplate</code></td><td>Embedded JavaScript note that will be used as the template for displaying the shared note. Falls back to the default template. Consider using <code>share_hidden_from_tree</code>.</td></tr><tr><td><code>shareFavicon</code></td><td>Favicon note to be set in the shared page. Typically you want to set it to share root and make it inheritable. Favicon note must be in the shared sub-tree as well. Consider using <code>share_hidden_from_tree</code>.</td></tr></tbody></table></figure>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

@@ -0,0 +1,87 @@
# Bulk Actions
<figure class="image"><img style="aspect-ratio:1425/654;" src="Bulk Actions_image.png" width="1425" height="654"></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.md">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.
* **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)
```

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

View File

@@ -1,16 +0,0 @@
# Bulk actions
### Execute script
For more complex scenarios, it is possible to type in a JavaScript expression in order to apply the necessary changes.
To apply a suffix (`- suffix` in this example), to the note title:
```javascript
note.title = note.title + " - suffix";
```
To alter attributes of a note in a bulk action, such as setting the `#shareAlias` label to the title of the note:
```javascript
note.setLabel("shareAlias", note.title)
```

View File

@@ -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.

View File

@@ -53,7 +53,7 @@ Trilium will then find our code note created above and execute it. `api.req`, `a
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](../Note%20Types/Code/Script%20API.md).
Once we pass these checks we will just create the desired note using [Script API](../Scripting/Script%20API.md).
## Custom resource provider

View File

@@ -17,14 +17,16 @@ And all children of "2022 Books" will be created with initial title "\[Author na
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.
As an example, imagine you collect server outage incidents and write some notes. It looks like this:
Second variable injected is `parentNote` which gives access to the parent [`FNote`](../Scripting/Script%20API/Frontend%20API/FNote.md).
* Incidents
* 2022-05-09: System crash
* 2022-05-15: Backup delay
See also <a class="reference-link" href="Templates.md">Templates</a> which provides similar capabilities, including default note's content.
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.
### Examples
Second variable injected is [parentNote](https://triliumnext.github.io/Notes/backend_api/BNote.html), an example could be `#titleTemplate="${parentNote.getLabelValue('authorName')}'s literary works"`.
See also \[\[[template](Templates.md)\]\] which provides similar capabilities, including default note's content.
* 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}`

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

View File

@@ -3,7 +3,7 @@ Trilium allows you to share selected notes as **publicly accessible** read-only
## Prerequisites
To use the sharing feature, you must have a [server installation](../Installation%20%26%20Setup/Server%20Installation.md) of Trilium. This is necessary because the notes will be hosted from the server.
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.
## How to Share a Note
@@ -40,7 +40,7 @@ To protect shared notes with a username and password, you can use the `#shareCre
The default shared page is basic in design, but you can customize it using your own CSS:
* **Custom CSS**: Link a CSS [code note](../Note%20Types/Code.md) 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.
* **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
@@ -81,12 +81,6 @@ To customize the favicon for your shared pages, create a relation `~shareFavicon
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. Consider combining this with the `#shareIndex` label, which will display a list of all shared notes.
## Additional Options
* **Raw Note Sharing**: Use the `#shareRaw` label to share a note without any HTML wrapper.
* **Disallow Robot Indexing**: Add the `#shareDisallowRobotIndexing` label to prevent search engines from indexing the shared page by including a `noindex, follow` meta tag and `X-Robots-Tag: noindex` header.
* **Shared Notes Index**: For text notes with the `#shareIndex` label, the content will display a list of all shared note roots.
## Limitations
While the sharing feature is powerful, it has some limitations:
@@ -98,4 +92,8 @@ While the sharing feature is powerful, it has some limitations:
* **Protected Notes**: Cannot be shared.
* **Include Notes**: Not supported.
Some of these limitations may be addressed in future updates.
Some of these limitations may be addressed in future updates.
## Attribute reference
<figure class="table"><table><thead><tr><th>Attribute</th><th>Description</th></tr></thead><tbody><tr><td><code>shareHiddenFromTree</code></td><td>this note is hidden from left navigation tree, but still accessible with its URL</td></tr><tr><td><code>shareExternalLink</code></td><td>note will act as a link to an external website in the share tree</td></tr><tr><td><code>shareAlias</code></td><td>define an alias using which the note will be available under <code>https://your_trilium_host/share/[your_alias]</code></td></tr><tr><td><code>shareOmitDefaultCss</code></td><td>default share page CSS will be omitted. Use when you make extensive styling changes.</td></tr><tr><td><code>shareRoot</code></td><td>marks note which is served on /share root.</td></tr><tr><td><code>shareDescription</code></td><td>define text to be added to the HTML meta tag for description</td></tr><tr><td><code>shareRaw</code></td><td>Note will be served in its raw format, without HTML wrapper. See also&nbsp;<a class="reference-link" href="Sharing/Serving%20directly%20the%20content%20o.md">Serving directly the content of a note</a>&nbsp;for an alternative method without setting an attribute.</td></tr><tr><td><code>shareDisallowRobotIndexing</code></td><td><p>Indicates to web crawlers that the page should not be indexed of this note by:</p><ul><li>Setting the <code>X-Robots-Tag: noindex</code> HTTP header.</li><li>Setting the <code>noindex, follow</code> meta tag.</li></ul></td></tr><tr><td><code>shareCredentials</code></td><td>require credentials to access this shared note. Value is expected to be in format <code>username:password</code>. Don't forget to make this inheritable to apply to child-notes/images.</td></tr><tr><td><code>shareIndex</code></td><td>Note with this label will list all roots of shared notes.</td></tr></tbody></table></figure>

View File

@@ -23,7 +23,7 @@ To create an instance note through the UI:
![show child note templates](Templates_template-create-.png)
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/Workspace.md), you can also mark templates with `#workspaceTemplate` to display them only in the workspace.
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.

View File

@@ -1,5 +1,5 @@
# Markdown
Trilium Notes supports importing Markdown restricted to the [CommonMark specification](https://spec.commonmark.org/current/) (where [tables are not supported](https://github.com/TriliumNext/Notes/issues/2026))
Trilium supports Markdown for both import and export, while trying to keep compatibility as high as possible.
## Import
@@ -38,4 +38,13 @@ If you want to export just single note without its subtree, you can do it from N
### 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.
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
* [GitHub-Flavored Markdown](https://github.github.com/gfm/) is the main syntax that Trilium is following.
* Images are supported. 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 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.
* <a class="reference-link" href="../../Note%20Types/Text/Admonitions.md">Admonitions</a> are supported using GitHub's format.
* Links are supported. “Reference links” (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 are supported using `$` and `$$` syntaxes.

View File

@@ -5,4 +5,4 @@ Hoisting is a standard outliner feature which allows you to focus on (or "zoom i
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](Workspace.md) which extends this feature.
See also [Workspace](Workspaces.md) which extends this feature.

View File

@@ -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`).

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -1,13 +1,59 @@
# Search
## Local Search
Local search allows you to search within the currently displayed note. To initiate a local search, press <kbd>Ctrl</kbd> + <kbd>F</kbd>. If using a web browser, this will be handled by the browser's native search functionality. In the desktop (electron) version, a separate dialog will apear.
## Note 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.
To search for notes, click on the magnifying glass icon on the toolbar or press the <kbd>Ctrl</kbd> + <kbd>S</kbd> keyboard [shortcut](../Keyboard%20Shortcuts.md).
## 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>.
## 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 ad-literam, 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>.
## 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.
### Simple Note Search Examples

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

View File

@@ -1,24 +0,0 @@
# Workspace
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: 
![](1_Workspace_image.png)
* visual identification of workspace in tabs:
![](Workspace_image.png)
### How to use workspaces
Let's say you have identified the workspaces and their subtrees. Define on the root of this subtree following labels:
* `#workspace` - Marks this note as a workspace, button to enter the workspace is controlled by this
* `#workspaceIconClass` - controls the box icon to be displayed in the tree and tabs, example `bx bx-home`. See [https://boxicons.com/](https://boxicons.com/)
* `#workspaceTabBackgroundColor` - Background color of the tab, 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. If there's no such note, the global calendar will be used.
* `#workspaceTemplate` - This note will appear in the selection of available templates when creating a new note, but only when you are currently hoisted into a workspace containing this template.

View File

@@ -0,0 +1,18 @@
# 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: 
![](1_Workspaces_image.png)
* visual identification of workspace in tabs:
![](Workspaces_image.png)
### Configuration
<figure class="table"><table><thead><tr><th>Label</th><th>Description</th></tr></thead><tbody><tr><td><code>workspace</code></td><td>Marks this note as a workspace, button to enter the workspace is controlled by this</td></tr><tr><td><code>workspaceIconClass</code></td><td>defines box icon CSS class which will be used in tab when hoisted to this note</td></tr><tr><td><code>workspaceTabBackgroundColor</code></td><td>CSS color used in the note tab when hoisted to this note, use any CSS color format, e.g. "lightblue" or "#ddd". See <a href="https://www.w3schools.com/cssref/css_colors.asp">https://www.w3schools.com/cssref/css_colors.asp</a>.</td></tr><tr><td><code>workspaceCalendarRoot</code></td><td>Marking a note with this label will define a new per-workspace calendar for&nbsp;<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.</td></tr><tr><td><code>workspaceTemplate</code></td><td>This note will appear in the selection of available template when creating new note, but only when hoisted into a workspace containing this template</td></tr><tr><td><code>workspaceSearchHome</code></td><td>new search notes will be created as children of this note when hoisted to some ancestor of this workspace note</td></tr><tr><td><code>workspaceInbox</code></td><td>default inbox location for new notes when hoisted to some ancestor of this workspace note</td></tr></tbody></table></figure>

View File

@@ -23,7 +23,7 @@ Tree structure of notes can resemble file system - but compared to that notes in
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 Recent Changes 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.
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, it's 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.
@@ -33,4 +33,4 @@ After the 7 days (configurable) the notes will be "erased" - their title, conten
## See also
* [Read-only note](Notes/Read-Only%20Notes.md)
* <a class="reference-link" href="Notes/Read-Only%20Notes.md">Read-Only Notes</a>

View File

@@ -51,10 +51,6 @@ As seen in the demo, you can view the list of all available clones in the "Note
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.
## Prefix
Since notes can be categorized into multiple places, 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 tree pane.
## Deleting notes/clones
With clones, it might not be immediately obvious how deleting works.

View File

@@ -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.

View File

@@ -1,6 +1,11 @@
# Note List
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
By default, the notes will be displayed in a grid, however there are also some other view types available.

View File

@@ -1,7 +1,14 @@
# Sorting Notes
## Sorting Notes
## Manual sorting
You can sort notes by right-clicking the parent note in the note tree and selecting Advanced -> Sort notes by ... This will sort existing notes, but will not automatically sort future notes added to this parent note
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.
* Changing sorting direction can also be adjusted (ascending or descending).
* Ensuring folders are displayed at the top.
* Natural sort, based on the sorting rules of a particular language.
## Automatic/Permanent Sorting

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

View File

@@ -56,7 +56,7 @@ Right click either the _Available launchers_ or _Visible launchers_ sections and
2. Optionally, set a `keyboardShortcut` to trigger the launcher.
3. **Custom Widget**
Allows defining a custom widget to be rendered inside the launcher. See [Widget Basics](../../Scripting/Widget%20Basics.md) for more information.
Allows defining a custom widget to be rendered inside the launcher. See [Widget Basics](../../Scripting/Custom%20Widgets/Widget%20Basics.md) for more information.
4. **Spacers**
Launchers that create some distance between other launchers for better visual distinction.

View File

@@ -1,7 +1,7 @@
# Note Tree
This page explains how to manipulate the note tree in TriliumNext, focusing on moving notes.
![](1_Note%20Tree_image.png)
![](Note%20Tree_image.png)
## Drag and Drop
@@ -22,12 +22,4 @@ You can easily rearrange the note tree by dragging and dropping notes, as demons
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).
## Multiple selection
It is possible to select multiple notes at one time.
To do so, first select the note to start the selection with. Then hold Shift 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.
![](Note%20Tree_image.png)
In the right-click menu, operations such as Cut, Copy, Move to, Clone to or Delete will apply to all the selected notes. It is also possible to apply [Bulk actions](../../Advanced%20Usage/Bulk%20actions.md) to them. The rest of the options will not be available and will appear disabled in the menu.
See <a class="reference-link" href="Note%20Tree/Note%20tree%20contextual%20menu.md">Note Tree Menu</a> for more information.

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

View File

@@ -0,0 +1,8 @@
# Multiple selection
It is possible to select multiple notes at one time.
To do so, first select the note to start the selection with. Then hold Shift 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.
![](Multiple%20selection_image.png)
In the right-click menu, operations such as Cut, Copy, Move to, Clone to or Delete will apply to all the selected notes. It is also possible to apply <a class="reference-link" href="../../../Advanced%20Usage/Bulk%20Actions.md">Bulk Actions</a> to them. The rest of the options will not be available and will appear disabled in the menu.

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

@@ -0,0 +1,94 @@
# Note tree contextual menu
<figure class="image image-style-align-right"><img style="aspect-ratio:372/760;" src="1_Note tree contextual menu_.png" width="372" height="760"></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.
* **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) dialog and places the imported notes as child notes of the selected one.
* **Export**
* Opens the [export](../../Import%20%26%20Export) 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:289/355;" src="Note tree contextual menu_.png" width="289" height="355"></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.
* **Duplicate subtree**
* 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>.
* **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.

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -0,0 +1,14 @@
# Recent Changes
<figure class="image image-style-align-center image_resized" style="width:50%;"><img style="aspect-ratio:988/572;" src="1_Recent Changes_image.png" width="988" height="572"></figure>
## Accessing the recent changes
* For an overview of the changes across all documents, press the <img src="Recent Changes_image.png" width="25" height="21"> button in the <a class="reference-link" href="Launch%20Bar.md">Launch Bar</a>.
* If there is a [hoisted note](../Navigation/Note%20Hoisting.md) or a [workspace](../Navigation/Workspaces.md), the list of recent changes will be limited to the descendents of the hoisted note, or the workspace.
* To limit the list of recent changes to a note and its descendants, look for the corresponding option in the <a class="reference-link" href="Note%20Tree/Note%20tree%20contextual%20menu.md">Note tree contextual menu</a> → Advanced.
## Interaction
* Notes which were changed will appear in reverse chronological order (latest update first).
* The title of the note is displayed, as well as the note path. Clicking on the note title will dismiss the dialog and navigate to that particular note.
* Deleted notes will also be listed here, at their time of deletion. Press the _Undelete_ link next to them in order to recover them.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -61,4 +61,6 @@ This section displays information about the current note:
### 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.
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.

View File

@@ -1,29 +0,0 @@
# Events
[Script](../../Scripting.md) notes can be triggered by events. Note that these are backend events and thus relation need to point to the "JS backend" code note.
## Global events
Global events are attached to the script note via label. Simply create e.g. "run" label with some of these values and script note will be executed once the event occurs.
* `run`
* `frontendStartup` - executes on frontend upon startup
* `mobileStartup` - executes on mobile frontend upon startup
* `backendStartup` - executes on backend upon startup
* `hourly` - executes once an hour on backend
* `daily` - executes once a day on backend
## 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).
* `runOnNoteCreation` - executes when note is created on backend
* `runOnNoteTitleChange` - executes when note title is changed (includes note creation as well)
* `runOnNoteContentChange` - executes when note content is changed (includes note creation as well).
* `runOnNoteChange` - executes when note is changed (includes note creation as well)
* `runOnNoteDeletion` - executes when note is being 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.
* `runOnBranchChange` (since v0.62) - executes when a branch is changed - either expanded status or prefix are changed.
* `runOnBranchDeletion` - executes when a branch is delete. Branch is a link between parent note and child note and is deleted e.g. when moving note (old branch/link is deleted).
* `runOnChildNoteCreation` - executes when new note is created under _this_ note
* `runOnAttributeCreation` - executes when new attribute is created under _this_ note
* `runOnAttributeChange` - executes when attribute is changed under _this_ note

View File

@@ -5,4 +5,4 @@ Trilium allows you to save common searches as notes within the note tree. The se
## 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/Workspace.md), you can use the `#workspaceSearchHome` label to specify a storage location for saved searches within that workspace.
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.

View File

@@ -1,5 +1,5 @@
# 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="Note%20Types/Code/Script%20API.md">Script API</a> provide extra functionality.
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.
## Scripting
@@ -34,8 +34,8 @@ You can see more scripting with explanation in <a class="reference-link" href="
## Events
See <a class="reference-link" href="Note%20Types/Code/Events.md">Events</a>.
See <a class="reference-link" href="Scripting/Events.md">Events</a>.
## Script API
See <a class="reference-link" href="Note%20Types/Code/Script%20API.md">Script API</a>.
See <a class="reference-link" href="Scripting/Script%20API.md">Script API</a>.

View File

@@ -22,10 +22,10 @@ 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).
2. Assign the `#widget` [attribute](../../Advanced%20Usage/Attributes.md) to the [note](../../Basic%20Concepts%20and%20Features/Notes.md).
3. Restart Trilium or reload the window.
To verify that the widget is working, open the developer tools (`Cmd` + `Shift` + `I`) and run `document.querySelector("#my-widget")`. If the element is found, the widget is functioning correctly. If `undefined` is returned, double-check that the [note](../Basic%20Concepts%20and%20Features/Notes.md) has the `#widget` [attribute](../Advanced%20Usage/Attributes.md).
To verify that the widget is working, open the developer tools (`Cmd` + `Shift` + `I`) and run `document.querySelector("#my-widget")`. If the element is found, the widget is functioning correctly. If `undefined` is returned, double-check that the [note](../../Basic%20Concepts%20and%20Features/Notes.md) has the `#widget` [attribute](../../Advanced%20Usage/Attributes.md).
### Step 2: Adding an UI Element
@@ -85,7 +85,7 @@ After reloading Trilium, the button should now appear at the bottom left of the
### Step 4: Adding User Interaction
Lets make the button interactive by showing a message when its clicked. We'll use the `api.showMessage` method from the [Script API](../Note%20Types/Code/Script%20API.md).
Lets make the button interactive by showing a message when its clicked. We'll use the `api.showMessage` method from the [Script API](../Script%20API.md).
```
class MyWidget extends api.BasicWidget {

View File

@@ -1,8 +1,8 @@
# 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>.
> 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="../../Code.md">Code</a> note of type JS frontend and **give it a** `#widget` **label**.
Create a <a class="reference-link" href="../../Note%20Types/Code.md">Code</a> note of type JS frontend and **give it a** `#widget` **label**.
```
/*
@@ -82,7 +82,7 @@ class WordCountWidget extends api.NoteContextAwareWidget {
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.
After you make changes it is necessary to [restart Trilium](../../Troubleshooting/Refreshing%20the%20application.md) so that the layout can be rebuilt.
At the bottom of the note you can see the resulting widget:

View File

@@ -0,0 +1,14 @@
# Events
[Script](../Scripting.md) notes can be triggered by events. Note that these are backend events and thus relation need to point to the "JS backend" code note.
## Global events
Global events are attached to the script note via label. Simply create e.g. "run" label with some of these values and script note will be executed once the event occurs.
<figure class="table"><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>frontendStartup</code> - when Trilium frontend starts up (or is refreshed), but not on mobile.</li><li><code>mobileStartup</code> - when Trilium frontend starts up (or is refreshed), on mobile.</li><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&nbsp;<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></figure>
## 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).
<figure class="table"><table><thead><tr><th>Relation</th><th>Description</th></tr></thead><tbody><tr><td><code>runOnNoteCreation</code></td><td>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.</td></tr><tr><td><code>runOnChildNoteCreation</code></td><td>executes when new note is created under the note where this relation is defined</td></tr><tr><td><code>runOnNoteTitleChange</code></td><td>executes when note title is changed (includes note creation as well)</td></tr><tr><td><code>runOnNoteContentChange</code></td><td>executes when note content is changed (includes note creation as well).</td></tr><tr><td><code>runOnNoteChange</code></td><td>executes when note is changed (includes note creation as well). Does not include content changes</td></tr><tr><td><code>runOnNoteDeletion</code></td><td>executes when note is being deleted</td></tr><tr><td><code>runOnBranchCreation</code></td><td>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.</td></tr><tr><td><code>runOnBranchChange</code></td><td>executes when a branch is updated. (since v0.62)</td></tr><tr><td><code>runOnBranchDeletion</code></td><td>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).</td></tr><tr><td><code>runOnAttributeCreation</code></td><td>executes when new attribute is created for the note which defines this relation</td></tr><tr><td><code>runOnAttributeChange</code></td><td>executes when the attribute is changed of a note which defines this relation. This is triggered also when the attribute is deleted</td></tr></tbody></table></figure>

View File

@@ -1,7 +1,7 @@
# Frontend Basics
## Frontend API
The frontend api supports two styles, regular scripts that are run with the current app and note context, and widgets that export an object to Trilium to be used in the UI. In both cases, the frontend api of Trilium is available to scripts running in the frontend context as global variable `api`. The members and methods of the api can be seen on the [Script API](../Note%20Types/Code/Script%20API.md) page.
The frontend api supports two styles, regular scripts that are run with the current app and note context, and widgets that export an object to Trilium to be used in the UI. In both cases, the frontend api of Trilium is available to scripts running in the frontend context as global variable `api`. The members and methods of the api can be seen on the [Script API](Script%20API.md) page.
## Scripts
@@ -54,4 +54,4 @@ Conversely to scripts, widgets do have some specific requirements in order to wo
### Tutorial
For more information on building widgets, take a look at [Widget Basics](Widget%20Basics.md).
For more information on building widgets, take a look at [Widget Basics](Custom%20Widgets/Widget%20Basics.md).

View File

@@ -21,7 +21,7 @@ TRILIUM_START_NOTE_ID=root ./trilium
## Broken Script Prevents Application Startup
If a custom script causes Triliumto crash, and it is set as a startup script or in an active [custom widget](Note%20Types/Code/Custom%20Widgets.md), start Triliumin "safe mode" to prevent any custom scripts from executing:
If a custom script causes Triliumto crash, and it is set as a startup script or in an active [custom widget](Scripting/Custom%20Widgets.md), start Triliumin "safe mode" to prevent any custom scripts from executing:
```
TRILIUM_SAFE_MODE=true ./trilium