Merge branch 'develop' into deps_express5
1761
src/public/app/doc_notes/en/User Guide/!!!meta.json
generated
@@ -36,8 +36,8 @@
|
||||
<h3>Attributes</h3>
|
||||
<p>Task template defines several <a href="../Attributes/Promoted%20Attributes.html">promoted attributes</a> -
|
||||
todoDate, doneDate, tags, location. Importantly it also defines <code>~runOnAttributeChange</code> relation
|
||||
- <a href="../../Note%20Types/Code/Events.html">event</a> handler which is
|
||||
run on attribute change. This <a href="../../Scripting.html">script</a> handles
|
||||
- <a href="../../Scripting/Events.html">event</a> handler which is run on
|
||||
attribute change. This <a href="../../Scripting.html">script</a> 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.</p>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<p>
|
||||
<img src="Weight Tracker_image.png">
|
||||
</p>
|
||||
<p>The <code>Weight Tracker</code> is a <a href="../../Note%20Types/Code/Script%20API.html">Script API</a> showcase
|
||||
<p>The <code>Weight Tracker</code> is a <a href="../../Scripting/Script%20API.html">Script API</a> showcase
|
||||
present in the <a href="../Database.html">demo notes</a>.</p>
|
||||
<p>By adding <code>weight</code> as a <a href="../Attributes/Promoted%20Attributes.html">promoted attribute</a> in
|
||||
the <a href="../Templates.html">template</a> from which <a href="Day%20Notes.html">day notes</a> are
|
||||
|
||||
@@ -13,114 +13,42 @@
|
||||
<h1 data-trilium-h1>Attributes</h1>
|
||||
|
||||
<div class="ck-content">
|
||||
<figure class="image">
|
||||
<img style="aspect-ratio:1071/146;" src="Attributes_image.png" width="1071"
|
||||
height="146">
|
||||
</figure>
|
||||
<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><strong>Labels</strong>: Simple key-value text records</li>
|
||||
<li><strong>Relations</strong>: Named links to other notes</li>
|
||||
<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.</p>
|
||||
<p>For more information, including predefined labels, see <a class="reference-link"
|
||||
href="Attributes/Labels.html">Labels</a>.</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>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>
|
||||
<p>
|
||||
<img src="Attributes_image.png">
|
||||
</p>
|
||||
<h2>Labels</h2>
|
||||
<p>Labels in Trilium can be used for a variety of purposes:</p>
|
||||
<ul>
|
||||
<li><strong>Metadata</strong>: Assign labels with optional values for categorization,
|
||||
such as <code>#year=1999</code>, <code>#genre="sci-fi"</code>, or <code>#author="Neal Stephenson"</code>
|
||||
</li>
|
||||
<li><strong>Configuration</strong>: Labels can configure advanced features
|
||||
or settings</li>
|
||||
<li><strong>Scripts and Plugins</strong>: Used to tag notes with special metadata,
|
||||
such as the "weight" attribute in the <a class="reference-link" href="Advanced%20Showcases/Weight%20Tracker.html">Weight Tracker</a>.</li>
|
||||
</ul>
|
||||
<p>Labels are also searchable, enhancing note retrieval.</p>
|
||||
<h3>Common Labels for Advanced Configuration</h3>
|
||||
<ul>
|
||||
<li><code>disableVersioning</code>: Disables automatic versioning, ideal for
|
||||
large, unimportant notes like script libraries</li>
|
||||
<li><code>versioningLimit</code>: Used to limit the number of revisions for
|
||||
a single note</li>
|
||||
<li><code>calendarRoot</code>: Marks the note as the root for <a href="Advanced%20Showcases/Day%20Notes.html">day notes</a>.
|
||||
Only one note should carry this label</li>
|
||||
<li><code>archived</code>: Hides notes from default search results and dialogs</li>
|
||||
<li><code>excludeFromExport</code>: Excludes notes and their subtrees from
|
||||
export operations</li>
|
||||
<li><code>run</code>: Specifies events to trigger scripts (e.g., <code>frontendStartup</code>, <code>hourly</code>)</li>
|
||||
<li><code>runAtHour</code>: Defines specific hours for scripts to run, used
|
||||
with <code>#run=hourly</code>
|
||||
</li>
|
||||
<li><code>disableInclusion</code>: Prevents a script from being included in
|
||||
parent script executions</li>
|
||||
<li><code>sorted</code>: Automatically sorts child notes alphabetically by
|
||||
title</li>
|
||||
<li><code>top</code>: Keeps the note at the top of its parent's list, useful
|
||||
with <code>sorted</code>
|
||||
</li>
|
||||
<li><code>hidePromotedAttributes</code>: Hides certain attributes in the note's
|
||||
display</li>
|
||||
<li><code>readOnly</code>: Sets the note to read-only mode, applicable to
|
||||
text and code notes</li>
|
||||
<li><code>autoReadOnlyDisabled</code>: Disables automatic read-only mode for
|
||||
large notes</li>
|
||||
<li><code>appCss</code>: Marks CSS notes used to modify Trilium’s appearance</li>
|
||||
<li><code>appTheme</code>: Marks full CSS themes available in Trilium's options</li>
|
||||
<li><code>cssClass</code>: Adds a CSS class to the note's representation in
|
||||
the tree</li>
|
||||
<li><code>iconClass</code>: 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.html">Note Icons</a>.</li>
|
||||
<li><code>pageSize</code>: Specifies the number of items per page in note
|
||||
listings</li>
|
||||
<li><code>customRequestHandler</code> <strong>and</strong> <code>customResourceProvider</code>:
|
||||
Refer to <a class="reference-link" href="Custom%20Request%20Handler.html">Custom Request Handler</a>
|
||||
</li>
|
||||
<li><code>widget</code>: Marks a note as a custom widget, added to Trilium's
|
||||
component tree</li>
|
||||
<li><code>workspace</code> <strong>and related attributes</strong>: See
|
||||
<a
|
||||
class="reference-link" href="../Basic%20Concepts%20and%20Features/Navigation/Workspace.html">Workspace</a> for more details</li>
|
||||
<li><code>searchHome</code>: Specifies the parent for new search notes</li>
|
||||
<li><code>inbox</code>: Designates a default location for new notes created
|
||||
via the sidebar</li>
|
||||
<li><code>sqlConsoleHome</code>: Default location for SQL console notes</li>
|
||||
<li><code>bookmarked</code> <strong>and</strong> <code>bookmarkFolder</code>:
|
||||
See <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Navigation/Bookmarks.html">Bookmarks</a>
|
||||
</li>
|
||||
<li><code>share:[…]</code>: See <a class="reference-link" href="Sharing.html">Sharing</a>
|
||||
</li>
|
||||
<li><code>keyboardShortcut</code>: Assigns a keyboard shortcut to open the
|
||||
note</li>
|
||||
<li><code>displayRelations</code> <strong>and</strong> <code>hideRelations</code>:
|
||||
Manages the display of note relations</li>
|
||||
<li><code>titleTemplate</code>: See <a class="reference-link" href="Default%20Note%20Title.html">Default Note Title</a>
|
||||
</li>
|
||||
<li><code>template</code>: Makes the note available as a template</li>
|
||||
<li><code>toc</code>: Controls the visibility of the table of contents</li>
|
||||
<li><code>color</code>: Defines the color of the note in the tree and links</li>
|
||||
<li><code>hideChildrenOverview</code>: Hides child notes in the parent note's
|
||||
editor</li>
|
||||
<li><code>viewType</code>: Sets the view of child notes (grid or list)</li>
|
||||
</ul>
|
||||
<h2>Relations</h2>
|
||||
<p>Relations define connections between notes, similar to links.</p>
|
||||
<h3>Uses</h3>
|
||||
<ul>
|
||||
<li><strong>Metadata Relationships</strong>: For example, linking a book note
|
||||
to an author note</li>
|
||||
<li><strong>Scripting</strong>: Attaching scripts to events or conditions
|
||||
related to the note</li>
|
||||
</ul>
|
||||
<h3>Common Relations</h3>
|
||||
<ul>
|
||||
<li><strong>Event-based Relations</strong>: Such as <code>runOnNoteCreation</code> or <code>runOnNoteChange</code>,
|
||||
which trigger scripts on specific actions</li>
|
||||
<li><strong>Other Relations</strong>: Include <code>template</code>, <code>renderNote</code>, <code>widget</code>,
|
||||
and sharing-related relations</li>
|
||||
</ul>
|
||||
<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 "multivalued", meaning multiple attributes
|
||||
with the same name can coexist.</p>
|
||||
<p>Attributes in Trilium can be "multi-valued", meaning multiple attributes
|
||||
with the same name can co-exist.</p>
|
||||
<h2>Attribute Definitions and Promoted Attributes</h2>
|
||||
<p>Special labels create "label/attribute" definitions, enhancing the organization
|
||||
and management of attributes. For more details, see <a class="reference-link"
|
||||
|
||||
@@ -13,35 +13,53 @@
|
||||
<h1 data-trilium-h1>Attribute Inheritance</h1>
|
||||
|
||||
<div class="ck-content">
|
||||
<h2>1. Standard Inheritance</h2>
|
||||
<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>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
|
||||
descendants.</p>
|
||||
<h3>Example Use Case</h3>
|
||||
<p>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>
|
||||
<p>To make an attribute inheritable, simply use the visual editor for
|
||||
<a
|
||||
class="reference-link" href="Labels.html">Labels</a> or <a class="reference-link" href="Relations.html">Relations</a>.
|
||||
Alternatively, the attribute can be manually defined where <code>#myLabel=value</code> becomes <code>#myLabel(inheritable)=value</code> when
|
||||
inheritable.</p>
|
||||
<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>
|
||||
<p>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 <em>copying inheritance</em> or <em>template inheritance</em> needs
|
||||
to be used instead.</p>
|
||||
<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
|
||||
independent of the parent and will persist even if the note is moved elsewhere.</p>
|
||||
<h3>How to Use</h3>
|
||||
<ul>
|
||||
<li><strong>Syntax:</strong> <code>#child:attributeName</code>
|
||||
</li>
|
||||
<li><strong>Chained Inheritance:</strong> You can chain this inheritance, such
|
||||
as <code>#child:child:attributeName</code>, where each child down the hierarchy
|
||||
receives the appropriate attribute.</li>
|
||||
</ul>
|
||||
<h3>Example</h3>
|
||||
<p>If a parent note has the label <code>#child:exampleAttribute</code>, all
|
||||
newly created child notes will inherit the <code>#exampleAttribute</code> label.
|
||||
newly created child notes (one level deep) 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>
|
||||
<p>Attributes can also be inherited from <a href="../Templates.html">templates</a>.
|
||||
<p>Similarly, for relations use <code>~child:myRelation</code>.</p>
|
||||
<p>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.</p>
|
||||
<h3>Chained inheritance</h3>
|
||||
<p>It is possible to define labels across multiple levels of depth. For example, <code>#child:child:child:foo</code> applied
|
||||
to a root note would create:</p>
|
||||
<ul>
|
||||
<li><code>#child:child:foo</code> on the first-level children.</li>
|
||||
<li><code>#child:foo</code> on the second-level children.</li>
|
||||
<li><code>#foo</code> on the third-level children.</li>
|
||||
</ul>
|
||||
<p>Similarly, use <code>~child:child:child:foo</code> if dealing with relations.</p>
|
||||
<p>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.</p>
|
||||
<h2>Template Inheritance</h2>
|
||||
<p>Attributes can also be inherited from <a class="reference-link" 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
|
||||
across notes that follow a similar structure or function.</p>
|
||||
|
||||
407
src/public/app/doc_notes/en/User Guide/User Guide/Advanced Usage/Attributes/Labels.html
generated
Normal file
@@ -0,0 +1,407 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="../../../style.css">
|
||||
<base target="_parent">
|
||||
<title data-trilium-title>Labels</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="content">
|
||||
<h1 data-trilium-h1>Labels</h1>
|
||||
|
||||
<div class="ck-content">
|
||||
<p>A label is an <a href="../Attributes.html">attribute</a> of a note which
|
||||
has a name and optionally a value.</p>
|
||||
<h2>Common use cases</h2>
|
||||
<ul>
|
||||
<li><strong>Metadata for personal use</strong>: Assign labels with optional
|
||||
values for categorization, such as <code>#year=1999</code>, <code>#genre="sci-fi"</code>,
|
||||
or <code>#author="Neal Stephenson"</code>. This can be combined with
|
||||
<a
|
||||
class="reference-link" href="Promoted%20Attributes.html">Promoted Attributes</a> to make their display more user-friendly.</li>
|
||||
<li><strong>Configuration</strong>: Labels can configure advanced features
|
||||
or settings (see reference below).</li>
|
||||
<li><strong>Scripts and Plugins</strong>: Used to tag notes with special metadata,
|
||||
such as the "weight" attribute in the <a class="reference-link" href="../Advanced%20Showcases/Weight%20Tracker.html">Weight Tracker</a>.</li>
|
||||
</ul>
|
||||
<h2>Creating a label using the visual editor</h2>
|
||||
<ol>
|
||||
<li>Go to the <em>Owned Attributes</em> section in the <a class="reference-link"
|
||||
href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Ribbon.html">Ribbon</a>.</li>
|
||||
<li>Press the + button (<em>Add new attribute</em>) to the right.</li>
|
||||
<li>Select <em>Add new label</em> for the relation.</li>
|
||||
</ol>
|
||||
<aside class="admonition tip">
|
||||
<p>If you prefer keyboard shortcuts, press <kbd>Alt</kbd>+<kbd>L</kbd> while
|
||||
focused on a note or in the <em>Owned Attributes</em> section to display
|
||||
the visual editor.</p>
|
||||
</aside>
|
||||
<p>While in the visual editor:</p>
|
||||
<ul>
|
||||
<li>Set the desired name</li>
|
||||
<li>Optionally, set the value of the label. Labels can exist without a value.</li>
|
||||
<li>Check <em>Inheritable</em> if the label should be inherited by the child
|
||||
notes as well. See <a class="reference-link" href="Attribute%20Inheritance.html">Attribute Inheritance</a> for
|
||||
more information.</li>
|
||||
</ul>
|
||||
<h2>Creating a label manually</h2>
|
||||
<p>In the <em>Owned Attributes</em> section in the <a class="reference-link"
|
||||
href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Ribbon.html">Ribbon</a>:</p>
|
||||
<ul>
|
||||
<li>To create a label called <code>myLabel</code> with no value, simply type <code>#myLabel</code>.</li>
|
||||
<li>To create a label called <code>myLabel</code> with a value <code>value</code>,
|
||||
simply type <code>#myLabel=value</code>.</li>
|
||||
<li>If the value contains spaces, then the text must be quoted: <code>#myLabel="Hello world"</code>.</li>
|
||||
<li>If the string contains quotes (regardless of whether it has spaces), then
|
||||
the text must be quoted with apostrophes instead: <code>#myLabel='Hello "world"'</code>.</li>
|
||||
<li>To create an inheritable label called <code>myLabel</code>, simply write <code>#myLabel(inheritable)</code> for
|
||||
no value or <code>#myLabel(inheritable)=value</code> if there is a value.</li>
|
||||
</ul>
|
||||
<h2>Predefined labels</h2>
|
||||
<p>This is a list of labels that Trilium natively supports.</p>
|
||||
<aside class="admonition tip">
|
||||
<p>Some labels presented here end with a <code>*</code>. 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.</p>
|
||||
</aside>
|
||||
<figure class="table" style="width:100%;">
|
||||
<table class="ck-table-resized">
|
||||
<colgroup>
|
||||
<col style="width:33.82%;">
|
||||
<col style="width:66.18%;">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Label</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><code>disableVersioning</code>
|
||||
</td>
|
||||
<td>Disables automatic creation of <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/Notes/Note%20Revisions.html">Note Revisions</a> for
|
||||
a particular note. Useful for e.g. large, but unimportant notes - e.g.
|
||||
large JS libraries used for scripting.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>versioningLimit</code>
|
||||
</td>
|
||||
<td>Limits the maximum number of <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/Notes/Note%20Revisions.html">Note Revisions</a> for
|
||||
a particular note, overriding the global settings.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>calendarRoot</code>
|
||||
</td>
|
||||
<td>Marks the note which should be used as root for <a class="reference-link"
|
||||
href="../Advanced%20Showcases/Day%20Notes.html">Day Notes</a>. Only one
|
||||
should be marked as such.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>archived</code>
|
||||
</td>
|
||||
<td>Hides notes from default search results and dialogs. Archived notes can
|
||||
optionally be hidden in the <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.html">Note Tree</a>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>excludeFromExport</code>
|
||||
</td>
|
||||
<td>Excludes this note and its children when exporting.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>run</code>, <code>runOnInstance</code>, <code>runAtHour</code>
|
||||
</td>
|
||||
<td>See <a class="reference-link" href="../../Scripting/Events.html">Events</a>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>disableInclusion</code>
|
||||
</td>
|
||||
<td>Scripts with this label won't be included into parent script execution.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>sorted</code>
|
||||
</td>
|
||||
<td>
|
||||
<p>Keeps child notes sorted by title alphabetically.</p>
|
||||
<p>When given a value, it will sort by 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.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>sortDirection</code>
|
||||
</td>
|
||||
<td>
|
||||
<p>If <code>sorted</code> is applied, specifies the direction of the sort:</p>
|
||||
<ul>
|
||||
<li><code>ASC</code>, ascending (default)</li>
|
||||
<li><code>DESC</code>, descending</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>sortFoldersFirst</code>
|
||||
</td>
|
||||
<td>If <code>sorted</code> is applied, folders (notes with children) will be
|
||||
sorted as a group at the top, and the rest will be sorted.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>top</code>
|
||||
</td>
|
||||
<td>If <code>sorted</code> is applied to the parent note, keeps given note on
|
||||
top in its parent.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>hidePromotedAttributes</code>
|
||||
</td>
|
||||
<td>Hide <a class="reference-link" href="Promoted%20Attributes.html">Promoted Attributes</a> on
|
||||
this note. Generally useful when defining inherited attributes, but the
|
||||
parent note doesn't need them.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>readOnly</code>
|
||||
</td>
|
||||
<td>Marks a note to be always be <a href="../../Basic%20Concepts%20and%20Features/Notes/Read-Only%20Notes.html">read-only</a>,
|
||||
if it's a supported note (text, code, mermaid).</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>autoReadOnlyDisabled</code>
|
||||
</td>
|
||||
<td>Disables automatic <a href="../../Basic%20Concepts%20and%20Features/Notes/Read-Only%20Notes.html">read-only mode</a> for
|
||||
the given note.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>appCss</code>
|
||||
</td>
|
||||
<td>Marks CSS notes which are loaded into the Trilium application and can
|
||||
thus be used to modify Trilium's looks. See <a class="reference-link"
|
||||
href="../../Theme%20development/Custom%20app-wide%20CSS.html">Custom app-wide CSS</a> for
|
||||
more info.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>appTheme</code>
|
||||
</td>
|
||||
<td>Marks CSS notes which are full Trilium themes and are thus available in
|
||||
Trilium options. See <a class="reference-link" href="../../Theme%20development">Theme development</a> for
|
||||
more information.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>appThemeBase</code>
|
||||
</td>
|
||||
<td>Set to <code>next</code>, <code>next-light</code>, or <code>next-dark</code> to
|
||||
use the corresponding TriliumNext theme (auto, light or dark) as the base
|
||||
for a custom theme, instead of the legacy one. See <a class="reference-link"
|
||||
href="../../Theme%20development/Customize%20the%20Next%20theme.html">Customize the Next theme</a> for
|
||||
more information.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>cssClass</code>
|
||||
</td>
|
||||
<td>Value of this label is then added as CSS class to the node representing
|
||||
given note in the <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.html">Note Tree</a>.
|
||||
This can be useful for advanced theming. Can be used in template notes.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>iconClass</code>
|
||||
</td>
|
||||
<td>value of this label is added as a CSS class to the icon on the tree which
|
||||
can help visually distinguish the notes in the tree. Example might be bx
|
||||
bx-home - icons are taken from boxicons. Can be used in template notes.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>pageSize</code>
|
||||
</td>
|
||||
<td>Specifies the number of items per page in <a class="reference-link"
|
||||
href="../../Basic%20Concepts%20and%20Features/Notes/Note%20List.html">Note List</a>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>customRequestHandler</code>
|
||||
</td>
|
||||
<td>See <a class="reference-link" href="../Custom%20Request%20Handler.html">Custom Request Handler</a>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>customResourceProvider</code>
|
||||
</td>
|
||||
<td>See <a class="reference-link" href="../Custom%20Resource%20Providers.html">Custom Resource Providers</a>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>widget</code>
|
||||
</td>
|
||||
<td>Marks this note as a custom widget which will be added to the Trilium
|
||||
component tree. See <a class="reference-link" href="../../Scripting/Custom%20Widgets.html">Custom Widgets</a> for
|
||||
more information.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>searchHome</code>
|
||||
</td>
|
||||
<td>New search notes will be created as children of this note (see
|
||||
<a
|
||||
class="reference-link" href="../../Note%20Types/Saved%20Search.html">Saved Search</a>).</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>workspace</code> and related attributes</td>
|
||||
<td>See <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/Navigation/Workspaces.html">Workspaces</a>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>inbox</code>
|
||||
</td>
|
||||
<td>default inbox location for new notes - when you create a note using <em>new note</em> button
|
||||
in the sidebar, notes will be created as child notes in the note marked
|
||||
as with <code>#inbox</code> label.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>sqlConsoleHome</code>
|
||||
</td>
|
||||
<td>Default location of <a class="reference-link" href="#root/_hidden/_help/_help_tC7s2alapj8V/_help_wX4HbRucYSDD/_help_oyIAJ9PvvwHX/_help_YKWqdJhzi2VY">SQL Console</a> notes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>bookmarked</code>
|
||||
</td>
|
||||
<td>Indicates this note is a <a href="../../Basic%20Concepts%20and%20Features/Navigation/Bookmarks.html">bookmark</a>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>bookmarkFolder</code>
|
||||
</td>
|
||||
<td>Note with this label will appear in bookmarks as folder (allowing access
|
||||
to its children). See <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/Navigation/Bookmarks.html">Bookmarks</a> for
|
||||
more information.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>share*</code>
|
||||
</td>
|
||||
<td>See the attribute reference in <a class="reference-link" href="../Sharing.html">Sharing</a>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>displayRelations</code>, <code>hideRelations</code>
|
||||
</td>
|
||||
<td>Comma delimited names of relations which should be displayed/hidden in
|
||||
a <a class="reference-link" href="../../Note%20Types/Relation%20Map.html">Relation Map</a> (both
|
||||
the note type and the <a class="reference-link" href="../Note%20Map%20(Link%20map%2C%20Tree%20map).html">Note Map (Link map, Tree map)</a> general
|
||||
functionality).</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>titleTemplate</code>
|
||||
</td>
|
||||
<td>
|
||||
<p>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 <code>now</code> and <code>parentNote</code> variables.</p>
|
||||
<p>Examples:</p>
|
||||
<ul>
|
||||
<li><code>${parentNote.getLabel('authorName')}'s literary works</code>
|
||||
</li>
|
||||
<li><code>Log for ${now.format('YYYY-MM-DD HH:mm:ss')}</code>
|
||||
</li>
|
||||
<li>to mirror the parent's template.</li>
|
||||
</ul>
|
||||
<p>See <a class="reference-link" href="../Default%20Note%20Title.html">Default Note Title</a> for
|
||||
more info.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>template</code>
|
||||
</td>
|
||||
<td>This note will appear in the selection of available template when creating
|
||||
new note. See <a class="reference-link" href="../Templates.html">Templates</a> for
|
||||
more information.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>toc</code>
|
||||
</td>
|
||||
<td>Controls the display of the <a class="reference-link" href="../../Note%20Types/Text/Table%20of%20contents.html">Table of contents</a> for
|
||||
a given note. <code>#toc</code> or <code>#toc=show</code> to always display
|
||||
the table of contents, <code>#toc=false</code> to always hide it.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>color</code>
|
||||
</td>
|
||||
<td>defines color of the note in note tree, links etc. Use any valid CSS color
|
||||
value like 'red' or #a13d5f</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>keyboardShortcut</code>
|
||||
</td>
|
||||
<td>Defines a keyboard shortcut which will immediately jump to this note.
|
||||
Example: 'ctrl+alt+e'. Requires frontend reload for the change to take
|
||||
effect.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>keepCurrentHoisting</code>
|
||||
</td>
|
||||
<td>Opening this link won't change hoisting even if the note is not displayable
|
||||
in the current hoisted subtree.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>executeButton</code>
|
||||
</td>
|
||||
<td>Title of the button which will execute the current code note</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>executeDescription</code>
|
||||
</td>
|
||||
<td>Longer description of the current code note displayed together with the
|
||||
execute button</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>excludeFromNoteMap</code>
|
||||
</td>
|
||||
<td>Notes with this label will be hidden from the <a class="reference-link"
|
||||
href="../../Note%20Types/Note%20Map.html">Note Map</a>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>newNotesOnTop</code>
|
||||
</td>
|
||||
<td>New notes will be created at the top of the parent note, not on the bottom.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>hideHighlightWidget</code>
|
||||
</td>
|
||||
<td>Hides the <a class="reference-link" href="../../Note%20Types/Text/Highlights%20list.html">Highlights list</a> widget</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>hideChildrenOverview</code>
|
||||
</td>
|
||||
<td>Hides the <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/Notes/Note%20List.html">Note List</a> for
|
||||
that particular note.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>printLandscape</code>
|
||||
</td>
|
||||
<td>When exporting to PDF, changes the orientation of the page to landscape
|
||||
instead of portrait.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>printPageSize</code>
|
||||
</td>
|
||||
<td>When exporting to PDF, changes the size of the page. Supported values: <code>A0</code>, <code>A1</code>, <code>A2</code>, <code>A3</code>, <code>A4</code>, <code>A5</code>, <code>A6</code>, <code>Legal</code>, <code>Letter</code>, <code>Tabloid</code>, <code>Ledger</code>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>geolocation</code>
|
||||
</td>
|
||||
<td>Indicates the latitude and longitude of a note, to be displayed in a
|
||||
<a
|
||||
class="reference-link" href="../../Note%20Types/Geo%20Map.html">Geo Map</a>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>calendar:*</code>
|
||||
</td>
|
||||
<td>Defines specific options for the <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/Notes/Note%20List/Calendar%20View.html">Calendar View</a>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>viewType</code>
|
||||
</td>
|
||||
<td>Sets the view of child notes (e.g. grid or list). See <a class="reference-link"
|
||||
href="../../Basic%20Concepts%20and%20Features/Notes/Note%20List.html">Note List</a> for
|
||||
more information.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</figure>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
159
src/public/app/doc_notes/en/User Guide/User Guide/Advanced Usage/Attributes/Relations.html
generated
Normal file
@@ -0,0 +1,159 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="../../../style.css">
|
||||
<base target="_parent">
|
||||
<title data-trilium-title>Relations</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="content">
|
||||
<h1 data-trilium-h1>Relations</h1>
|
||||
|
||||
<div class="ck-content">
|
||||
<p>A relation is similar to a <a href="Labels.html">label</a>, but instead
|
||||
of having a text value it refers to another note.</p>
|
||||
<h2>Common use cases</h2>
|
||||
<ul>
|
||||
<li><strong>Metadata Relationships for personal use</strong>: For example,
|
||||
linking a book note to an author note.
|
||||
<br>This can be combined with <a class="reference-link" href="Promoted%20Attributes.html">Promoted Attributes</a> to
|
||||
make their display more user-friendly.</li>
|
||||
<li><strong>Configuration</strong>: For configuring some notes such as
|
||||
<a
|
||||
class="reference-link" href="../../Note%20Types/Render%20Note.html">Render Note</a>, or configuring <a class="reference-link" href="../Sharing.html">Sharing</a> or
|
||||
<a
|
||||
class="reference-link" href="../Templates.html">Templates</a> (see the list below).</li>
|
||||
<li><strong>Scripting</strong>: Attaching scripts to events or conditions
|
||||
related to the note.</li>
|
||||
</ul>
|
||||
<h2>Creating a relation using the visual editor</h2>
|
||||
<ol>
|
||||
<li>Go to the <em>Owned Attributes</em> section in the <a class="reference-link"
|
||||
href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Ribbon.html">Ribbon</a>.</li>
|
||||
<li>Press the + button (<em>Add new attribute</em>) to the right.</li>
|
||||
<li>Select <em>Add new relation</em> for the relation.</li>
|
||||
</ol>
|
||||
<aside class="admonition tip">
|
||||
<p>If you prefer keyboard shortcuts, press <kbd>Alt</kbd>+<kbd>L</kbd> while
|
||||
focused on a note or in the <em>Owned Attributes</em> section to display
|
||||
the visual editor.</p>
|
||||
</aside>
|
||||
<p>While in the visual editor:</p>
|
||||
<ul>
|
||||
<li>Set the desired name</li>
|
||||
<li>Set the Target note (the note to point to). Unlike labels, relations cannot
|
||||
exist with a target note.</li>
|
||||
<li>Check <em>Inheritable</em> if the label should be inherited by the child
|
||||
notes as well. See <a class="reference-link" href="Attribute%20Inheritance.html">Attribute Inheritance</a> for
|
||||
more information.</li>
|
||||
</ul>
|
||||
<h2>Creating a relation manually</h2>
|
||||
<p>In the <em>Owned Attributes</em> section in the <a class="reference-link"
|
||||
href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Ribbon.html">Ribbon</a>:</p>
|
||||
<ul>
|
||||
<li>To create a relation called <code>myRelation</code>:
|
||||
<ul>
|
||||
<li>First type <code>~myRelation=@</code> .</li>
|
||||
<li>After this, an autocompletion box should appear.</li>
|
||||
<li>Type the title of the note to point to and press <kbd>Enter</kbd> to confirm
|
||||
(or click the desired note).</li>
|
||||
<li>Alternatively copy a note from the <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.html">Note Tree</a> and
|
||||
paste it after the <code>=</code> sign (without the <code>@</code> , in this
|
||||
case).</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>To create an inheritable relation, follow the same steps as previously
|
||||
described but instead of <code>~myRelation</code> write <code>~myRelation(inheritable)</code>.</li>
|
||||
</ul>
|
||||
<h2>Predefined relations</h2>
|
||||
<p>These relations are supported and used internally by Trilium.</p>
|
||||
<aside
|
||||
class="admonition tip">
|
||||
<p>Some relations presented here end with a <code>*</code>. 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.</p>
|
||||
</aside>
|
||||
<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 <a class="reference-link" href="../../Scripting/Events.html">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 <a class="reference-link" href="../Templates.html">Templates</a> for
|
||||
a similar concept. See <a class="reference-link" href="Attribute%20Inheritance.html">Attribute Inheritance</a> in
|
||||
the documentation.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>renderNote</code>
|
||||
</td>
|
||||
<td>notes of type <a class="reference-link" href="../../Note%20Types/Render%20Note.html">Render Note</a> will
|
||||
be rendered using a code note (HTML or script) and it is necessary to point
|
||||
using this relation to which note should be rendered</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>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 32 KiB |
BIN
src/public/app/doc_notes/en/User Guide/User Guide/Advanced Usage/Bulk Actions_image.png
generated
Normal file
|
After Width: | Height: | Size: 82 KiB |
@@ -5,21 +5,183 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="../../style.css">
|
||||
<base target="_parent">
|
||||
<title data-trilium-title>Bulk actions</title>
|
||||
<title data-trilium-title>Bulk Actions</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="content">
|
||||
<h1 data-trilium-h1>Bulk actions</h1>
|
||||
<h1 data-trilium-h1>Bulk Actions</h1>
|
||||
|
||||
<div class="ck-content">
|
||||
<h3>Execute script</h3>
|
||||
<p>For more complex scenarios, it is possible to type in a JavaScript expression
|
||||
in order to apply the necessary changes.</p>
|
||||
<p>To apply a suffix (<code>- suffix</code> in this example), to the note
|
||||
title:</p><pre><code class="language-application-javascript-env-backend">note.title = note.title + " - suffix";</code></pre>
|
||||
<p>To alter attributes of a note in a bulk action, such as setting the <code>#shareAlias</code> label
|
||||
to the title of the note:</p><pre><code class="language-application-javascript-env-backend">note.setLabel("shareAlias", note.title)</code></pre>
|
||||
<figure class="image">
|
||||
<img style="aspect-ratio:1425/654;" src="Bulk Actions_image.png" width="1425"
|
||||
height="654">
|
||||
</figure>
|
||||
<p>The <em>Bulk Actions</em> 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.</p>
|
||||
<h2>Interaction</h2>
|
||||
<ul>
|
||||
<li>The first step is to select the notes in the <a class="reference-link"
|
||||
href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.html">Note Tree</a>.
|
||||
It's possible to apply bulk actions to:
|
||||
<ul>
|
||||
<li>A single note (and potentially its child notes) simply by clicking on
|
||||
it (with a left click or a right click).</li>
|
||||
<li>Multiple notes. See <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree/Multiple%20selection.html">Multiple selection</a> on
|
||||
how to do so.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Right click in the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.html">Note Tree</a> and
|
||||
select <em>Advanced </em>→ <em>Apply bulk actions</em>.</li>
|
||||
<li>By default, only the selected notes will be affected. To also include
|
||||
all the descendants of the notes, check <em>Include descendants of the selected notes</em>.
|
||||
The number of affected notes at the top of the dialog will update to reflect
|
||||
the change.</li>
|
||||
<li>Click on which action to apply from the <em>Available actions</em> section.
|
||||
A detailed description of each is available in the next section.
|
||||
<ul>
|
||||
<li>For each action selected, the <em>Chosen actions</em> section will update
|
||||
to reveal the entry. Each action will have its own configuration.</li>
|
||||
<li>To remove an action, simply press the X button to the right of it.</li>
|
||||
<li>It is possible to apply multiple actions of the same type, such as adding
|
||||
multiple types.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>When all the actions are defined, press <em>Execute bulk actions</em> to
|
||||
trigger all of them at once.</li>
|
||||
<li>For convenience, the last bulk action configuration is saved for further
|
||||
use and will be restored when entering the dialog again.</li>
|
||||
</ul>
|
||||
<h2>Actions</h2>
|
||||
<h3>Labels</h3>
|
||||
<p>These actions operate the <a class="reference-link" href="Attributes/Labels.html">Labels</a> of
|
||||
a note:</p>
|
||||
<ul>
|
||||
<li><strong>Add label</strong>
|
||||
<ul>
|
||||
<li>For each note, if it doesn't already have a <a href="Attributes/Labels.html">label</a> of
|
||||
the given name, it will create it. Keep the <em>New value</em> field empty
|
||||
to create a label without a value, or complete it to assign a value.</li>
|
||||
<li>If a note already has this label, its value will be updated.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Update label value</strong>
|
||||
<ul>
|
||||
<li>For each note, if it has a <a href="Attributes/Labels.html">label</a> of
|
||||
the given name, it will change its value to the specified one. Leave <em>New value</em> field
|
||||
empty to create a label without a value.</li>
|
||||
<li>Notes without the label will not be affected.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><em><strong>Rename label</strong></em>
|
||||
<ul>
|
||||
<li>For each note, if it has a <a href="Attributes/Labels.html">label</a> 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.</li>
|
||||
<li>Notes without the label will not be affected.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Delete label</strong>
|
||||
<ul>
|
||||
<li>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).</li>
|
||||
<li>Notes without the label will not be affected.</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Relations</h3>
|
||||
<p>These actions operate the <a class="reference-link" href="Attributes/Relations.html">Relations</a> of
|
||||
a note:</p>
|
||||
<ul>
|
||||
<li><strong>Add relation</strong>
|
||||
<ul>
|
||||
<li>For each note, it will create a relation pointing to the given note.</li>
|
||||
<li>Notes without this relation will not be affected.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Update relation target</strong>
|
||||
<ul>
|
||||
<li>For each note, it will modify a relation to point to the newly given note.</li>
|
||||
<li>Notes without this relation will not be affected.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Rename relation</strong>
|
||||
<ul>
|
||||
<li>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.</li>
|
||||
<li>Notes without this relation will not be affected.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Delete relation</strong>
|
||||
<ul>
|
||||
<li>For each note, if it has a relation of the given name, it will be deleted.</li>
|
||||
<li>Notes without this relation will not be affected.</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Notes</h3>
|
||||
<ul>
|
||||
<li><strong>Rename note</strong>
|
||||
<ul>
|
||||
<li>For each note, it will change the title of the note to the given one.</li>
|
||||
<li>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.html">FNote</a>, for example:
|
||||
<ul>
|
||||
<li><code>NEW: ${note.title}</code> will prefix all notes with <code>NEW: </code>.</li>
|
||||
<li><code>${note.dateCreatedObj.format('MM-DD:')}: ${note.title}</code> will
|
||||
prefix the note titles with each note's creation date (in month-day format).</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Move note</strong>
|
||||
<ul>
|
||||
<li>For each note, it will be moved to the specified parent note.</li>
|
||||
<li>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.html">Note Tree</a> via
|
||||
cut → paste or via the contextual menu.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Delete note</strong>
|
||||
<ul>
|
||||
<li>For each note, it will be deleted.</li>
|
||||
<li>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.html">Note Tree</a> by
|
||||
selecting them and pressing <kbd>Delete</kbd>.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Delete note revisions</strong>
|
||||
<ul>
|
||||
<li>This will delete all the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Notes/Note%20Revisions.html">Note Revisions</a> of
|
||||
the notes.</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Others</h3>
|
||||
<ul>
|
||||
<li><strong>Execute script</strong>
|
||||
<ul>
|
||||
<li>For more complex scenarios, it is possible to type in a JavaScript expression
|
||||
in order to apply the necessary changes.</li>
|
||||
<li>Examples:
|
||||
<ul>
|
||||
<li>
|
||||
<p>To apply a suffix (<code>- suffix</code> in this example), to the note
|
||||
title:</p><pre><code class="language-application-javascript-env-backend">note.title = note.title + " - suffix";</code></pre>
|
||||
</li>
|
||||
<li>
|
||||
<p>To alter attributes of a note based on another attribute, such as setting
|
||||
the <code>#shareAlias</code> label to the title of the note:</p><pre><code class="language-application-javascript-env-backend">note.setLabel("shareAlias", note.title)</code></pre>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="../../../style.css">
|
||||
<base target="_parent">
|
||||
<title data-trilium-title>Trilium instance</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="content">
|
||||
<h1 data-trilium-h1>Trilium instance</h1>
|
||||
|
||||
<div class="ck-content">
|
||||
<p>A Trilium instance represents a server. If <a class="reference-link"
|
||||
href="../../Installation%20%26%20Setup/Synchronization.html">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.</p>
|
||||
<h2>Setting the instance name</h2>
|
||||
<p>To set up a name for the instance, modify the <code>config.ini</code>:</p><pre><code class="language-text-x-trilium-auto">[General]
|
||||
instanceName=Hello</code></pre>
|
||||
<h2>Distinguishing the instance on back-end</h2>
|
||||
<p>Use <code>api.getInstanceName()</code> to obtain the instance name of the
|
||||
current server, as specified in the config file or in environment variables.</p>
|
||||
<h2>Limiting script runs based on instance</h2>
|
||||
<p>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 <code>runOnInstance</code> 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.</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -68,7 +68,7 @@ Content-Type: application/json
|
||||
and you need to take care of this yourself.</p>
|
||||
<p>Once we pass these checks we will just create the desired note using
|
||||
<a
|
||||
href="../Note%20Types/Code/Script%20API.html">Script API</a>.</p>
|
||||
href="../Scripting/Script%20API.html">Script API</a>.</p>
|
||||
<h2>Custom resource provider</h2>
|
||||
<p>Another common use case is that you want to just expose a file note -
|
||||
in such case you create label <code>customResourceProvider</code> (value
|
||||
|
||||
@@ -42,23 +42,31 @@
|
||||
<p>The value of <code>#titleTemplate</code> 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.</p>
|
||||
<p>As an example, imagine you collect server outage incidents and write some
|
||||
notes. It looks like this:</p>
|
||||
<p>Second variable injected is <code>parentNote</code> which gives access to
|
||||
the parent <a href="../Scripting/Script%20API/Frontend%20API/FNote.html"><code>FNote</code></a>.</p>
|
||||
<p>See also <a class="reference-link" href="Templates.html">Templates</a> which
|
||||
provides similar capabilities, including default note's content.</p>
|
||||
<h3>Examples</h3>
|
||||
<ul>
|
||||
<li>Incidents
|
||||
<li>Imagine you collect server outage incidents and write some notes. It looks
|
||||
like this:
|
||||
<ul>
|
||||
<li>2022-05-09: System crash</li>
|
||||
<li>2022-05-15: Backup delay</li>
|
||||
<li>Incidents
|
||||
<ul>
|
||||
<li>2022-05-09: System crash</li>
|
||||
<li>2022-05-15: Backup delay</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>You can automatize the date assignment by assigning a label <code>#titleTemplate="${now.format('YYYY-MM-DD')}: "</code> to
|
||||
the parent note "Incidents". Whenever a new child note is created, the
|
||||
title template is evaluated with the injected <a href="https://day.js.org/docs/en/display/format">now</a> object.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>To use a parent's attribute in the title of new notes: <code>#titleTemplate="${parentNote.getLabelValue('authorName')}'s literary works"</code>
|
||||
</li>
|
||||
<li>To mirror the parent's note title: <code>${parentNote.title}</code>
|
||||
</li>
|
||||
</ul>
|
||||
<p>You can automatize the date assignment by assigning a label <code>#titleTemplate="${now.format('YYYY-MM-DD')}: "</code> to
|
||||
the parent note "Incidents". Whenever a new child note is created, the
|
||||
title template is evaluated with the injected <a href="https://day.js.org/docs/en/display/format">now</a> object.</p>
|
||||
<p>Second variable injected is <a href="https://triliumnext.github.io/Notes/backend_api/BNote.html">parentNote</a>,
|
||||
an example could be <code>#titleTemplate="${parentNote.getLabelValue('authorName')}'s literary works"</code>.</p>
|
||||
<p>See also [[<a href="Templates.html">template</a>]] which provides similar
|
||||
capabilities, including default note's content.</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
202
src/public/app/doc_notes/en/User Guide/User Guide/Advanced Usage/Hidden Notes.html
generated
Normal file
@@ -0,0 +1,202 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="../../style.css">
|
||||
<base target="_parent">
|
||||
<title data-trilium-title>Hidden Notes</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="content">
|
||||
<h1 data-trilium-h1>Hidden Notes</h1>
|
||||
|
||||
<div class="ck-content">
|
||||
<figure class="image image-style-align-right">
|
||||
<img style="aspect-ratio:263/445;" src="Hidden Notes_image.png" width="263"
|
||||
height="445">
|
||||
</figure>
|
||||
<p>For easy extensibility, a lot of features in Trilium make use of actual
|
||||
notes to store information as opposed to having them stored in a separate
|
||||
location in the database. This allows some functions such as <a class="reference-link"
|
||||
href="Attributes.html">Attributes</a>, <a class="reference-link" href="Attributes/Relations.html">Relations</a> or
|
||||
even <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Navigation/Search.html">Search</a> and
|
||||
<a
|
||||
class="reference-link" href="../Note%20Types/Text/Links.html">Links</a> to be able to operate on them.</p>
|
||||
<p>As the name suggests, these notes are hidden to the user by default to
|
||||
prevent cluttering the note tree and to prevent them from being accidentally
|
||||
deleted.</p>
|
||||
<p>The hidden notes are stored in the user's <a class="reference-link"
|
||||
href="Database.html">Database</a> just like normal notes, but they
|
||||
have a unique <a class="reference-link" href="Note%20ID.html">Note ID</a> which
|
||||
allows them to be distinguished from the normal ones.</p>
|
||||
<h2>Accessing the hidden note tree</h2>
|
||||
<p>From the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Global%20menu.html">Global menu</a>,
|
||||
select <em>Advanced</em> → <em>Show Hidden Subtree</em>.</p>
|
||||
<h2>Contents of the hidden note tree</h2>
|
||||
<p>Here is a brief summary of all the notes within the hidden tree:</p>
|
||||
<figure
|
||||
class="table" style="width:100%;">
|
||||
<table class="ck-table-resized">
|
||||
<colgroup>
|
||||
<col style="width:19.93%;">
|
||||
<col style="width:80.07%;">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Note</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><a class="reference-link" href="#root/_hidden/_globalNoteMap">Note Map</a>
|
||||
</td>
|
||||
<td>
|
||||
<p>This note is actually opened when the <a class="reference-link" href="../Note%20Types/Note%20Map.html">Note Map</a> feature
|
||||
that is accessed from the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Launch%20Bar.html">Launch Bar</a>.</p>
|
||||
<p>It is possible to create any child notes in it without any additional
|
||||
meaning. For example, it can be used to store a list of note maps which
|
||||
can be linked to from other notes or <a href="../Basic%20Concepts%20and%20Features/Navigation/Bookmarks.html">bookmarked</a>.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a class="reference-link" href="#root/_hidden/_sqlConsole">SQL Console History</a>
|
||||
</td>
|
||||
<td>
|
||||
<p>When SQL queries or commands are executed in the <a class="reference-link"
|
||||
href="Database/Manually%20altering%20the%20database/SQL%20Console.html">SQL Console</a>,
|
||||
they are stored here, grouped by month. Only the query is stored and not
|
||||
the results.</p>
|
||||
<p>This section can be accessed without going to the hidden tree by simply
|
||||
going to the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Global%20menu.html">Global menu</a> and
|
||||
selecting Advanced → Open SQL Console History.</p>
|
||||
<p>Notes can be added as children of this tree, but it's generally not recommended
|
||||
to do so to not interfere with the normal history process.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a class="reference-link" href="#root/_hidden/_search">Search History</a>
|
||||
</td>
|
||||
<td>
|
||||
<p>Whenever a search is executed from the full <a class="reference-link"
|
||||
href="../Basic%20Concepts%20and%20Features/Navigation/Search.html">Search</a>,
|
||||
the query will be stored here, grouped by month. Only the search parameters
|
||||
are stored and not the results themselves.</p>
|
||||
<p>This section can be accessed without going to the hidden tree by simply
|
||||
going to the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Global%20menu.html">Global menu</a> and
|
||||
selecting Advanced → Open Search History.</p>
|
||||
<p>Notes can be added as children of this tree, but it's generally not recommended
|
||||
to do so to not interfere with the normal history process.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a class="reference-link" href="#root/_hidden/_bulkAction">Bulk Action</a>
|
||||
</td>
|
||||
<td>
|
||||
<p>This section is used for <a class="reference-link" href="Bulk%20Actions.html">Bulk Actions</a>.
|
||||
The last configuration for bulk actions will be stored as part of this
|
||||
note, each action in its own <code>action</code> label.</p>
|
||||
<p>Notes can be added as children of this tree, but there won't be any benefit
|
||||
in doing so.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a class="reference-link" href="#root/_hidden/_backendLog">Backend Log</a>
|
||||
</td>
|
||||
<td>
|
||||
<p>This note corresponds to the backend log feature (see <a class="reference-link"
|
||||
href="../Troubleshooting/Error%20logs.html">Error logs</a>).</p>
|
||||
<p>This item can be accessed without going to the hidden try by going to
|
||||
the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Global%20menu.html">Global menu</a> and
|
||||
selecting Advanced → Show backend log.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a class="reference-link" href="#root/_hidden/_userHidden">User Hidden</a>
|
||||
</td>
|
||||
<td>This section can be used by <a href="../Scripting.html">scripts</a> to create
|
||||
their own notes that should not be directly visible to the user. The note
|
||||
can be identified by scripts by its unique ID: <code>_userHidden</code>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a class="reference-link" href="#root/_hidden/_lbTplRoot">Launch Bar Templates</a>
|
||||
</td>
|
||||
<td>
|
||||
<p>This section contains the templates for the creation of launchers in the
|
||||
<a
|
||||
class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Launch%20Bar.html">Launch Bar</a>. It is not possible to create child notes here.</p>
|
||||
<p>Theoretically some of the notes here can be customized, but there's not
|
||||
much benefit to be had in doing so.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a class="reference-link" href="#root/_hidden/_share">Shared Notes</a>
|
||||
</td>
|
||||
<td>
|
||||
<p>This tree lists all of the notes that are <a href="Sharing.html">shared</a> publicly.
|
||||
It can be useful to track down which notes are shared regardless of their
|
||||
position in the note tree.</p>
|
||||
<p>This section can be accessed without going to the hidden tree simply by
|
||||
going to the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Global%20menu.html">Global menu</a> and
|
||||
selecting <em>Show Shared Notes Subtree</em>.</p>
|
||||
<p>Sub-notes cannot be created here.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a class="reference-link" href="#root/_hidden/_lbRoot">Launch Bar</a>
|
||||
</td>
|
||||
<td>
|
||||
<p>The tree contains both available and displayed items of the <a class="reference-link"
|
||||
href="../Basic%20Concepts%20and%20Features/UI%20Elements/Launch%20Bar.html">Launch Bar</a>.</p>
|
||||
<p>This section can be accessed without going to the hidden tree by:</p>
|
||||
<ul>
|
||||
<li>Going to the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Global%20menu.html">Global menu</a> and
|
||||
selecting <em>Configure Launchbar</em>.</li>
|
||||
<li>Right-clicking an empty space on the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Launch%20Bar.html">Launch Bar</a> and
|
||||
selecting <em>Configure Launchbar</em>.</li>
|
||||
</ul>
|
||||
<p>Sub-notes cannot be created here.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a class="reference-link" href="#root/_hidden/_options">Options</a>
|
||||
</td>
|
||||
<td>
|
||||
<p>This section stores the list of <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Options.html">Options</a>.</p>
|
||||
<p>This section can be accessed without going to the hidden tree by:</p>
|
||||
<ul>
|
||||
<li>Going to the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Global%20menu.html">Global menu</a> and
|
||||
selecting <em>Options</em>.</li>
|
||||
<li>Pressing the dedicated Options icon in the <a class="reference-link"
|
||||
href="../Basic%20Concepts%20and%20Features/UI%20Elements/Launch%20Bar.html">Launch Bar</a>.</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a class="reference-link" href="#root/_hidden/_lbMobileRoot">Mobile Launch Bar</a>
|
||||
</td>
|
||||
<td>
|
||||
<p>This is very similar to the <em>Launch Bar</em>, but is dedicated for the
|
||||
mobile UI only.</p>
|
||||
<p>Accessing it outside the <em>Launch Bar</em> is the same as the Launch Bar,
|
||||
but needs to be done so from the mobile interface.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a class="reference-link" href="#root/_hidden/_help">User Guide</a>
|
||||
</td>
|
||||
<td>This is where the note structure for the User Guide is actually stored.
|
||||
Only the metadata is stored, as the help itself is present as actual files
|
||||
in the application directory.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</figure>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
BIN
src/public/app/doc_notes/en/User Guide/User Guide/Advanced Usage/Hidden Notes_image.png
generated
Normal file
|
After Width: | Height: | Size: 30 KiB |
@@ -17,7 +17,8 @@
|
||||
documents. This feature is particularly useful for publishing content directly
|
||||
from your Trilium notes, making it accessible to others online.</p>
|
||||
<h2>Prerequisites</h2>
|
||||
<p>To use the sharing feature, you must have a <a href="../Installation%20%26%20Setup/Server%20Installation.html">server installation</a> of
|
||||
<p>To use the sharing feature, you must have a <a class="reference-link"
|
||||
href="../Installation%20%26%20Setup/Server%20Installation.html">Server Installation</a> of
|
||||
Trilium. This is necessary because the notes will be hosted from the server.</p>
|
||||
<h2>How to Share a Note</h2>
|
||||
<ol>
|
||||
@@ -64,10 +65,11 @@
|
||||
<p>The default shared page is basic in design, but you can customize it using
|
||||
your own CSS:</p>
|
||||
<ul>
|
||||
<li><strong>Custom CSS</strong>: Link a CSS <a href="../Note%20Types/Code.html">code note</a> to
|
||||
the shared page by adding a <code>~shareCss</code> 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 <code>#shareHiddenFromTree</code> label.</li>
|
||||
<li><strong>Custom CSS</strong>: Link a CSS <a class="reference-link"
|
||||
href="../Note%20Types/Code.html">Code</a> note to the shared page
|
||||
by adding a <code>~shareCss</code> 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 <code>#shareHiddenFromTree</code> label.</li>
|
||||
<li><strong>Omitting Default CSS</strong>: For extensive styling changes,
|
||||
use the <code>#shareOmitDefaultCss</code> label to avoid conflicts with Trilium's
|
||||
<a
|
||||
@@ -112,16 +114,6 @@ for (const attr of parentNote.attributes) {
|
||||
making it easier to use Trilium as a fully-fledged website. Consider combining
|
||||
this with the <code>#shareIndex</code> label, which will display a list of
|
||||
all shared notes.</p>
|
||||
<h2>Additional Options</h2>
|
||||
<ul>
|
||||
<li><strong>Raw Note Sharing</strong>: Use the <code>#shareRaw</code> label
|
||||
to share a note without any HTML wrapper.</li>
|
||||
<li><strong>Disallow Robot Indexing</strong>: Add the <code>#shareDisallowRobotIndexing</code> label
|
||||
to prevent search engines from indexing the shared page by including a <code>noindex, follow</code> meta
|
||||
tag and <code>X-Robots-Tag: noindex</code> header.</li>
|
||||
<li><strong>Shared Notes Index</strong>: For text notes with the <code>#shareIndex</code> label,
|
||||
the content will display a list of all shared note roots.</li>
|
||||
</ul>
|
||||
<h2>Limitations</h2>
|
||||
<p>While the sharing feature is powerful, it has some limitations:</p>
|
||||
<ul>
|
||||
@@ -135,6 +127,84 @@ for (const attr of parentNote.attributes) {
|
||||
<li><strong>Include Notes</strong>: Not supported.</li>
|
||||
</ul>
|
||||
<p>Some of these limitations may be addressed in future updates.</p>
|
||||
<h2>Attribute reference</h2>
|
||||
<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
|
||||
<a
|
||||
class="reference-link" href="Sharing/Serving%20directly%20the%20content%20o.html">Serving directly the content of a note</a> for an alternative method
|
||||
without setting an attribute.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>shareDisallowRobotIndexing</code>
|
||||
</td>
|
||||
<td>
|
||||
<p>Indicates to web crawlers that the page should not be indexed of this
|
||||
note by:</p>
|
||||
<ul>
|
||||
<li>Setting the <code>X-Robots-Tag: noindex</code> HTTP header.</li>
|
||||
<li>Setting the <code>noindex, follow</code> meta tag.</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>shareCredentials</code>
|
||||
</td>
|
||||
<td>require credentials to access this shared note. Value is expected to be
|
||||
in format <code>username:password</code>. Don't forget to make this inheritable
|
||||
to apply to child-notes/images.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>shareIndex</code>
|
||||
</td>
|
||||
<td>Note with this label will list all roots of shared notes.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</figure>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
</p>
|
||||
<p>For the template to appear in the menu, the template note must have the <code>#template</code> label.
|
||||
Do not confuse this with the <code>~template</code> relation, which links
|
||||
the instance note to the template note. If you use <a href="../Basic%20Concepts%20and%20Features/Navigation/Workspace.html">workspaces</a>,
|
||||
the instance note to the template note. If you use <a href="../Basic%20Concepts%20and%20Features/Navigation/Workspaces.html">workspaces</a>,
|
||||
you can also mark templates with <code>#workspaceTemplate</code> to display
|
||||
them only in the workspace.</p>
|
||||
<p>Templates can also be added or changed after note creation by creating
|
||||
|
||||
@@ -13,9 +13,8 @@
|
||||
<h1 data-trilium-h1>Markdown</h1>
|
||||
|
||||
<div class="ck-content">
|
||||
<p>Trilium Notes supports importing Markdown restricted to the <a href="https://spec.commonmark.org/current/">CommonMark specification</a> (where
|
||||
<a
|
||||
href="https://github.com/TriliumNext/Notes/issues/2026">tables are not supported</a>)</p>
|
||||
<p>Trilium supports Markdown for both import and export, while trying to
|
||||
keep compatibility as high as possible.</p>
|
||||
<h2>Import</h2>
|
||||
<h3>Clipboard import</h3>
|
||||
<p>If you want to import just a chunk of markdown from clipboard, you can
|
||||
@@ -57,6 +56,23 @@
|
||||
<p>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.</p>
|
||||
<h2>Supported syntax</h2>
|
||||
<ul>
|
||||
<li><a href="https://github.github.com/gfm/">GitHub-Flavored Markdown</a> is
|
||||
the main syntax that Trilium is following.</li>
|
||||
<li>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.</li>
|
||||
<li>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.</li>
|
||||
<li><a class="reference-link" href="../../Note%20Types/Text/Admonitions.html">Admonitions</a> are
|
||||
supported using GitHub's format.</li>
|
||||
<li>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.</li>
|
||||
<li>Math equations are supported using <code>$</code> and <code>$$</code> syntaxes.</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
@@ -22,7 +22,7 @@
|
||||
<p>In addition to showing only this subtree, this also narrows both full
|
||||
text search and <a href="Note%20Navigation.html">“jump to note”</a> to just
|
||||
notes present in hoisted subtree.</p>
|
||||
<p>See also <a href="Workspace.html">Workspace</a> which extends this feature.</p>
|
||||
<p>See also <a href="Workspaces.html">Workspace</a> which extends this feature.</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="../../../style.css">
|
||||
<base target="_parent">
|
||||
<title data-trilium-title>Workspace</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="content">
|
||||
<h1 data-trilium-h1>Workspace</h1>
|
||||
|
||||
<div class="ck-content">
|
||||
<p>Workspace is a concept built up on top of <a href="Note%20Hoisting.html">note hoisting</a>.
|
||||
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.</p>
|
||||
<p>So far workspace consists of these features:</p>
|
||||
<ul>
|
||||
<li>
|
||||
<p><a href="Note%20Hoisting.html">note hoisting</a> - you can "zoom" into
|
||||
a workspace subtree to focus only on the relevant notes</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>easy entering of workspace: </p>
|
||||
<p>
|
||||
<img src="1_Workspace_image.png">
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>visual identification of workspace in tabs:
|
||||
<br>
|
||||
<img src="Workspace_image.png">
|
||||
</p>
|
||||
</li>
|
||||
</ul>
|
||||
<h3>How to use workspaces</h3>
|
||||
<p>Let's say you have identified the workspaces and their subtrees. Define
|
||||
on the root of this subtree following labels:</p>
|
||||
<ul>
|
||||
<li><code>#workspace</code> - Marks this note as a workspace, button to enter
|
||||
the workspace is controlled by this</li>
|
||||
<li><code>#workspaceIconClass</code> - controls the box icon to be displayed
|
||||
in the tree and tabs, example <code>bx bx-home</code>. See <a href="https://boxicons.com/">https://boxicons.com/</a>
|
||||
</li>
|
||||
<li><code>#workspaceTabBackgroundColor</code> - Background color of the tab,
|
||||
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>.</li>
|
||||
<li><code>#workspaceCalendarRoot</code> - 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.</li>
|
||||
<li><code>#workspaceTemplate</code> - 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.</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
100
src/public/app/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/Navigation/Workspaces.html
generated
Normal file
@@ -0,0 +1,100 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="../../../style.css">
|
||||
<base target="_parent">
|
||||
<title data-trilium-title>Workspaces</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="content">
|
||||
<h1 data-trilium-h1>Workspaces</h1>
|
||||
|
||||
<div class="ck-content">
|
||||
<p>Workspace is a concept built up on top of <a href="Note%20Hoisting.html">note hoisting</a>.
|
||||
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.</p>
|
||||
<p>So far workspace consists of these features:</p>
|
||||
<ul>
|
||||
<li>
|
||||
<p><a href="Note%20Hoisting.html">note hoisting</a> - you can "zoom" into
|
||||
a workspace subtree to focus only on the relevant notes</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>easy entering of workspace: </p>
|
||||
<p>
|
||||
<img src="1_Workspaces_image.png">
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>visual identification of workspace in tabs:
|
||||
<br>
|
||||
<img src="Workspaces_image.png">
|
||||
</p>
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Configuration</h3>
|
||||
<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 <a class="reference-link" href="../../Advanced%20Usage/Advanced%20Showcases/Day%20Notes.html">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>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
Before Width: | Height: | Size: 9.0 KiB After Width: | Height: | Size: 9.0 KiB |
@@ -43,10 +43,10 @@
|
||||
(soft-delete) - the actual content, title, attributes etc. are not deleted,
|
||||
only hidden.</p>
|
||||
<p>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.</p>
|
||||
notes - open the <a class="reference-link" href="UI%20Elements/Recent%20Changes.html">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.</p>
|
||||
<p>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.</p>
|
||||
@@ -60,7 +60,7 @@
|
||||
href="../Installation%20%26%20Setup/Backup.html">Backup</a>).</p>
|
||||
<h2>See also</h2>
|
||||
<ul>
|
||||
<li><a href="Notes/Read-Only%20Notes.html">Read-only note</a>
|
||||
<li><a class="reference-link" href="Notes/Read-Only%20Notes.html">Read-Only Notes</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -103,13 +103,7 @@
|
||||
the "Note Paths" tab in the Ribbon toolbar.</p>
|
||||
<p>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.</p>
|
||||
<h2>Prefix</h2>
|
||||
<p>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.</p>
|
||||
<p> </p>
|
||||
<h2>Deleting notes/clones</h2>
|
||||
<p>With clones, it might not be immediately obvious how deleting works.</p>
|
||||
<p>If you try to delete a note, it works like this:</p>
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="../../../../style.css">
|
||||
<base target="_parent">
|
||||
<title data-trilium-title>Branch prefix</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="content">
|
||||
<h1 data-trilium-h1>Branch prefix</h1>
|
||||
|
||||
<div class="ck-content">
|
||||
<p>Since a single note can appear into multiple places in the <a class="reference-link"
|
||||
href="../../UI%20Elements/Note%20Tree.html">Note Tree</a> via a process
|
||||
called <a class="reference-link" href="../Cloning%20Notes.html">Cloning Notes</a>,
|
||||
it's recommended to choose a generalized name that fits into all locations
|
||||
instead of something more specific to avoid confusion.</p>
|
||||
<p>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.</p>
|
||||
<p>The prefix is location-specific, so it's displayed only in the note tree.</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -15,6 +15,16 @@
|
||||
<div class="ck-content">
|
||||
<p>When a note has one or more child notes, they will be listed at the end
|
||||
of the note for easy navigation.</p>
|
||||
<h2>Configuration</h2>
|
||||
<ul>
|
||||
<li>To hide the note list for a particular note, simply apply the <code>hideChildrenOverview</code>
|
||||
<a
|
||||
href="../../Advanced%20Usage/Attributes.html">label</a>.</li>
|
||||
<li>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 <code>pageSize</code> to
|
||||
the desired number.</li>
|
||||
</ul>
|
||||
<h2>View types</h2>
|
||||
<p>By default, the notes will be displayed in a grid, however there are also
|
||||
some other view types available.</p>
|
||||
|
||||
@@ -13,11 +13,18 @@
|
||||
<h1 data-trilium-h1>Sorting Notes</h1>
|
||||
|
||||
<div class="ck-content">
|
||||
<h2>Sorting Notes</h2>
|
||||
<p>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</p>
|
||||
<h2>Manual sorting</h2>
|
||||
<p>You can sort notes by right-clicking the parent note in the <a class="reference-link"
|
||||
href="../UI%20Elements/Note%20Tree.html">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.</p>
|
||||
<p>The sorting dialog allows:</p>
|
||||
<ul>
|
||||
<li>Sorting by title, creation or modification date.</li>
|
||||
<li>Changing sorting direction can also be adjusted (ascending or descending).</li>
|
||||
<li>Ensuring folders are displayed at the top.</li>
|
||||
<li>Natural sort, based on the sorting rules of a particular language.</li>
|
||||
</ul>
|
||||
<h2>Automatic/Permanent Sorting</h2>
|
||||
<p>Child notes can be automatically sorted by attaching specific <a href="../../Advanced%20Usage/Attributes.html">labels</a> to
|
||||
the parent note:</p>
|
||||
|
||||
|
Before Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 80 KiB |
@@ -95,7 +95,7 @@
|
||||
</p>
|
||||
<p>Allows defining a custom widget to be rendered inside the launcher. See
|
||||
<a
|
||||
href="../../Scripting/Widget%20Basics.html">Widget Basics</a> for more information.</p>
|
||||
href="../../Scripting/Custom%20Widgets/Widget%20Basics.html">Widget Basics</a> for more information.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><strong>Spacers</strong>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<p>This page explains how to manipulate the note tree in TriliumNext, focusing
|
||||
on moving notes.</p>
|
||||
<p>
|
||||
<img src="1_Note Tree_image.png">
|
||||
<img src="Note Tree_image.png">
|
||||
</p>
|
||||
<h2>Drag and Drop</h2>
|
||||
<p>
|
||||
@@ -45,19 +45,8 @@
|
||||
in the context menu, or with the associated keyboard <a href="../Keyboard%20Shortcuts.html">shortcuts</a>: <code>CTRL-C</code> (
|
||||
<a
|
||||
href="../Notes/Cloning%20Notes.html">copy</a>), <kbd>Ctrl</kbd> + <kbd>X</kbd> (cut) and <kbd>Ctrl</kbd> + <kbd>V</kbd> (paste).</p>
|
||||
<h2>Multiple selection</h2>
|
||||
<p>It is possible to select multiple notes at one time.</p>
|
||||
<p>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.</p>
|
||||
<p>
|
||||
<img src="Note Tree_image.png">
|
||||
</p>
|
||||
<p>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 href="../../Advanced%20Usage/Bulk%20actions.html">Bulk actions</a> to
|
||||
them. The rest of the options will not be available and will appear disabled
|
||||
in the menu.</p>
|
||||
<p>See <a class="reference-link" href="Note%20Tree/Note%20tree%20contextual%20menu.html">Note Tree Menu</a> for
|
||||
more information.</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
|
After Width: | Height: | Size: 94 KiB |
@@ -0,0 +1,32 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="../../../../style.css">
|
||||
<base target="_parent">
|
||||
<title data-trilium-title>Multiple selection</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="content">
|
||||
<h1 data-trilium-h1>Multiple selection</h1>
|
||||
|
||||
<div class="ck-content">
|
||||
<p>It is possible to select multiple notes at one time.</p>
|
||||
<p>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.</p>
|
||||
<p>
|
||||
<img src="Multiple selection_image.png">
|
||||
</p>
|
||||
<p>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.html">Bulk Actions</a> to
|
||||
them. The rest of the options will not be available and will appear disabled
|
||||
in the menu.</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
After Width: | Height: | Size: 7.3 KiB |
@@ -0,0 +1,243 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="../../../../style.css">
|
||||
<base target="_parent">
|
||||
<title data-trilium-title>Note tree contextual menu</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="content">
|
||||
<h1 data-trilium-h1>Note tree contextual menu</h1>
|
||||
|
||||
<div class="ck-content">
|
||||
<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>
|
||||
<p>The <em>note tree menu</em> can be accessed by right-clicking in the
|
||||
<a
|
||||
class="reference-link" href="../Note%20Tree.html">Note Tree</a>.</p>
|
||||
<h2>Interaction</h2>
|
||||
<p>The contextual menu can operate:</p>
|
||||
<ul>
|
||||
<li>On a single note, by right clicking it in the note tree.</li>
|
||||
<li>On multiple notes, by selecting them first. See <a class="reference-link"
|
||||
href="Multiple%20selection.html">Multiple selection</a> on how to
|
||||
do so.
|
||||
<ul>
|
||||
<li>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.</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<h2>Available options</h2>
|
||||
<aside class="admonition note">
|
||||
<p>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.</p>
|
||||
</aside>
|
||||
<ul>
|
||||
<li><strong>Open in a new tab</strong>
|
||||
<ul>
|
||||
<li>Will open a single note in a new <a href="../Tabs.html">tab</a>.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Open in a new split</strong>
|
||||
<ul>
|
||||
<li>Will open a split to the right with the given note within the current
|
||||
tab.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Hoist note</strong>
|
||||
<ul>
|
||||
<li>Will focus the note tree on this note. See <a class="reference-link"
|
||||
href="../../Navigation/Note%20Hoisting.html">Note Hoisting</a> for
|
||||
more information.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Insert note after</strong>
|
||||
<ul>
|
||||
<li>Allows easy creation of a note with a specified <a href="../../../Note%20Types.html">note type</a>.</li>
|
||||
<li><a class="reference-link" href="../../../Advanced%20Usage/Templates.html">Templates</a> will
|
||||
also be present (if any) at the end of the list.</li>
|
||||
<li>The note will be added on the same level of hierarchy as the note selected.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Insert child note</strong>
|
||||
<ul>
|
||||
<li>Same as <em>Insert note after</em>, but the note will be created as a child
|
||||
of the selected note.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Protect subtree</strong>
|
||||
<ul>
|
||||
<li>Will mark this note and all of its descendents as protected. See
|
||||
<a
|
||||
class="reference-link" href="../../Notes/Protected%20Notes.html">Protected Notes</a> for more information.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Unprotect subtree</strong>
|
||||
<ul>
|
||||
<li>Will unprotect this note and all of its descendents.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Cut</strong>
|
||||
<ul>
|
||||
<li>Will place the given notes in clipboard.</li>
|
||||
<li>Use one of the two paste functions (or the keyboard shortcuts) to move
|
||||
them to the desired location.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Copy / clone</strong>
|
||||
<ul>
|
||||
<li>Will place the given notes in clipboard.</li>
|
||||
<li>Use one of the two paste functions (or the keyboard shortcuts) to copy
|
||||
them to the desired location.</li>
|
||||
<li>Note that the copy function here works according to the <a class="reference-link"
|
||||
href="../../Notes/Cloning%20Notes.html">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).</li>
|
||||
<li>To simply create a duplicate note that can be modified independently,
|
||||
look for <em>Duplicate subtree</em>.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Paste into</strong>
|
||||
<ul>
|
||||
<li>If there are any notes in clipboard, they will be pasted as child notes
|
||||
to the right-clicked one.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Paste after</strong>
|
||||
<ul>
|
||||
<li>If there are any notes in clipboard, they will be pasted underneath the
|
||||
right-clicked one.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Move to…</strong>
|
||||
<ul>
|
||||
<li>Will display a modal to specify where to move the desired notes.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Clone to…</strong>
|
||||
<ul>
|
||||
<li>Will display a modal to specify where to <a href="../../Notes/Cloning%20Notes.html">clone</a> the
|
||||
desired notes.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Delete</strong>
|
||||
<ul>
|
||||
<li>Will delete the given notes, asking for confirmation first.</li>
|
||||
<li>In the dialog, the following options can be configured:
|
||||
<ul>
|
||||
<li><em>Delete also all clones</em> 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.html">Cloning Notes</a>).</li>
|
||||
<li><em>Erase notes permanently</em> will ensure that the note cannot be recovered
|
||||
from <a class="reference-link" href="../Recent%20Changes.html">Recent Changes</a>.</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Import into note</strong>
|
||||
<ul>
|
||||
<li>Opens the <a href="../../Import%20%26%20Export">import</a> dialog and places
|
||||
the imported notes as child notes of the selected one.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Export</strong>
|
||||
<ul>
|
||||
<li>Opens the <a href="../../Import%20%26%20Export">export</a> dialog for the
|
||||
selected notes.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Search in subtree</strong>
|
||||
<ul>
|
||||
<li>Opens a full <a class="reference-link" href="../../Navigation/Search.html">Search</a> with
|
||||
it preconfigured to only look into this note and its descendants (the <em>Ancestor</em> field).</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<h2>Advanced options</h2>
|
||||
<figure class="image image-style-align-right">
|
||||
<img style="aspect-ratio:289/355;" src="Note tree contextual menu_.png"
|
||||
width="289" height="355">
|
||||
</figure>
|
||||
<p>The advanced options menu offers some of the less frequently used actions
|
||||
for notes.</p>
|
||||
<p>To access these options, first look for the <em>Advanced</em> option in
|
||||
the contextual menu to reveal a sub-menu with:</p>
|
||||
<ul>
|
||||
<li><strong>Apply bulk actions</strong>
|
||||
<ul>
|
||||
<li>Opens the <a class="reference-link" href="../../../Advanced%20Usage/Bulk%20Actions.html">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.html">Multiple selection</a>).</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Edit branch prefix</strong>
|
||||
<ul>
|
||||
<li>Opens a dialog to assign a name to be able to distinguish <a href="../../Notes/Cloning%20Notes.html">clones</a>,
|
||||
see <a class="reference-link" href="../../Notes/Cloning%20Notes/Branch%20prefix.html">Branch prefix</a> for
|
||||
more information.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Convert to attachment</strong>
|
||||
<ul>
|
||||
<li>Converts the selected notes to <a class="reference-link" href="../../Notes/Attachments.html">Attachments</a> of
|
||||
their parent notes.</li>
|
||||
<li>This functional is most useful when dealing with image <a class="reference-link"
|
||||
href="../../../Note%20Types/File.html">File</a> notes that were imported
|
||||
from an external source or an older version of Trilium.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Duplicate subtree</strong>
|
||||
<ul>
|
||||
<li>Creates a copy of the note and its descendants.</li>
|
||||
<li>This process is different from <a class="reference-link" href="../../Notes/Cloning%20Notes.html">Cloning Notes</a> since
|
||||
the duplicated note can be edited independently from the original.</li>
|
||||
<li>An alternative to this, if done regularly, would be <a class="reference-link"
|
||||
href="../../../Advanced%20Usage/Templates.html">Templates</a>.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Expand subtree</strong>
|
||||
<ul>
|
||||
<li>Expands all the child notes in the <a class="reference-link" href="../Note%20Tree.html">Note Tree</a>.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Collapse subtree</strong>
|
||||
<ul>
|
||||
<li>Collapses all the child notes in the note tree.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Sort by…</strong>
|
||||
<ul>
|
||||
<li>Opens a dialog to sort all the child notes of the selected note.</li>
|
||||
<li>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.html">Attributes</a>.</li>
|
||||
<li>See <a class="reference-link" href="../../Notes/Sorting%20Notes.html">Sorting Notes</a> for
|
||||
more information.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Copy note path to clipboard</strong>
|
||||
<ul>
|
||||
<li>Copies a URL fragment representing the full path to this branch for a
|
||||
note, such as <code>#root/Hb2E70L7HPuf/4sRFgMZhYFts/2IVuShedRJ3U/LJVMvKXOFv7n</code>.</li>
|
||||
<li>The URL to manually create <a class="reference-link" href="../../../Note%20Types/Text/Links.html">Links</a> within
|
||||
notes, or for note <a class="reference-link" href="../../Navigation">Navigation</a>.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Recent changes in subtree</strong>
|
||||
<ul>
|
||||
<li>This will open <a class="reference-link" href="../Recent%20Changes.html">Recent Changes</a>,
|
||||
but filtered to only the changes related to this note or one of its descendants.</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 17 KiB |
@@ -0,0 +1,50 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="../../../style.css">
|
||||
<base target="_parent">
|
||||
<title data-trilium-title>Recent Changes</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="content">
|
||||
<h1 data-trilium-h1>Recent Changes</h1>
|
||||
|
||||
<div class="ck-content">
|
||||
<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>
|
||||
<h2>Accessing the recent changes</h2>
|
||||
<ul>
|
||||
<li>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.html">Launch Bar</a>.
|
||||
<ul>
|
||||
<li>If there is a <a href="../Navigation/Note%20Hoisting.html">hoisted note</a> or
|
||||
a <a href="../Navigation/Workspaces.html">workspace</a>, the list of recent
|
||||
changes will be limited to the descendents of the hoisted note, or the
|
||||
workspace.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>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.html">Note tree contextual menu</a> →
|
||||
Advanced.</li>
|
||||
</ul>
|
||||
<h2>Interaction</h2>
|
||||
<ul>
|
||||
<li>Notes which were changed will appear in reverse chronological order (latest
|
||||
update first).</li>
|
||||
<li>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.</li>
|
||||
<li>Deleted notes will also be listed here, at their time of deletion. Press
|
||||
the <em>Undelete</em> link next to them in order to recover them.</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
@@ -105,6 +105,9 @@
|
||||
<h3>Edited notes</h3>
|
||||
<p>This section pops automatically when entering a <a href="../../Advanced%20Usage/Advanced%20Showcases/Day%20Notes.html">day note</a> and
|
||||
shows the notes that were edited that day.</p>
|
||||
<p>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 <em>Ribbon widgets</em> section.</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="../../../style.css">
|
||||
<base target="_parent">
|
||||
<title data-trilium-title>Events</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="content">
|
||||
<h1 data-trilium-h1>Events</h1>
|
||||
|
||||
<div class="ck-content">
|
||||
<p><a href="../../Scripting.html">Script</a> notes can be triggered by events.
|
||||
Note that these are backend events and thus relation need to point to the
|
||||
"JS backend" code note.</p>
|
||||
<h2>Global events</h2>
|
||||
<p>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.</p>
|
||||
<ul>
|
||||
<li><code>run</code>
|
||||
<ul>
|
||||
<li><code>frontendStartup</code> - executes on frontend upon startup</li>
|
||||
<li><code>mobileStartup</code> - executes on mobile frontend upon startup</li>
|
||||
<li><code>backendStartup</code> - executes on backend upon startup</li>
|
||||
<li><code>hourly</code> - executes once an hour on backend</li>
|
||||
<li><code>daily</code> - executes once a day on backend</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<h2>Entity events</h2>
|
||||
<p>Other events are bound to some entity, these are defined as <a href="../../Advanced%20Usage/Attributes.html">relations</a> -
|
||||
meaning that script is triggered only if note has this script attached
|
||||
to it through relations (or it can inherit it).</p>
|
||||
<ul>
|
||||
<li><code>runOnNoteCreation</code> - executes when note is created on backend</li>
|
||||
<li><code>runOnNoteTitleChange</code> - executes when note title is changed
|
||||
(includes note creation as well)</li>
|
||||
<li><code>runOnNoteContentChange</code> - executes when note content is changed
|
||||
(includes note creation as well).</li>
|
||||
<li><code>runOnNoteChange</code> - executes when note is changed (includes
|
||||
note creation as well)</li>
|
||||
<li><code>runOnNoteDeletion</code> - executes when note is being deleted</li>
|
||||
<li><code>runOnBranchCreation</code> - 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.</li>
|
||||
<li><code>runOnBranchChange</code> (since v0.62) - executes when a branch is
|
||||
changed - either expanded status or prefix are changed.</li>
|
||||
<li><code>runOnBranchDeletion</code> - 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).</li>
|
||||
<li><code>runOnChildNoteCreation</code> - executes when new note is created
|
||||
under <em>this</em> note</li>
|
||||
<li><code>runOnAttributeCreation</code> - executes when new attribute is created
|
||||
under <em>this</em> note</li>
|
||||
<li><code>runOnAttributeChange</code> - executes when attribute is changed
|
||||
under <em>this</em> note</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -25,7 +25,7 @@
|
||||
<h2>Location</h2>
|
||||
<p>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 <code>#searchHome</code> label.
|
||||
Additionally, for <a href="../Basic%20Concepts%20and%20Features/Navigation/Workspace.html">workspaces</a>,
|
||||
Additionally, for <a href="../Basic%20Concepts%20and%20Features/Navigation/Workspaces.html">workspaces</a>,
|
||||
you can use the <code>#workspaceSearchHome</code> label to specify a storage
|
||||
location for saved searches within that workspace.</p>
|
||||
</div>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<p>Trilium supports creating <a class="reference-link" href="Note%20Types/Code.html">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.html">Script API</a> provide
|
||||
Trilium which can in conjunction with <a class="reference-link" href="Scripting/Script%20API.html">Script API</a> provide
|
||||
extra functionality.</p>
|
||||
<h2>Scripting</h2>
|
||||
<p>To go further I must explain basic architecture of Trilium - in its essence
|
||||
@@ -58,9 +58,9 @@
|
||||
<p>You can see more scripting with explanation in <a class="reference-link"
|
||||
href="Advanced%20Usage/Advanced%20Showcases.html">Advanced Showcases</a>.</p>
|
||||
<h2>Events</h2>
|
||||
<p>See <a class="reference-link" href="Note%20Types/Code/Events.html">Events</a>.</p>
|
||||
<p>See <a class="reference-link" href="Scripting/Events.html">Events</a>.</p>
|
||||
<h2>Script API</h2>
|
||||
<p>See <a class="reference-link" href="Note%20Types/Code/Script%20API.html">Script API</a>.</p>
|
||||
<p>See <a class="reference-link" href="Scripting/Script%20API.html">Script API</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="../../../style.css">
|
||||
<link rel="stylesheet" href="../../style.css">
|
||||
<base target="_parent">
|
||||
<title data-trilium-title>Custom Widgets</title>
|
||||
</head>
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="../../style.css">
|
||||
<link rel="stylesheet" href="../../../style.css">
|
||||
<base target="_parent">
|
||||
<title data-trilium-title>Widget Basics</title>
|
||||
</head>
|
||||
@@ -33,15 +33,15 @@ module.exports = new MyWidget();</code></pre>
|
||||
<ol>
|
||||
<li>Create a new <code>JS Frontend</code> note in Trilium and paste in the code
|
||||
above.</li>
|
||||
<li>Assign the <code>#widget</code> <a href="../Advanced%20Usage/Attributes.html">attribute</a> to
|
||||
the <a href="../Basic%20Concepts%20and%20Features/Notes.html">note</a>.</li>
|
||||
<li>Assign the <code>#widget</code> <a href="../../Advanced%20Usage/Attributes.html">attribute</a> to
|
||||
the <a href="../../Basic%20Concepts%20and%20Features/Notes.html">note</a>.</li>
|
||||
<li>Restart Trilium or reload the window.</li>
|
||||
</ol>
|
||||
<p>To verify that the widget is working, open the developer tools (<code>Cmd</code> + <code>Shift</code> + <code>I</code>)
|
||||
and run <code>document.querySelector("#my-widget")</code>. If the element
|
||||
is found, the widget is functioning correctly. If <code>undefined</code> is
|
||||
returned, double-check that the <a href="../Basic%20Concepts%20and%20Features/Notes.html">note</a> has
|
||||
the <code>#widget</code> <a href="../Advanced%20Usage/Attributes.html">attribute</a>.</p>
|
||||
returned, double-check that the <a href="../../Basic%20Concepts%20and%20Features/Notes.html">note</a> has
|
||||
the <code>#widget</code> <a href="../../Advanced%20Usage/Attributes.html">attribute</a>.</p>
|
||||
<h3>Step 2: Adding an UI Element</h3>
|
||||
<p>Next, let's improve the widget by adding a button to it.</p><pre><code class="language-text-x-trilium-auto">const template = ``;
|
||||
|
||||
@@ -84,7 +84,7 @@ module.exports = new MyWidget();</code></pre>
|
||||
of the left pane, alongside other action buttons.</p>
|
||||
<h3>Step 4: Adding User Interaction</h3>
|
||||
<p>Let’s make the button interactive by showing a message when it’s clicked.
|
||||
We'll use the <code>api.showMessage</code> method from the <a href="../Note%20Types/Code/Script%20API.html">Script API</a>.</p><pre><code class="language-text-x-trilium-auto">class MyWidget extends api.BasicWidget {
|
||||
We'll use the <code>api.showMessage</code> method from the <a href="../Script%20API.html">Script API</a>.</p><pre><code class="language-text-x-trilium-auto">class MyWidget extends api.BasicWidget {
|
||||
get position() { return 1; }
|
||||
get parentWidget() { return "left-pane"; }
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="../../../../style.css">
|
||||
<link rel="stylesheet" href="../../../style.css">
|
||||
<base target="_parent">
|
||||
<title data-trilium-title>Word count widget</title>
|
||||
</head>
|
||||
@@ -15,9 +15,9 @@
|
||||
<div class="ck-content">
|
||||
<aside class="admonition tip">
|
||||
<p>This widget is also present in new installations in the <a class="reference-link"
|
||||
href="../../../Advanced%20Usage/Database/Demo%20Notes.html">Demo Notes</a>.</p>
|
||||
href="../../Advanced%20Usage/Database/Demo%20Notes.html">Demo Notes</a>.</p>
|
||||
</aside>
|
||||
<p>Create a <a class="reference-link" href="../../Code.html">Code</a> note
|
||||
<p>Create a <a class="reference-link" href="../../Note%20Types/Code.html">Code</a> note
|
||||
of type JS frontend and <strong>give it a</strong> <code>#widget</code> <strong>label</strong>.</p><pre><code class="language-text-x-trilium-auto">/*
|
||||
* This defines a custom widget which displays number of words and characters in a current text note.
|
||||
* To be activated for a given note, add label 'wordCount' to the note, you can also make it inheritable and thus activate it for the whole subtree.
|
||||
@@ -93,7 +93,7 @@ class WordCountWidget extends api.NoteContextAwareWidget {
|
||||
}
|
||||
|
||||
module.exports = new WordCountWidget();</code></pre>
|
||||
<p>After you make changes it is necessary to <a href="../../../Troubleshooting/Refreshing%20the%20application.html">restart Trilium</a> so
|
||||
<p>After you make changes it is necessary to <a href="../../Troubleshooting/Refreshing%20the%20application.html">restart Trilium</a> so
|
||||
that the layout can be rebuilt.</p>
|
||||
<p>At the bottom of the note you can see the resulting widget:</p>
|
||||
<figure
|
||||
|
Before Width: | Height: | Size: 108 KiB After Width: | Height: | Size: 108 KiB |
150
src/public/app/doc_notes/en/User Guide/User Guide/Scripting/Events.html
generated
Normal file
@@ -0,0 +1,150 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="../../style.css">
|
||||
<base target="_parent">
|
||||
<title data-trilium-title>Events</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="content">
|
||||
<h1 data-trilium-h1>Events</h1>
|
||||
|
||||
<div class="ck-content">
|
||||
<p><a href="../Scripting.html">Script</a> notes can be triggered by events.
|
||||
Note that these are backend events and thus relation need to point to the
|
||||
"JS backend" code note.</p>
|
||||
<h2>Global events</h2>
|
||||
<p>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.</p>
|
||||
<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 <a class="reference-link"
|
||||
href="../Advanced%20Usage/Configuration%20(config.ini%20or%20environment%20variables)/Trilium%20instance.html">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>
|
||||
|
||||
<h2>Entity events</h2>
|
||||
<p>Other events are bound to some entity, these are defined as <a href="../Advanced%20Usage/Attributes.html">relations</a> -
|
||||
meaning that script is triggered only if note has this script attached
|
||||
to it through relations (or it can inherit it).</p>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -18,7 +18,7 @@
|
||||
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 <code>api</code>.
|
||||
The members and methods of the api can be seen on the <a href="../Note%20Types/Code/Script%20API.html">Script API</a> page.</p>
|
||||
The members and methods of the api can be seen on the <a href="Script%20API.html">Script API</a> page.</p>
|
||||
<h2>Scripts</h2>
|
||||
<p>Scripts don't have any special requirements. They can be run at will using
|
||||
the execute button in the UI or they can be configured to run at certain
|
||||
@@ -95,7 +95,7 @@
|
||||
notes.</li>
|
||||
</ul>
|
||||
<h3>Tutorial</h3>
|
||||
<p>For more information on building widgets, take a look at <a href="Widget%20Basics.html">Widget Basics</a>.</p>
|
||||
<p>For more information on building widgets, take a look at <a href="Custom%20Widgets/Widget%20Basics.html">Widget Basics</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="../../../style.css">
|
||||
<link rel="stylesheet" href="../../style.css">
|
||||
<base target="_parent">
|
||||
<title data-trilium-title>Script API</title>
|
||||
</head>
|
||||
19
src/public/app/doc_notes/en/User Guide/User Guide/Scripting/Script API/Backend API.html
generated
Normal file
@@ -0,0 +1,19 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="../../../style.css">
|
||||
<base target="_parent">
|
||||
<title data-trilium-title>Backend API</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="content">
|
||||
<h1 data-trilium-h1>Backend API</h1>
|
||||
|
||||
<div class="ck-content"></div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
19
src/public/app/doc_notes/en/User Guide/User Guide/Scripting/Script API/Frontend API/FNote.html
generated
Normal file
@@ -0,0 +1,19 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="../../../../style.css">
|
||||
<base target="_parent">
|
||||
<title data-trilium-title>FNote</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="content">
|
||||
<h1 data-trilium-h1>FNote</h1>
|
||||
|
||||
<div class="ck-content"></div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -31,7 +31,7 @@
|
||||
In Linux, you can set it as follows:</p><pre><code class="language-text-x-trilium-auto">TRILIUM_START_NOTE_ID=root ./trilium</code></pre>
|
||||
<h2>Broken Script Prevents Application Startup</h2>
|
||||
<p>If a custom script causes Triliumto crash, and it is set as a startup
|
||||
script or in an active <a href="Note%20Types/Code/Custom%20Widgets.html">custom widget</a>,
|
||||
script or in an active <a href="Scripting/Custom%20Widgets.html">custom widget</a>,
|
||||
start Triliumin "safe mode" to prevent any custom scripts from executing:</p><pre><code class="language-text-x-trilium-auto">TRILIUM_SAFE_MODE=true ./trilium</code></pre>
|
||||
<p>Depending on your Trilium distribution, you may have pre-made scripts
|
||||
available: <code>trilium-safe-mode.bat</code> and <code>trilium-safe-mode.sh</code>.</p>
|
||||
|
||||
@@ -84,6 +84,14 @@
|
||||
</li>
|
||||
<li><a href="User%20Guide/Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.html"
|
||||
target="detail">Note Tree</a>
|
||||
<ul>
|
||||
<li><a href="User%20Guide/Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree/Note%20tree%20contextual%20menu.html"
|
||||
target="detail">Note tree contextual menu</a>
|
||||
</li>
|
||||
<li><a href="User%20Guide/Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree/Multiple%20selection.html"
|
||||
target="detail">Multiple selection</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="User%20Guide/Basic%20Concepts%20and%20Features/UI%20Elements/Ribbon.html"
|
||||
target="detail">Ribbon</a>
|
||||
@@ -109,6 +117,9 @@
|
||||
<li><a href="User%20Guide/Basic%20Concepts%20and%20Features/UI%20Elements/Right%20Sidebar.html"
|
||||
target="detail">Right Sidebar</a>
|
||||
</li>
|
||||
<li><a href="User%20Guide/Basic%20Concepts%20and%20Features/UI%20Elements/Recent%20Changes.html"
|
||||
target="detail">Recent Changes</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="User%20Guide/Basic%20Concepts%20and%20Features/Notes.html" target="detail">Notes</a>
|
||||
@@ -121,6 +132,11 @@
|
||||
</li>
|
||||
<li><a href="User%20Guide/Basic%20Concepts%20and%20Features/Notes/Cloning%20Notes.html"
|
||||
target="detail">Cloning Notes</a>
|
||||
<ul>
|
||||
<li><a href="User%20Guide/Basic%20Concepts%20and%20Features/Notes/Cloning%20Notes/Branch%20prefix.html"
|
||||
target="detail">Branch prefix</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="User%20Guide/Basic%20Concepts%20and%20Features/Notes/Protected%20Notes.html"
|
||||
target="detail">Protected Notes</a>
|
||||
@@ -173,8 +189,8 @@
|
||||
<li><a href="User%20Guide/Basic%20Concepts%20and%20Features/Navigation/Note%20Hoisting.html"
|
||||
target="detail">Note Hoisting</a>
|
||||
</li>
|
||||
<li><a href="User%20Guide/Basic%20Concepts%20and%20Features/Navigation/Workspace.html"
|
||||
target="detail">Workspace</a>
|
||||
<li><a href="User%20Guide/Basic%20Concepts%20and%20Features/Navigation/Workspaces.html"
|
||||
target="detail">Workspaces</a>
|
||||
</li>
|
||||
<li><a href="User%20Guide/Basic%20Concepts%20and%20Features/Navigation/Similar%20Notes.html"
|
||||
target="detail">Similar Notes</a>
|
||||
@@ -254,19 +270,6 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="User%20Guide/Note%20Types/Code.html" target="detail">Code</a>
|
||||
<ul>
|
||||
<li><a href="User%20Guide/Note%20Types/Code/Script%20API.html" target="detail">Script API</a>
|
||||
</li>
|
||||
<li><a href="User%20Guide/Note%20Types/Code/Events.html" target="detail">Events</a>
|
||||
</li>
|
||||
<li><a href="User%20Guide/Note%20Types/Code/Custom%20Widgets.html" target="detail">Custom Widgets</a>
|
||||
<ul>
|
||||
<li><a href="User%20Guide/Note%20Types/Code/Custom%20Widgets/Word%20count%20widget.html"
|
||||
target="detail">Word count widget</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="User%20Guide/Note%20Types/Saved%20Search.html" target="detail">Saved Search</a>
|
||||
</li>
|
||||
@@ -332,6 +335,10 @@
|
||||
<ul>
|
||||
<li><a href="User%20Guide/Advanced%20Usage/Attributes.html" target="detail">Attributes</a>
|
||||
<ul>
|
||||
<li><a href="User%20Guide/Advanced%20Usage/Attributes/Labels.html" target="detail">Labels</a>
|
||||
</li>
|
||||
<li><a href="User%20Guide/Advanced%20Usage/Attributes/Relations.html" target="detail">Relations</a>
|
||||
</li>
|
||||
<li><a href="User%20Guide/Advanced%20Usage/Attributes/Attribute%20Inheritance.html"
|
||||
target="detail">Attribute Inheritance</a>
|
||||
</li>
|
||||
@@ -396,8 +403,13 @@
|
||||
</li>
|
||||
<li><a href="User%20Guide/Advanced%20Usage/Configuration%20(config.ini%20or%20e.html"
|
||||
target="detail">Configuration (config.ini or environment variables)</a>
|
||||
<ul>
|
||||
<li><a href="User%20Guide/Advanced%20Usage/Configuration%20(config.ini%20or%20environment%20variables)/Trilium%20instance.html"
|
||||
target="detail">Trilium instance</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="User%20Guide/Advanced%20Usage/Bulk%20actions.html" target="detail">Bulk actions</a>
|
||||
<li><a href="User%20Guide/Advanced%20Usage/Bulk%20Actions.html" target="detail">Bulk Actions</a>
|
||||
</li>
|
||||
<li><a href="User%20Guide/Advanced%20Usage/Note%20source.html" target="detail">Note source</a>
|
||||
</li>
|
||||
@@ -426,14 +438,14 @@
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="User%20Guide/Advanced%20Usage/Hidden%20Notes.html" target="detail">Hidden Notes</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="User%20Guide/Scripting.html" target="detail">Scripting</a>
|
||||
<ul>
|
||||
<li><a href="User%20Guide/Scripting/Frontend%20Basics.html" target="detail">Frontend Basics</a>
|
||||
</li>
|
||||
<li><a href="User%20Guide/Scripting/Widget%20Basics.html" target="detail">Widget Basics</a>
|
||||
</li>
|
||||
<li>Examples
|
||||
<ul>
|
||||
<li><a href="User%20Guide/Scripting/Examples/New%20Task%20launcher%20button.html"
|
||||
@@ -447,6 +459,31 @@
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="User%20Guide/Scripting/Events.html" target="detail">Events</a>
|
||||
</li>
|
||||
<li><a href="User%20Guide/Scripting/Custom%20Widgets.html" target="detail">Custom Widgets</a>
|
||||
<ul>
|
||||
<li><a href="User%20Guide/Scripting/Custom%20Widgets/Word%20count%20widget.html"
|
||||
target="detail">Word count widget</a>
|
||||
</li>
|
||||
<li><a href="User%20Guide/Scripting/Custom%20Widgets/Widget%20Basics.html"
|
||||
target="detail">Widget Basics</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="User%20Guide/Scripting/Script%20API.html" target="detail">Script API</a>
|
||||
<ul>
|
||||
<li>Frontend API
|
||||
<ul>
|
||||
<li><a href="User%20Guide/Scripting/Script%20API/Frontend%20API/FNote.html"
|
||||
target="detail">FNote</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="User%20Guide/Scripting/Script%20API/Backend%20API.html" target="detail">Backend API</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
5
src/public/app/types.d.ts
vendored
@@ -296,6 +296,7 @@ declare global {
|
||||
}
|
||||
|
||||
interface CKNode {
|
||||
_children: CKNode[];
|
||||
name: string;
|
||||
childCount: number;
|
||||
isEmpty: boolean;
|
||||
@@ -356,8 +357,8 @@ declare global {
|
||||
getChanges(): {
|
||||
type: string;
|
||||
name: string;
|
||||
position: {
|
||||
nodeAfter: CKNode;
|
||||
position?: {
|
||||
nodeAfter?: CKNode;
|
||||
parent: CKNode;
|
||||
toJSON(): Object;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,6 @@ const TPL = /*html*/`
|
||||
<p>${t("update_relation_target.on_all_matched_notes")}:</p>
|
||||
|
||||
<ul style="margin-bottom: 0;">
|
||||
<li>${t("update_relation_target.create_given_relation")}</li>
|
||||
<li>${t("update_relation_target.change_target_note")}</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -11,19 +11,6 @@ export default class LauncherContainer extends FlexContainer<LauncherWidget> {
|
||||
super(isHorizontalLayout ? "row" : "column");
|
||||
|
||||
this.id("launcher-container");
|
||||
|
||||
if (isHorizontalLayout) {
|
||||
this.css("width", "100%");
|
||||
this.css("height", "100%");
|
||||
this.css("overflow-x", "auto");
|
||||
this.css("overflow-y", "hidden");
|
||||
} else {
|
||||
this.css("height", "100%");
|
||||
this.css("overflow-x", "hidden");
|
||||
this.css("overflow-y", "auto");
|
||||
}
|
||||
|
||||
this.css("scrollbar-gutter", "stable both-edges");
|
||||
this.filling();
|
||||
this.isHorizontalLayout = isHorizontalLayout;
|
||||
|
||||
|
||||
@@ -56,7 +56,11 @@ export default class QuickSearchWidget extends BasicWidget {
|
||||
|
||||
doRender() {
|
||||
this.$widget = $(TPL);
|
||||
this.dropdown = Dropdown.getOrCreateInstance(this.$widget.find("[data-bs-toggle='dropdown']")[0]);
|
||||
this.dropdown = Dropdown.getOrCreateInstance(this.$widget.find("[data-bs-toggle='dropdown']")[0], {
|
||||
popperConfig: {
|
||||
strategy: "fixed"
|
||||
}
|
||||
});
|
||||
|
||||
this.$searchString = this.$widget.find(".search-string");
|
||||
this.$dropdownMenu = this.$widget.find(".dropdown-menu");
|
||||
|
||||
@@ -168,10 +168,10 @@ export default abstract class AbstractSplitTypeWidget extends TypeWidget {
|
||||
this.#destroyResizer();
|
||||
}
|
||||
|
||||
async doRefresh(note: FNote | null | undefined) {
|
||||
async doRefresh(note: FNote) {
|
||||
this.#adjustLayoutOrientation();
|
||||
|
||||
if (note && !this.isReadOnly) {
|
||||
if (!this.isReadOnly) {
|
||||
await this.editorTypeWidget.initialized;
|
||||
this.editorTypeWidget.noteContext = this.noteContext;
|
||||
this.editorTypeWidget.spacedUpdate = this.spacedUpdate;
|
||||
|
||||
@@ -46,7 +46,7 @@ export default abstract class AbstractSvgSplitTypeWidget extends AbstractSplitTy
|
||||
$(window).on("resize", this.zoomHandler);
|
||||
}
|
||||
|
||||
async doRefresh(note: FNote | null | undefined) {
|
||||
async doRefresh(note: FNote) {
|
||||
super.doRefresh(note);
|
||||
|
||||
const blob = await note?.getBlob();
|
||||
|
||||
@@ -45,9 +45,6 @@ export default class AttachmentListTypeWidget extends TypeWidget {
|
||||
}
|
||||
|
||||
async doRefresh(note: Parameters<TypeWidget["doRefresh"]>[0]) {
|
||||
// TriliumNextTODO: do we need to handle an undefined/null note?
|
||||
if (!note) return false;
|
||||
|
||||
const $helpButton = $(`
|
||||
<button class="attachment-help-button icon-action bx bx-help-circle"
|
||||
type="button" data-help-page="attachments.html"
|
||||
|
||||
@@ -101,25 +101,47 @@ function initTextEditor(textEditor: TextEditor) {
|
||||
const changes = document.differ.getChanges();
|
||||
let dirtyCodeBlocks = new Set<CKNode>();
|
||||
|
||||
function lookForCodeBlocks(node: CKNode) {
|
||||
for (const child of node._children) {
|
||||
if (child.is("element", "paragraph")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (child.is("element", "codeBlock")) {
|
||||
dirtyCodeBlocks.add(child);
|
||||
} else if (child.childCount > 0) {
|
||||
lookForCodeBlocks(child);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (const change of changes) {
|
||||
dbg("change " + JSON.stringify(change));
|
||||
|
||||
if (change.type == "insert" && change.name == "codeBlock") {
|
||||
if (change.name !== "paragraph" && change.name !== "codeBlock" && change?.position?.nodeAfter && change.position.nodeAfter.childCount > 0) {
|
||||
/*
|
||||
* We need to look for code blocks recursively, as they can be placed within a <div> due to
|
||||
* general HTML support or normally underneath other elements such as tables, blockquotes, etc.
|
||||
*/
|
||||
lookForCodeBlocks(change.position.nodeAfter);
|
||||
} else if (change.type == "insert" && change.name == "codeBlock") {
|
||||
// A new code block was inserted
|
||||
const codeBlock = change.position.nodeAfter;
|
||||
const codeBlock = change.position?.nodeAfter;
|
||||
// Even if it's a new codeblock, it needs dirtying in case
|
||||
// it already has children, like when pasting one or more
|
||||
// full codeblocks, undoing a delete, changing the language,
|
||||
// etc (the postfixer won't get later changes for those).
|
||||
log("dirtying inserted codeBlock " + JSON.stringify(codeBlock.toJSON()));
|
||||
dirtyCodeBlocks.add(codeBlock);
|
||||
} else if (change.type == "remove" && change.name == "codeBlock") {
|
||||
if (codeBlock) {
|
||||
log("dirtying inserted codeBlock " + JSON.stringify(codeBlock.toJSON()));
|
||||
dirtyCodeBlocks.add(codeBlock);
|
||||
}
|
||||
} else if (change.type == "remove" && change.name == "codeBlock" && change.position) {
|
||||
// An existing codeblock was removed, do nothing. Note the
|
||||
// node is no longer in the editor so the codeblock cannot
|
||||
// be inspected here. No need to dirty the codeblock since
|
||||
// it has been removed
|
||||
log("removing codeBlock at path " + JSON.stringify(change.position.toJSON()));
|
||||
} else if ((change.type == "remove" || change.type == "insert") && change.position.parent.is("element", "codeBlock")) {
|
||||
} else if ((change.type == "remove" || change.type == "insert") && change?.position?.parent.is("element", "codeBlock")) {
|
||||
// Text was added or removed from the codeblock, force a
|
||||
// highlight
|
||||
const codeBlock = change.position.parent;
|
||||
|
||||
@@ -137,6 +137,12 @@ const CONTENT_WIDGETS: Record<string, (typeof NoteContextAwareWidget)[]> = {
|
||||
]
|
||||
};
|
||||
|
||||
/**
|
||||
* Type widget that displays one or more widgets based on the type of note, generally used for options and other interactive notes such as the backend log.
|
||||
*
|
||||
* One important aspect is that, like its parent {@link TypeWidget}, the content widgets don't receive all events by default and they must be manually added
|
||||
* to the propagation list in {@link TypeWidget.handleEventInChildren}.
|
||||
*/
|
||||
export default class ContentWidgetTypeWidget extends TypeWidget {
|
||||
private $content!: JQuery<HTMLElement>;
|
||||
private widget?: BasicWidget;
|
||||
@@ -177,12 +183,4 @@ export default class ContentWidgetTypeWidget extends TypeWidget {
|
||||
}
|
||||
}
|
||||
|
||||
async handleEventInChildren<T extends EventNames>(name: T, data: EventData<T>) {
|
||||
if (this.widget && this.widget.handleEvent) {
|
||||
return this.widget.handleEvent(name, data);
|
||||
}
|
||||
|
||||
return super.handleEventInChildren(name, data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ export default class EmptyTypeWidget extends TypeWidget {
|
||||
super.doRender();
|
||||
}
|
||||
|
||||
async doRefresh(note: FNote) {
|
||||
async doRefresh() {
|
||||
const workspaceNotes = await searchService.searchForNotes("#workspace #!template");
|
||||
|
||||
this.$workspaceNotes.empty();
|
||||
|
||||
@@ -32,9 +32,9 @@ export default class ReadOnlyCodeTypeWidget extends AbstractCodeTypeWidget {
|
||||
super.doRender();
|
||||
}
|
||||
|
||||
async doRefresh(note: FNote | null | undefined) {
|
||||
async doRefresh(note: FNote) {
|
||||
const blob = await this.note?.getBlob();
|
||||
if (!blob || !note) return false;
|
||||
if (!blob) return;
|
||||
|
||||
const isFormattable = note.type === "text" && this.noteContext?.viewScope?.viewMode === "source";
|
||||
const content = isFormattable ? this.format(blob.content) : blob.content;
|
||||
|
||||
@@ -3,7 +3,11 @@ import appContext, { type EventData, type EventNames } from "../../components/ap
|
||||
import type FNote from "../../entities/fnote.js";
|
||||
import type NoteDetailWidget from "../note_detail.js";
|
||||
import type SpacedUpdate from "../../services/spaced_update.js";
|
||||
import type EmptyTypeWidget from "./empty.js";
|
||||
|
||||
/**
|
||||
* The base class for all the note types.
|
||||
*/
|
||||
export default abstract class TypeWidget extends NoteContextAwareWidget {
|
||||
|
||||
spacedUpdate!: SpacedUpdate;
|
||||
@@ -17,7 +21,7 @@ export default abstract class TypeWidget extends NoteContextAwareWidget {
|
||||
return super.doRender();
|
||||
}
|
||||
|
||||
doRefresh(note: FNote | null | undefined) {}
|
||||
doRefresh(note: FNote): void | Promise<void> {}
|
||||
|
||||
async refresh() {
|
||||
const thisWidgetType = (this.constructor as any).getType();
|
||||
@@ -30,7 +34,13 @@ export default abstract class TypeWidget extends NoteContextAwareWidget {
|
||||
} else {
|
||||
this.toggleInt(true);
|
||||
|
||||
await this.doRefresh(this.note);
|
||||
// Avoid passing nullable this.note down to doRefresh().
|
||||
if (thisWidgetType !== "empty" && this.note) {
|
||||
await this.doRefresh(this.note);
|
||||
} else if (thisWidgetType === "empty") {
|
||||
// EmptyTypeWidget is a special case, since it's used for a new tab where there's no note.
|
||||
await (this as unknown as EmptyTypeWidget).doRefresh();
|
||||
}
|
||||
|
||||
this.triggerEvent("noteDetailRefreshed", { ntxId: this.noteContext?.ntxId });
|
||||
}
|
||||
@@ -61,12 +71,20 @@ export default abstract class TypeWidget extends NoteContextAwareWidget {
|
||||
}
|
||||
}
|
||||
|
||||
// events should be propagated manually to the children widgets
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* By default:
|
||||
*
|
||||
* - `activeContextChanged` is intercepted and converted to a `setNoteContext` event to avoid `refresh()`.
|
||||
* - `entitiesReloaded` and `refreshData` are passed as-is.
|
||||
* - any other event is not passed to the children.
|
||||
*/
|
||||
handleEventInChildren<T extends EventNames>(name: T, data: EventData<T>) {
|
||||
if (["activeContextChanged", "setNoteContext"].includes(name)) {
|
||||
// won't trigger .refresh();
|
||||
return super.handleEventInChildren("setNoteContext", data as EventData<"activeContextChanged">);
|
||||
} else if (name === "entitiesReloaded") {
|
||||
} else if (name === "entitiesReloaded" || name === "refreshData") {
|
||||
return super.handleEventInChildren(name, data);
|
||||
} else {
|
||||
return Promise.resolve();
|
||||
|
||||
@@ -65,6 +65,7 @@ const TPL = /*html*/`
|
||||
.calendar-container .promoted-attribute {
|
||||
font-size: 0.85em;
|
||||
opacity: 0.85;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -155,27 +156,54 @@ export default class CalendarView extends ViewMode {
|
||||
locale: await CalendarView.#getLocale(),
|
||||
height: "100%",
|
||||
nowIndicator: true,
|
||||
eventContent: (e) => {
|
||||
let html = "";
|
||||
eventDidMount: (e) => {
|
||||
const { iconClass, promotedAttributes } = e.event.extendedProps;
|
||||
|
||||
// Title and icon
|
||||
// Prepend the icon to the title, if any.
|
||||
if (iconClass) {
|
||||
html += `<span class="${iconClass}"></span> `;
|
||||
}
|
||||
html += utils.escapeHtml(e.event.title);
|
||||
let titleContainer;
|
||||
switch (e.view.type) {
|
||||
case "timeGridWeek":
|
||||
case "dayGridMonth":
|
||||
titleContainer = e.el.querySelector(".fc-event-title");
|
||||
break;
|
||||
case "multiMonthYear":
|
||||
break;
|
||||
case "listMonth":
|
||||
titleContainer = e.el.querySelector(".fc-list-event-title a");
|
||||
break;
|
||||
}
|
||||
|
||||
// Promoted attributes
|
||||
if (titleContainer) {
|
||||
const icon = /*html*/`<span class="${iconClass}"></span> `;
|
||||
titleContainer.insertAdjacentHTML("afterbegin", icon);
|
||||
}
|
||||
}
|
||||
|
||||
// Append promoted attributes to the end of the event container.
|
||||
if (promotedAttributes) {
|
||||
let promotedAttributesHtml = "";
|
||||
for (const [name, value] of promotedAttributes) {
|
||||
html += `\
|
||||
promotedAttributesHtml = /*html*/`\
|
||||
<div class="promoted-attribute">
|
||||
<span class="promoted-attribute-name">${name}</span>: <span class="promoted-attribute-value">${value}</span>
|
||||
</div>`;
|
||||
}
|
||||
}
|
||||
|
||||
return { html };
|
||||
let mainContainer;
|
||||
switch (e.view.type) {
|
||||
case "timeGridWeek":
|
||||
case "dayGridMonth":
|
||||
mainContainer = e.el.querySelector(".fc-event-main");
|
||||
break;
|
||||
case "multiMonthYear":
|
||||
break;
|
||||
case "listMonth":
|
||||
mainContainer = e.el.querySelector(".fc-list-event-title");
|
||||
break;
|
||||
}
|
||||
$(mainContainer ?? e.el).append($(promotedAttributesHtml));
|
||||
}
|
||||
},
|
||||
dateClick: async (e) => {
|
||||
if (!this.isCalendarRoot) {
|
||||
|
||||
@@ -108,6 +108,10 @@ body.layout-horizontal > .horizontal {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
#launcher-container {
|
||||
scrollbar-gutter: stable both-edges;
|
||||
}
|
||||
|
||||
#launcher-pane.vertical {
|
||||
--launcher-pane-border-color: unset;
|
||||
--launcher-pane-background-color: var(--launcher-pane-vert-background-color);
|
||||
@@ -126,6 +130,12 @@ body.layout-horizontal > .horizontal {
|
||||
padding-bottom: var(--launcher-pane-button-gap);
|
||||
}
|
||||
|
||||
#launcher-pane.vertical #launcher-container {
|
||||
height: 100%;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
#launcher-pane.horizontal {
|
||||
--launcher-pane-border-color: var(--launcher-pane-horiz-border-color);
|
||||
--launcher-pane-background-color: var(--launcher-pane-horiz-background-color);
|
||||
@@ -144,6 +154,13 @@ body.layout-horizontal > .horizontal {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
#launcher-pane.horizontal #launcher-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
@media (max-width: 991px) {
|
||||
#mobile-bottom-bar {
|
||||
background: var(--launcher-pane-horiz-background-color);
|
||||
|
||||
@@ -555,7 +555,6 @@
|
||||
"to": "到",
|
||||
"target_note": "目标笔记",
|
||||
"on_all_matched_notes": "在所有匹配的笔记上",
|
||||
"create_given_relation": "如果笔记还没有关系,则创建给定关系",
|
||||
"change_target_note": "或更改现有关系的目标笔记",
|
||||
"update_relation_target": "更新关系目标"
|
||||
},
|
||||
|
||||
@@ -555,7 +555,6 @@
|
||||
"to": "zu",
|
||||
"target_note": "Zielnotiz",
|
||||
"on_all_matched_notes": "Auf allen übereinstimmenden Notizen",
|
||||
"create_given_relation": "Erstelle die gegebene Beziehung, wenn die Notiz noch keine hat",
|
||||
"change_target_note": "oder ändere die Zielnotiz der bestehenden Beziehung",
|
||||
"update_relation_target": "Beziehungsziel aktualisieren"
|
||||
},
|
||||
|
||||
@@ -555,8 +555,7 @@
|
||||
"to": "to",
|
||||
"target_note": "target note",
|
||||
"on_all_matched_notes": "On all matched notes",
|
||||
"create_given_relation": "create given relation if note doesn't have one yet",
|
||||
"change_target_note": "or change target note of the existing relation",
|
||||
"change_target_note": "change target note of the existing relation",
|
||||
"update_relation_target": "Update relation target"
|
||||
},
|
||||
"attachments_actions": {
|
||||
|
||||
@@ -555,7 +555,6 @@
|
||||
"to": "a",
|
||||
"target_note": "nota de destino",
|
||||
"on_all_matched_notes": "En todas las notas coincidentes",
|
||||
"create_given_relation": "crear una relación dada si la nota aún no tiene una",
|
||||
"change_target_note": "o cambiar la nota de destino de la relación existente",
|
||||
"update_relation_target": "Actualizar destino de relación"
|
||||
},
|
||||
|
||||
@@ -555,7 +555,6 @@
|
||||
"to": "vers",
|
||||
"target_note": "note cible",
|
||||
"on_all_matched_notes": "Pour toutes les notes correspondantes",
|
||||
"create_given_relation": "créer une relation donnée si la note ne la possède pas encore",
|
||||
"change_target_note": "ou changer la note cible de la relation existante",
|
||||
"update_relation_target": "Mettre à jour la cible de la relation"
|
||||
},
|
||||
|
||||
@@ -1285,8 +1285,7 @@
|
||||
},
|
||||
"update_relation_target": {
|
||||
"allowed_characters": "Sunt permise doar caractere alfanumerice, underline și două puncte.",
|
||||
"change_target_note": "sau schimbă notița-țintă a unei relații existente",
|
||||
"create_given_relation": "crează relația dată dacă notița nu are încă una",
|
||||
"change_target_note": "schimbă notița-țintă a unei relații existente",
|
||||
"on_all_matched_notes": "Pentru toate notițele găsite:",
|
||||
"relation_name": "denumirea relației",
|
||||
"target_note": "notița destinație",
|
||||
@@ -1648,7 +1647,7 @@
|
||||
},
|
||||
"notes": {
|
||||
"duplicate-note-suffix": "(dupl.)",
|
||||
"duplicate-note-title": "{{ noteTitle }} {{ duplicateNoteSuffix }}"
|
||||
"duplicate-note-title": "{{- noteTitle }} {{ duplicateNoteSuffix }}"
|
||||
},
|
||||
"geo-map-context": {
|
||||
"open-location": "Deschide locația",
|
||||
|
||||
@@ -526,7 +526,6 @@
|
||||
"to": "到",
|
||||
"target_note": "目標筆記",
|
||||
"on_all_matched_notes": "在所有匹配的筆記上",
|
||||
"create_given_relation": "如果筆記還沒有關係,則新增給定關係",
|
||||
"change_target_note": "或更改現有關係的目標筆記",
|
||||
"update_relation_target": "更新關係目標"
|
||||
},
|
||||
|
||||
@@ -278,14 +278,14 @@ describe("Markdown export", () => {
|
||||
});
|
||||
|
||||
it("converts inline math expressions into proper Markdown syntax", () => {
|
||||
const html = /*html*/`<p>The equation is <span class="math-tex">\\(e=mc^{2}\\)</span>.</p>`;
|
||||
const expected = `The equation is\u00a0$e=mc^{2}$.`;
|
||||
const html = /*html*/String.raw`<span class="math-tex">\(H(X, Y) = \sum_{i=1}^{M} \sum_{j=1}^{L} p(x_i, y_j) \log_2 \frac{1}{p(x_i, y_j)} = - \sum_{i=1}^{M} \sum_{j=1}^{L} p(x_i, y_j) \log_2 p(x_i, y_j) \frac{\text{bits}}{\text{symbol}}\)</span></span>`;
|
||||
const expected = String.raw`$H(X, Y) = \sum_{i=1}^{M} \sum_{j=1}^{L} p(x_i, y_j) \log_2 \frac{1}{p(x_i, y_j)} = - \sum_{i=1}^{M} \sum_{j=1}^{L} p(x_i, y_j) \log_2 p(x_i, y_j) \frac{\text{bits}}{\text{symbol}}$`;
|
||||
expect(markdownExportService.toMarkdown(html)).toBe(expected);
|
||||
});
|
||||
|
||||
it("converts display math expressions into proper Markdown syntax", () => {
|
||||
const html = /*html*/`<span class="math-tex">\\[\sqrt{x^{2}+1}\\]</span>`;
|
||||
const expected = `$$\sqrt{x^{2}+1}$$`;
|
||||
const html = /*html*/String.raw`<span class="math-tex">\[H(X, Y) = \sum_{i=1}^{M} \sum_{j=1}^{L} p(x_i, y_j) \log_2 \frac{1}{p(x_i, y_j)} = - \sum_{i=1}^{M} \sum_{j=1}^{L} p(x_i, y_j) \log_2 p(x_i, y_j) \frac{\text{bits}}{\text{symbol}}\]</span></span>`;
|
||||
const expected = String.raw`$$H(X, Y) = \sum_{i=1}^{M} \sum_{j=1}^{L} p(x_i, y_j) \log_2 \frac{1}{p(x_i, y_j)} = - \sum_{i=1}^{M} \sum_{j=1}^{L} p(x_i, y_j) \log_2 p(x_i, y_j) \frac{\text{bits}}{\text{symbol}}$$`;
|
||||
expect(markdownExportService.toMarkdown(html)).toBe(expected);
|
||||
});
|
||||
|
||||
|
||||
@@ -208,19 +208,28 @@ function buildFigureFilter(): Rule {
|
||||
}
|
||||
|
||||
function buildMathFilter(): Rule {
|
||||
const MATH_INLINE_PREFIX = "\\(";
|
||||
const MATH_INLINE_SUFFIX = "\\)";
|
||||
|
||||
const MATH_DISPLAY_PREFIX = "\\[";
|
||||
const MATH_DISPLAY_SUFFIX = "\\]";
|
||||
|
||||
return {
|
||||
filter(node) {
|
||||
return node.nodeName === "SPAN" && node.classList.contains("math-tex");
|
||||
},
|
||||
replacement(content) {
|
||||
replacement(_, node) {
|
||||
// We have to use the raw HTML text, otherwise the content is escaped too much.
|
||||
const content = (node as HTMLElement).innerText;
|
||||
|
||||
// Inline math
|
||||
if (content.startsWith("\\\\(") && content.endsWith("\\\\)")) {
|
||||
return `$${content.substring(3, content.length - 3)}$`;
|
||||
if (content.startsWith(MATH_INLINE_PREFIX) && content.endsWith(MATH_INLINE_SUFFIX)) {
|
||||
return `$${content.substring(MATH_INLINE_PREFIX.length, content.length - MATH_INLINE_SUFFIX.length)}$`;
|
||||
}
|
||||
|
||||
// Display math
|
||||
if (content.startsWith(String.raw`\\\[`) && content.endsWith(String.raw`\\\]`)) {
|
||||
return `$$${content.substring(4, content.length - 4)}$$`;
|
||||
if (content.startsWith(MATH_DISPLAY_PREFIX) && content.endsWith(MATH_DISPLAY_SUFFIX)) {
|
||||
return `$$${content.substring(MATH_DISPLAY_PREFIX.length, content.length - MATH_DISPLAY_SUFFIX.length)}$$`;
|
||||
}
|
||||
|
||||
// Unknown.
|
||||
|
||||