diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Collections/Kanban Board.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Collections/Kanban Board.html index de9b60c9c..c2696105a 100644 --- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Collections/Kanban Board.html +++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Collections/Kanban Board.html @@ -7,94 +7,98 @@ adjusted.

How it works

When first creating a collection of Board type, a few subnotes - will be created, each having a #status label set. The board - then groups each note by the value of the status attribute.

+ will be created, each having a #status label + set. The board then groups each note by the value of the status attribute.

Notes are displayed recursively, so even the child notes of the child notes will be displayed. However, unlike the Table, the notes are not displayed in a hierarchy.

Interaction

Working with columns

Working with notes

Working with the note tree

It's also possible to add items on the board using the Note Tree.

    -
  1. Select the desired note in the Note Tree.
  2. -
  3. Hold the mouse on the note and drag it to the to the desired column.
  4. +
  5. Select the desired note in the Note Tree.
  6. +
  7. Hold the mouse on the note and drag it to the to the desired column.

This works for:

Keyboard interaction

The board view has mild support for keyboard-based navigation:

Configuration

Displaying custom attributes

@@ -102,39 +106,43 @@ -

Note attributes can be displayed on the board to enhance it with custom - information such as adding a Due date for your tasks.

+

Since v0.100.0, note attributes can be displayed on the board to enhance + it with custom information such as adding a Due date for your tasks.

This feature works exclusively via attribute definitions (Promoted Attributes). The easiest way to add these is:

    -
  1. Go to board note.
  2. -
  3. In the ribbon select Owned Attributes → plus button → Add new label/relation definition.
  4. -
  5. Configure the attribute as desired.
  6. -
  7. Check Inheritable to make it applicable to child notes automatically.
  8. +
  9. Go to board note.
  10. +
  11. In the ribbon select Owned Attributes → plus button → Add new label/relation definition.
  12. +
  13. Configure the attribute as desired.
  14. +
  15. Check Inheritable to make it applicable to child notes automatically.

After creating the attribute, click on a note and fill in the promoted attributes which should then reflect inside the board.

Of note:

Grouping by another label

-

By default, the label used to group the notes is #status. - It is possible to use a different label if needed by defining a label named #board:groupBy with - the value being the attribute to use (with or without # attribute - prefix).

+

By default, the label used to group the notes is #status. + It is possible to use a different label if needed by defining a label named + #board:groupBywith the value being the attribute to use (with or + without # attribute prefix).

Grouping by relations

A more advanced use-case is grouping by Relations.

During this mode:

Using relations instead of labels has some benefits:

To do so:

    -
  1. -

    First, create a Kanban board from scratch and not a template:

    -
  2. -
  3. -

    Assign #viewType=board #hidePromotedAttributes to emulate the - default template.

    -
  4. -
  5. -

    Set #board:groupBy to the name of a relation to group by, including the **~** prefix (e.g. ~status).

    -
  6. -
  7. -

    Optionally, use Promoted Attributes for - easy status change within the note:

    #relation:status(inheritable)="promoted,alias=Status,single"
    -
  8. +
  9. First, create a Kanban board from scratch and not a template:
  10. +
  11. Assign #viewType=board #hidePromotedAttributes to + emulate the default template.
  12. +
  13. Set #board:groupBy to the name of a relation + to group by, including the ~ prefix (e.g. + ~status).
  14. +
  15. +

    Optionally, use Promoted Attributes for + easy status change within the note:

    #relation:status(inheritable)="promoted,alias=Status,single"
    +
\ No newline at end of file diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Scripting/Backend scripts/Events.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Scripting/Backend scripts/Events.html index 59a2a8738..2703fe28b 100644 --- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Scripting/Backend scripts/Events.html +++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Scripting/Backend scripts/Events.html @@ -5,169 +5,147 @@

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.

-
- - - - - - - - - - - - - - - - - - - - - -
LabelDescription
run - -

Defines on which events script should run. Possible values are:

-
    -
  • frontendStartup - when Trilium frontend - starts up (or is refreshed), but not on mobile.
  • -
  • mobileStartup - when Trilium frontend starts - up (or is refreshed), on mobile.
  • -
  • backendStartup - when Trilium backend starts - up
  • -
  • hourly - run once an hour. You can use - additional label runAtHour to specify at - which hour, on the back-end.
  • -
  • daily - run once a day, on the back-end
  • -
-
runOnInstance - Specifies that the script should only run on a particular Trilium instance.
runAtHour - On which hour should this run. Should be used together with #run=hourly. - Can be defined multiple times for more runs during the day.
-
+ + + + + + + + + + + + + + + + + + + + + +
LabelDescription
run + +

Defines on which events script should run. Possible values are:

+
    +
  • frontendStartup - when Trilium frontend starts up (or is refreshed), + but not on mobile.
  • +
  • mobileStartup - when Trilium frontend starts up (or is refreshed), + on mobile.
  • +
  • backendStartup - when Trilium backend starts up
  • +
  • hourly - run once an hour. You can use additional label runAtHour to + specify at which hour, on the back-end.
  • +
  • daily - run once a day, on the back-end
  • +
+
runOnInstance + Specifies that the script should only run on a particular Trilium instance.
runAtHour + On which hour should this run. Should be used together with #run=hourly. + Can be defined multiple times for more runs during the day.
+

Entity events

Other events are bound to some entity, these are defined as relations - meaning that script is triggered only if note has this script attached to it through relations (or it can inherit it).

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
RelationTrigger conditionOrigin entity (see below)
runOnNoteCreation - 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.The BNote that got created.
runOnChildNoteCreation - executes when new note is created under the note where this relation is - definedThe BNote of the child that got created.
runOnNoteTitleChange - executes when note title is changed (includes note creation as well)The BNote of the note whose title got changed.
runOnNoteContentChange - executes when note content is changed (includes note creation as well).The BNote of the note whose content got - changed.
runOnNoteChange - executes when note is changed (includes note creation as well). Does not - include content changesThe BNote of the note that got changed.
runOnNoteDeletion - executes when note is being deletedThe BNote of the note that got (soft) deleted.
runOnBranchCreation - 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.The BBranch that got created.
runOnBranchChange - executes when a branch is updated. (since v0.62)The BBranch that got changed.
runOnBranchDeletion - 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).The BBranch that got (soft) deleted.
runOnAttributeCreation - executes when new attribute is created for the note which defines this - relationThe BAttribute that got created.
runOnAttributeChange - executes when the attribute is changed of a note which defines this relation. - This is triggered also when the attribute is deletedThe BAttribute that got changed.
-
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
RelationTrigger conditionOrigin entity (see below)
runOnNoteCreation + 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.The BNote that got created.
runOnChildNoteCreation + executes when new note is created under the note where this relation is + definedThe BNote of the child that got created.
runOnNoteTitleChange + executes when note title is changed (includes note creation as well)The BNote of the note whose title got changed.
runOnNoteContentChange + executes when note content is changed (includes note creation as well).The BNote of the note whose content got changed.
runOnNoteChange + executes when note is changed (includes note creation as well). Does not + include content changesThe BNote of the note that got changed.
runOnNoteDeletion + executes when note is being deletedThe BNote of the note that got (soft) deleted.
runOnBranchCreation + 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.The BBranch that got created.
runOnBranchChange + executes when a branch is updated. (since v0.62)The BBranch that got changed.
runOnBranchDeletion + 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).The BBranch that got (soft) deleted.
runOnAttributeCreation + executes when new attribute is created for the note which defines this + relationThe BAttribute that got created.
runOnAttributeChange + executes when the attribute is changed of a note which defines this relation. + This is triggered also when the attribute is deletedThe BAttribute that got changed.
+

Origin entity

-

When a script is run by an event such as the ones described above, - api.originEntitywill get populated with the note, branch or attribute - that triggered the change.

-

For example, here's a script with ~runOnAttributeChange which - automatically changes the color of a note based on the value of the - mycategorylabel:

const attr = api.originEntity;
-
+

When a script is run by an event such as the ones described above, api.originEntity will + get populated with the note, branch or attribute that triggered the change.

+

For example, here's a script with ~runOnAttributeChange which + automatically changes the color of a note based on the value of the mycategory label:

const attr = api.originEntity;
 if (attr.name !== "mycategory") return;
-
 const note = api.getNote(attr.noteId);
-
 if (attr.value === "Health") {
-
     note.setLabel("color", "green");
-
 } else {
-
     note.removeLabel("color");
-
 }
\ No newline at end of file diff --git a/docs/Developer Guide/Developer Guide/Documentation.md b/docs/Developer Guide/Developer Guide/Documentation.md index 5889ed1be..6dca18485 100644 --- a/docs/Developer Guide/Developer Guide/Documentation.md +++ b/docs/Developer Guide/Developer Guide/Documentation.md @@ -1,5 +1,5 @@ # Documentation -There are multiple types of documentation for Trilium: +There are multiple types of documentation for Trilium: * The _User Guide_ represents the user-facing documentation. This documentation can be browsed by users directly from within Trilium, by pressing F1. * The _Developer's Guide_ represents a set of Markdown documents that present the internals of Trilium, for developers. diff --git a/docs/User Guide/User Guide/Collections/Kanban Board.md b/docs/User Guide/User Guide/Collections/Kanban Board.md index dce70cef7..872c85e97 100644 --- a/docs/User Guide/User Guide/Collections/Kanban Board.md +++ b/docs/User Guide/User Guide/Collections/Kanban Board.md @@ -69,7 +69,7 @@ The board view has mild support for keyboard-based navigation:
-Note attributes can be displayed on the board to enhance it with custom information such as adding a Due date for your tasks. +Since v0.100.0, note attributes can be displayed on the board to enhance it with custom information such as adding a _Due date_ for your tasks. This feature works exclusively via attribute definitions (Promoted Attributes). The easiest way to add these is: @@ -116,7 +116,7 @@ To do so: 1. First, create a Kanban board from scratch and not a template: 2. Assign `#viewType=board #hidePromotedAttributes` to emulate the default template. -3. Set `#board:groupBy` to the name of a relation to group by, **including the** `**~**` **prefix** (e.g. `~status`). +3. Set `#board:groupBy` to the name of a relation to group by, **including the** `~` **prefix** (e.g. `~status`). 4. Optionally, use Promoted Attributes for easy status change within the note: ``` diff --git a/docs/User Guide/User Guide/Scripting/Backend scripts/Events.md b/docs/User Guide/User Guide/Scripting/Backend scripts/Events.md index 2ffd2bbdb..27fedb948 100644 --- a/docs/User Guide/User Guide/Scripting/Backend scripts/Events.md +++ b/docs/User Guide/User Guide/Scripting/Backend scripts/Events.md @@ -5,7 +5,7 @@ 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. -
LabelDescription
run

Defines on which events script should run. Possible values are:

  • frontendStartup - when Trilium frontend starts up (or is refreshed), but not on mobile.
  • mobileStartup - when Trilium frontend starts up (or is refreshed), on mobile.
  • backendStartup - when Trilium backend starts up
  • hourly - run once an hour. You can use additional label runAtHour to specify at which hour, on the back-end.
  • daily - run once a day, on the back-end
runOnInstanceSpecifies that the script should only run on a particular Trilium instance.
runAtHourOn which hour should this run. Should be used together with #run=hourly. Can be defined multiple times for more runs during the day.
+
LabelDescription
run

Defines on which events script should run. Possible values are:

  • frontendStartup - when Trilium frontend starts up (or is refreshed), but not on mobile.
  • mobileStartup - when Trilium frontend starts up (or is refreshed), on mobile.
  • backendStartup - when Trilium backend starts up
  • hourly - run once an hour. You can use additional label runAtHour to specify at which hour, on the back-end.
  • daily - run once a day, on the back-end
runOnInstanceSpecifies that the script should only run on a particular Trilium instance.
runAtHourOn which hour should this run. Should be used together with #run=hourly. Can be defined multiple times for more runs during the day.
## Entity events