diff --git a/docs/User Guide/!!!meta.json b/docs/User Guide/!!!meta.json index b4f83e5be..58bdb0538 100644 --- a/docs/User Guide/!!!meta.json +++ b/docs/User Guide/!!!meta.json @@ -6732,25 +6732,347 @@ { "type": "relation", "name": "internalLink", - "value": "Ucmcs8SfrYdD", + "value": "HI6GBBIduIgv", "isInheritable": false, "position": 120 + }, + { + "type": "relation", + "name": "internalLink", + "value": "Cq5X6iKQop6R", + "isInheritable": false, + "position": 130 } ], "format": "markdown", "dataFileName": "Attributes.md", "attachments": [ { - "attachmentId": "P4eRVtGFoHh2", + "attachmentId": "4YqnV7iugVCJ", "title": "image.png", "role": "image", - "mime": "image/jpg", + "mime": "image/png", "position": 10, "dataFileName": "Attributes_image.png" } ], "dirFileName": "Attributes", "children": [ + { + "isClone": false, + "noteId": "HI6GBBIduIgv", + "notePath": [ + "pOsGYCXsbNQG", + "tC7s2alapj8V", + "zEY4DaJG4YT5", + "HI6GBBIduIgv" + ], + "title": "Labels", + "notePosition": 10, + "prefix": null, + "isExpanded": false, + "type": "text", + "mime": "text/html", + "attributes": [ + { + "type": "relation", + "name": "internalLink", + "value": "zEY4DaJG4YT5", + "isInheritable": false, + "position": 10 + }, + { + "type": "relation", + "name": "internalLink", + "value": "BlN9DFI679QC", + "isInheritable": false, + "position": 20 + }, + { + "type": "relation", + "name": "internalLink", + "value": "bwZpz2ajCEwO", + "isInheritable": false, + "position": 30 + }, + { + "type": "label", + "name": "iconClass", + "value": "bx bx-hash", + "isInheritable": false, + "position": 40 + }, + { + "type": "relation", + "name": "internalLink", + "value": "vZWERwf8U3nx", + "isInheritable": false, + "position": 60 + }, + { + "type": "relation", + "name": "internalLink", + "value": "l0tKav7yLHGF", + "isInheritable": false, + "position": 70 + }, + { + "type": "relation", + "name": "internalLink", + "value": "oPVyFC7WL2Lp", + "isInheritable": false, + "position": 80 + }, + { + "type": "relation", + "name": "internalLink", + "value": "GPERMystNGTB", + "isInheritable": false, + "position": 90 + }, + { + "type": "relation", + "name": "internalLink", + "value": "OFXdgB2nNk1F", + "isInheritable": false, + "position": 100 + }, + { + "type": "relation", + "name": "internalLink", + "value": "CoFPLs3dRlXc", + "isInheritable": false, + "position": 110 + }, + { + "type": "relation", + "name": "internalLink", + "value": "AlhDUqhENtH7", + "isInheritable": false, + "position": 120 + }, + { + "type": "relation", + "name": "internalLink", + "value": "pKK96zzmvBGf", + "isInheritable": false, + "position": 130 + }, + { + "type": "relation", + "name": "internalLink", + "value": "WFGzWeUK6arS", + "isInheritable": false, + "position": 140 + }, + { + "type": "relation", + "name": "internalLink", + "value": "0ESUbbAxVnoK", + "isInheritable": false, + "position": 150 + }, + { + "type": "relation", + "name": "internalLink", + "value": "J5Ex1ZrMbyJ6", + "isInheritable": false, + "position": 160 + }, + { + "type": "relation", + "name": "internalLink", + "value": "d3fAXQ2diepH", + "isInheritable": false, + "position": 170 + }, + { + "type": "relation", + "name": "internalLink", + "value": "MgibgPcfeuGz", + "isInheritable": false, + "position": 180 + }, + { + "type": "relation", + "name": "internalLink", + "value": "m523cpzocqaD", + "isInheritable": false, + "position": 190 + }, + { + "type": "relation", + "name": "internalLink", + "value": "9sRHySam5fXb", + "isInheritable": false, + "position": 200 + }, + { + "type": "relation", + "name": "internalLink", + "value": "_help_YKWqdJhzi2VY", + "isInheritable": false, + "position": 210 + }, + { + "type": "relation", + "name": "internalLink", + "value": "u3YFHC9tQlpm", + "isInheritable": false, + "position": 220 + }, + { + "type": "relation", + "name": "internalLink", + "value": "R9pX4DGra2Vt", + "isInheritable": false, + "position": 230 + }, + { + "type": "relation", + "name": "internalLink", + "value": "iRwzGnHPzonm", + "isInheritable": false, + "position": 240 + }, + { + "type": "relation", + "name": "internalLink", + "value": "BCkXAVs63Ttv", + "isInheritable": false, + "position": 250 + }, + { + "type": "relation", + "name": "internalLink", + "value": "47ZrP6FNuoG8", + "isInheritable": false, + "position": 260 + }, + { + "type": "relation", + "name": "internalLink", + "value": "KC1HB96bqqHX", + "isInheritable": false, + "position": 270 + }, + { + "type": "relation", + "name": "internalLink", + "value": "BFvAtE74rbP6", + "isInheritable": false, + "position": 280 + }, + { + "type": "relation", + "name": "internalLink", + "value": "bdUJEHsAPYQR", + "isInheritable": false, + "position": 290 + }, + { + "type": "relation", + "name": "internalLink", + "value": "AxshuNRegLAv", + "isInheritable": false, + "position": 300 + }, + { + "type": "relation", + "name": "internalLink", + "value": "81SGnPGMk7Xc", + "isInheritable": false, + "position": 310 + }, + { + "type": "relation", + "name": "internalLink", + "value": "xWbu3jpNWapp", + "isInheritable": false, + "position": 320 + } + ], + "format": "markdown", + "dataFileName": "Labels.md", + "attachments": [] + }, + { + "isClone": false, + "noteId": "Cq5X6iKQop6R", + "notePath": [ + "pOsGYCXsbNQG", + "tC7s2alapj8V", + "zEY4DaJG4YT5", + "Cq5X6iKQop6R" + ], + "title": "Relations", + "notePosition": 20, + "prefix": null, + "isExpanded": false, + "type": "text", + "mime": "text/html", + "attributes": [ + { + "type": "relation", + "name": "internalLink", + "value": "HI6GBBIduIgv", + "isInheritable": false, + "position": 10 + }, + { + "type": "label", + "name": "iconClass", + "value": "bx bx-transfer", + "isInheritable": false, + "position": 20 + }, + { + "type": "relation", + "name": "internalLink", + "value": "BlN9DFI679QC", + "isInheritable": false, + "position": 30 + }, + { + "type": "relation", + "name": "internalLink", + "value": "bwZpz2ajCEwO", + "isInheritable": false, + "position": 40 + }, + { + "type": "relation", + "name": "internalLink", + "value": "oPVyFC7WL2Lp", + "isInheritable": false, + "position": 50 + }, + { + "type": "relation", + "name": "internalLink", + "value": "GPERMystNGTB", + "isInheritable": false, + "position": 60 + }, + { + "type": "relation", + "name": "internalLink", + "value": "KC1HB96bqqHX", + "isInheritable": false, + "position": 70 + }, + { + "type": "relation", + "name": "internalLink", + "value": "HcABDtFCkbFN", + "isInheritable": false, + "position": 80 + } + ], + "format": "markdown", + "dataFileName": "Relations.md", + "attachments": [] + }, { "isClone": false, "noteId": "bwZpz2ajCEwO", @@ -6761,7 +7083,7 @@ "bwZpz2ajCEwO" ], "title": "Attribute Inheritance", - "notePosition": 10, + "notePosition": 30, "prefix": null, "isExpanded": false, "type": "text", @@ -6787,6 +7109,20 @@ "value": "bx bx-list-plus", "isInheritable": false, "position": 30 + }, + { + "type": "relation", + "name": "internalLink", + "value": "HI6GBBIduIgv", + "isInheritable": false, + "position": 40 + }, + { + "type": "relation", + "name": "internalLink", + "value": "Cq5X6iKQop6R", + "isInheritable": false, + "position": 50 } ], "format": "markdown", @@ -6803,7 +7139,7 @@ "OFXdgB2nNk1F" ], "title": "Promoted Attributes", - "notePosition": 20, + "notePosition": 40, "prefix": null, "isExpanded": false, "type": "text", @@ -6858,237 +7194,6 @@ "dataFileName": "Promoted Attributes_promot.png" } ] - }, - { - "isClone": false, - "noteId": "Ucmcs8SfrYdD", - "notePath": [ - "pOsGYCXsbNQG", - "tC7s2alapj8V", - "zEY4DaJG4YT5", - "Ucmcs8SfrYdD" - ], - "title": "Attribute Reference", - "notePosition": 30, - "prefix": null, - "isExpanded": false, - "type": "text", - "mime": "text/html", - "attributes": [ - { - "type": "relation", - "name": "internalLink", - "value": "l0tKav7yLHGF", - "isInheritable": false, - "position": 10 - }, - { - "type": "relation", - "name": "internalLink", - "value": "bwZpz2ajCEwO", - "isInheritable": false, - "position": 20 - }, - { - "type": "relation", - "name": "internalLink", - "value": "vZWERwf8U3nx", - "isInheritable": false, - "position": 30 - }, - { - "type": "relation", - "name": "internalLink", - "value": "oPVyFC7WL2Lp", - "isInheritable": false, - "position": 40 - }, - { - "type": "relation", - "name": "internalLink", - "value": "OFXdgB2nNk1F", - "isInheritable": false, - "position": 50 - }, - { - "type": "relation", - "name": "internalLink", - "value": "CoFPLs3dRlXc", - "isInheritable": false, - "position": 60 - }, - { - "type": "relation", - "name": "internalLink", - "value": "WFGzWeUK6arS", - "isInheritable": false, - "position": 70 - }, - { - "type": "relation", - "name": "internalLink", - "value": "J5Ex1ZrMbyJ6", - "isInheritable": false, - "position": 80 - }, - { - "type": "relation", - "name": "internalLink", - "value": "d3fAXQ2diepH", - "isInheritable": false, - "position": 90 - }, - { - "type": "relation", - "name": "internalLink", - "value": "MgibgPcfeuGz", - "isInheritable": false, - "position": 100 - }, - { - "type": "relation", - "name": "internalLink", - "value": "BFvAtE74rbP6", - "isInheritable": false, - "position": 110 - }, - { - "type": "relation", - "name": "internalLink", - "value": "bdUJEHsAPYQR", - "isInheritable": false, - "position": 120 - }, - { - "type": "relation", - "name": "internalLink", - "value": "KC1HB96bqqHX", - "isInheritable": false, - "position": 130 - }, - { - "type": "relation", - "name": "internalLink", - "value": "HcABDtFCkbFN", - "isInheritable": false, - "position": 140 - }, - { - "type": "relation", - "name": "internalLink", - "value": "9sRHySam5fXb", - "isInheritable": false, - "position": 160 - }, - { - "type": "relation", - "name": "internalLink", - "value": "u3YFHC9tQlpm", - "isInheritable": false, - "position": 170 - }, - { - "type": "relation", - "name": "internalLink", - "value": "R9pX4DGra2Vt", - "isInheritable": false, - "position": 180 - }, - { - "type": "relation", - "name": "internalLink", - "value": "pKK96zzmvBGf", - "isInheritable": false, - "position": 220 - }, - { - "type": "relation", - "name": "internalLink", - "value": "AlhDUqhENtH7", - "isInheritable": false, - "position": 230 - }, - { - "type": "relation", - "name": "internalLink", - "value": "0ESUbbAxVnoK", - "isInheritable": false, - "position": 240 - }, - { - "type": "relation", - "name": "internalLink", - "value": "m523cpzocqaD", - "isInheritable": false, - "position": 250 - }, - { - "type": "relation", - "name": "internalLink", - "value": "_help_YKWqdJhzi2VY", - "isInheritable": false, - "position": 260 - }, - { - "type": "relation", - "name": "internalLink", - "value": "iRwzGnHPzonm", - "isInheritable": false, - "position": 270 - }, - { - "type": "relation", - "name": "internalLink", - "value": "BCkXAVs63Ttv", - "isInheritable": false, - "position": 280 - }, - { - "type": "relation", - "name": "internalLink", - "value": "47ZrP6FNuoG8", - "isInheritable": false, - "position": 290 - }, - { - "type": "relation", - "name": "internalLink", - "value": "81SGnPGMk7Xc", - "isInheritable": false, - "position": 300 - }, - { - "type": "relation", - "name": "internalLink", - "value": "GPERMystNGTB", - "isInheritable": false, - "position": 310 - }, - { - "type": "relation", - "name": "internalLink", - "value": "AxshuNRegLAv", - "isInheritable": false, - "position": 320 - }, - { - "type": "relation", - "name": "internalLink", - "value": "xWbu3jpNWapp", - "isInheritable": false, - "position": 330 - }, - { - "type": "label", - "name": "iconClass", - "value": "bx bx-book-bookmark", - "isInheritable": false, - "position": 340 - } - ], - "format": "markdown", - "dataFileName": "Attribute Reference.md", - "attachments": [] } ] }, diff --git a/docs/User Guide/User Guide/Advanced Usage/Attributes.md b/docs/User Guide/User Guide/Advanced Usage/Attributes.md index 9e61ff648..18b556bd1 100644 --- a/docs/User Guide/User Guide/Advanced Usage/Attributes.md +++ b/docs/User Guide/User Guide/Advanced Usage/Attributes.md @@ -1,12 +1,12 @@ # Attributes 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. Labels: Simple key-value text records +2. Relations: Named links to other notes These attributes play a crucial role in organizing, categorising, and enhancing the functionality of notes. -![](Attributes_image.png) +
## Labels @@ -18,26 +18,22 @@ Labels in Trilium can be used for a variety of purposes: Labels are also searchable, enhancing note retrieval. -### Common Labels for Advanced Configuration - -See the corresponding section in Attribute Reference for a comprehensive list of attributes. +For more information, including predefined labels, see Labels. ## Relations Relations define connections between notes, similar to links. -### Uses +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 - -See the corresponding section in Attribute Reference for a comprehensive list of relations. +For more information, including a list of predefined relations, see Relations. ## 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 diff --git a/docs/User Guide/User Guide/Advanced Usage/Attributes/Attribute Inheritance.md b/docs/User Guide/User Guide/Advanced Usage/Attributes/Attribute Inheritance.md index 28e1baf1f..a96b04b99 100644 --- a/docs/User Guide/User Guide/Advanced Usage/Attributes/Attribute Inheritance.md +++ b/docs/User Guide/User Guide/Advanced Usage/Attributes/Attribute Inheritance.md @@ -1,11 +1,13 @@ # 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). + ## 1\. 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 Labels or Relations. 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 diff --git a/docs/User Guide/User Guide/Advanced Usage/Attributes/Attribute Reference.md b/docs/User Guide/User Guide/Advanced Usage/Attributes/Labels.md similarity index 81% rename from docs/User Guide/User Guide/Advanced Usage/Attributes/Attribute Reference.md rename to docs/User Guide/User Guide/Advanced Usage/Attributes/Labels.md index 1edca7486..e34003a54 100644 --- a/docs/User Guide/User Guide/Advanced Usage/Attributes/Attribute Reference.md +++ b/docs/User Guide/User Guide/Advanced Usage/Attributes/Labels.md @@ -1,14 +1,36 @@ -# Attribute Reference -## Labels +# Labels +A label is an [attribute](../Attributes.md) of a note which has a name and optionally a value.  + +## Creating a label using the visual editor + +1. Go to the _Owned Attributes_ section in the Ribbon. +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 Attribute Inheritance for more information. + +## Creating a label manually + +In the _Owned Attributes_ section in the Ribbon: + +* 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. -
LabelDescription
disableVersioningDisables automatic creation of Note Revisions for a particular note. Useful for e.g. large, but unimportant notes - e.g. large JS libraries used for scripting.
versioningLimitLimits the maximum number of Note Revisions for a particular note, overriding the global settings.
calendarRootMarks the note which should be used as root for Day Notes. Only one should be marked as such.
archivedHides notes from default search results and dialogs. Archived notes can optionally be hidden in the Note Tree.
excludeFromExportExcludes this note and its children when exporting.
run, runOnInstance, runAtHourSee Events.
disableInclusionScripts with this label won't be included into parent script execution.
sorted

Keeps child notes sorted by title alphabetically.

When given a value, it will sort by the value of another label instead. If one of the child notes doesn't have the specified label, the title will be used for them instead.

sortDirection

If sorted is applied, specifies the direction of the sort:

  • ASC, ascending (default)
  • DESC, descending
sortFoldersFirstIf sorted is applied, folders (notes with children) will be sorted as a group at the top, and the rest will be sorted.
topIf sorted is applied to the parent note, keeps given note on top in its parent.
hidePromotedAttributesHide Promoted Attributes on this note. Generally useful when defining inherited attributes, but the parent note doesn't need them.
readOnlyMarks a note to be always be read-only, if it's a supported note (text, code, mermaid).
autoReadOnlyDisabledDisables automatic read-only mode for the given note.
appCssMarks CSS notes which are loaded into the Trilium application and can thus be used to modify Trilium's looks. See Custom app-wide CSS for more info.
appThemeMarks CSS notes which are full Trilium themes and are thus available in Trilium options. See Theme development for more information.
appThemeBaseSet 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 Customize the Next theme for more information.
cssClassValue of this label is then added as CSS class to the node representing given note in the Note Tree. This can be useful for advanced theming. Can be used in template notes.
iconClassvalue 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.
pageSizeSpecifies the number of items per page in Note List.
customRequestHandlerSee Custom Request Handler.
customResourceProviderSee Custom Resource Providers.
widgetMarks this note as a custom widget which will be added to the Trilium component tree. See Custom Widgets for more information.
searchHomeNew search notes will be created as children of this note (see Saved Search).
workspace and related attributesSee Workspaces.
inboxdefault inbox location for new notes - when you create a note using new note button in the sidebar, notes will be created as child notes in the note marked as with #inbox label.
sqlConsoleHomeDefault location of SQL Console notes
bookmarkedIndicates this note is a bookmark.
bookmarkFolderNote with this label will appear in bookmarks as folder (allowing access to its children). See Bookmarks for more information.
share*See the attribute reference in Sharing.
displayRelations, hideRelationsComma delimited names of relations which should be displayed/hidden in a Relation Map (both the note type and the Note Map (Link map, Tree map) 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.

Examples:

  • ${parentNote.getLabel('authorName')}'s literary works
  • Log for ${now.format('YYYY-MM-DD HH:mm:ss')}
  • to mirror the parent's template.

See Default Note Title for more info.

templateThis note will appear in the selection of available template when creating new note. See Templates for more information.
tocControls the display of the Table of contents for a given note. #toc or #toc=show to always display the table of contents, #toc=false to always hide it.
colordefines color of the note in note tree, links etc. Use any valid CSS color value like 'red' or #a13d5f
keyboardShortcutDefines a keyboard shortcut which will immediately jump to this note. Example: 'ctrl+alt+e'. Requires frontend reload for the change to take effect.
keepCurrentHoistingOpening this link won't change hoisting even if the note is not displayable in the current hoisted subtree.
executeButtonTitle of the button which will execute the current code note
executeDescriptionLonger description of the current code note displayed together with the execute button
excludeFromNoteMapNotes with this label will be hidden from the Note Map.
newNotesOnTopNew notes will be created at the top of the parent note, not on the bottom.
hideHighlightWidgetHides the Highlights list widget
hideChildrenOverviewHides the Note List for that particular note.
printLandscapeWhen exporting to PDF, changes the orientation of the page to landscape instead of portrait.
printPageSizeWhen exporting to PDF, changes the size of the page. Supported values: A0, A1, A2, A3, A4, A5, A6, Legal, Letter, Tabloid, Ledger.
geolocationIndicates the latitude and longitude of a note, to be displayed in a Geo Map.
calendar:*Defines specific options for the Calendar View.
viewTypeSets the view of child notes (e.g. grid or list). See Note List for more information.
- -## Relations - -> [!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. - -
LabelDescription
runOn*See Events
templatenote'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.
inheritnote's attributes will be inherited even without a parent-child relationship. See Templates for a similar concept. See Attribute Inheritance in the documentation.
renderNotenotes of type Render Note 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_relationtarget of this relation will be executed and rendered as a widget in the sidebar
shareCssCSS note which will be injected into the share page. CSS note must be in the shared sub-tree as well. Consider using share_hidden_from_tree and share_omit_default_css as well.
shareJsJavaScript note which will be injected into the share page. JS note must be in the shared sub-tree as well. Consider using share_hidden_from_tree.
shareTemplateEmbedded JavaScript note that will be used as the template for displaying the shared note. Falls back to the default template. Consider using share_hidden_from_tree.
shareFaviconFavicon 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 share_hidden_from_tree.
\ No newline at end of file +
LabelDescription
disableVersioningDisables automatic creation of Note Revisions for a particular note. Useful for e.g. large, but unimportant notes - e.g. large JS libraries used for scripting.
versioningLimitLimits the maximum number of Note Revisions for a particular note, overriding the global settings.
calendarRootMarks the note which should be used as root for Day Notes. Only one should be marked as such.
archivedHides notes from default search results and dialogs. Archived notes can optionally be hidden in the Note Tree.
excludeFromExportExcludes this note and its children when exporting.
run, runOnInstance, runAtHourSee Events.
disableInclusionScripts with this label won't be included into parent script execution.
sorted

Keeps child notes sorted by title alphabetically.

When given a value, it will sort by the value of another label instead. If one of the child notes doesn't have the specified label, the title will be used for them instead.

sortDirection

If sorted is applied, specifies the direction of the sort:

  • ASC, ascending (default)
  • DESC, descending
sortFoldersFirstIf sorted is applied, folders (notes with children) will be sorted as a group at the top, and the rest will be sorted.
topIf sorted is applied to the parent note, keeps given note on top in its parent.
hidePromotedAttributesHide Promoted Attributes on this note. Generally useful when defining inherited attributes, but the parent note doesn't need them.
readOnlyMarks a note to be always be read-only, if it's a supported note (text, code, mermaid).
autoReadOnlyDisabledDisables automatic read-only mode for the given note.
appCssMarks CSS notes which are loaded into the Trilium application and can thus be used to modify Trilium's looks. See Custom app-wide CSS for more info.
appThemeMarks CSS notes which are full Trilium themes and are thus available in Trilium options. See Theme development for more information.
appThemeBaseSet 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 Customize the Next theme for more information.
cssClassValue of this label is then added as CSS class to the node representing given note in the Note Tree. This can be useful for advanced theming. Can be used in template notes.
iconClassvalue 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.
pageSizeSpecifies the number of items per page in Note List.
customRequestHandlerSee Custom Request Handler.
customResourceProviderSee Custom Resource Providers.
widgetMarks this note as a custom widget which will be added to the Trilium component tree. See Custom Widgets for more information.
searchHomeNew search notes will be created as children of this note (see Saved Search).
workspace and related attributesSee Workspaces.
inboxdefault inbox location for new notes - when you create a note using new note button in the sidebar, notes will be created as child notes in the note marked as with #inbox label.
sqlConsoleHomeDefault location of SQL Console notes
bookmarkedIndicates this note is a bookmark.
bookmarkFolderNote with this label will appear in bookmarks as folder (allowing access to its children). See Bookmarks for more information.
share*See the attribute reference in Sharing.
displayRelations, hideRelationsComma delimited names of relations which should be displayed/hidden in a Relation Map (both the note type and the Note Map (Link map, Tree map) 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.

Examples:

  • ${parentNote.getLabel('authorName')}'s literary works
  • Log for ${now.format('YYYY-MM-DD HH:mm:ss')}
  • to mirror the parent's template.

See Default Note Title for more info.

templateThis note will appear in the selection of available template when creating new note. See Templates for more information.
tocControls the display of the Table of contents for a given note. #toc or #toc=show to always display the table of contents, #toc=false to always hide it.
colordefines color of the note in note tree, links etc. Use any valid CSS color value like 'red' or #a13d5f
keyboardShortcutDefines a keyboard shortcut which will immediately jump to this note. Example: 'ctrl+alt+e'. Requires frontend reload for the change to take effect.
keepCurrentHoistingOpening this link won't change hoisting even if the note is not displayable in the current hoisted subtree.
executeButtonTitle of the button which will execute the current code note
executeDescriptionLonger description of the current code note displayed together with the execute button
excludeFromNoteMapNotes with this label will be hidden from the Note Map.
newNotesOnTopNew notes will be created at the top of the parent note, not on the bottom.
hideHighlightWidgetHides the Highlights list widget
hideChildrenOverviewHides the Note List for that particular note.
printLandscapeWhen exporting to PDF, changes the orientation of the page to landscape instead of portrait.
printPageSizeWhen exporting to PDF, changes the size of the page. Supported values: A0, A1, A2, A3, A4, A5, A6, Legal, Letter, Tabloid, Ledger.
geolocationIndicates the latitude and longitude of a note, to be displayed in a Geo Map.
calendar:*Defines specific options for the Calendar View.
viewTypeSets the view of child notes (e.g. grid or list). See Note List for more information.
\ No newline at end of file diff --git a/docs/User Guide/User Guide/Advanced Usage/Attributes/Relations.md b/docs/User Guide/User Guide/Advanced Usage/Attributes/Relations.md new file mode 100644 index 000000000..754351a78 --- /dev/null +++ b/docs/User Guide/User Guide/Advanced Usage/Attributes/Relations.md @@ -0,0 +1,37 @@ +# Relations +A relation is similar to a [label](Labels.md), but instead of having a text value it refers to another note. + +## Creating a relation using the visual editor + +1. Go to the _Owned Attributes_ section in the Ribbon. +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 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 +* 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 Attribute Inheritance for more information. + +## Creating a relation manually + +In the _Owned Attributes_ section in the Ribbon: + +* 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 Enter to confirm (or click the desired note). + * Alternatively copy a note from the Note Tree 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. + +
LabelDescription
runOn*See Events
templatenote'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.
inheritnote's attributes will be inherited even without a parent-child relationship. See Templates for a similar concept. See Attribute Inheritance in the documentation.
renderNotenotes of type Render Note 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_relationtarget of this relation will be executed and rendered as a widget in the sidebar
shareCssCSS note which will be injected into the share page. CSS note must be in the shared sub-tree as well. Consider using share_hidden_from_tree and share_omit_default_css as well.
shareJsJavaScript note which will be injected into the share page. JS note must be in the shared sub-tree as well. Consider using share_hidden_from_tree.
shareTemplateEmbedded JavaScript note that will be used as the template for displaying the shared note. Falls back to the default template. Consider using share_hidden_from_tree.
shareFaviconFavicon 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 share_hidden_from_tree.
\ No newline at end of file diff --git a/docs/User Guide/User Guide/Advanced Usage/Attributes_image.png b/docs/User Guide/User Guide/Advanced Usage/Attributes_image.png index 2ea269012..bb52b5001 100644 Binary files a/docs/User Guide/User Guide/Advanced Usage/Attributes_image.png and b/docs/User Guide/User Guide/Advanced Usage/Attributes_image.png differ diff --git a/src/public/app/doc_notes/en/User Guide/!!!meta.json b/src/public/app/doc_notes/en/User Guide/!!!meta.json index a5fbfdeb4..3e8fc5011 100644 --- a/src/public/app/doc_notes/en/User Guide/!!!meta.json +++ b/src/public/app/doc_notes/en/User Guide/!!!meta.json @@ -6732,25 +6732,347 @@ { "type": "relation", "name": "internalLink", - "value": "Ucmcs8SfrYdD", + "value": "HI6GBBIduIgv", "isInheritable": false, "position": 120 + }, + { + "type": "relation", + "name": "internalLink", + "value": "Cq5X6iKQop6R", + "isInheritable": false, + "position": 130 } ], "format": "html", "dataFileName": "Attributes.html", "attachments": [ { - "attachmentId": "P4eRVtGFoHh2", + "attachmentId": "4YqnV7iugVCJ", "title": "image.png", "role": "image", - "mime": "image/jpg", + "mime": "image/png", "position": 10, "dataFileName": "Attributes_image.png" } ], "dirFileName": "Attributes", "children": [ + { + "isClone": false, + "noteId": "HI6GBBIduIgv", + "notePath": [ + "pOsGYCXsbNQG", + "tC7s2alapj8V", + "zEY4DaJG4YT5", + "HI6GBBIduIgv" + ], + "title": "Labels", + "notePosition": 10, + "prefix": null, + "isExpanded": false, + "type": "text", + "mime": "text/html", + "attributes": [ + { + "type": "relation", + "name": "internalLink", + "value": "zEY4DaJG4YT5", + "isInheritable": false, + "position": 10 + }, + { + "type": "relation", + "name": "internalLink", + "value": "BlN9DFI679QC", + "isInheritable": false, + "position": 20 + }, + { + "type": "relation", + "name": "internalLink", + "value": "bwZpz2ajCEwO", + "isInheritable": false, + "position": 30 + }, + { + "type": "label", + "name": "iconClass", + "value": "bx bx-hash", + "isInheritable": false, + "position": 40 + }, + { + "type": "relation", + "name": "internalLink", + "value": "vZWERwf8U3nx", + "isInheritable": false, + "position": 60 + }, + { + "type": "relation", + "name": "internalLink", + "value": "l0tKav7yLHGF", + "isInheritable": false, + "position": 70 + }, + { + "type": "relation", + "name": "internalLink", + "value": "oPVyFC7WL2Lp", + "isInheritable": false, + "position": 80 + }, + { + "type": "relation", + "name": "internalLink", + "value": "GPERMystNGTB", + "isInheritable": false, + "position": 90 + }, + { + "type": "relation", + "name": "internalLink", + "value": "OFXdgB2nNk1F", + "isInheritable": false, + "position": 100 + }, + { + "type": "relation", + "name": "internalLink", + "value": "CoFPLs3dRlXc", + "isInheritable": false, + "position": 110 + }, + { + "type": "relation", + "name": "internalLink", + "value": "AlhDUqhENtH7", + "isInheritable": false, + "position": 120 + }, + { + "type": "relation", + "name": "internalLink", + "value": "pKK96zzmvBGf", + "isInheritable": false, + "position": 130 + }, + { + "type": "relation", + "name": "internalLink", + "value": "WFGzWeUK6arS", + "isInheritable": false, + "position": 140 + }, + { + "type": "relation", + "name": "internalLink", + "value": "0ESUbbAxVnoK", + "isInheritable": false, + "position": 150 + }, + { + "type": "relation", + "name": "internalLink", + "value": "J5Ex1ZrMbyJ6", + "isInheritable": false, + "position": 160 + }, + { + "type": "relation", + "name": "internalLink", + "value": "d3fAXQ2diepH", + "isInheritable": false, + "position": 170 + }, + { + "type": "relation", + "name": "internalLink", + "value": "MgibgPcfeuGz", + "isInheritable": false, + "position": 180 + }, + { + "type": "relation", + "name": "internalLink", + "value": "m523cpzocqaD", + "isInheritable": false, + "position": 190 + }, + { + "type": "relation", + "name": "internalLink", + "value": "9sRHySam5fXb", + "isInheritable": false, + "position": 200 + }, + { + "type": "relation", + "name": "internalLink", + "value": "_help_YKWqdJhzi2VY", + "isInheritable": false, + "position": 210 + }, + { + "type": "relation", + "name": "internalLink", + "value": "u3YFHC9tQlpm", + "isInheritable": false, + "position": 220 + }, + { + "type": "relation", + "name": "internalLink", + "value": "R9pX4DGra2Vt", + "isInheritable": false, + "position": 230 + }, + { + "type": "relation", + "name": "internalLink", + "value": "iRwzGnHPzonm", + "isInheritable": false, + "position": 240 + }, + { + "type": "relation", + "name": "internalLink", + "value": "BCkXAVs63Ttv", + "isInheritable": false, + "position": 250 + }, + { + "type": "relation", + "name": "internalLink", + "value": "47ZrP6FNuoG8", + "isInheritable": false, + "position": 260 + }, + { + "type": "relation", + "name": "internalLink", + "value": "KC1HB96bqqHX", + "isInheritable": false, + "position": 270 + }, + { + "type": "relation", + "name": "internalLink", + "value": "BFvAtE74rbP6", + "isInheritable": false, + "position": 280 + }, + { + "type": "relation", + "name": "internalLink", + "value": "bdUJEHsAPYQR", + "isInheritable": false, + "position": 290 + }, + { + "type": "relation", + "name": "internalLink", + "value": "AxshuNRegLAv", + "isInheritable": false, + "position": 300 + }, + { + "type": "relation", + "name": "internalLink", + "value": "81SGnPGMk7Xc", + "isInheritable": false, + "position": 310 + }, + { + "type": "relation", + "name": "internalLink", + "value": "xWbu3jpNWapp", + "isInheritable": false, + "position": 320 + } + ], + "format": "html", + "dataFileName": "Labels.html", + "attachments": [] + }, + { + "isClone": false, + "noteId": "Cq5X6iKQop6R", + "notePath": [ + "pOsGYCXsbNQG", + "tC7s2alapj8V", + "zEY4DaJG4YT5", + "Cq5X6iKQop6R" + ], + "title": "Relations", + "notePosition": 20, + "prefix": null, + "isExpanded": false, + "type": "text", + "mime": "text/html", + "attributes": [ + { + "type": "relation", + "name": "internalLink", + "value": "HI6GBBIduIgv", + "isInheritable": false, + "position": 10 + }, + { + "type": "label", + "name": "iconClass", + "value": "bx bx-transfer", + "isInheritable": false, + "position": 20 + }, + { + "type": "relation", + "name": "internalLink", + "value": "BlN9DFI679QC", + "isInheritable": false, + "position": 30 + }, + { + "type": "relation", + "name": "internalLink", + "value": "bwZpz2ajCEwO", + "isInheritable": false, + "position": 40 + }, + { + "type": "relation", + "name": "internalLink", + "value": "oPVyFC7WL2Lp", + "isInheritable": false, + "position": 50 + }, + { + "type": "relation", + "name": "internalLink", + "value": "GPERMystNGTB", + "isInheritable": false, + "position": 60 + }, + { + "type": "relation", + "name": "internalLink", + "value": "KC1HB96bqqHX", + "isInheritable": false, + "position": 70 + }, + { + "type": "relation", + "name": "internalLink", + "value": "HcABDtFCkbFN", + "isInheritable": false, + "position": 80 + } + ], + "format": "html", + "dataFileName": "Relations.html", + "attachments": [] + }, { "isClone": false, "noteId": "bwZpz2ajCEwO", @@ -6761,7 +7083,7 @@ "bwZpz2ajCEwO" ], "title": "Attribute Inheritance", - "notePosition": 10, + "notePosition": 30, "prefix": null, "isExpanded": false, "type": "text", @@ -6787,6 +7109,20 @@ "value": "bx bx-list-plus", "isInheritable": false, "position": 30 + }, + { + "type": "relation", + "name": "internalLink", + "value": "HI6GBBIduIgv", + "isInheritable": false, + "position": 40 + }, + { + "type": "relation", + "name": "internalLink", + "value": "Cq5X6iKQop6R", + "isInheritable": false, + "position": 50 } ], "format": "html", @@ -6803,7 +7139,7 @@ "OFXdgB2nNk1F" ], "title": "Promoted Attributes", - "notePosition": 20, + "notePosition": 40, "prefix": null, "isExpanded": false, "type": "text", @@ -6858,237 +7194,6 @@ "dataFileName": "Promoted Attributes_promot.png" } ] - }, - { - "isClone": false, - "noteId": "Ucmcs8SfrYdD", - "notePath": [ - "pOsGYCXsbNQG", - "tC7s2alapj8V", - "zEY4DaJG4YT5", - "Ucmcs8SfrYdD" - ], - "title": "Attribute Reference", - "notePosition": 30, - "prefix": null, - "isExpanded": false, - "type": "text", - "mime": "text/html", - "attributes": [ - { - "type": "relation", - "name": "internalLink", - "value": "l0tKav7yLHGF", - "isInheritable": false, - "position": 10 - }, - { - "type": "relation", - "name": "internalLink", - "value": "bwZpz2ajCEwO", - "isInheritable": false, - "position": 20 - }, - { - "type": "relation", - "name": "internalLink", - "value": "vZWERwf8U3nx", - "isInheritable": false, - "position": 30 - }, - { - "type": "relation", - "name": "internalLink", - "value": "oPVyFC7WL2Lp", - "isInheritable": false, - "position": 40 - }, - { - "type": "relation", - "name": "internalLink", - "value": "OFXdgB2nNk1F", - "isInheritable": false, - "position": 50 - }, - { - "type": "relation", - "name": "internalLink", - "value": "CoFPLs3dRlXc", - "isInheritable": false, - "position": 60 - }, - { - "type": "relation", - "name": "internalLink", - "value": "WFGzWeUK6arS", - "isInheritable": false, - "position": 70 - }, - { - "type": "relation", - "name": "internalLink", - "value": "J5Ex1ZrMbyJ6", - "isInheritable": false, - "position": 80 - }, - { - "type": "relation", - "name": "internalLink", - "value": "d3fAXQ2diepH", - "isInheritable": false, - "position": 90 - }, - { - "type": "relation", - "name": "internalLink", - "value": "MgibgPcfeuGz", - "isInheritable": false, - "position": 100 - }, - { - "type": "relation", - "name": "internalLink", - "value": "BFvAtE74rbP6", - "isInheritable": false, - "position": 110 - }, - { - "type": "relation", - "name": "internalLink", - "value": "bdUJEHsAPYQR", - "isInheritable": false, - "position": 120 - }, - { - "type": "relation", - "name": "internalLink", - "value": "KC1HB96bqqHX", - "isInheritable": false, - "position": 130 - }, - { - "type": "relation", - "name": "internalLink", - "value": "HcABDtFCkbFN", - "isInheritable": false, - "position": 140 - }, - { - "type": "relation", - "name": "internalLink", - "value": "9sRHySam5fXb", - "isInheritable": false, - "position": 160 - }, - { - "type": "relation", - "name": "internalLink", - "value": "u3YFHC9tQlpm", - "isInheritable": false, - "position": 170 - }, - { - "type": "relation", - "name": "internalLink", - "value": "R9pX4DGra2Vt", - "isInheritable": false, - "position": 180 - }, - { - "type": "relation", - "name": "internalLink", - "value": "pKK96zzmvBGf", - "isInheritable": false, - "position": 220 - }, - { - "type": "relation", - "name": "internalLink", - "value": "AlhDUqhENtH7", - "isInheritable": false, - "position": 230 - }, - { - "type": "relation", - "name": "internalLink", - "value": "0ESUbbAxVnoK", - "isInheritable": false, - "position": 240 - }, - { - "type": "relation", - "name": "internalLink", - "value": "m523cpzocqaD", - "isInheritable": false, - "position": 250 - }, - { - "type": "relation", - "name": "internalLink", - "value": "_help_YKWqdJhzi2VY", - "isInheritable": false, - "position": 260 - }, - { - "type": "relation", - "name": "internalLink", - "value": "iRwzGnHPzonm", - "isInheritable": false, - "position": 270 - }, - { - "type": "relation", - "name": "internalLink", - "value": "BCkXAVs63Ttv", - "isInheritable": false, - "position": 280 - }, - { - "type": "relation", - "name": "internalLink", - "value": "47ZrP6FNuoG8", - "isInheritable": false, - "position": 290 - }, - { - "type": "relation", - "name": "internalLink", - "value": "81SGnPGMk7Xc", - "isInheritable": false, - "position": 300 - }, - { - "type": "relation", - "name": "internalLink", - "value": "GPERMystNGTB", - "isInheritable": false, - "position": 310 - }, - { - "type": "relation", - "name": "internalLink", - "value": "AxshuNRegLAv", - "isInheritable": false, - "position": 320 - }, - { - "type": "relation", - "name": "internalLink", - "value": "xWbu3jpNWapp", - "isInheritable": false, - "position": 330 - }, - { - "type": "label", - "name": "iconClass", - "value": "bx bx-book-bookmark", - "isInheritable": false, - "position": 340 - } - ], - "format": "html", - "dataFileName": "Attribute Reference.html", - "attachments": [] } ] }, diff --git a/src/public/app/doc_notes/en/User Guide/User Guide/Advanced Usage/Attributes.html b/src/public/app/doc_notes/en/User Guide/User Guide/Advanced Usage/Attributes.html index 9f715ddee..4e579189d 100644 --- a/src/public/app/doc_notes/en/User Guide/User Guide/Advanced Usage/Attributes.html +++ b/src/public/app/doc_notes/en/User Guide/User Guide/Advanced Usage/Attributes.html @@ -16,14 +16,17 @@

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. -
  3. Relations: Named links to other notes
  4. +
  5. Labels: Simple + key-value text records
  6. +
  7. Relations: + Named links to other notes

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

-

- -

+
+ +

Labels

Labels in Trilium can be used for a variety of purposes:

Labels are also searchable, enhancing note retrieval.

-

Common Labels for Advanced Configuration

-

See the corresponding section in Attribute Reference for - a comprehensive list of attributes.

+

For more information, including predefined labels, see Labels.

Relations

Relations define connections between notes, similar to links.

-

Uses

+

Uses:

-

Common Relations

-

See the corresponding section in Attribute Reference for - a comprehensive list of relations.

+

For more information, including a list of predefined relations, see  + Relations.

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

Special labels create "label/attribute" definitions, enhancing the organization and management of attributes. For more details, see Attribute Inheritance

+

Inheritance refers to the process of having a label or + a relation shared across multiple notes, generally + in parent-child relations (or anywhere if using templates).

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

-

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.

+

To make an attribute inheritable, simply use the visual editor for  + Labels or Relations. + 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.

2. 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 diff --git a/src/public/app/doc_notes/en/User Guide/User Guide/Advanced Usage/Attributes/Attribute Reference.html b/src/public/app/doc_notes/en/User Guide/User Guide/Advanced Usage/Attributes/Labels.html similarity index 81% rename from src/public/app/doc_notes/en/User Guide/User Guide/Advanced Usage/Attributes/Attribute Reference.html rename to src/public/app/doc_notes/en/User Guide/User Guide/Advanced Usage/Attributes/Labels.html index ebf750601..c644d9513 100644 --- a/src/public/app/doc_notes/en/User Guide/User Guide/Advanced Usage/Attributes/Attribute Reference.html +++ b/src/public/app/doc_notes/en/User Guide/User Guide/Advanced Usage/Attributes/Labels.html @@ -5,15 +5,51 @@ - Attribute Reference + Labels

-

Attribute Reference

+

Labels

-

Labels

+

A label is an attribute of a note which + has a name and optionally a value. 

+

Creating a label using the visual editor

+
    +
  1. Go to the Owned Attributes section in the Ribbon.
  2. +
  3. Press the + button (Add new attribute) to the right.
  4. +
  5. Select Add new label for the relation.
  6. +
+ +

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 Attribute Inheritance for + more information.
  • +
+

Creating a label manually

+

In the Owned Attributes section in the Ribbon:

+
    +
  • 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.

diff --git a/src/public/app/doc_notes/en/User Guide/User Guide/Advanced Usage/Attributes/Relations.html b/src/public/app/doc_notes/en/User Guide/User Guide/Advanced Usage/Attributes/Relations.html new file mode 100644 index 000000000..1148c6d8c --- /dev/null +++ b/src/public/app/doc_notes/en/User Guide/User Guide/Advanced Usage/Attributes/Relations.html @@ -0,0 +1,145 @@ + + + + + + + + Relations + + + +
+

Relations

+ +
+

A relation is similar to a label, but instead + of having a text value it refers to another note.

+

Creating a relation using the visual editor

+
    +
  1. Go to the Owned Attributes section in the Ribbon.
  2. +
  3. Press the + button (Add new attribute) to the right.
  4. +
  5. Select Add new relation for the relation.
  6. +
+ +

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 Attribute Inheritance for + more information.
  • +
+

Creating a relation manually

+

In the Owned Attributes section in the Ribbon:

+
    +
  • 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 Enter to confirm + (or click the desired note).
    • +
    • Alternatively copy a note from the Note Tree 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.

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LabelDescription
runOn* + See Events +
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.
inherit + note's attributes will be inherited even without a parent-child relationship. + See Templates for + a similar concept. See Attribute Inheritance in + the documentation.
renderNote + notes of type Render Note 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_relation + target of this relation will be executed and rendered as a widget in the + sidebar
shareCss + CSS note which will be injected into the share page. CSS note must be + in the shared sub-tree as well. Consider using share_hidden_from_tree and share_omit_default_css 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 share_hidden_from_tree.
shareTemplate + Embedded JavaScript note that will be used as the template for displaying + the shared note. Falls back to the default template. Consider using share_hidden_from_tree.
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 share_hidden_from_tree.
+
+
+
+ + + \ No newline at end of file diff --git a/src/public/app/doc_notes/en/User Guide/User Guide/Advanced Usage/Attributes_image.png b/src/public/app/doc_notes/en/User Guide/User Guide/Advanced Usage/Attributes_image.png index 2ea269012..bb52b5001 100644 Binary files a/src/public/app/doc_notes/en/User Guide/User Guide/Advanced Usage/Attributes_image.png and b/src/public/app/doc_notes/en/User Guide/User Guide/Advanced Usage/Attributes_image.png differ diff --git a/src/public/app/doc_notes/en/User Guide/navigation.html b/src/public/app/doc_notes/en/User Guide/navigation.html index 0a19e04f1..e182e8de3 100644 --- a/src/public/app/doc_notes/en/User Guide/navigation.html +++ b/src/public/app/doc_notes/en/User Guide/navigation.html @@ -319,15 +319,16 @@