mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 10:02:59 +08:00
feat(docs): clarify attribute prefixes
This commit is contained in:
parent
ec5025d7fd
commit
5130089b34
@ -6735,6 +6735,13 @@
|
||||
"value": "Cq5X6iKQop6R",
|
||||
"isInheritable": false,
|
||||
"position": 130
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "BlN9DFI679QC",
|
||||
"isInheritable": false,
|
||||
"position": 140
|
||||
}
|
||||
],
|
||||
"format": "markdown",
|
||||
|
@ -1,24 +1,25 @@
|
||||
# Attributes
|
||||
<figure class="image"><img style="aspect-ratio:1071/146;" src="Attributes_image.png" width="1071" height="146"></figure>
|
||||
|
||||
In Trilium, attributes are key-value pairs assigned to notes, providing additional metadata or functionality. There are two primary types of attributes:
|
||||
|
||||
1. <a class="reference-link" href="Attributes/Labels.md">Labels</a>: Simple key-value text records
|
||||
2. <a class="reference-link" href="Attributes/Relations.md">Relations</a>: 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.
|
||||
|
||||
<figure class="image"><img style="aspect-ratio:1071/146;" src="Attributes_image.png" width="1071" height="146"></figure>
|
||||
## 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, 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>.
|
||||
|
||||
## Relations
|
||||
|
||||
Relations 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>.
|
||||
In the list of attributes, labels are prefixed with the `#` character whereas relations are prefixed with the `~` character.
|
||||
|
||||
## Multiplicity
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
# 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
|
||||
## 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.
|
||||
|
||||
@ -9,7 +9,7 @@ To make an attribute inheritable, simply use the visual editor for <a class="re
|
||||
|
||||
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
|
||||
|
||||
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.
|
||||
|
||||
@ -22,6 +22,6 @@ Copying inheritance differs from standard inheritance by using a `child:` prefix
|
||||
|
||||
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.
|
||||
|
||||
## 3\. Template Inheritance
|
||||
## Template Inheritance
|
||||
|
||||
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.
|
@ -6735,6 +6735,13 @@
|
||||
"value": "Cq5X6iKQop6R",
|
||||
"isInheritable": false,
|
||||
"position": 130
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "internalLink",
|
||||
"value": "BlN9DFI679QC",
|
||||
"isInheritable": false,
|
||||
"position": 140
|
||||
}
|
||||
],
|
||||
"format": "html",
|
||||
|
@ -13,32 +13,42 @@
|
||||
<h1 data-trilium-h1>Attributes</h1>
|
||||
|
||||
<div class="ck-content">
|
||||
<p>In Trilium, attributes are key-value pairs assigned to notes, providing
|
||||
additional metadata or functionality. There are two primary types of attributes:</p>
|
||||
<ol>
|
||||
<li><a class="reference-link" href="Attributes/Labels.html">Labels</a>: Simple
|
||||
key-value text records</li>
|
||||
<li><a class="reference-link" href="Attributes/Relations.html">Relations</a>:
|
||||
Named links to other notes</li>
|
||||
</ol>
|
||||
<p>These attributes play a crucial role in organizing, categorising, and
|
||||
enhancing the functionality of notes.</p>
|
||||
<figure class="image">
|
||||
<img style="aspect-ratio:1071/146;" src="Attributes_image.png" width="1071"
|
||||
height="146">
|
||||
</figure>
|
||||
<h2>Labels</h2>
|
||||
<p>Labels in Trilium can be used for a variety of purposes, such as storing
|
||||
metadata or configuring the behaviour of notes. Labels are also searchable,
|
||||
enhancing note retrieval.</p>
|
||||
<p>For more information, including predefined labels, see <a class="reference-link"
|
||||
href="Attributes/Labels.html">Labels</a>.</p>
|
||||
<h2>Relations</h2>
|
||||
<p>Relations define connections between notes, similar to links. These can
|
||||
be used for metadata and scripting purposes.</p>
|
||||
<p>For more information, including a list of predefined relations, see
|
||||
<a
|
||||
class="reference-link" href="Attributes/Relations.html">Relations</a>.</p>
|
||||
<p>In Trilium, attributes are key-value pairs assigned to notes, providing
|
||||
additional metadata or functionality. There are two primary types of attributes:</p>
|
||||
<ol>
|
||||
<li>
|
||||
<p><a class="reference-link" href="Attributes/Labels.html">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.
|
||||
<br>
|
||||
<br>For more information, including predefined labels, see <a class="reference-link"
|
||||
href="Attributes/Labels.html">Labels</a>.</p>
|
||||
<p> </p>
|
||||
</li>
|
||||
<li>
|
||||
<p><a class="reference-link" href="Attributes/Relations.html">Relations</a> define
|
||||
connections between notes, similar to links. These can be used for metadata
|
||||
and scripting purposes.</p>
|
||||
<p>
|
||||
<br>For more information, including a list of predefined relations, see
|
||||
<a
|
||||
class="reference-link" href="Attributes/Relations.html">Relations</a>.</p>
|
||||
</li>
|
||||
</ol>
|
||||
<p>These attributes play a crucial role in organizing, categorising, and
|
||||
enhancing the functionality of notes.</p>
|
||||
<h2>Viewing the list of attributes</h2>
|
||||
<p>Both the labels and relations for the current note are displayed in the <em>Owned Attributes</em> section
|
||||
of the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Ribbon.html">Ribbon</a>,
|
||||
where they can be viewed and edited. Inherited attributes are displayed
|
||||
in the <em>Inherited Attributes</em> section of the ribbon, where they can
|
||||
only be viewed.</p>
|
||||
<p>In the list of attributes, labels are prefixed with the <code>#</code> character
|
||||
whereas relations are prefixed with the <code>~</code> character.</p>
|
||||
<h2>Multiplicity</h2>
|
||||
<p>Attributes in Trilium can be "multi-valued", meaning multiple attributes
|
||||
with the same name can co-exist.</p>
|
||||
|
@ -16,7 +16,7 @@
|
||||
<p>Inheritance refers to the process of having a <a href="Labels.html">label</a> or
|
||||
a <a href="Relations.html">relation</a> shared across multiple notes, generally
|
||||
in parent-child relations (or anywhere if using templates).</p>
|
||||
<h2>1. Standard Inheritance</h2>
|
||||
<h2>Standard Inheritance</h2>
|
||||
<p>In Trilium, attributes can be automatically inherited by child notes if
|
||||
they have the <code>isInheritable</code> flag set to <code>true</code>. This
|
||||
means the attribute (a key-value pair) is applied to the note and all its
|
||||
@ -29,7 +29,7 @@
|
||||
<p>As an example, the <code>archived</code> label can be set to be inheritable,
|
||||
allowing you to hide a whole subtree of notes from searches and other dialogs
|
||||
by applying this label at the top level.</p>
|
||||
<h2>2. Copying Inheritance</h2>
|
||||
<h2>Copying Inheritance</h2>
|
||||
<p>Copying inheritance differs from standard inheritance by using a <code>child:</code> prefix
|
||||
in the attribute name. This prefix causes new child notes to automatically
|
||||
receive specific attributes from the parent note. These attributes are
|
||||
@ -47,7 +47,7 @@
|
||||
newly created child notes will inherit the <code>#exampleAttribute</code> label.
|
||||
This can be useful for setting default properties for notes in a specific
|
||||
section.</p>
|
||||
<h2>3. Template Inheritance</h2>
|
||||
<h2>Template Inheritance</h2>
|
||||
<p>Attributes can also be inherited from <a href="../Templates.html">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
|
||||
|
Loading…
x
Reference in New Issue
Block a user