mirror of
https://github.com/zadam/trilium.git
synced 2025-11-06 13:26:01 +01:00
Merge branch 'develop' into calendar
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# Advanced Showcases
|
||||
Trilium offers advanced functionality through [Scripts](../Note%20Types/Code/Scripts.md) and [Promoted Attributes](Attributes/Promoted%20Attributes.md). To illustrate these features, we've prepared several showcases available in the [demo notes](Database.md):
|
||||
Trilium offers advanced functionality through [Scripts](../Note%20Types/Code/Scripting.md) and [Promoted Attributes](Attributes/Promoted%20Attributes.md). To illustrate these features, we've prepared several showcases available in the [demo notes](Database.md):
|
||||
|
||||
* [Relation Map](../Note%20Types/Relation%20Map.md)
|
||||
* [Day Notes](Advanced%20Showcases/Day%20Notes.md)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Task Manager
|
||||
Task Manager is a [promoted attributes](../Attributes/Promoted%20Attributes.md) and [scripts](../../Note%20Types/Code/Scripts.md)showcase present in the [demo notes](../Database.md).
|
||||
Task Manager is a [promoted attributes](../Attributes/Promoted%20Attributes.md) and [scripts](../../Note%20Types/Code/Scripting.md)showcase present in the [demo notes](../Database.md).
|
||||
|
||||
## Demo
|
||||
|
||||
@@ -15,7 +15,7 @@ New tasks are created in the TODO note which has `~child:template` [relation](..
|
||||
|
||||
### Attributes
|
||||
|
||||
Task template defines several [promoted attributes](../Attributes/Promoted%20Attributes.md) - todoDate, doneDate, tags, location. Importantly it also defines `~runOnAttributeChange` relation - [event](../../Note%20Types/Code/Events.md) handler which is run on attribute change. This [script](../../Note%20Types/Code/Scripts.md) handles when e.g. we fill out the doneDate attribute - meaning the task is done and should be moved to "Done" note and removed from TODO, locations and tags.
|
||||
Task template defines several [promoted attributes](../Attributes/Promoted%20Attributes.md) - todoDate, doneDate, tags, location. Importantly it also defines `~runOnAttributeChange` relation - [event](../../Note%20Types/Code/Events.md) handler which is run on attribute change. This [script](../../Note%20Types/Code/Scripting.md) handles when e.g. we fill out the doneDate attribute - meaning the task is done and should be moved to "Done" note and removed from TODO, locations and tags.
|
||||
|
||||
### New task button
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ By adding `weight` as a [promoted attribute](../Attributes/Promoted%20Attributes
|
||||
|
||||
## Implementation
|
||||
|
||||
The `Weight Tracker` note in the screenshot above is of the type `Render Note`. That type of note doesn't have any useful content itself. Instead it is a placeholder where a [script](../../Note%20Types/Code/Scripts.md) can render its output.
|
||||
The `Weight Tracker` note in the screenshot above is of the type `Render Note`. That type of note doesn't have any useful content itself. Instead it is a placeholder where a [script](../../Note%20Types/Code/Scripting.md) can render its output.
|
||||
|
||||
Scripts for `Render Notes` are defined in a [relation](../Attributes.md) called `~renderNote`. In this example, it's the `Weight Tracker`'s child `Implementation`. The Implementation consists of two [code notes](../../Note%20Types/Code.md) that contain some HTML and JavaScript respectively, which load all the notes with a `weight` attribute and display their values in a chart.
|
||||
|
||||
|
||||
@@ -14,46 +14,46 @@ Labels in Trilium can be used for a variety of purposes:
|
||||
|
||||
* **Metadata**: Assign labels with optional values for categorization, such as `#year=1999`, `#genre="sci-fi"`, or `#author="Neal Stephenson"`
|
||||
* **Configuration**: Labels can configure advanced features or settings
|
||||
* **Scripts and Plugins**: Used to tag notes with special metadata, such as the "weight" attribute in the [Weight Tracker](Advanced%20Showcases/Weight%20Tracker.md)
|
||||
* **Scripts and Plugins**: Used to tag notes with special metadata, such as the "weight" attribute in the <a class="reference-link" href="Advanced%20Showcases/Weight%20Tracker.md">Weight Tracker</a>.
|
||||
|
||||
Labels are also searchable, enhancing note retrieval.
|
||||
|
||||
### Common Labels for Advanced Configuration
|
||||
|
||||
* `**disableVersioning**`: Disables automatic versioning, ideal for large, unimportant notes like script libraries
|
||||
* `**versioningLimit**`: Used to limit the number of revisions for a single note
|
||||
* `**calendarRoot**`: Marks the note as the root for [day notes](Advanced%20Showcases/Day%20Notes.md). Only one note should carry this label
|
||||
* `**archived**`: Hides notes from default search results and dialogs
|
||||
* `**excludeFromExport**`: Excludes notes and their subtrees from export operations
|
||||
* `**run**`: Specifies events to trigger scripts (e.g., `frontendStartup`, `hourly`)
|
||||
* `**runAtHour**`: Defines specific hours for scripts to run, used with `#run=hourly`
|
||||
* `**disableInclusion**`: Prevents a script from being included in parent script executions
|
||||
* `**sorted**`: Automatically sorts child notes alphabetically by title
|
||||
* `**top**`: Keeps the note at the top of its parent's list, useful with `sorted`
|
||||
* `**hidePromotedAttributes**`: Hides certain attributes in the note's display
|
||||
* `**readOnly**`: Sets the note to read-only mode, applicable to text and code notes
|
||||
* `**autoReadOnlyDisabled**`: Disables automatic read-only mode for large notes
|
||||
* `**appCss**`: Marks CSS notes used to modify Trilium’s appearance
|
||||
* `**appTheme**`: Marks full CSS themes available in Trilium's options
|
||||
* `**cssClass**`: Adds a CSS class to the note's representation in the tree
|
||||
* `**iconClass**`: Adds a CSS class to the note's icon, useful for distinguishing notes visually. See [note icons](../Basic%20Concepts%20and%20Features/Notes/Note%20Icons.md)
|
||||
* `**pageSize**`: Specifies the number of items per page in note listings
|
||||
* `**customRequestHandler**` **and** `**customResourceProvider**`: Refer to [Custom request handler](Custom%20Request%20Handler.md)
|
||||
* `**widget**`: Marks a note as a custom widget, added to Trilium's component tree
|
||||
* `**workspace**` **and related attributes**: See [Workspace](../Basic%20Concepts%20and%20Features/Navigation/Workspace.md) for more details
|
||||
* `**searchHome**`: Specifies the parent for new search notes
|
||||
* `**inbox**`: Designates a default location for new notes created via the sidebar
|
||||
* `**sqlConsoleHome**`: Default location for SQL console notes
|
||||
* `**bookmarked**` **and** `**bookmarkFolder**`: See [Bookmarks](../Basic%20Concepts%20and%20Features/Navigation/Bookmarks.md)
|
||||
* `**shareXXX**`: See [Sharing](Sharing.md)
|
||||
* `**keyboardShortcut**`: Assigns a keyboard shortcut to open the note
|
||||
* `**displayRelations**` **and** `**hideRelations**`: Manages the display of note relations
|
||||
* `**titleTemplate**`: See [Default note title](Default%20Note%20Title.md)
|
||||
* `**template**`: Makes the note available as a template
|
||||
* `**toc**`: Controls the visibility of the table of contents
|
||||
* `**color**`: Defines the color of the note in the tree and links
|
||||
* `**hideChildrenOverview**`: Hides child notes in the parent note's editor
|
||||
* `**viewType**`: Sets the view of child notes (grid or list)
|
||||
* `disableVersioning`: Disables automatic versioning, ideal for large, unimportant notes like script libraries
|
||||
* `versioningLimit`: Used to limit the number of revisions for a single note
|
||||
* `calendarRoot`: Marks the note as the root for [day notes](Advanced%20Showcases/Day%20Notes.md). Only one note should carry this label
|
||||
* `archived`: Hides notes from default search results and dialogs
|
||||
* `excludeFromExport`: Excludes notes and their subtrees from export operations
|
||||
* `run`: Specifies events to trigger scripts (e.g., `frontendStartup`, `hourly`)
|
||||
* `runAtHour`: Defines specific hours for scripts to run, used with `#run=hourly`
|
||||
* `disableInclusion`: Prevents a script from being included in parent script executions
|
||||
* `sorted`: Automatically sorts child notes alphabetically by title
|
||||
* `top`: Keeps the note at the top of its parent's list, useful with `sorted`
|
||||
* `hidePromotedAttributes`: Hides certain attributes in the note's display
|
||||
* `readOnly`: Sets the note to read-only mode, applicable to text and code notes
|
||||
* `autoReadOnlyDisabled`: Disables automatic read-only mode for large notes
|
||||
* `appCss`: Marks CSS notes used to modify Trilium’s appearance
|
||||
* `appTheme`: Marks full CSS themes available in Trilium's options
|
||||
* `cssClass`: Adds a CSS class to the note's representation in the tree
|
||||
* `iconClass`: Adds a CSS class to the note's icon, useful for distinguishing notes visually. See <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Notes/Note%20Icons.md">Note Icons</a>.
|
||||
* `pageSize`: Specifies the number of items per page in note listings
|
||||
* `customRequestHandler` **and** `customResourceProvider`: Refer to <a class="reference-link" href="Custom%20Request%20Handler.md">Custom Request Handler</a>
|
||||
* `widget`: Marks a note as a custom widget, added to Trilium's component tree
|
||||
* `workspace` **and related attributes**: See <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Navigation/Workspace.md">Workspace</a> for more details
|
||||
* `searchHome`: Specifies the parent for new search notes
|
||||
* `inbox`: Designates a default location for new notes created via the sidebar
|
||||
* `sqlConsoleHome`: Default location for SQL console notes
|
||||
* `bookmarked` **and** `bookmarkFolder`: See <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Navigation/Bookmarks.md">Bookmarks</a>
|
||||
* `share:[…]`: See <a class="reference-link" href="Sharing.md">Sharing</a>
|
||||
* `keyboardShortcut`: Assigns a keyboard shortcut to open the note
|
||||
* `displayRelations` **and** `hideRelations`: Manages the display of note relations
|
||||
* `titleTemplate`: See <a class="reference-link" href="Default%20Note%20Title.md">Default Note Title</a>
|
||||
* `template`: Makes the note available as a template
|
||||
* `toc`: Controls the visibility of the table of contents
|
||||
* `color`: Defines the color of the note in the tree and links
|
||||
* `hideChildrenOverview`: Hides child notes in the parent note's editor
|
||||
* `viewType`: Sets the view of child notes (grid or list)
|
||||
|
||||
## Relations
|
||||
|
||||
@@ -75,8 +75,8 @@ Attributes in Trilium can be "multivalued", meaning multiple attributes with the
|
||||
|
||||
## Attribute Definitions and Promoted Attributes
|
||||
|
||||
Special labels create "label/attribute" definitions, enhancing the organization and management of attributes. For more details, see [Promoted attributes](Attributes/Promoted%20Attributes.md).
|
||||
Special labels create "label/attribute" definitions, enhancing the organization and management of attributes. For more details, see <a class="reference-link" href="Attributes/Promoted%20Attributes.md">Promoted Attributes</a>.
|
||||
|
||||
## Attribute Inheritance
|
||||
|
||||
Trilium supports attribute inheritance, allowing child notes to inherit attributes from their parents. For more information, see [Attribute inheritance](Attributes/Attribute%20Inheritance.md).
|
||||
Trilium supports attribute inheritance, allowing child notes to inherit attributes from their parents. For more information, see <a class="reference-link" href="Attributes/Attribute%20Inheritance.md">Attribute Inheritance</a>.
|
||||
@@ -1,5 +1,5 @@
|
||||
# Custom Request Handler
|
||||
Trilium provides a mechanism for [scripts](../Note%20Types/Code/Scripts.md) to open a public REST endpoint. This opens a way for various integrations with other services - a simple example would be creating new note from Slack by issuing a slash command (e.g. `/trilium buy milk`).
|
||||
Trilium provides a mechanism for [scripts](../Note%20Types/Code/Scripting.md) to open a public REST endpoint. This opens a way for various integrations with other services - a simple example would be creating new note from Slack by issuing a slash command (e.g. `/trilium buy milk`).
|
||||
|
||||
## Create note from outside Trilium
|
||||
|
||||
|
||||
16
docs/User Guide/User Guide/Advanced Usage/Note ID.md
Normal file
16
docs/User Guide/User Guide/Advanced Usage/Note ID.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# Note ID
|
||||
Whereas some applications use file names to uniquely identify notes, Trilium uses the concept of Note ID.
|
||||
|
||||
Generally, the Note ID is a 12-character long alphanumeric sequence (including both lower and upper case letter) that is randomly generated for each new note.
|
||||
|
||||
## How does the import/export affect the note IDs
|
||||
|
||||
When notes are exported, their note ID is kept in the metadata of the export. However when they are imported back in, a new note ID is generated for all the notes. This also includes other entities that are part of the import/export process such as <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Notes/Attachments.md">Attachments</a>.
|
||||
|
||||
## Note collisions
|
||||
|
||||
Since the Note ID is a fixed-width randomly generated number, due to the [pigeonhole principle](https://en.wikipedia.org/wiki/Pigeonhole_principle), there is a possibility that a newly created note will have the same ID as an existing note.
|
||||
|
||||
Since the note ID is alphanumeric and the length is 12 we have $62^{12}$ unique IDs. However since we are generating them randomly, we can use a collision calculator such as the one for [Nano ID](https://alex7kom.github.io/nano-nanoid-cc/?alphabet=0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&size=12&speed=1000&speedUnit=hour) to determine that we'd need to create 1000 notes per hour every hour for 9 centuries in order to have at least 1% probability of a note collision.
|
||||
|
||||
As such, Trilium does not take any explicit action against potential note collisions, similar to other software that makes uses of unique hashes such as [Git](https://stackoverflow.com/questions/10434326/hash-collision-in-git). If one would theoretically occur, what would most likely happen is that the existing note will be replaced by the new one.
|
||||
@@ -1,17 +1,17 @@
|
||||
# Note source
|
||||
## Understanding the source code of the different notes
|
||||
|
||||
Internally, the structure of the content of each note is different based on the [Note Types](../Note%20Types).
|
||||
Internally, the structure of the content of each note is different based on the <a class="reference-link" href="../Note%20Types.md">Note Types</a>.
|
||||
|
||||
For example:
|
||||
|
||||
* [Text Notes](#root/_hidden/_options/_optionsTextNotes) are represented internally as HTML, using the [CKEditor](Technologies%20used/CKEditor.md) representation. Note that due to the custom plugins, some HTML elements are specific to Trilium only, for example the admonitions.
|
||||
* [Code Notes](#root/_hidden/_options/_optionsCodeNotes) are plain text and are represented internally as-is.
|
||||
* [Geo map](../Note%20Types/Geo%20map.md) notes contain only minimal information (viewport, zoom) as a JSON.
|
||||
* [Canvas](../Note%20Types/Canvas.md) notes are represented as JSON, with Trilium's own information alongside with [Excalidraw](Technologies%20used/Excalidraw.md)'s internal JSON representation format.
|
||||
* [Mind Map](../Note%20Types/Mind%20Map.md) notes are represented as JSON, with the internal format of [MindElixir](Technologies%20used/MindElixir.md).
|
||||
* <a class="reference-link" href="../Note%20Types/Text.md">Text</a> notes are represented internally as HTML, using the <a class="reference-link" href="Technologies%20used/CKEditor.md">CKEditor</a> representation. Note that due to the custom plugins, some HTML elements are specific to Trilium only, for example the admonitions.
|
||||
* <a class="reference-link" href="../Note%20Types/Code.md">Code</a> notes are plain text and are represented internally as-is.
|
||||
* <a class="reference-link" href="../Note%20Types/Geo%20Map.md">Geo Map</a> notes contain only minimal information (viewport, zoom) as a JSON.
|
||||
* <a class="reference-link" href="../Note%20Types/Canvas.md">Canvas</a> notes are represented as JSON, with Trilium's own information alongside with <a class="reference-link" href="Technologies%20used/Excalidraw.md">Excalidraw</a>'s internal JSON representation format.
|
||||
* <a class="reference-link" href="../Note%20Types/Mind%20Map.md">Mind Map</a> notes are represented as JSON, with the internal format of <a class="reference-link" href="Technologies%20used/MindElixir.md">MindElixir</a>.
|
||||
|
||||
Note that some information is also stored as [Attachments](../Attachments). For example [Canvas](../Note%20Types/Canvas.md) notes use the attachments feature to store the custom libraries, and alongside with [Mind Map](../Note%20Types/Mind%20Map.md) and other similar note types it stores an SVG representation of the content for use in other features such as including in other notes, shared notes, etc.
|
||||
Note that some information is also stored as <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Notes/Attachments.md">Attachments</a>. For example <a class="reference-link" href="../Note%20Types/Canvas.md">Canvas</a> notes use the attachments feature to store the custom libraries, and alongside with <a class="reference-link" href="../Note%20Types/Mind%20Map.md">Mind Map</a> and other similar note types it stores an SVG representation of the content for use in other features such as including in other notes, shared notes, etc.
|
||||
|
||||
Here's part of the HTML representation of this note, as it's stored in the database (but prettified).
|
||||
|
||||
@@ -21,7 +21,7 @@ Here's part of the HTML representation of this note, as it's stored in the datab
|
||||
</h2>
|
||||
<p>
|
||||
Internally, the structure of the content of each note is different based on the
|
||||
<a class="reference-link" href="../Note%20Types">
|
||||
<a class="reference-link" href="../Note%20Types.md">
|
||||
Note Types
|
||||
</a>
|
||||
.
|
||||
@@ -30,7 +30,7 @@ Here's part of the HTML representation of this note, as it's stored in the datab
|
||||
|
||||
## Viewing the source code
|
||||
|
||||
It is possible to view the source code of a note by pressing the contextual menu in [Note buttons](../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20buttons.md) and selecting _Note source_.
|
||||
It is possible to view the source code of a note by pressing the contextual menu in <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20buttons.md">Note buttons</a> and selecting _Note source_.
|
||||
|
||||

|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Technologies used
|
||||
One core aspect of Trilium that allows it to have support for multiple [Note Types](../Note%20Types) is the fact that it makes use of various off-the-shelf or reusable libraries.
|
||||
One core aspect of Trilium that allows it to have support for multiple [Note Types](../Note%20Types.md) is the fact that it makes use of various off-the-shelf or reusable libraries.
|
||||
|
||||
The sub-pages showcase some of the technologies used, for a better understanding of how Trilium works but also to credit the developers of that particular technology.
|
||||
@@ -1,5 +1,5 @@
|
||||
# Leaflet
|
||||
Leaflet is the library behind [Geo map](../../Note%20Types/Geo%20map.md) notes.
|
||||
Leaflet is the library behind [Geo map](../../Note%20Types/Geo%20Map.md) notes.
|
||||
|
||||
## Plugins
|
||||
|
||||
|
||||
Reference in New Issue
Block a user