diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Attributes.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Attributes.html index 3825c8af8..c52770536 100644 --- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Attributes.html +++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Attributes.html @@ -5,14 +5,14 @@

In Trilium, attributes are key-value pairs assigned to notes, providing additional metadata or functionality. There are two primary types of attributes:

    -
  1. +
  2. Labels can be used for a variety of purposes, such as storing metadata or configuring the behavior of notes. Labels are also searchable, enhancing note retrieval.

    For more information, including predefined labels, see Labels.

  3. -
  4. +
  5. Relations define connections between notes, similar to links. These can be used for metadata and scripting purposes.

    @@ -27,25 +27,24 @@

    Conceptually there are two types of attributes (applying to both labels and relations):

      -
    1. System attributes +
    2. System attributes
      As the name suggest, these attributes have a special meaning since they are interpreted by Trilium. For example the color attribute will change the color of the note as displayed in the Note Tree and - links, and iconClass will change the icon of a note. -
       
    3. -
    4. User-defined attributes + href="#root/_help_oPVyFC7WL2Lp">Note Tree and links, and iconClass will + change the icon of a note.
    5. +
    6. User-defined attributes
      These are free-form labels or relations that can be used by the user. They can be used purely for categorization purposes (especially if combined - with Search), + with Search), or they can be given meaning through the use of Scripting.
    7. + href="#root/_help_CdNpE2pqjmI6">Scripting.

    In practice, Trilium makes no direct distinction of whether an attribute is a system one or a user-defined one. A label or relation is considered a system attribute if it matches one of the built-in names (e.g. like the aforementioned iconClass). Keep this in mind when creating -  Promoted Attributes in +  Promoted Attributes in order not to accidentally alter a system attribute (unless intended).

    Viewing the list of attributes

    Both the labels and relations for the current note are displayed in the Owned Attributes section @@ -56,14 +55,13 @@

    In the list of attributes, labels are prefixed with the # character whereas relations are prefixed with the ~ character.

    Attribute Definitions and Promoted Attributes

    -

    Promoted Attributes create +

    Promoted Attributes create a form-like editing experience for attributes, which makes it easy to enhancing the organization and management of attributes

    Multiplicity

    Attributes in Trilium can be "multi-valued", meaning multiple attributes with the same name can co-exist. This can be combined with Promoted Attributes to - easily add them.

    + href="#root/_help_OFXdgB2nNk1F">Promoted Attributes to easily add them.

    Attribute Inheritance

    Trilium supports attribute inheritance, allowing child notes to inherit attributes from their parents. For more information, see 

    The Attribute definition specifies how should this value be interpreted:

      -
    • Is it just string, or is it a date?
    • -
    • Should we allow multiple values or note?
    • -
    • Should we promote the attribute or not?
    • +
    • Is it just string, or is it a date?
    • +
    • Should we allow multiple values or note?
    • +
    • Should we promote the attribute or not?

    Creating a new promoted attribute definition

    To create a new promoted attribute:

      -
    1. Go to a note.
    2. -
    3. Go to Owned Attributes in the Ribbon.
    4. -
    5. Press the + button.
    6. -
    7. Select either Add new label definition or Add new relation definition.
    8. -
    9. Select the name which will be name of the label or relation that will - be created when the promoted attribute is edited.
    10. -
    11. Ensure Promoted is checked in order to display it at the top of - notes.
    12. -
    13. Optionally, choose an Alias which will be displayed next to the - promoted attribute instead of the attribute name. Generally it's best to - choose a “user-friendly” name since it can contain spaces and other characters - which are not supported as attribute names.
    14. -
    15. Check Inheritable to apply it to this note and all its descendants. - To keep it only for the current note, un-check it.
    16. -
    17. Press “Save & Close” to apply the changes.
    18. +
    19. Go to a note.
    20. +
    21. Go to Owned Attributes in the Ribbon.
    22. +
    23. Press the + button.
    24. +
    25. Select either Add new label definition or Add new relation definition.
    26. +
    27. Select the name which will be name of the label or relation that will + be created when the promoted attribute is edited.
    28. +
    29. Ensure Promoted is checked in order to display it at the top of + notes.
    30. +
    31. Optionally, choose an Alias which will be displayed next to the + promoted attribute instead of the attribute name. Generally it's best to + choose a “user-friendly” name since it can contain spaces and other characters + which are not supported as attribute names.
    32. +
    33. Check Inheritable to apply it to this note and all its descendants. + To keep it only for the current note, un-check it.
    34. +
    35. Press “Save & Close” to apply the changes.

    How attribute definitions actually work

    When a new promoted attribute definition is created, it creates a corresponding @@ -54,37 +52,37 @@

    The only purpose of the attribute definition is to set up a template. If the attribute was marked as promoted, then it's also displayed to the user for easy editing.

    -
    - - - - - - - - - - - - - - - -
    -
    - -
    -
    Notice how the promoted attribute definition only creates a “Due date” - box above the text content.
    -
    - -
    -
    Once a value is set by the user, a new label (or relation, depending on - the type) is created. The name of the attribute matches one set when creating - the promoted attribute.
    -
    + + + + + + + + + + + + + + + + + +
    +
    + +
    +
    Notice how the promoted attribute definition only creates a “Due date” + box above the text content.
    +
    + +
    +
    Once a value is set by the user, a new label (or relation, depending on + the type) is created. The name of the attribute matches one set when creating + the promoted attribute.

    So there's one attribute for value and one for definition. But notice how an definition attribute can be made Inheritable, meaning that it's also applied to all descendant notes. In this case, the @@ -95,22 +93,22 @@ to be able to easily alter them.

    Here are a few practical examples:

    Inverse relation

    diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Collections/Geo Map.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Collections/Geo Map.html index 58f9014d1..e7e3c73f6 100644 --- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Collections/Geo Map.html +++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Collections/Geo Map.html @@ -1,11 +1,9 @@

    Creating a new geo map

    -
    - - - - - - - - - - - - - - - - - - - - -
       
    1 -
    - -
    -
    Right click on any note on the note tree and select Insert child noteGeo Map (beta).
    2 -
    - -
    -
    By default the map will be empty and will show the entire world.
    -
    + + + + + + + + + + + + + + + + + + + + +
    1 +
    + +
    +
    Right click on any note on the note tree and select Insert child noteGeo Map (beta).
    2 +
    + +
    +
    By default the map will be empty and will show the entire world.
    +

    Repositioning the map

      -
    • Click and drag the map in order to move across the map.
    • -
    • Use the mouse wheel, two-finger gesture on a touchpad or the +/- buttons +
    • Click and drag the map in order to move across the map.
    • +
    • Use the mouse wheel, two-finger gesture on a touchpad or the +/- buttons on the top-left to adjust the zoom.

    The position on the map and the zoom are saved inside the map note and restored when visiting again the note.

    Adding a marker using the map

    Adding a new note using the plus button

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       
    1To create a marker, first navigate to the desired point on the map. Then - press the - button in the Floating buttons (top-right) - area.     -
    -
    If the button is not visible, make sure the button section is visible - by pressing the chevron button ( - ) in the top-right of the map.
     
    2 - - Once pressed, the map will enter in the insert mode, as illustrated by - the notification.        -
    -
    Simply click the point on the map where to place the marker, or the Escape - key to cancel.
    3 - - Enter the name of the marker/note to be created.
    4 - - Once confirmed, the marker will show up on the map and it will also be - displayed as a child note of the map.
    -
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    1To create a marker, first navigate to the desired point on the map. Then + press the + button in the Floating buttons (top-right) + area.     +
    +
    If the button is not visible, make sure the button section is visible + by pressing the chevron button ( + ) in the top-right of the map.
    2 + + Once pressed, the map will enter in the insert mode, as illustrated by + the notification.        +
    +
    Simply click the point on the map where to place the marker, or the Escape + key to cancel.
    3 + + Enter the name of the marker/note to be created.
    4 + + Once confirmed, the marker will show up on the map and it will also be + displayed as a child note of the map.
    +

    Adding a new note using the contextual menu

      -
    1. Right click anywhere on the map, where to place the newly created marker +
    2. Right click anywhere on the map, where to place the newly created marker (and corresponding note).
    3. -
    4. Select Add a marker at this location.
    5. -
    6. Enter the name of the neNote Treewly +
    7. Select Add a marker at this location.
    8. +
    9. Enter the name of the neNote Treewly created note.
    10. -
    11. The map should be updated with the new marker.
    12. +
    13. The map should be updated with the new marker.

    Adding an existing note on note from 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 map to the desired location.
    4. -
    5. The map should be updated with the new marker.
    6. +
    7. Select the desired note in the Note Tree.
    8. +
    9. Hold the mouse on the note and drag it to the map to the desired location.
    10. +
    11. The map should be updated with the new marker.

    This works for:

      -
    • Notes that are not part of the geo map, case in which a clone will +
    • Notes that are not part of the geo map, case in which a clone will be created.
    • -
    • Notes that are a child of the geo map but not yet positioned on the map.
    • -
    • Notes that are a child of the geo map and also positioned, case in which +
    • Notes that are a child of the geo map but not yet positioned on the map.
    • +
    • Notes that are a child of the geo map and also positioned, case in which the marker will be relocated to the new position.
    -

    A more advanced use-case is 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/docs/Developer Guide/!!!meta.json b/docs/Developer Guide/!!!meta.json index cdf47264f..9e479b0cc 100644 --- a/docs/Developer Guide/!!!meta.json +++ b/docs/Developer Guide/!!!meta.json @@ -1974,6 +1974,13 @@ "value": "i18n", "isInheritable": false, "position": 20 + }, + { + "type": "relation", + "name": "internalLink", + "value": "lXjOyKpUSKgE", + "isInheritable": false, + "position": 30 } ], "format": "markdown", @@ -2071,6 +2078,34 @@ "format": "markdown", "dataFileName": "Server translations.md", "attachments": [] + }, + { + "isClone": false, + "noteId": "lXjOyKpUSKgE", + "notePath": [ + "jdjRLhLV3TtI", + "yeqU0zo0ZQ83", + "TLXJwBDo8Rdv", + "lXjOyKpUSKgE" + ], + "title": "Adding a new locale", + "notePosition": 40, + "prefix": null, + "isExpanded": false, + "type": "text", + "mime": "text/html", + "attributes": [ + { + "type": "label", + "name": "shareAlias", + "value": "new-locale", + "isInheritable": false, + "position": 20 + } + ], + "format": "markdown", + "dataFileName": "Adding a new locale.md", + "attachments": [] } ] }, diff --git a/docs/Developer Guide/Developer Guide/Concepts/Internationalisation Translat.md b/docs/Developer Guide/Developer Guide/Concepts/Internationalisation Translat.md index 7ae59016f..2449b6c72 100644 --- a/docs/Developer Guide/Developer Guide/Concepts/Internationalisation Translat.md +++ b/docs/Developer Guide/Developer Guide/Concepts/Internationalisation Translat.md @@ -15,7 +15,7 @@ One important aspect is the fact that we are using a key-based approach. This me The key-based approach allows a hierarchical structure. For example, a key of `about.title` would be added in `translation.json` as follows: -```json +``` { "about": { "title": "About Trilium Notes" @@ -27,11 +27,7 @@ Follow the Adding a new locale. ### Changing the language diff --git a/docs/Developer Guide/Developer Guide/Concepts/Internationalisation Translations/Adding a new locale.md b/docs/Developer Guide/Developer Guide/Concepts/Internationalisation Translations/Adding a new locale.md new file mode 100644 index 000000000..e36815b90 --- /dev/null +++ b/docs/Developer Guide/Developer Guide/Concepts/Internationalisation Translations/Adding a new locale.md @@ -0,0 +1,11 @@ +# Adding a new locale +Once the Weblate translations for a single language have reached ~50% in coverage, it's time to add it to the application. + +To do so: + +1. In `packages/commons` look for `i18n.ts` and add a new entry to `UNSORTED_LOCALES` for the language. +2. In `apps/server` look for `services/i18n.ts` and add a mapping for the new language in `DAYJS_LOADER`. Sort the entire list. +3. In `apps/client`, look for `collections/calendar/index.tsx` and modify `LOCALE_MAPPINGS` to add support to the new language. +4. In `apps/client`, look for `widgets/type_widgets/canvas/i18n.ts` and modify `LANGUAGE_MAPPINGS`. A unit test ensures that the language is actually loadable. +5. In `apps/client`, look for `widgets/type_widgets/MindMap.tsx` and modify `LOCALE_MAPPINGS`. The type definitions should already validate if the new value is supported by Mind Elixir. +6. In `packages/ckeditor5`, look for `i18n.ts` and modify `LOCALE_MAPPINGS`. The import validation should already check if the new value is supported by CKEditor, and there's also a test to ensure it. \ 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 5f9f17e5f..617684bfd 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/!!!meta.json b/docs/User Guide/!!!meta.json index f859cd689..40a40e9fc 100644 --- a/docs/User Guide/!!!meta.json +++ b/docs/User Guide/!!!meta.json @@ -9872,23 +9872,16 @@ "position": 10 }, { - "type": "label", - "name": "iconClass", - "value": "bx bx-columns", - "isInheritable": false, - "position": 10 - }, - { - "type": "label", - "name": "shareAlias", - "value": "kanban-board", + "type": "relation", + "name": "internalLink", + "value": "oPVyFC7WL2Lp", "isInheritable": false, "position": 20 }, { "type": "relation", "name": "internalLink", - "value": "Cq5X6iKQop6R", + "value": "IakOLONlIfGI", "isInheritable": false, "position": 30 }, @@ -9902,23 +9895,30 @@ { "type": "relation", "name": "internalLink", - "value": "bdUJEHsAPYQR", + "value": "Cq5X6iKQop6R", "isInheritable": false, "position": 50 }, { "type": "relation", "name": "internalLink", - "value": "oPVyFC7WL2Lp", + "value": "bdUJEHsAPYQR", "isInheritable": false, "position": 60 }, { - "type": "relation", - "name": "internalLink", - "value": "IakOLONlIfGI", + "type": "label", + "name": "iconClass", + "value": "bx bx-columns", "isInheritable": false, - "position": 70 + "position": 10 + }, + { + "type": "label", + "name": "shareAlias", + "value": "kanban-board", + "isInheritable": false, + "position": 20 } ], "format": "markdown", @@ -9968,59 +9968,73 @@ { "type": "relation", "name": "internalLink", - "value": "KSZ04uQ2D1St", + "value": "zEY4DaJG4YT5", "isInheritable": false, "position": 10 }, { "type": "relation", "name": "internalLink", - "value": "0ESUbbAxVnoK", + "value": "OFXdgB2nNk1F", "isInheritable": false, "position": 20 }, { "type": "relation", "name": "internalLink", - "value": "XpOYSgsLkTJy", + "value": "KSZ04uQ2D1St", "isInheritable": false, "position": 30 }, { "type": "relation", "name": "internalLink", - "value": "oPVyFC7WL2Lp", + "value": "0ESUbbAxVnoK", "isInheritable": false, "position": 40 }, { "type": "relation", "name": "internalLink", - "value": "IakOLONlIfGI", + "value": "XpOYSgsLkTJy", "isInheritable": false, "position": 50 }, { "type": "relation", "name": "internalLink", - "value": "lgKX7r3aL30x", + "value": "oPVyFC7WL2Lp", "isInheritable": false, "position": 60 }, { "type": "relation", "name": "internalLink", - "value": "ZjLYv08Rp3qC", + "value": "IakOLONlIfGI", "isInheritable": false, "position": 70 }, { "type": "relation", "name": "internalLink", - "value": "BlN9DFI679QC", + "value": "lgKX7r3aL30x", "isInheritable": false, "position": 80 }, + { + "type": "relation", + "name": "internalLink", + "value": "ZjLYv08Rp3qC", + "isInheritable": false, + "position": 90 + }, + { + "type": "relation", + "name": "internalLink", + "value": "BlN9DFI679QC", + "isInheritable": false, + "position": 100 + }, { "type": "label", "name": "iconClass", @@ -10034,20 +10048,6 @@ "value": "geomap", "isInheritable": false, "position": 90 - }, - { - "type": "relation", - "name": "internalLink", - "value": "zEY4DaJG4YT5", - "isInheritable": false, - "position": 100 - }, - { - "type": "relation", - "name": "internalLink", - "value": "OFXdgB2nNk1F", - "isInheritable": false, - "position": 110 } ], "format": "markdown", @@ -11240,24 +11240,45 @@ { "type": "relation", "name": "internalLink", - "value": "BlN9DFI679QC", + "value": "oPVyFC7WL2Lp", "isInheritable": false, "position": 30 }, { "type": "relation", "name": "internalLink", - "value": "OFXdgB2nNk1F", + "value": "eIg8jdvaoNNd", "isInheritable": false, "position": 40 }, { "type": "relation", "name": "internalLink", - "value": "bwZpz2ajCEwO", + "value": "CdNpE2pqjmI6", "isInheritable": false, "position": 50 }, + { + "type": "relation", + "name": "internalLink", + "value": "OFXdgB2nNk1F", + "isInheritable": false, + "position": 60 + }, + { + "type": "relation", + "name": "internalLink", + "value": "BlN9DFI679QC", + "isInheritable": false, + "position": 70 + }, + { + "type": "relation", + "name": "internalLink", + "value": "bwZpz2ajCEwO", + "isInheritable": false, + "position": 80 + }, { "type": "label", "name": "shareAlias", @@ -11271,27 +11292,6 @@ "value": "bx bx-list-check", "isInheritable": false, "position": 110 - }, - { - "type": "relation", - "name": "internalLink", - "value": "oPVyFC7WL2Lp", - "isInheritable": false, - "position": 120 - }, - { - "type": "relation", - "name": "internalLink", - "value": "eIg8jdvaoNNd", - "isInheritable": false, - "position": 130 - }, - { - "type": "relation", - "name": "internalLink", - "value": "CdNpE2pqjmI6", - "isInheritable": false, - "position": 140 } ], "format": "markdown", @@ -11740,10 +11740,38 @@ { "type": "relation", "name": "internalLink", - "value": "bwZpz2ajCEwO", + "value": "BlN9DFI679QC", "isInheritable": false, "position": 20 }, + { + "type": "relation", + "name": "internalLink", + "value": "bwZpz2ajCEwO", + "isInheritable": false, + "position": 30 + }, + { + "type": "relation", + "name": "internalLink", + "value": "GTwFsgaA0lCt", + "isInheritable": false, + "position": 40 + }, + { + "type": "relation", + "name": "internalLink", + "value": "zP3PMqaG71Ct", + "isInheritable": false, + "position": 50 + }, + { + "type": "relation", + "name": "internalLink", + "value": "R9pX4DGra2Vt", + "isInheritable": false, + "position": 60 + }, { "type": "label", "name": "shareAlias", @@ -11757,34 +11785,6 @@ "value": "bx bx-table", "isInheritable": false, "position": 20 - }, - { - "type": "relation", - "name": "internalLink", - "value": "BlN9DFI679QC", - "isInheritable": false, - "position": 50 - }, - { - "type": "relation", - "name": "internalLink", - "value": "GTwFsgaA0lCt", - "isInheritable": false, - "position": 60 - }, - { - "type": "relation", - "name": "internalLink", - "value": "zP3PMqaG71Ct", - "isInheritable": false, - "position": 70 - }, - { - "type": "relation", - "name": "internalLink", - "value": "R9pX4DGra2Vt", - "isInheritable": false, - "position": 80 } ], "format": "markdown",