mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
advanced showcases
parent
2dce193886
commit
db157d34a0
@ -1 +1,6 @@
|
||||
Good
|
||||
Trilium provides some advanced functionality in the form of [[Scripts]] and [[promoted attributes]]. To explain and visualize these features we've prepared few showcases which are also available in the [[demo document|Document#demo-document]]:
|
||||
|
||||
* [[Day notes]]
|
||||
* [[Weight Tracker]]
|
||||
* [[Family Tree]]
|
||||
* [[Task Manager]]
|
@ -0,0 +1,2 @@
|
||||
Sometimes the fastest way to assess the software is just through screenshots so here they are.
|
||||
|
12
Scripts.md
12
Scripts.md
@ -16,7 +16,7 @@ To go further I must explain basic architecture of Trilium - in its essence it i
|
||||
|
||||
So we have frontend and backend, each with their own set of responsibilities, but their common feature is that they both run JavaScript code. Add to this the fact, that we're able to create JavaScript code notes and we're onto something.
|
||||
|
||||
# Button use case
|
||||
## Button use case
|
||||
|
||||
Let's take a look at our demo script (shipped with default Trilium [[document]]) - Task manager. One of the things this script does is adding a button to the Trilium interface which will allow user to easily add new Task (TODO item).
|
||||
|
||||
@ -33,11 +33,11 @@ In the note content you can see the code which calls one of the API methods, thi
|
||||
* optional shortcut under which you can trigger the button
|
||||
* most importantly "action" - what must happen when button is clicked
|
||||
|
||||
## Action handler
|
||||
### Action handler
|
||||
|
||||
Saving the note to the database is backend's responsibility so we immediately pass control to the backend and ask it to create a note. Once this is done, we show the newly created note so that the user can set the task title and maybe some attributes.
|
||||
|
||||
## Script execution
|
||||
### Script execution
|
||||
|
||||
So we have a script which will add the button to the toolbar. But how can we execute it? One possibility is to click on "play" icon (marked by red circle). The problem with this is that this UI change is time bound by Trilium runtime so when we restart Trilium, button won't be there.
|
||||
|
||||
@ -45,7 +45,11 @@ We need to execute it every time Trilium starts up, but we probably don't want t
|
||||
|
||||
The solution is marked by red circle at the bottom - this note has [[label|Attributes]] @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.
|
||||
|
||||
### Events
|
||||
### More showcases
|
||||
|
||||
You can see more scripting with explanation in [[Advanced showcases]]
|
||||
|
||||
## Events
|
||||
|
||||
See [[Events]].
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
Task Manager is a [[promoted attributes]] and [[scripts]] showcase present in the [[demo document|Document#demo-document]].
|
||||
|
||||
## Demo
|
||||
[[images/weight-tracker.png]]
|
||||
[[images/task-manager.png]]
|
||||
|
||||
Task Manager manages outstanding (TODO) tasks and finished tasks (non-empty doneDate attribute). Outstanding tasks are further categorized by location and arbitrary tags - whenever you change tag attribute in the task note, this task is then automatically moved to appropriate location.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user