Stores the information about a search (the search text, criteria, etc.) for later use. Can be used for quick filtering of a large amount of notes, for example. The search can easily be triggered.
Used in Scripting, it displays the HTML content of another note. This allows displaying any kind of content, provided there is a script behind it to generate it.
Displays diagrams such as bar charts, flow charts, state diagrams, etc. Requires a bit of technical knowledge since the diagrams are written in a specialized format.
Displays the children of the note as a geographical map, one use-case would be to plan vacations. It even has basic support for tracks. Notes can also be created from it.
Stores the information about a search (the search text, criteria, etc.) for later use. Can be used for quick filtering of a large amount of notes, for example. The search can easily be triggered.
Used in Scripting, it displays the HTML content of another note. This allows displaying any kind of content, provided there is a script behind it to generate it.
Displays diagrams such as bar charts, flow charts, state diagrams, etc. Requires a bit of technical knowledge since the diagrams are written in a specialized format.
Displays the children of the note as a geographical map, one use-case would be to plan vacations. It even has basic support for tracks. Notes can also be created from it.
Represents an uploaded file such as PDFs, images, video or audio files.
\ No newline at end of file
diff --git a/docs/User Guide/User Guide/Note Types/Code.md b/docs/User Guide/User Guide/Note Types/Code.md
index a44bb8c8c..cba400984 100644
--- a/docs/User Guide/User Guide/Note Types/Code.md
+++ b/docs/User Guide/User Guide/Note Types/Code.md
@@ -5,7 +5,7 @@ This can be useful for a few things:
* computer programmers can store code snippets as notes with syntax highlighting
* JavaScript code notes can be executed inside Trilium for some extra functionality
- * we call such JavaScript code notes "scripts" - see [Scripts](Code/Scripting.md)
+ * we call such JavaScript code notes "scripts" - see Scripting
* JSON, XML etc. can be used as storage for structured data (typically used in conjunction with scripting)
For shorter snippets of code that can be embedded in [Text](Text.md) notes, see [Code blocks](Text/Developer-specific%20formatting/Code%20blocks.md).
diff --git a/docs/User Guide/User Guide/Note Types/Code/Events.md b/docs/User Guide/User Guide/Note Types/Code/Events.md
index 7e50ca30e..ca3336889 100644
--- a/docs/User Guide/User Guide/Note Types/Code/Events.md
+++ b/docs/User Guide/User Guide/Note Types/Code/Events.md
@@ -1,5 +1,5 @@
# Events
-[Script](Scripting.md) notes can be triggered by events. Note that these are backend events and thus relation need to point to the "JS backend" code note.
+[Script](../../Scripting.md) notes can be triggered by events. Note that these are backend events and thus relation need to point to the "JS backend" code note.
## Global events
diff --git a/docs/User Guide/User Guide/Note Types/Code/Scripting/New Task launcher button.md b/docs/User Guide/User Guide/Note Types/Code/Scripting/New Task launcher button.md
deleted file mode 100644
index 8c9148c42..000000000
--- a/docs/User Guide/User Guide/Note Types/Code/Scripting/New Task launcher button.md
+++ /dev/null
@@ -1,47 +0,0 @@
-# "New Task" launcher button
-In this example we are going to extend the functionality of Task Manager showcase (which comes by default with Trilium) by adding a button in the Launch Bar () to create a new task automatically and open it.
-
-## Creating the note
-
-1. First, create a new Code note type with the _JS frontend_ language.
-2. Define the `#run=frontendStartup` label in Attributes.
-
-## Content of the script
-
-Copy-paste the following script:
-
-```javascript
-api.addButtonToToolbar({
- title: "New task",
- icon: "task",
- shortcut: "alt+n",
- action: async () => {
- const taskNoteId = await api.runOnBackend(() => {
- const todoRootNote = api.getNoteWithLabel("taskTodoRoot");
- const resp = api.createTextNote(todoRootNote.noteId, "New task", "")
- return resp.note.noteId;
- });
-
- await api.waitUntilSynced();
- await api.activateNewNote(taskNoteId);
- }
-});
-```
-
-## Testing the functionality
-
-Since we set the script to be run on start-up, all we need to do is to [refresh the application](../../../Troubleshooting/Refreshing%20the%20application.md).
-
-## Understanding how the script works
-
-
Here we identify a note with the label#taskTodoRoot. This is how the Task Manager showcase knows where to place all the different tasks.
Normally this might return a null value if no such note could be identified, but error handling is outside the scope of this example.
const resp = api.createTextNote(todoRootNote.noteId, "New task", "")
We create a new child note within the to-do root note (first argument) with the title “New task" (second argument) and no content by default (third argument).
await api.waitUntilSynced();
Back on the client, since we created a new note on the server, we now need to wait for the change to be reflected in the client.
await api.activateNewNote(taskNoteId);
Since we know the ID of the newly created note, all we have to do now is to show this note to the user.
\ No newline at end of file
diff --git a/docs/User Guide/User Guide/Note Types/Render Note.md b/docs/User Guide/User Guide/Note Types/Render Note.md
index e69de29bb..6b70ad128 100644
--- a/docs/User Guide/User Guide/Note Types/Render Note.md
+++ b/docs/User Guide/User Guide/Note Types/Render Note.md
@@ -0,0 +1,39 @@
+# Render Note
+
+
+Render Note is used in Scripting. It works by displaying the HTML of a Code note, via an attribute.
+
+## Creating a render note
+
+1. Create a Code note with the HTML language, with what needs to be displayed (for example `
Hello world.
`).
+2. Create a Render Note.
+3. Assign the `renderNote` [relation](../Advanced%20Usage/Attributes.md) to point at the previously created code note.
+
+## Dynamic content
+
+A static HTML is generally not enough for Scripting. The next step is to automatically change parts of the note using JavaScript.
+
+For a simple example, we are going to create a render note that displays the current date in a field.
+
+To do so, first create an HTML code note with the following content:
+
+```
+
Current date & time
+The current date & time is
+```
+
+Now we need to add the script. Create another Code, but this time of JavaScript (frontend) language. Make sure the newly created note is a direct child of the HTML note created previously; with the following content:
+
+```
+const $dateEl = api.$container.find(".date");
+$dateEl.text(new Date());
+```
+
+Now create a render note at any place and set its `~renderNote` relation to point to the HTML note. When the render note is accessed it will display:
+
+> **Current date & time**
+> The current date & time is Sun Apr 06 2025 15:26:29 GMT+0300 (Eastern European Summer Time)
+
+## Examples
+
+* Weight Tracker which is present in the Demo Notes.
\ No newline at end of file
diff --git a/docs/User Guide/User Guide/Note Types/Render Note_image.png b/docs/User Guide/User Guide/Note Types/Render Note_image.png
new file mode 100644
index 000000000..18afa6cee
Binary files /dev/null and b/docs/User Guide/User Guide/Note Types/Render Note_image.png differ
diff --git a/docs/User Guide/User Guide/Note Types/Code/Scripting.md b/docs/User Guide/User Guide/Scripting.md
similarity index 56%
rename from docs/User Guide/User Guide/Note Types/Code/Scripting.md
rename to docs/User Guide/User Guide/Scripting.md
index 2720b095a..09b451e49 100644
--- a/docs/User Guide/User Guide/Note Types/Code/Scripting.md
+++ b/docs/User Guide/User Guide/Scripting.md
@@ -1,5 +1,5 @@
# Scripting
-Trilium supports creating Code 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 Script API provide extra functionality.
+Trilium supports creating Code 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 Script API provide extra functionality.
## Scripting
@@ -12,7 +12,7 @@ So we have frontend and backend, each with their own set of responsibilities, bu
## Use cases
-* "New Task" launcher button
+* "New Task" launcher button
## Action handler
@@ -24,18 +24,18 @@ So we have a script which will add the button to the toolbar. But how can we exe
We need to execute it every time Trilium starts up, but we probably don't want to have to manually click on play button on every start up.
-The solution is marked by red circle at the bottom - this note has [label](../../Advanced%20Usage/Attributes.md) `#run=frontendStartup` - this is one of the "system" labels which Trilium understands. As you might guess, this will cause all such labeled script notes to be executed once Trilium frontend starts up.
+The solution is marked by red circle at the bottom - this note has [label](Advanced%20Usage/Attributes.md) `#run=frontendStartup` - this is one of the "system" labels which Trilium understands. As you might guess, this will cause all such labeled script notes to be executed once Trilium frontend starts up.
-(`#run=frontendStartup` does not work for [Mobile frontend](../../Installation%20%26%20Setup/Mobile%20Frontend.md) - if you want to have scripts running there, give the script `#run=mobileStartup` label)
+(`#run=frontendStartup` does not work for [Mobile frontend](Installation%20%26%20Setup/Mobile%20Frontend.md) - if you want to have scripts running there, give the script `#run=mobileStartup` label)
## More showcases
-You can see more scripting with explanation in Advanced Showcases.
+You can see more scripting with explanation in Advanced Showcases.
## Events
-See Events.
+See Events.
## Script API
-See Script API.
\ No newline at end of file
+See Script API.
\ No newline at end of file
diff --git a/docs/User Guide/User Guide/Developer Guides/Examples/Downloading responses from Goo.md b/docs/User Guide/User Guide/Scripting/Examples/Downloading responses from Goo.md
similarity index 100%
rename from docs/User Guide/User Guide/Developer Guides/Examples/Downloading responses from Goo.md
rename to docs/User Guide/User Guide/Scripting/Examples/Downloading responses from Goo.md
diff --git a/docs/User Guide/User Guide/Scripting/Examples/New Task launcher button.md b/docs/User Guide/User Guide/Scripting/Examples/New Task launcher button.md
new file mode 100644
index 000000000..6fd6f16f7
--- /dev/null
+++ b/docs/User Guide/User Guide/Scripting/Examples/New Task launcher button.md
@@ -0,0 +1,47 @@
+# "New Task" launcher button
+In this example we are going to extend the functionality of Task Manager showcase (which comes by default with Trilium) by adding a button in the Launch Bar () to create a new task automatically and open it.
+
+## Creating the note
+
+1. First, create a new Code note type with the _JS frontend_ language.
+2. Define the `#run=frontendStartup` label in Attributes.
+
+## Content of the script
+
+Copy-paste the following script:
+
+```javascript
+api.addButtonToToolbar({
+ title: "New task",
+ icon: "task",
+ shortcut: "alt+n",
+ action: async () => {
+ const taskNoteId = await api.runOnBackend(() => {
+ const todoRootNote = api.getNoteWithLabel("taskTodoRoot");
+ const resp = api.createTextNote(todoRootNote.noteId, "New task", "")
+ return resp.note.noteId;
+ });
+
+ await api.waitUntilSynced();
+ await api.activateNewNote(taskNoteId);
+ }
+});
+```
+
+## Testing the functionality
+
+Since we set the script to be run on start-up, all we need to do is to [refresh the application](../../Troubleshooting/Refreshing%20the%20application.md).
+
+## Understanding how the script works
+
+
Here we identify a note with the label#taskTodoRoot. This is how the Task Manager showcase knows where to place all the different tasks.
Normally this might return a null value if no such note could be identified, but error handling is outside the scope of this example.
const resp = api.createTextNote(todoRootNote.noteId, "New task", "")
We create a new child note within the to-do root note (first argument) with the title “New task" (second argument) and no content by default (third argument).
await api.waitUntilSynced();
Back on the client, since we created a new note on the server, we now need to wait for the change to be reflected in the client.
await api.activateNewNote(taskNoteId);
Since we know the ID of the newly created note, all we have to do now is to show this note to the user.
Trilium offers advanced functionality through Scripts and
+
Trilium offers advanced functionality through Scripts and
Promoted Attributes. To illustrate these features, we've prepared
several showcases available in the demo notes:
+ href="../../Scripting.html">scriptsshowcase present in the demo notes.
Demo
@@ -37,7 +37,7 @@
Task template defines several promoted attributes -
todoDate, doneDate, tags, location. Importantly it also defines ~runOnAttributeChange relation
- event handler which is
- run on attribute change. This script handles
+ run on attribute change. This script 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.
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 can
- render its output.
+ a placeholder where a script can render
+ its output.
Scripts for Render Notes are defined in a relation called ~renderNote.
In this example, it's the Weight Tracker's child Implementation.
The Implementation consists of two code notes that
diff --git a/src/public/app/doc_notes/en/User Guide/User Guide/Advanced Usage/Custom Request Handler.html b/src/public/app/doc_notes/en/User Guide/User Guide/Advanced Usage/Custom Request Handler.html
index ee165623a..8c491ef80 100644
--- a/src/public/app/doc_notes/en/User Guide/User Guide/Advanced Usage/Custom Request Handler.html
+++ b/src/public/app/doc_notes/en/User Guide/User Guide/Advanced Usage/Custom Request Handler.html
@@ -13,7 +13,7 @@
Trilium provides a mechanism for scripts 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).
diff --git a/src/public/app/doc_notes/en/User Guide/User Guide/Advanced Usage/Database.html b/src/public/app/doc_notes/en/User Guide/User Guide/Advanced Usage/Database.html
index 4b52c6f4a..be62b8869 100644
--- a/src/public/app/doc_notes/en/User Guide/User Guide/Advanced Usage/Database.html
+++ b/src/public/app/doc_notes/en/User Guide/User Guide/Advanced Usage/Database.html
@@ -18,36 +18,9 @@
The database file is named document.db and is stored in the
application's default Data directory.
Demo Notes
-
When you run Trilium for the first time, it will generate a new database
- containing demo notes. These notes showcase its many features, such as:
There are some cases in which you may want to restore the original demo
- notes. For example, if you experimented with some of the more advanced
- features and want to see the original reference, or if you simply want
- to explore the latest version of the demo notes, which might showcase new
- features.
-
You can easily restore the demo notes by using Trilium's built-in import
- feature by importing them:
-
-
Download this .zip archive with
- the latest version of the demo notes
-
Right click on any note in your tree under which you would like the demo
- notes to be imported
-
Click "Import into note"
-
Select the .zip archive to import it
-
+
When first starting Trilium, it will provide a set of notes to showcase
+ various features of the application.
Trilium provides a lot of flexibility, and with it, opportunities for
advanced users to tweak it. If you need to explore or modify the database
diff --git a/src/public/app/doc_notes/en/User Guide/User Guide/Advanced Usage/Database/Demo Notes.html b/src/public/app/doc_notes/en/User Guide/User Guide/Advanced Usage/Database/Demo Notes.html
new file mode 100644
index 000000000..bc15cd499
--- /dev/null
+++ b/src/public/app/doc_notes/en/User Guide/User Guide/Advanced Usage/Database/Demo Notes.html
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+ Demo Notes
+
+
+
+
+
Demo Notes
+
+
+
When you run Trilium for the first time, it will generate a new database
+ containing demo notes. These notes showcase its many features, such as:
There are some cases in which you may want to restore the original demo
+ notes. For example, if you experimented with some of the more advanced
+ features and want to see the original reference, or if you simply want
+ to explore the latest version of the demo notes, which might showcase new
+ features.
+
You can easily restore the demo notes by using Trilium's built-in import
+ feature by importing them:
+
+
Download this .zip archive with
+ the latest version of the demo notes
+
Right click on any note in your tree under which you would like the demo
+ notes to be imported
+
Click "Import into note"
+
Select the .zip archive to import it
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/public/app/doc_notes/en/User Guide/User Guide/Advanced Usage/Database/Manually altering the database.html b/src/public/app/doc_notes/en/User Guide/User Guide/Advanced Usage/Database/Manually altering the database.html
index b41a6518a..d831e67c7 100644
--- a/src/public/app/doc_notes/en/User Guide/User Guide/Advanced Usage/Database/Manually altering the database.html
+++ b/src/public/app/doc_notes/en/User Guide/User Guide/Advanced Usage/Database/Manually altering the database.html
@@ -20,7 +20,7 @@
of your document.db file.
Modifying it internally using the SQL Console
The SQL Console is Trilium's built-in database editor.
In Trilium there's no specific "folder" note type. Any note can have children
and thus be a folder.
Root note
diff --git a/src/public/app/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/Notes/Attachments.html b/src/public/app/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/Notes/Attachments.html
index 4e5d2c70d..423734561 100644
--- a/src/public/app/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/Notes/Attachments.html
+++ b/src/public/app/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/Notes/Attachments.html
@@ -16,7 +16,7 @@
A note in Trilium can own one or more
attachments, which can be either images or files. These attachments can
be displayed or linked within the note that owns them.
-
This can be especially useful to include dependencies for your scripts.
+
This can be especially useful to include dependencies for your scripts.
The Weight Tracker shows
how to use chartjs which is attached to
the script note.
diff --git a/src/public/app/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/UI Elements/Launch Bar.html b/src/public/app/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/UI Elements/Launch Bar.html
index 93dd27ed0..de42d0c71 100644
--- a/src/public/app/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/UI Elements/Launch Bar.html
+++ b/src/public/app/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/UI Elements/Launch Bar.html
@@ -84,7 +84,7 @@
Script Launcher An advanced launcher which will run a script upon pressing. See
Scripts for more information.
+ href="../../Scripting.html">Scripts for more information.
Set script to point to the desired script to run.
Optionally, set a keyboardShortcut to trigger the launcher.
@@ -95,7 +95,7 @@
Allows defining a custom widget to be rendered inside the launcher. See
Widget Basics for more information.
+ href="../../Scripting/Widget%20Basics.html">Widget Basics for more information.
the assumption that only single person has access to the app simplifies
many things, or just outright makes them possible. In multi-user app, our
scriptingsupport would be a XSS security hole, while with the single
+ href="Scripting.html">scriptingsupport would be a XSS security hole, while with the single
user assumption it's an endless customizable tool.
How to open multiple documents in one Trilium instance
diff --git a/src/public/app/doc_notes/en/User Guide/User Guide/Installation & Setup/Mobile Frontend.html b/src/public/app/doc_notes/en/User Guide/User Guide/Installation & Setup/Mobile Frontend.html
index a9528ed37..5f55eec45 100644
--- a/src/public/app/doc_notes/en/User Guide/User Guide/Installation & Setup/Mobile Frontend.html
+++ b/src/public/app/doc_notes/en/User Guide/User Guide/Installation & Setup/Mobile Frontend.html
@@ -47,7 +47,7 @@
If this is not appropriate, you can use ?mobile or ?desktop query
param on login page (Note: you might need to log out).
Used in Scripting,
it displays the HTML content of another note. This allows displaying any
kind of content, provided there is a script behind it to generate it.
Script notes can be triggered by events. Note
- that these are backend events and thus relation need to point to the "JS
- backend" code note.
+
Script notes can be triggered by events.
+ Note that these are backend events and thus relation need to point to the
+ "JS backend" code note.
Global events
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
diff --git a/src/public/app/doc_notes/en/User Guide/User Guide/Note Types/Render Note.html b/src/public/app/doc_notes/en/User Guide/User Guide/Note Types/Render Note.html
index fcebc8389..347cf2129 100644
--- a/src/public/app/doc_notes/en/User Guide/User Guide/Note Types/Render Note.html
+++ b/src/public/app/doc_notes/en/User Guide/User Guide/Note Types/Render Note.html
@@ -12,7 +12,48 @@
Render Note
-
+
+
+
+
+
Render Note is used in Scripting.
+ It works by displaying the HTML of a Code note,
+ via an attribute.
+
Creating a render note
+
+
Create a Code note
+ with the HTML language, with what needs to be displayed (for example <p>Hello world.</p>).
Assign the renderNoterelation to
+ point at the previously created code note.
+
+
Dynamic content
+
A static HTML is generally not enough for Scripting. The next step is to automatically
+ change parts of the note using JavaScript.
+
For a simple example, we are going to create a render note that displays
+ the current date in a field.
+
To do so, first create an HTML code note with the following content:
<h1>Current date & time</h1>
+The current date & time is <span class="date"></span>
+
Now we need to add the script. Create another Code, but this time of JavaScript (frontend) language.
+ Make sure the newly created note is a direct child of the HTML note created
+ previously; with the following content:
Trilium supports creating Code 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 Script API provide
+ Trilium which can in conjunction with Script API provide
extra functionality.
Scripting
To go further I must explain basic architecture of Trilium - in its essence
@@ -33,7 +33,7 @@
we're onto something.
@@ -48,19 +48,19 @@
by Trilium runtime so when we restart Trilium, button won't be there.
We need to execute it every time Trilium starts up, but we probably don't
want to have to manually click on play button on every start up.
-
The solution is marked by red circle at the bottom - this note has label#run=frontendStartup -
+
The solution is marked by red circle at the bottom - this note has label#run=frontendStartup -
this is one of the "system" labels which Trilium understands. As you might
guess, this will cause all such labeled script notes to be executed once
Trilium frontend starts up.
diff --git a/src/public/app/doc_notes/en/User Guide/User Guide/Developer Guides/Examples/Downloading responses from Goo.html b/src/public/app/doc_notes/en/User Guide/User Guide/Scripting/Examples/Downloading responses from Goo.html
similarity index 100%
rename from src/public/app/doc_notes/en/User Guide/User Guide/Developer Guides/Examples/Downloading responses from Goo.html
rename to src/public/app/doc_notes/en/User Guide/User Guide/Scripting/Examples/Downloading responses from Goo.html
diff --git a/src/public/app/doc_notes/en/User Guide/User Guide/Note Types/Code/Scripting/New Task launcher button.html b/src/public/app/doc_notes/en/User Guide/User Guide/Scripting/Examples/New Task launcher button.html
similarity index 83%
rename from src/public/app/doc_notes/en/User Guide/User Guide/Note Types/Code/Scripting/New Task launcher button.html
rename to src/public/app/doc_notes/en/User Guide/User Guide/Scripting/Examples/New Task launcher button.html
index 625fed737..dca84feef 100644
--- a/src/public/app/doc_notes/en/User Guide/User Guide/Note Types/Code/Scripting/New Task launcher button.html
+++ b/src/public/app/doc_notes/en/User Guide/User Guide/Scripting/Examples/New Task launcher button.html
@@ -3,7 +3,7 @@
-
+
"New Task" launcher button
@@ -14,17 +14,17 @@
In this example we are going to extend the functionality of Task Manager showcase
+ href="../../Advanced%20Usage/Advanced%20Showcases/Task%20Manager.html">Task Manager showcase
(which comes by default with Trilium) by adding a button in the
Launch Bar (
+ class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Launch%20Bar.html">Launch Bar (
) to create a new task automatically and open it.