Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit 4ea82bb

Browse files
authored
Merge branch 'develop' into deps_express5
2 parents 26d5462 + 43c2818 commit 4ea82bb

File tree

139 files changed

+5617
-1561
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+5617
-1561
lines changed

docs/User Guide/!!!meta.json

Lines changed: 1533 additions & 464 deletions
Large diffs are not rendered by default.

docs/User Guide/User Guide/Advanced Usage/Advanced Showcases/Task Manager.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ New tasks are created in the TODO note which has `~child:template` [relation](..
1515

1616
### Attributes
1717

18-
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.
18+
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.
1919

2020
### New task button
2121

docs/User Guide/User Guide/Advanced Usage/Advanced Showcases/Weight Tracker.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Weight Tracker
22
![](Weight%20Tracker_image.png)
33

4-
The `Weight Tracker` is a [Script API](../../Note%20Types/Code/Script%20API.md) showcase present in the [demo notes](../Database.md).
4+
The `Weight Tracker` is a [Script API](../../Scripting/Script%20API.md) showcase present in the [demo notes](../Database.md).
55

66
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.
77

docs/User Guide/User Guide/Advanced Usage/Attributes.md

Lines changed: 14 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,28 @@
11
# Attributes
2+
<figure class="image"><img style="aspect-ratio:1071/146;" src="Attributes_image.png" width="1071" height="146"></figure>
3+
24
In Trilium, attributes are key-value pairs assigned to notes, providing additional metadata or functionality. There are two primary types of attributes:
35

4-
1. **Labels**: Simple key-value text records
5-
2. **Relations**: Named links to other notes
6+
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.
7+
8+
For more information, including predefined labels, see <a class="reference-link" href="Attributes/Labels.md">Labels</a>.
9+
10+
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.
11+
12+
For more information, including a list of predefined relations, see <a class="reference-link" href="Attributes/Relations.md">Relations</a>.
13+
614

715
These attributes play a crucial role in organizing, categorising, and enhancing the functionality of notes.
816

9-
![](Attributes_image.png)
10-
11-
## Labels
12-
13-
Labels in Trilium can be used for a variety of purposes:
14-
15-
* **Metadata**: Assign labels with optional values for categorization, such as `#year=1999`, `#genre="sci-fi"`, or `#author="Neal Stephenson"`
16-
* **Configuration**: Labels can configure advanced features or settings
17-
* **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>.
18-
19-
Labels are also searchable, enhancing note retrieval.
20-
21-
### Common Labels for Advanced Configuration
22-
23-
* `disableVersioning`: Disables automatic versioning, ideal for large, unimportant notes like script libraries
24-
* `versioningLimit`: Used to limit the number of revisions for a single note
25-
* `calendarRoot`: Marks the note as the root for [day notes](Advanced%20Showcases/Day%20Notes.md). Only one note should carry this label
26-
* `archived`: Hides notes from default search results and dialogs
27-
* `excludeFromExport`: Excludes notes and their subtrees from export operations
28-
* `run`: Specifies events to trigger scripts (e.g., `frontendStartup`, `hourly`)
29-
* `runAtHour`: Defines specific hours for scripts to run, used with `#run=hourly`
30-
* `disableInclusion`: Prevents a script from being included in parent script executions
31-
* `sorted`: Automatically sorts child notes alphabetically by title
32-
* `top`: Keeps the note at the top of its parent's list, useful with `sorted`
33-
* `hidePromotedAttributes`: Hides certain attributes in the note's display
34-
* `readOnly`: Sets the note to read-only mode, applicable to text and code notes
35-
* `autoReadOnlyDisabled`: Disables automatic read-only mode for large notes
36-
* `appCss`: Marks CSS notes used to modify Trilium’s appearance
37-
* `appTheme`: Marks full CSS themes available in Trilium's options
38-
* `cssClass`: Adds a CSS class to the note's representation in the tree
39-
* `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>.
40-
* `pageSize`: Specifies the number of items per page in note listings
41-
* `customRequestHandler` **and** `customResourceProvider`: Refer to <a class="reference-link" href="Custom%20Request%20Handler.md">Custom Request Handler</a>
42-
* `widget`: Marks a note as a custom widget, added to Trilium's component tree
43-
* `workspace` **and related attributes**: See <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Navigation/Workspace.md">Workspace</a> for more details
44-
* `searchHome`: Specifies the parent for new search notes
45-
* `inbox`: Designates a default location for new notes created via the sidebar
46-
* `sqlConsoleHome`: Default location for SQL console notes
47-
* `bookmarked` **and** `bookmarkFolder`: See <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Navigation/Bookmarks.md">Bookmarks</a>
48-
* `share:[…]`: See <a class="reference-link" href="Sharing.md">Sharing</a>
49-
* `keyboardShortcut`: Assigns a keyboard shortcut to open the note
50-
* `displayRelations` **and** `hideRelations`: Manages the display of note relations
51-
* `titleTemplate`: See <a class="reference-link" href="Default%20Note%20Title.md">Default Note Title</a>
52-
* `template`: Makes the note available as a template
53-
* `toc`: Controls the visibility of the table of contents
54-
* `color`: Defines the color of the note in the tree and links
55-
* `hideChildrenOverview`: Hides child notes in the parent note's editor
56-
* `viewType`: Sets the view of child notes (grid or list)
57-
58-
## Relations
59-
60-
Relations define connections between notes, similar to links.
61-
62-
### Uses
63-
64-
* **Metadata Relationships**: For example, linking a book note to an author note
65-
* **Scripting**: Attaching scripts to events or conditions related to the note
17+
## Viewing the list of attributes
6618

67-
### Common Relations
19+
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.
6820

69-
* **Event-based Relations**: Such as `runOnNoteCreation` or `runOnNoteChange`, which trigger scripts on specific actions
70-
* **Other Relations**: Include `template`, `renderNote`, `widget`, and sharing-related relations
21+
In the list of attributes, labels are prefixed with the `#` character whereas relations are prefixed with the `~` character.
7122

7223
## Multiplicity
7324

74-
Attributes in Trilium can be "multivalued", meaning multiple attributes with the same name can coexist.
25+
Attributes in Trilium can be "multi-valued", meaning multiple attributes with the same name can co-exist.
7526

7627
## Attribute Definitions and Promoted Attributes
7728

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,38 @@
11
# Attribute Inheritance
2-
## 1\. Standard Inheritance
2+
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).
3+
4+
## Standard Inheritance
35

46
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.
57

6-
### Example Use Case
8+
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.
9+
10+
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.
711

8-
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.
12+
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.
913

10-
## 2\. Copying Inheritance
14+
## Copying Inheritance
1115

1216
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.
1317

14-
### How to Use
18+
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.
19+
20+
Similarly, for relations use `~child:myRelation`.
21+
22+
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.
23+
24+
### Chained inheritance
25+
26+
It is possible to define labels across multiple levels of depth. For example, `#child:child:child:foo` applied to a root note would create:
1527

16-
* **Syntax:** `#child:attributeName`
17-
* **Chained Inheritance:** You can chain this inheritance, such as `#child:child:attributeName`, where each child down the hierarchy receives the appropriate attribute.
28+
* `#child:child:foo` on the first-level children.
29+
* `#child:foo` on the second-level children.
30+
* `#foo` on the third-level children.
1831

19-
### Example
32+
Similarly, use `~child:child:child:foo` if dealing with relations.
2033

21-
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.
34+
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.
2235

23-
## 3\. Template Inheritance
36+
## Template Inheritance
2437

25-
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.
38+
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.

0 commit comments

Comments
 (0)