Merge branch 'develop' of https://github.com/TriliumNext/Notes into develop
4
.gitignore
vendored
@ -14,7 +14,6 @@ po-*/
|
||||
!test/**/*.db
|
||||
!integration-tests/db/document.db
|
||||
!integration-tests/db/config.ini
|
||||
!data-docs/document.db
|
||||
integration-tests/db/log
|
||||
integration-tests/db/sessions
|
||||
integration-tests/db/backup
|
||||
@ -42,4 +41,5 @@ images/app-icons/mac/*.png
|
||||
data-docs/backup
|
||||
data-docs/log
|
||||
data-docs/session
|
||||
data-docs/session_secret.txt
|
||||
data-docs/session_secret.txt
|
||||
data-docs/document.*
|
@ -1,5 +1,5 @@
|
||||
# Advanced Showcases
|
||||
Trilium offers advanced functionality through [Scripts](Code%20Notes/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/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):
|
||||
|
||||
* [Relation Map](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](../Code%20Notes/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/Scripts.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](../Code%20Notes/Events.md) handler which is run on attribute change. This [script](../Code%20Notes/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/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.
|
||||
|
||||
### New task button
|
||||
|
||||
@ -46,7 +46,7 @@ api.addButtonToToolbar({
|
||||
|
||||
In the demo screenshot above you may notice that TODO tasks are in red color and DONE tasks are green.
|
||||
|
||||
This is done by having this CSS [code note](../Code%20Notes.md) which defines extra CSS classes:
|
||||
This is done by having this CSS [code note](../../Note%20Types/Code.md) which defines extra CSS classes:
|
||||
|
||||
```
|
||||
span.fancytree-node.todo .fancytree-title {
|
||||
@ -58,6 +58,6 @@ span.fancytree-node.done .fancytree-title {
|
||||
}
|
||||
```
|
||||
|
||||
This [code note](../Code%20Notes.md) has `#appCss` [label](../Attributes.md)which is recognized by Trilium on startup and loaded as CSS into the application.
|
||||
This [code note](../../Note%20Types/Code.md) has `#appCss` [label](../Attributes.md)which is recognized by Trilium on startup and loaded as CSS into the application.
|
||||
|
||||
Second part of this functionality is based in event handler described above which assigns `#cssClass` label to the task to either "done" or "todo" based on the task status.
|
@ -1,21 +1,21 @@
|
||||
# Weight Tracker
|
||||

|
||||
|
||||
The `Weight Tracker` is a [Script API](../Code%20Notes/Script%20API.md) showcase present in the [demo notes](../Database.md).
|
||||
The `Weight Tracker` is a [Script API](../../Note%20Types/Code/Script%20API.md) showcase present in the [demo notes](../Database.md).
|
||||
|
||||
By adding `weight` as a [promoted attribute](../Attributes/Promoted%20Attributes.md) in the [template](../Attributes/Template.md) from which [day notes](Day%20Notes.md) are created, you can aggregate the data and plot weight change over time.
|
||||
|
||||
## 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](../Code%20Notes/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/Scripts.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](../Code%20Notes.md) that contain some HTML and JavaScript respectively, which load all the notes with a `weight` attribute and display their values in a chart.
|
||||
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.
|
||||
|
||||
To actually render the chart, we're using a third party library called [chart.js](https://www.chartjs.org/)which is imported as an attachment, since it's not built into Trilium.
|
||||
|
||||
### Code
|
||||
|
||||
Here's the content of the script which is placed in a [code note](../Code%20Notes.md) of type `JS Frontend`:
|
||||
Here's the content of the script which is placed in a [code note](../../Note%20Types/Code.md) of type `JS Frontend`:
|
||||
|
||||
```
|
||||
async function getChartData() {
|
||||
|
@ -1,21 +0,0 @@
|
||||
# Code Notes
|
||||
Trilium supports creating "code" notes, i.e. notes which contain some sort of formal code - be it programming language (C++, JavaScript), structured data (JSON, XML) or other types of codes (CSS etc.).
|
||||
|
||||
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%20Notes/Scripts.md)
|
||||
* JSON, XML etc. can be used as storage for structured data (typically used in conjunction with scripting)
|
||||
|
||||

|
||||
|
||||
## Extra languages
|
||||
|
||||
Trilium supports syntax highlighting for many languages, but by default displays only some of them (to reduce the number of items). You can add extra languages in Options -> Code notes.
|
||||
|
||||
## Code blocks
|
||||
|
||||
An alternative to the code note is a "code block" - feature of a text note which can add short snippets of code to the text editor. Starting with TriliumNext v0.90.12, the code blocks also support syntax highlighting.
|
||||
|
||||

|
@ -1,11 +1,11 @@
|
||||
# Custom Request Handler
|
||||
Trilium provides a mechanism for [scripts](Code%20Notes/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/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`).
|
||||
|
||||
## Create note from outside Trilium
|
||||
|
||||
Let's take a look at an example. The goal is to provide a REST endpoint to which we can send title and content and Trilium will create a note.
|
||||
|
||||
We'll start with creating a JavaScript backend [code note](Code%20Notes.md) containing:
|
||||
We'll start with creating a JavaScript backend [code note](../Note%20Types/Code.md) containing:
|
||||
|
||||
```
|
||||
const {req, res} = api;
|
||||
@ -53,7 +53,7 @@ Trilium will then find our code note created above and execute it. `api.req`, `a
|
||||
|
||||
In the code note we check the request method and then use trivial authentication - keep in mind that these endpoints are by default totally unauthenticated, and you need to take care of this yourself.
|
||||
|
||||
Once we pass these checks we will just create the desired note using [Script API](Code%20Notes/Script%20API.md).
|
||||
Once we pass these checks we will just create the desired note using [Script API](../Note%20Types/Code/Script%20API.md).
|
||||
|
||||
## Custom resource provider
|
||||
|
||||
|
@ -40,7 +40,7 @@ To protect shared notes with a username and password, you can use the `#shareCre
|
||||
|
||||
The default shared page is basic in design, but you can customize it using your own CSS:
|
||||
|
||||
* **Custom CSS**: Link a CSS [code note](Code%20Notes.md) to the shared page by adding a `~shareCss` relation to the note. If you want this style to apply to the entire subtree, make the label inheritable. You can hide the CSS code note from the tree navigation by adding the `#shareHiddenFromTree` label.
|
||||
* **Custom CSS**: Link a CSS [code note](../Note%20Types/Code.md) to the shared page by adding a `~shareCss` relation to the note. If you want this style to apply to the entire subtree, make the label inheritable. You can hide the CSS code note from the tree navigation by adding the `#shareHiddenFromTree` label.
|
||||
* **Omitting Default CSS**: For extensive styling changes, use the `#shareOmitDefaultCss` label to avoid conflicts with Trilium's [default stylesheet](../Basic%20Concepts/Themes.md).
|
||||
|
||||
### Adding JavaScript
|
||||
|
@ -49,7 +49,7 @@ Only in desktop (electron build):
|
||||
|
||||
## Editing notes
|
||||
|
||||
Trilium uses CKEditor 5 for the [text notes](../Note%20Types/Text.md) and CodeMirror 5 for [code notes](../Advanced%20Usage/Code%20Notes.md). Check the documentation of these projects to see all their built-in keyboard shortcuts.
|
||||
Trilium uses CKEditor 5 for the [text notes](../Note%20Types/Text.md) and CodeMirror 5 for [code notes](../Note%20Types/Code.md). Check the documentation of these projects to see all their built-in keyboard shortcuts.
|
||||
|
||||
* `ALT-F10` - bring up inline formatting toolbar (arrow keys `<-`,`->` to navigate, `ENTER` to apply)
|
||||
* `ALT-F10` - again to bring up block formatting toolbar
|
||||
|
@ -4,10 +4,10 @@ Note is a central entity in Trilium. Main attributes of note are title and conte
|
||||
### Note types
|
||||
|
||||
* [text note](../Note%20Types/Text.md) - this is default note type which allows you to put rich text, images etc.
|
||||
* [code note](../Advanced%20Usage/Code%20Notes.md) - some kind of formal code, typically programming language (e.g. JavaScript) or data structure (e.g. JSON)
|
||||
* [code note](../Note%20Types/Code.md) - some kind of formal code, typically programming language (e.g. JavaScript) or data structure (e.g. JSON)
|
||||
* [image note](https://github.com/TriliumNext/Notes/wiki/Images) - represents single image
|
||||
* file note - represents uploaded file (e.g. docx MS Word document).
|
||||
* render HTML note - this works as an output screen of attached [scripts](../Advanced%20Usage/Code%20Notes/Scripts.md)
|
||||
* render HTML note - this works as an output screen of attached [scripts](../Note%20Types/Code/Scripts.md)
|
||||
* [saved search](../Note%20Types/Saved%20Search.md) note - contains saved search query and dynamically displays result of the search as its sub-notes
|
||||
* [relation map](../Advanced%20Usage/Relation%20Map.md) note - visualizes notes and their relations
|
||||
* [book note](../Note%20Types/Book.md) - displays its children notes, useful for reading many short notes
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Attachments
|
||||
A [note](../Note.md) 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](../../Advanced%20Usage/Code%20Notes/Scripts.md). The [Weight Tracker](../../Advanced%20Usage/Advanced%20Showcases/Weight%20Tracker.md) shows how to use [chartjs](https://chartjs.org/) which is attached to the [script note](#root/HcUYTojFohtb).
|
||||
This can be especially useful to include dependencies for your [scripts](../../Note%20Types/Code/Scripts.md). The [Weight Tracker](../../Advanced%20Usage/Advanced%20Showcases/Weight%20Tracker.md) shows how to use [chartjs](https://chartjs.org/) which is attached to the [script note](#root/HcUYTojFohtb).
|
||||
|
||||
Each note exclusively owns its attachments, meaning attachments cannot be shared or linked from one note to another. If an attachment link is copied to a different note, the attachment itself is duplicated, and the copies are managed independently thereafter.
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Read-Only Notes
|
||||
Both [text](../../Note%20Types/Text.md) and [code](../../Advanced%20Usage/Code%20Notes.md) notes in Trilium can be set to read-only. When a note is in read-only mode, it is presented to the user in a non-editable view, with the option to switch to editing mode if needed.
|
||||
Both [text](../../Note%20Types/Text.md) and [code](../../Note%20Types/Code.md) notes in Trilium can be set to read-only. When a note is in read-only mode, it is presented to the user in a non-editable view, with the option to switch to editing mode if needed.
|
||||
|
||||
## Setting Read-Only Mode with a Label
|
||||
|
||||
|
@ -9,7 +9,7 @@ Trilium comes with a couple pre-installed color themes, with the default being a
|
||||
|
||||
Trilium supports custom user themes, allowing you to personalize the application's appearance. To create a custom theme, follow these steps:
|
||||
|
||||
1. **Create a CSS Code Note**: Start by creating a new [code note](../Advanced%20Usage/Code%20Notes.md) with the `CSS` type.
|
||||
1. **Create a CSS Code Note**: Start by creating a new [code note](../Note%20Types/Code.md) with the `CSS` type.
|
||||
2. **Annotate with** `**#appTheme**`: Add the [attribute](../Advanced%20Usage/Attributes.md) `#appTheme=my-theme-name` to your note, where `my-theme-name` is the name of your custom theme.
|
||||
3. **Define Your Styles**: Write your custom CSS within the note. Below is an example of a custom theme:
|
||||
|
||||
@ -95,7 +95,7 @@ In addition to full themes, Trilium allows for custom CSS that isn't tied to a t
|
||||
|
||||
To use custom CSS:
|
||||
|
||||
1. **Create a CSS Code Note**: Create a new [code note](../Advanced%20Usage/Code%20Notes.md) with the `CSS` type.
|
||||
1. **Create a CSS Code Note**: Create a new [code note](../Note%20Types/Code.md) with the `CSS` type.
|
||||
2. **Add the** `**appCss**` **Label**: Annotate the note with the `#appCss` [label](../Advanced%20Usage/Attributes.md).
|
||||
3. **Write Your CSS**: Add your custom CSS rules to the note.
|
||||
|
||||
|
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 188 B |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 327 B |
After Width: | Height: | Size: 81 KiB |
After Width: | Height: | Size: 79 KiB |
After Width: | Height: | Size: 780 B |
After Width: | Height: | Size: 367 B |
@ -1,9 +1,8 @@
|
||||
# Global menu
|
||||
The position of the global menu differs based on which layout is selected in settings:
|
||||
The global menu configures the current window (zoom, keeping the window on top) and offers access to some more advanced options.
|
||||
|
||||
* For the vertical layout, the icon is in the top-left of the screen, in the form of the Trilium icon.
|
||||
* For the horizontal layout, the icon is in the top-right of the screen, in form of a hamburger menu icon.
|
||||

|
||||
|
||||
| | |
|
||||
| --- | --- |
|
||||
|  <br> <br>The global menu in the vertical layout. |  <br> <br>The global menu in the horizontal layout. |
|
||||
## Accessing the global menu
|
||||
|
||||
See [Vertical and horizontal layout](Vertical%20and%20horizontal%20layout.md) since the position of the global menu is changed based on which layout has been selected.
|
@ -0,0 +1,61 @@
|
||||
# Launch Bar
|
||||
## Position of the Launch bar
|
||||
|
||||
Depending on the layout selected, the launcher bar will either be on the left side of the screen with buttons displayed vertically or at the top of the screen. See [Vertical and horizontal layout](Vertical%20and%20horizontal%20layout.md) for more information.
|
||||
|
||||
## Terminology
|
||||
|
||||
* **Launcher**: a button that can be (or is) displayed on the launch bar.
|
||||
* **Available Launcher**: a launcher that is not displayed on the launch bar, but can be added.
|
||||
* **Visible Launcher**: a launcher that is currently displayed on the launch bar.
|
||||
|
||||
## Configuring the Launch bar
|
||||
|
||||
There are two ways to configure the launch bar:
|
||||
|
||||
* Right click in the empty space between launchers on the launch bar and select _Configure Launchbar._
|
||||
* Click on the [Global menu](Global%20menu.md) and select _Configure Launchbar_.
|
||||
|
||||
This will open a new tab with the [Note Tree](Note%20Tree.md) listing the launchers.
|
||||
|
||||

|
||||
|
||||
Expanding _Available Launchers_ section will show the list of launchers that are not displayed on the launch bar. The _Visible Launchers_ will show the ones that are currently displayed.
|
||||
|
||||
### Adding/removing and reordering launchers
|
||||
|
||||
To display a new launcher in the launch bar, first look for it in the _Available Launchers_ section. Then right click it and select _Move to visible launchers_. It is also possible to drag and drop the item manually.
|
||||
|
||||
Similarly, to remove it from the launch bar, simply look for it in _Visible Launchers_ then right click it and select _Move to available launchers_ or use drag-and-drop.
|
||||
|
||||
Drag-and-drop the items in the tree in order to change their order. See [Note Tree](Note%20Tree.md) for more interaction options, including using keyboard shortcuts.
|
||||
|
||||
### Resetting
|
||||
|
||||
Resetting allows restoring the original configuration of Trilium for the launcher bar, or for a portion of it. Simply right click a launcher (or even the entire _Launch Bar_ section) and select _Reset_ to bring it back to the original state.
|
||||
|
||||
### Creating new launchers / types of launchers
|
||||
|
||||
Right click either the _Available launchers_ or _Visible launchers_ sections and select one of the options:
|
||||
|
||||
1. **Note Launcher**
|
||||
A note launcher will simply navigate to a specified note.
|
||||
|
||||
1. Set the `target` promoted attribute to the note to navigate to.
|
||||
2. Optionally, set `hoistedNote` to hoist a particular note. See [Note Hoisting](../Navigation/Note%20Hoisting.md) for more information.
|
||||
3. Optionally, set a `keyboardShortcut` to trigger the launcher.
|
||||
|
||||
2. **Script Launcher**
|
||||
An advanced launcher which will run a script upon pressing. See [Scripts](../../Note%20Types/Code/Scripts.md) for more information.
|
||||
|
||||
1. Set `script` to point to the desired script to run.
|
||||
2. Optionally, set a `keyboardShortcut` to trigger the launcher.
|
||||
|
||||
3. **Custom Widget**
|
||||
|
||||
Allows defining a custom widget to be rendered inside the launcher. See [Widget Basics](../../Developer%20Guides/Widget%20Basics.md) for more information.
|
||||
|
||||
4. **Spacers**
|
||||
Launchers that create some distance between other launchers for better visual distinction.
|
||||
|
||||
Launchers are configured via predefined [Promoted Attributes](../../Advanced%20Usage/Attributes/Promoted%20Attributes.md).
|
After Width: | Height: | Size: 5.4 KiB |
@ -1,9 +1,13 @@
|
||||
# Tree Manipulation
|
||||
# Note Tree
|
||||
This page explains how to manipulate the note tree in TriliumNext, focusing on moving notes.
|
||||
|
||||

|
||||
|
||||
## Drag and Drop
|
||||
|
||||
You can easily rearrange the note tree by dragging and dropping notes, as demonstrated in the example above.
|
||||

|
||||
|
||||
You can easily rearrange the note tree by dragging and dropping notes, as demonstrated in the example above.
|
||||
|
||||
## Keyboard Manipulation
|
||||
|
||||
@ -16,4 +20,14 @@ This page explains how to manipulate the note tree in TriliumNext, focusing on m
|
||||
|
||||
## Context Menu
|
||||
|
||||
You can also move notes using the familiar cut and paste functions available in the context menu, or with the associated keyboard [shortcuts](../Keyboard%20Shortcuts.md): `CTRL-C` ( [copy](../Note/Cloning%20Notes.md)), `CTRL-X` (cut) and `CTRL-V` (paste).
|
||||
You can also move notes using the familiar cut and paste functions available in the context menu, or with the associated keyboard [shortcuts](../Keyboard%20Shortcuts.md): `CTRL-C` ( [copy](../Note/Cloning%20Notes.md)), `CTRL-X` (cut) and `CTRL-V` (paste).
|
||||
|
||||
## Multiple selection
|
||||
|
||||
It is possible to select multiple notes at one time.
|
||||
|
||||
To do so, first select the note to start the selection with. Then hold Shift and click on the note to end the selection with. All the notes between the start and the end note will be selected as well.
|
||||
|
||||

|
||||
|
||||
In the right-click menu, operations such as Cut, Copy, Move to, Clone to or Delete will apply to all the selected notes. It is also possible to apply [Bulk actions](../../Advanced%20Usage/Bulk%20actions.md) to them. The rest of the options will not be available and will appear disabled in the menu.
|
After Width: | Height: | Size: 7.3 KiB |
@ -0,0 +1,8 @@
|
||||
# Ribbon
|
||||

|
||||
|
||||
The ribbon allows changing options, attributes and viewing information about the current note.
|
||||
|
||||
## Settings
|
||||
|
||||
It is possible to change whether some ribbon items will be automatically open when navigating to a new note. To do so, in [Settings](Options.md), go to _Appearance_ and look for the _Ribbon widgets_ section.
|
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 482 B |
@ -0,0 +1,34 @@
|
||||
# Vertical and horizontal layout
|
||||
## Layouts
|
||||
|
||||
Trilium supports two different layouts, based on your preference.
|
||||
|
||||
### Vertical layout
|
||||
|
||||
The vertical layout is Trilium's original layout:
|
||||
|
||||
* The [Launcher Bar](Launch%20Bar.md) is positioned on the left side of the screen, with buttons being laid out vertically.
|
||||
* The tab bar is at the top, but to the right of the [Note Tree](Note%20Tree.md).
|
||||
* The [Quick search](Quick%20search.md) is at the top of the [Note Tree](Note%20Tree.md).
|
||||
* The [Note Tree](Note%20Tree.md) can be collapsed by pressing the  button at the bottom of the [Launcher Bar](Launch%20Bar.md).
|
||||
* The [Global menu](Global%20menu.md) can be accessed via the  icon at the top of the [Launcher Bar](Launch%20Bar.md).
|
||||
|
||||

|
||||
|
||||
### Horizontal layout
|
||||
|
||||
The horizontal layout is a more traditional layout, since it bears similarity with other applications. In this mode:
|
||||
|
||||
* The [Launcher Bar](Launch%20Bar.md) is at the top of the screen, with the buttons laid horizontally.
|
||||
* The tab bar is at the top of the screen, but now covers the entirety of the width, allowing for more tabs to be displayed at once.
|
||||
* The [Quick search](Quick%20search.md) is now part of the [Launcher Bar](Launch%20Bar.md). It can be moved around according to preference and even removed if needed.
|
||||
* The [Note Tree](Note%20Tree.md) can be collapsed by pressing the small  button to the left of the first tab.
|
||||
* The [Global menu](Global%20menu.md) can be accessed via the  button at the end of the [Launcher Bar](Launch%20Bar.md).
|
||||
|
||||

|
||||
|
||||
## Changing the layout
|
||||
|
||||
Go to [Settings](#root/_hidden/_lbRoot/_lbVisibleLaunchers/_lbSettings) and look for the _Appearance_ option on the left. Then look for the _Layout_ section, where there is the possibility to switch between the two available layouts.
|
||||
|
||||
Selecting an option will immediately apply the new layout by reloading the window.
|
@ -1,7 +1,7 @@
|
||||
# Frontend Basics
|
||||
## Frontend API
|
||||
|
||||
The frontend api supports two styles, regular scripts that are run with the current app and note context, and widgets that export an object to Trilium to be used in the UI. In both cases, the frontend api of Trilium is available to scripts running in the frontend context as global variable `api`. The members and methods of the api can be seen on the [Script API](../Advanced%20Usage/Code%20Notes/Script%20API.md) page.
|
||||
The frontend api supports two styles, regular scripts that are run with the current app and note context, and widgets that export an object to Trilium to be used in the UI. In both cases, the frontend api of Trilium is available to scripts running in the frontend context as global variable `api`. The members and methods of the api can be seen on the [Script API](../Note%20Types/Code/Script%20API.md) page.
|
||||
|
||||
## Scripts
|
||||
|
||||
|
@ -85,7 +85,7 @@ After reloading Trilium, the button should now appear at the bottom left of the
|
||||
|
||||
### Step 4: Adding User Interaction
|
||||
|
||||
Let’s make the button interactive by showing a message when it’s clicked. We'll use the `api.showMessage` method from the [Script API](../Advanced%20Usage/Code%20Notes/Script%20API.md).
|
||||
Let’s make the button interactive by showing a message when it’s clicked. We'll use the `api.showMessage` method from the [Script API](../Note%20Types/Code/Script%20API.md).
|
||||
|
||||
```
|
||||
class MyWidget extends api.BasicWidget {
|
||||
|
@ -23,7 +23,7 @@ Common request is to allow multiple users collaborate, share notes etc. So far I
|
||||
|
||||
* it's a huge feature, or rather a Pandora's box of collaboration features like user management, permissions, conflict resolution, real-time editing of a note by multiple people etc. This would be a huge amount of work. Trilium Notes is project made mostly by one person in free time and that's unlikely to change in the future.
|
||||
* given its size it would probably pivot the attention away from my main focus which is a personal note-taking
|
||||
* 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 [scripting](Advanced%20Usage/Code%20Notes/Scripts.md)support would be a XSS security hole, while with the single user assumption it's an endless customizable tool.
|
||||
* 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 [scripting](Note%20Types/Code/Scripts.md)support 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
|
||||
|
||||
|
@ -31,4 +31,4 @@ Trilium decides automatically whether to use mobile or desktop frontend. If this
|
||||
|
||||
## Scripting
|
||||
|
||||
You can alter the behavior with [scripts](../Advanced%20Usage/Code%20Notes/Scripts.md) just like for normal frontend. For script notes to be executed, they need to have labeled `#run=mobileStartup`.
|
||||
You can alter the behavior with [scripts](../Note%20Types/Code/Scripts.md) just like for normal frontend. For script notes to be executed, they need to have labeled `#run=mobileStartup`.
|
BIN
docs/User Guide/User Guide/Note Types/1_Code_image.png
Normal file
After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 68 KiB |
@ -0,0 +1,27 @@
|
||||
# Code
|
||||
Trilium supports creating "code" notes, i.e. notes which contain some sort of formal code - be it programming language (C++, JavaScript), structured data (JSON, XML) or other types of codes (CSS etc.).
|
||||
|
||||
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/Scripts.md)
|
||||
* 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/Code%20blocks.md).
|
||||
|
||||

|
||||
|
||||
## Adjusting the language of a code note
|
||||
|
||||
In the [Ribbon](../Basic%20Concepts/UI%20Elements/Ribbon.md), look for the _Note type_ selector and click it to reveal the possible note types. Inside of it there will be a section called _Code_, select any one of the languages.
|
||||
|
||||

|
||||
|
||||
## Adjusting the list of languages
|
||||
|
||||
Trilium supports syntax highlighting for many languages, but by default displays only some of them. The supported languages can be adjusted by going to [Options](../Basic%20Concepts/UI%20Elements/Options.md), then _Code Notes_ and looking for the _Available MIME types in the dropdown_ section. Simply check any of the items to add them to the list, or un-check them to remove them from the list.
|
||||
|
||||
Note that the list of languages is not immediately refreshed, you'd have to manually [refresh the application](../Troubleshooting/Refreshing%20the%20application.md).
|
||||
|
||||
The list of languages is also shared with the [Code blocks](Text/Code%20blocks.md) feature of [Text](Text.md) notes.
|
@ -14,7 +14,7 @@ Global events are attached to the script note via label. Simply create e.g. "run
|
||||
|
||||
## Entity events
|
||||
|
||||
Other events are bound to some entity, these are defined as [relations](../Attributes.md) - meaning that script is triggered only if note has this script attached to it through relations (or it can inherit it).
|
||||
Other events are bound to some entity, these are defined as [relations](../../Advanced%20Usage/Attributes.md) - meaning that script is triggered only if note has this script attached to it through relations (or it can inherit it).
|
||||
|
||||
* `runOnNoteCreation` - executes when note is created on backend
|
||||
* `runOnNoteTitleChange` - executes when note title is changed (includes note creation as well)
|
@ -1,5 +1,5 @@
|
||||
# Scripts
|
||||
Trilium supports creating [code notes](../Code%20Notes.md), 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](Script%20API.md) provide extra functionality.
|
||||
Trilium supports creating [code notes](../Code.md), 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](Script%20API.md) provide extra functionality.
|
||||
|
||||
## Scripting
|
||||
|
||||
@ -12,7 +12,7 @@ So we have frontend and backend, each with their own set of responsibilities, bu
|
||||
|
||||
## Button use case
|
||||
|
||||
Let's take a look at our demo script (shipped with default Trilium [database](../Database.md)) - 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).
|
||||
Let's take a look at our demo script (shipped with default Trilium [database](../../Advanced%20Usage/Database.md)) - 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).
|
||||
|
||||

|
||||
|
||||
@ -37,13 +37,13 @@ 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](../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)
|
||||
|
||||
### More showcases
|
||||
|
||||
You can see more scripting with explanation in [Advanced showcases](../Advanced%20Showcases.md)
|
||||
You can see more scripting with explanation in [Advanced showcases](../../Advanced%20Usage/Advanced%20Showcases.md)
|
||||
|
||||
## Events
|
||||
|
Before Width: | Height: | Size: 99 KiB After Width: | Height: | Size: 99 KiB |
After Width: | Height: | Size: 30 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 6.2 KiB |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 10 KiB |
35
docs/User Guide/User Guide/Note Types/Text/Code blocks.md
Normal file
@ -0,0 +1,35 @@
|
||||
# Code blocks
|
||||

|
||||
|
||||
The code blocks feature allows entering pieces of code in text notes.
|
||||
|
||||
Note that this feature is meant for generally small snippets of code. For larger files such as an entire log, see the dedicated [\[missing note\]](#root/pOsGYCXsbNQG/KSZ04uQ2D1St/FVuX89AJuFSw) note type instead.
|
||||
|
||||
## Inserting a code block
|
||||
|
||||
* Via the [Formatting toolbar](Formatting%20toolbar.md), look for the  button.
|
||||
* Pressing directly on the icon will insert a code block with the language that was selected most recently. If this is the first time a code block is inserted, the language will be “Auto-detected” by default.
|
||||
* Pressing the arrow next to the icon, which will show a popup with the available languages.
|
||||
* Type ` ``` ` (as in Markdown).
|
||||
* Note that it's not possible to specify the language, as it will default to the last selected language.
|
||||
|
||||
## Syntax highlighting
|
||||
|
||||
Since TriliumNext v0.90.12, Trilium will try to offer syntax highlighting to the code block. Note that the syntax highlighting mechanism is slightly different than the one in [Code Notes](../Code.md) notes as different technologies are involved.
|
||||
|
||||
When the language is set to _Auto-detected_, Trilium will try to identify the programming language (or similar) that corresponds to the given snippet of text and highlight it. If this is problematic, consider changing the language of the code block manually.
|
||||
|
||||
When the language is set to _Plain text_, there will be no syntax highlighting.
|
||||
|
||||
## Changing the language of a code block
|
||||
|
||||
Simply click anywhere inside the code block and press again the code block button in the [Formatting toolbar](Formatting%20toolbar.md):
|
||||

|
||||
|
||||
## Adjusting the list of languages
|
||||
|
||||
The code blocks feature shares the list of languages with the [Code Notes](../Code.md) note type.
|
||||
|
||||
The supported languages can be adjusted by going to [Options](../../Basic%20Concepts/UI%20Elements/Options.md), then _Code Notes_ and looking for the _Available MIME types in the dropdown_ section. Simply check any of the items to add them to the list, or uncheck them to remove them from the list.
|
||||
|
||||
Note that the list of languages is not immediately refreshed, you'd have to manually [refresh the application](../../Troubleshooting/Refreshing%20the%20application.md).
|
BIN
docs/User Guide/User Guide/Note Types/Text/Code blocks_image.png
Normal file
After Width: | Height: | Size: 682 B |
@ -0,0 +1,35 @@
|
||||
# Formatting toolbar
|
||||
Trilium allows two different editing experiences for text notes, based on your preference.
|
||||
|
||||
To do so, go to [Options](../../Basic%20Concepts/UI%20Elements/Options.md) and look for the _Text Notes_ section. There is a corresponding section called _Formatting toolbar_.
|
||||
|
||||
## Floating
|
||||
|
||||
The floating bar is a more minimalist option, in which the formatting is hidden behind two different popups.
|
||||
|
||||
### Block-level popup
|
||||
|
||||
The first popup is the block-level popup. This will appear to the left of the current paragraph you are currently editing, as a sequence of dots:
|
||||

|
||||
|
||||
Clicking this popup will reveal the formatting options that are specific to the entire paragraph, such as setting a heading, lists, tables, etc.
|
||||
|
||||

|
||||
|
||||
### Inline popup
|
||||
|
||||
The inline popup appears automatically when selecting a text:
|
||||
|
||||

|
||||
|
||||
All the options here apply only to the selected portion of text, such as changing the font size, or making the text bold.
|
||||
|
||||
## Fixed
|
||||
|
||||
The fixed formatting offers a more traditional editing paradigm, usually useful if a lot of formatting is needed.
|
||||
|
||||
All the options are combined into a single toolbar that will appear as part of the [Ribbon](../../Basic%20Concepts/UI%20Elements/Ribbon.md).
|
||||
|
||||

|
||||
|
||||
By default, if the toolbar does not fit on the screen, the rest of the options will be grouped into a single option at the end. It is possible to display items on multiple lines by checking the corresponding option in the _Formatting toolbar_ section.
|
After Width: | Height: | Size: 8.9 KiB |
@ -21,7 +21,7 @@ TRILIUM_START_NOTE_ID=root ./trilium
|
||||
|
||||
## Broken Script Prevents Application Startup
|
||||
|
||||
If a custom script causes Triliumto crash, and it is set as a startup script or in an active [custom widget](Advanced%20Usage/Code%20Notes/Custom%20Widgets.md), start Triliumin "safe mode" to prevent any custom scripts from executing:
|
||||
If a custom script causes Triliumto crash, and it is set as a startup script or in an active [custom widget](Note%20Types/Code/Custom%20Widgets.md), start Triliumin "safe mode" to prevent any custom scripts from executing:
|
||||
|
||||
```
|
||||
TRILIUM_SAFE_MODE=true ./trilium
|
||||
|
@ -0,0 +1,4 @@
|
||||
# Refreshing the application
|
||||
Some changes to the application will not take effect immediately and as such it might require to manually reload or refresh the application.
|
||||
|
||||
To do so, simply press Ctrl+Shift+R.
|
1225
src/public/app/doc_notes/en/User Guide/!!!meta.json
generated
@ -13,7 +13,7 @@
|
||||
<h1 data-trilium-h1>Advanced Showcases</h1>
|
||||
|
||||
<div class="ck-content">
|
||||
<p>Trilium offers advanced functionality through <a href="Code%20Notes/Scripts.html">Scripts</a> and
|
||||
<p>Trilium offers advanced functionality through <a href="../Note%20Types/Code/Scripts.html">Scripts</a> and
|
||||
<a
|
||||
href="Attributes/Promoted%20Attributes.html">Promoted Attributes</a>. To illustrate these features, we've prepared
|
||||
several showcases available in the <a href="Database.html">demo notes</a>:</p>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<div class="ck-content">
|
||||
<p>Task Manager is a <a href="../Attributes/Promoted%20Attributes.html">promoted attributes</a> and
|
||||
<a
|
||||
href="../Code%20Notes/Scripts.html">scripts</a>showcase present in the <a href="../Database.html">demo notes</a>.</p>
|
||||
href="../../Note%20Types/Code/Scripts.html">scripts</a>showcase present in the <a href="../Database.html">demo notes</a>.</p>
|
||||
|
||||
<h2>Demo</h2>
|
||||
|
||||
@ -42,8 +42,8 @@
|
||||
|
||||
<p>Task template defines several <a href="../Attributes/Promoted%20Attributes.html">promoted attributes</a> -
|
||||
todoDate, doneDate, tags, location. Importantly it also defines <code>~runOnAttributeChange</code> relation
|
||||
- <a href="../Code%20Notes/Events.html">event</a> handler which is run on
|
||||
attribute change. This <a href="../Code%20Notes/Scripts.html">script</a> handles
|
||||
- <a href="../../Note%20Types/Code/Events.html">event</a> handler which is
|
||||
run on attribute change. This <a href="../../Note%20Types/Code/Scripts.html">script</a> 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.</p>
|
||||
@ -74,7 +74,7 @@
|
||||
|
||||
<p>In the demo screenshot above you may notice that TODO tasks are in red
|
||||
color and DONE tasks are green.</p>
|
||||
<p>This is done by having this CSS <a href="../Code%20Notes.html">code note</a> which
|
||||
<p>This is done by having this CSS <a href="../../Note%20Types/Code.html">code note</a> which
|
||||
defines extra CSS classes:</p>
|
||||
<pre><code class="language-text-x-trilium-auto">span.fancytree-node.todo .fancytree-title {
|
||||
color: red !important;
|
||||
@ -83,7 +83,7 @@
|
||||
span.fancytree-node.done .fancytree-title {
|
||||
color: green !important;
|
||||
}</code></pre>
|
||||
<p>This <a href="../Code%20Notes.html">code note</a> has <code>#appCss</code>
|
||||
<p>This <a href="../../Note%20Types/Code.html">code note</a> has <code>#appCss</code>
|
||||
<a
|
||||
href="../Attributes.html">label</a>which is recognized by Trilium on startup and loaded as CSS into
|
||||
the application.</p>
|
||||
|
@ -16,7 +16,7 @@
|
||||
<p>
|
||||
<img src="Weight Tracker_image.png" alt="" />
|
||||
</p>
|
||||
<p>The <code>Weight Tracker</code> is a <a href="../Code%20Notes/Script%20API.html">Script API</a> showcase
|
||||
<p>The <code>Weight Tracker</code> is a <a href="../../Note%20Types/Code/Script%20API.html">Script API</a> showcase
|
||||
present in the <a href="../Database.html">demo notes</a>.</p>
|
||||
<p>By adding <code>weight</code> as a <a href="../Attributes/Promoted%20Attributes.html">promoted attribute</a> in
|
||||
the <a href="../Attributes/Template.html">template</a> from which <a href="Day%20Notes.html">day notes</a> are
|
||||
@ -26,11 +26,11 @@
|
||||
|
||||
<p>The <code>Weight Tracker</code> note in the screenshot above is of the type <code>Render Note</code>.
|
||||
That type of note doesn't have any useful content itself. Instead it is
|
||||
a placeholder where a <a href="../Code%20Notes/Scripts.html">script</a> can
|
||||
a placeholder where a <a href="../../Note%20Types/Code/Scripts.html">script</a> can
|
||||
render its output.</p>
|
||||
<p>Scripts for <code>Render Notes</code> are defined in a <a href="../Attributes.html">relation</a> called <code>~renderNote</code>.
|
||||
In this example, it's the <code>Weight Tracker</code>'s child <code>Implementation</code>.
|
||||
The Implementation consists of two <a href="../Code%20Notes.html">code notes</a> that
|
||||
The Implementation consists of two <a href="../../Note%20Types/Code.html">code notes</a> that
|
||||
contain some HTML and JavaScript respectively, which load all the notes
|
||||
with a <code>weight</code> attribute and display their values in a chart.</p>
|
||||
<p>To actually render the chart, we're using a third party library called
|
||||
@ -40,7 +40,7 @@
|
||||
|
||||
<h3>Code</h3>
|
||||
|
||||
<p>Here's the content of the script which is placed in a <a href="../Code%20Notes.html">code note</a> of
|
||||
<p>Here's the content of the script which is placed in a <a href="../../Note%20Types/Code.html">code note</a> of
|
||||
type <code>JS Frontend</code>:</p>
|
||||
<pre><code class="language-text-x-trilium-auto">async function getChartData() {
|
||||
const days = await api.runOnBackend(async () => {
|
||||
|
@ -1,53 +0,0 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="../../style.css">
|
||||
<base target="_parent">
|
||||
<title data-trilium-title>Code Notes</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="content">
|
||||
<h1 data-trilium-h1>Code Notes</h1>
|
||||
|
||||
<div class="ck-content">
|
||||
<p>Trilium supports creating "code" notes, i.e. notes which contain some
|
||||
sort of formal code - be it programming language (C++, JavaScript), structured
|
||||
data (JSON, XML) or other types of codes (CSS etc.).</p>
|
||||
<p>This can be useful for a few things:</p>
|
||||
<ul>
|
||||
<li>computer programmers can store code snippets as notes with syntax highlighting</li>
|
||||
<li>JavaScript code notes can be executed inside Trilium for some extra functionality
|
||||
<ul>
|
||||
<li>we call such JavaScript code notes "scripts" - see <a href="Code%20Notes/Scripts.html">Scripts</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>JSON, XML etc. can be used as storage for structured data (typically used
|
||||
in conjunction with scripting)</li>
|
||||
</ul>
|
||||
<p>
|
||||
<img src="Code Notes_image.png" alt="" />
|
||||
</p>
|
||||
|
||||
<h2>Extra languages</h2>
|
||||
|
||||
<p>Trilium supports syntax highlighting for many languages, but by default
|
||||
displays only some of them (to reduce the number of items). You can add
|
||||
extra languages in Options -> Code notes.</p>
|
||||
|
||||
<h2>Code blocks</h2>
|
||||
|
||||
<p>An alternative to the code note is a "code block" - feature of a text
|
||||
note which can add short snippets of code to the text editor. Starting
|
||||
with TriliumNext v0.90.12, the code blocks also support syntax highlighting.</p>
|
||||
<p>
|
||||
<img src="1_Code Notes_image.png" alt="" />
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
@ -13,7 +13,7 @@
|
||||
<h1 data-trilium-h1>Custom Request Handler</h1>
|
||||
|
||||
<div class="ck-content">
|
||||
<p>Trilium provides a mechanism for <a href="Code%20Notes/Scripts.html">scripts</a> to
|
||||
<p>Trilium provides a mechanism for <a href="../Note%20Types/Code/Scripts.html">scripts</a> 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. <code>/trilium buy milk</code>).</p>
|
||||
@ -22,7 +22,7 @@
|
||||
|
||||
<p>Let's take a look at an example. The goal is to provide a REST endpoint
|
||||
to which we can send title and content and Trilium will create a note.</p>
|
||||
<p>We'll start with creating a JavaScript backend <a href="Code%20Notes.html">code note</a> containing:</p>
|
||||
<p>We'll start with creating a JavaScript backend <a href="../Note%20Types/Code.html">code note</a> containing:</p>
|
||||
<pre><code class="language-text-x-trilium-auto">const {req, res} = api;
|
||||
const {secret, title, content} = req.body;
|
||||
|
||||
@ -74,7 +74,7 @@ Content-Type: application/json
|
||||
and you need to take care of this yourself.</p>
|
||||
<p>Once we pass these checks we will just create the desired note using
|
||||
<a
|
||||
href="Code%20Notes/Script%20API.html">Script API</a>.</p>
|
||||
href="../Note%20Types/Code/Script%20API.html">Script API</a>.</p>
|
||||
|
||||
<h2>Custom resource provider</h2>
|
||||
|
||||
|
@ -82,7 +82,7 @@
|
||||
<p>The default shared page is basic in design, but you can customize it using
|
||||
your own CSS:</p>
|
||||
<ul>
|
||||
<li><strong>Custom CSS</strong>: Link a CSS <a href="Code%20Notes.html">code note</a> to
|
||||
<li><strong>Custom CSS</strong>: Link a CSS <a href="../Note%20Types/Code.html">code note</a> to
|
||||
the shared page by adding a <code>~shareCss</code> relation to the note.
|
||||
If you want this style to apply to the entire subtree, make the label inheritable.
|
||||
You can hide the CSS code note from the tree navigation by adding the <code>#shareHiddenFromTree</code> label.</li>
|
||||
|
@ -91,8 +91,8 @@
|
||||
<h2>Editing notes</h2>
|
||||
|
||||
<p>Trilium uses CKEditor 5 for the <a href="../Note%20Types/Text.html">text notes</a> and
|
||||
CodeMirror 5 for <a href="../Advanced%20Usage/Code%20Notes.html">code notes</a>.
|
||||
Check the documentation of these projects to see all their built-in keyboard
|
||||
CodeMirror 5 for <a href="../Note%20Types/Code.html">code notes</a>. Check
|
||||
the documentation of these projects to see all their built-in keyboard
|
||||
shortcuts.</p>
|
||||
<ul>
|
||||
<li><code>ALT-F10</code> - bring up inline formatting toolbar (arrow keys <code><-</code>,<code>-></code> to
|
||||
|
@ -21,13 +21,13 @@
|
||||
<ul>
|
||||
<li><a href="../Note%20Types/Text.html">text note</a> - this is default note
|
||||
type which allows you to put rich text, images etc.</li>
|
||||
<li><a href="../Advanced%20Usage/Code%20Notes.html">code note</a> - some kind
|
||||
of formal code, typically programming language (e.g. JavaScript) or data
|
||||
structure (e.g. JSON)</li>
|
||||
<li><a href="../Note%20Types/Code.html">code note</a> - some kind of formal
|
||||
code, typically programming language (e.g. JavaScript) or data structure
|
||||
(e.g. JSON)</li>
|
||||
<li><a href="https://github.com/TriliumNext/Notes/wiki/Images">image note</a> -
|
||||
represents single image</li>
|
||||
<li>file note - represents uploaded file (e.g. docx MS Word document).</li>
|
||||
<li>render HTML note - this works as an output screen of attached <a href="../Advanced%20Usage/Code%20Notes/Scripts.html">scripts</a>
|
||||
<li>render HTML note - this works as an output screen of attached <a href="../Note%20Types/Code/Scripts.html">scripts</a>
|
||||
</li>
|
||||
<li><a href="../Note%20Types/Saved%20Search.html">saved search</a> note - contains
|
||||
saved search query and dynamically displays result of the search as its
|
||||
|
@ -16,7 +16,7 @@
|
||||
<p>A <a href="../Note.html">note</a> in Trilium can <em>own</em> one or more
|
||||
attachments, which can be either images or files. These attachments can
|
||||
be displayed or linked within the note that owns them.</p>
|
||||
<p>This can be especially useful to include dependencies for your <a href="../../Advanced%20Usage/Code%20Notes/Scripts.html">scripts</a>.
|
||||
<p>This can be especially useful to include dependencies for your <a href="../../Note%20Types/Code/Scripts.html">scripts</a>.
|
||||
The <a href="../../Advanced%20Usage/Advanced%20Showcases/Weight%20Tracker.html">Weight Tracker</a> shows
|
||||
how to use <a href="https://chartjs.org/">chartjs</a> which is attached to
|
||||
the <a href="#root/HcUYTojFohtb">script note</a>.</p>
|
||||
|
@ -13,7 +13,7 @@
|
||||
<h1 data-trilium-h1>Read-Only Notes</h1>
|
||||
|
||||
<div class="ck-content">
|
||||
<p>Both <a href="../../Note%20Types/Text.html">text</a> and <a href="../../Advanced%20Usage/Code%20Notes.html">code</a> notes
|
||||
<p>Both <a href="../../Note%20Types/Text.html">text</a> and <a href="../../Note%20Types/Code.html">code</a> notes
|
||||
in Trilium can be set to read-only. When a note is in read-only mode, it
|
||||
is presented to the user in a non-editable view, with the option to switch
|
||||
to editing mode if needed.</p>
|
||||
|
@ -28,7 +28,7 @@
|
||||
<p>Trilium supports custom user themes, allowing you to personalize the application's
|
||||
appearance. To create a custom theme, follow these steps:</p>
|
||||
<ol>
|
||||
<li><strong>Create a CSS Code Note</strong>: Start by creating a new <a href="../Advanced%20Usage/Code%20Notes.html">code note</a> with
|
||||
<li><strong>Create a CSS Code Note</strong>: Start by creating a new <a href="../Note%20Types/Code.html">code note</a> with
|
||||
the <code>CSS</code> type.</li>
|
||||
<li><strong>Annotate with</strong> <code>**#appTheme**</code>: Add the <a href="../Advanced%20Usage/Attributes.html">attribute</a> <code>#appTheme=my-theme-name</code> to
|
||||
your note, where <code>my-theme-name</code> is the name of your custom theme.</li>
|
||||
@ -122,7 +122,7 @@ body .CodeMirror {
|
||||
|
||||
<p>To use custom CSS:</p>
|
||||
<ol>
|
||||
<li><strong>Create a CSS Code Note</strong>: Create a new <a href="../Advanced%20Usage/Code%20Notes.html">code note</a> with
|
||||
<li><strong>Create a CSS Code Note</strong>: Create a new <a href="../Note%20Types/Code.html">code note</a> with
|
||||
the <code>CSS</code> type.</li>
|
||||
<li><strong>Add the</strong> <code>**appCss**</code> <strong>Label</strong>:
|
||||
Annotate the note with the <code>#appCss</code> <a href="../Advanced%20Usage/Attributes.html">label</a>.</li>
|
||||
|
BIN
src/public/app/doc_notes/en/User Guide/User Guide/Basic Concepts/UI Elements/1_Note Tree_image.png
generated
Normal file
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 188 B |
BIN
src/public/app/doc_notes/en/User Guide/User Guide/Basic Concepts/UI Elements/2_Global menu_image.png
generated
Normal file
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 327 B |
After Width: | Height: | Size: 81 KiB |
After Width: | Height: | Size: 79 KiB |
After Width: | Height: | Size: 780 B |
After Width: | Height: | Size: 367 B |
@ -13,34 +13,15 @@
|
||||
<h1 data-trilium-h1>Global menu</h1>
|
||||
|
||||
<div class="ck-content">
|
||||
<p>The position of the global menu differs based on which layout is selected
|
||||
in settings:</p>
|
||||
<ul>
|
||||
<li>For the vertical layout, the icon is in the top-left of the screen, in
|
||||
the form of the Trilium icon.</li>
|
||||
<li>For the horizontal layout, the icon is in the top-right of the screen,
|
||||
in form of a hamburger menu icon.</li>
|
||||
</ul>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<img src="Global menu_image.png" alt="" />
|
||||
<br />
|
||||
<br />The global menu in the vertical layout.</td>
|
||||
<td>
|
||||
<img src="1_Global menu_image.png" alt="" />
|
||||
<br />
|
||||
<br />The global menu in the horizontal layout.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>The global menu configures the current window (zoom, keeping the window
|
||||
on top) and offers access to some more advanced options.</p>
|
||||
<p>
|
||||
<img src="2_Global menu_image.png" width="245" height="332">
|
||||
</p>
|
||||
<h2>Accessing the global menu</h2>
|
||||
<p>See <a class="reference-link" href="Vertical%20and%20horizontal%20layout.html">Vertical and horizontal layout</a> since
|
||||
the position of the global menu is changed based on which layout has been
|
||||
selected.</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
106
src/public/app/doc_notes/en/User Guide/User Guide/Basic Concepts/UI Elements/Launch Bar.html
generated
Normal file
@ -0,0 +1,106 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="../../../style.css">
|
||||
<base target="_parent">
|
||||
<title data-trilium-title>Launch Bar</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="content">
|
||||
<h1 data-trilium-h1>Launch Bar</h1>
|
||||
|
||||
<div class="ck-content">
|
||||
<h2>Position of the Launch bar</h2>
|
||||
<p>Depending on the layout selected, the launcher bar will either be on the
|
||||
left side of the screen with buttons displayed vertically or at the top
|
||||
of the screen. See <a class="reference-link" href="Vertical%20and%20horizontal%20layout.html">Vertical and horizontal layout</a> for
|
||||
more information.</p>
|
||||
<h2>Terminology</h2>
|
||||
<ul>
|
||||
<li><strong>Launcher</strong>: a button that can be (or is) displayed on the
|
||||
launch bar.</li>
|
||||
<li><strong>Available Launcher</strong>: a launcher that is not displayed
|
||||
on the launch bar, but can be added.</li>
|
||||
<li><strong>Visible Launcher</strong>: a launcher that is currently displayed
|
||||
on the launch bar.</li>
|
||||
</ul>
|
||||
<h2>Configuring the Launch bar</h2>
|
||||
<p>There are two ways to configure the launch bar:</p>
|
||||
<ul>
|
||||
<li>Right click in the empty space between launchers on the launch bar and
|
||||
select <i>Configure Launchbar.</i>
|
||||
</li>
|
||||
<li>Click on the <a class="reference-link" href="Global%20menu.html">Global menu</a> and
|
||||
select <i>Configure Launchbar</i>.</li>
|
||||
</ul>
|
||||
<p>This will open a new tab with the <a class="reference-link" href="Note%20Tree.html">Note Tree</a> listing
|
||||
the launchers.</p>
|
||||
<p>
|
||||
<img src="Launch Bar_image.png" width="355" height="104">
|
||||
</p>
|
||||
<p>Expanding <i>Available Launchers</i> section will show the list of launchers
|
||||
that are not displayed on the launch bar. The <i>Visible Launchers</i> will
|
||||
show the ones that are currently displayed.</p>
|
||||
<h3>Adding/removing and reordering launchers</h3>
|
||||
<p>To display a new launcher in the launch bar, first look for it in the <i>Available Launchers</i> section.
|
||||
Then right click it and select <i>Move to visible launchers</i>. It is also
|
||||
possible to drag and drop the item manually.</p>
|
||||
<p>Similarly, to remove it from the launch bar, simply look for it in <i>Visible Launchers</i> then
|
||||
right click it and select <i>Move to available launchers </i>or use drag-and-drop.</p>
|
||||
<p>Drag-and-drop the items in the tree in order to change their
|
||||
order. See <a class="reference-link" href="Note%20Tree.html">Note Tree</a> for
|
||||
more interaction options, including using keyboard shortcuts.</p>
|
||||
<h3>Resetting</h3>
|
||||
<p>Resetting allows restoring the original configuration of Trilium for the
|
||||
launcher bar, or for a portion of it. Simply right click a launcher (or
|
||||
even the entire <i>Launch Bar</i> section) and select <i>Reset</i> to bring
|
||||
it back to the original state.</p>
|
||||
<h3>Creating new launchers / types of launchers</h3>
|
||||
<p>Right click either the <i>Available launchers</i> or <i>Visible launchers</i> sections
|
||||
and select one of the options:</p>
|
||||
<ol>
|
||||
<li>
|
||||
<p><strong>Note Launcher</strong>
|
||||
<br>A note launcher will simply navigate to a specified note.</p>
|
||||
<ol>
|
||||
<li>Set the <code>target</code> promoted attribute to the note to navigate to.</li>
|
||||
<li>Optionally, set <code>hoistedNote</code> to hoist a particular note. See
|
||||
<a
|
||||
class="reference-link" href="../Navigation/Note%20Hoisting.html">Note Hoisting</a> for more information.</li>
|
||||
<li>Optionally, set a <code>keyboardShortcut</code> to trigger the launcher.</li>
|
||||
</ol>
|
||||
<p> </p>
|
||||
</li>
|
||||
<li>
|
||||
<p><strong>Script Launcher</strong>
|
||||
<br>An advanced launcher which will run a script upon pressing. See
|
||||
<a
|
||||
class="reference-link" href="../../Note%20Types/Code/Scripts.html">Scripts</a> for more information.</p>
|
||||
<ol>
|
||||
<li>Set <code>script</code> to point to the desired script to run.</li>
|
||||
<li>Optionally, set a <code>keyboardShortcut</code> to trigger the launcher.</li>
|
||||
</ol>
|
||||
<p> </p>
|
||||
</li>
|
||||
<li>
|
||||
<p><strong>Custom Widget</strong>
|
||||
</p>
|
||||
<p>Allows defining a custom widget to be rendered inside the launcher. See
|
||||
<a
|
||||
class="reference-link" href="../../Developer%20Guides/Widget%20Basics.html">Widget Basics</a> for more information.</p>
|
||||
<p> </p>
|
||||
</li>
|
||||
<li><strong>Spacers</strong>
|
||||
<br>Launchers that create some distance between other launchers for better
|
||||
visual distinction.</li>
|
||||
</ol>
|
||||
<p>Launchers are configured via predefined <a class="reference-link"
|
||||
href="../../Advanced%20Usage/Attributes/Promoted%20Attributes.html">Promoted Attributes</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
BIN
src/public/app/doc_notes/en/User Guide/User Guide/Basic Concepts/UI Elements/Launch Bar_image.png
generated
Normal file
After Width: | Height: | Size: 5.4 KiB |
@ -5,29 +5,28 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="../../../style.css">
|
||||
<base target="_parent">
|
||||
<title data-trilium-title>Tree Manipulation</title>
|
||||
<title data-trilium-title>Note Tree</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="content">
|
||||
<h1 data-trilium-h1>Tree Manipulation</h1>
|
||||
<h1 data-trilium-h1>Note Tree</h1>
|
||||
|
||||
<div class="ck-content">
|
||||
<p>This page explains how to manipulate the note tree in TriliumNext, focusing
|
||||
on moving notes.</p>
|
||||
|
||||
<h2>Drag and Drop</h2>
|
||||
|
||||
<p>
|
||||
<img src="../../Attachments/drag-and-drop.gif" alt="Drag and drop example"
|
||||
/>You can easily rearrange the note tree by dragging and dropping notes,
|
||||
<img src="1_Note Tree_image.png" width="284" height="459">
|
||||
</p>
|
||||
<h2>Drag and Drop</h2>
|
||||
<p>
|
||||
<img src="../../Attachments/drag-and-drop.gif" alt="Drag and drop example">
|
||||
</p>
|
||||
<p>You can easily rearrange the note tree by dragging and dropping notes,
|
||||
as demonstrated in the example above.</p>
|
||||
|
||||
<h2>Keyboard Manipulation</h2>
|
||||
|
||||
<h2>Keyboard Manipulation</h2>
|
||||
<p>
|
||||
<img src="../../Attachments/move-note-with-keyboard.gif" alt="Example of using keyboard keys to move a note"
|
||||
/>Trilium offers efficient keyboard-based manipulation using the following
|
||||
<img src="../../Attachments/move-note-with-keyboard.gif" alt="Example of using keyboard keys to move a note">Trilium offers efficient keyboard-based manipulation using the following
|
||||
<a
|
||||
href="../Keyboard%20Shortcuts.html">shortcuts</a>:</p>
|
||||
<ul>
|
||||
@ -40,13 +39,24 @@
|
||||
through a demo or hands-on experience).</li>
|
||||
<li><code>LEFT</code> and <code>RIGHT</code>: Expand and collapse a sub-tree.</li>
|
||||
</ul>
|
||||
|
||||
<h2>Context Menu</h2>
|
||||
|
||||
<h2>Context Menu</h2>
|
||||
<p>You can also move notes using the familiar cut and paste functions available
|
||||
in the context menu, or with the associated keyboard <a href="../Keyboard%20Shortcuts.html">shortcuts</a>: <code>CTRL-C</code> (
|
||||
<a
|
||||
href="../Note/Cloning%20Notes.html">copy</a>), <code>CTRL-X</code> (cut) and <code>CTRL-V</code> (paste).</p>
|
||||
<h2>Multiple selection</h2>
|
||||
<p>It is possible to select multiple notes at one time.</p>
|
||||
<p>To do so, first select the note to start the selection with. Then hold
|
||||
Shift and click on the note to end the selection with. All the notes between
|
||||
the start and the end note will be selected as well.</p>
|
||||
<p>
|
||||
<img src="Note Tree_image.png" width="233" height="205">
|
||||
</p>
|
||||
<p>In the right-click menu, operations such as Cut, Copy, Move to, Clone
|
||||
to or Delete will apply to all the selected notes. It is also possible
|
||||
to apply <a class="reference-link" href="../../Advanced%20Usage/Bulk%20actions.html">Bulk actions</a> to
|
||||
them. The rest of the options will not be available and will appear disabled
|
||||
in the menu.</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
BIN
src/public/app/doc_notes/en/User Guide/User Guide/Basic Concepts/UI Elements/Note Tree_image.png
generated
Normal file
After Width: | Height: | Size: 7.3 KiB |
19
src/public/app/doc_notes/en/User Guide/User Guide/Basic Concepts/UI Elements/Options.html
generated
Normal file
@ -0,0 +1,19 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="../../../style.css">
|
||||
<base target="_parent">
|
||||
<title data-trilium-title>Options</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="content">
|
||||
<h1 data-trilium-h1>Options</h1>
|
||||
|
||||
<div class="ck-content"></div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
19
src/public/app/doc_notes/en/User Guide/User Guide/Basic Concepts/UI Elements/Quick search.html
generated
Normal file
@ -0,0 +1,19 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="../../../style.css">
|
||||
<base target="_parent">
|
||||
<title data-trilium-title>Quick search</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="content">
|
||||
<h1 data-trilium-h1>Quick search</h1>
|
||||
|
||||
<div class="ck-content"></div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
30
src/public/app/doc_notes/en/User Guide/User Guide/Basic Concepts/UI Elements/Ribbon.html
generated
Normal file
@ -0,0 +1,30 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="../../../style.css">
|
||||
<base target="_parent">
|
||||
<title data-trilium-title>Ribbon</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="content">
|
||||
<h1 data-trilium-h1>Ribbon</h1>
|
||||
|
||||
<div class="ck-content">
|
||||
<figure class="image">
|
||||
<img style="aspect-ratio:1073/202;" src="Ribbon_image.png" width="1073"
|
||||
height="202">
|
||||
</figure>
|
||||
<p>The ribbon allows changing options, attributes and viewing information
|
||||
about the current note.</p>
|
||||
<h2>Settings</h2>
|
||||
<p>It is possible to change whether some ribbon items will be automatically
|
||||
open when navigating to a new note. To do so, in <a class="reference-link"
|
||||
href="Options.html">Settings</a>, go to <i>Appearance</i> and look for the <i>Ribbon widgets</i> section.</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
BIN
src/public/app/doc_notes/en/User Guide/User Guide/Basic Concepts/UI Elements/Ribbon_image.png
generated
Normal file
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 482 B |
@ -0,0 +1,74 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="../../../style.css">
|
||||
<base target="_parent">
|
||||
<title data-trilium-title>Vertical and horizontal layout</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="content">
|
||||
<h1 data-trilium-h1>Vertical and horizontal layout</h1>
|
||||
|
||||
<div class="ck-content">
|
||||
<h2>Layouts</h2>
|
||||
<p>Trilium supports two different layouts, based on your preference.</p>
|
||||
<h3>Vertical layout</h3>
|
||||
<p>The vertical layout is Trilium's original layout:</p>
|
||||
<ul>
|
||||
<li>The <a class="reference-link" href="Launch%20Bar.html">Launcher Bar</a> is
|
||||
positioned on the left side of the screen, with buttons being laid out
|
||||
vertically.</li>
|
||||
<li>The tab bar is at the top, but to the right of the <a class="reference-link"
|
||||
href="Note%20Tree.html">Note Tree</a>.</li>
|
||||
<li>The <a class="reference-link" href="Quick%20search.html">Quick search</a> is
|
||||
at the top of the <a class="reference-link" href="Note%20Tree.html">Note Tree</a>.</li>
|
||||
<li>The <a class="reference-link" href="Note%20Tree.html">Note Tree</a> can
|
||||
be collapsed by pressing the
|
||||
<img src="6_Vertical and horizontal la.png"
|
||||
width="11" height="11">button at the bottom of the <a class="reference-link" href="Launch%20Bar.html">Launcher Bar</a>.</li>
|
||||
<li>The <a class="reference-link" href="Global%20menu.html">Global menu</a> can
|
||||
be accessed via the
|
||||
<img src="5_Vertical and horizontal la.png" width="26"
|
||||
height="23">icon at the top of the <a class="reference-link" href="Launch%20Bar.html">Launcher Bar</a>.</li>
|
||||
</ul>
|
||||
<p>
|
||||
<img src="4_Vertical and horizontal la.png" width="1043" height="684">
|
||||
</p>
|
||||
<h3>Horizontal layout</h3>
|
||||
<p>The horizontal layout is a more traditional layout, since it bears similarity
|
||||
with other applications. In this mode:</p>
|
||||
<ul>
|
||||
<li>The <a class="reference-link" href="Launch%20Bar.html">Launcher Bar</a> is
|
||||
at the top of the screen, with the buttons laid horizontally.</li>
|
||||
<li>The tab bar is at the top of the screen, but now covers the entirety of
|
||||
the width, allowing for more tabs to be displayed at once.</li>
|
||||
<li>The <a class="reference-link" href="Quick%20search.html">Quick search</a> is
|
||||
now part of the <a class="reference-link" href="Launch%20Bar.html">Launcher Bar</a>.
|
||||
It can be moved around according to preference and even removed if needed.</li>
|
||||
<li>The <a class="reference-link" href="Note%20Tree.html">Note Tree</a> can
|
||||
be collapsed by pressing the small
|
||||
<img src="2_Vertical and horizontal la.png"
|
||||
width="14" height="13">button to the left of the first tab.</li>
|
||||
<li>The <a class="reference-link" href="Global%20menu.html">Global menu</a> can
|
||||
be accessed via the
|
||||
<img src="1_Vertical and horizontal la.png" width="15"
|
||||
height="11">button at the end of the <a class="reference-link" href="Launch%20Bar.html">Launcher Bar</a>.</li>
|
||||
</ul>
|
||||
<figure class="image">
|
||||
<img style="aspect-ratio:1043/684;" src="3_Vertical and horizontal la.png"
|
||||
width="1043" height="684">
|
||||
</figure>
|
||||
<h2>Changing the layout</h2>
|
||||
<p>Go to <a class="reference-link" href="#root/_hidden/_lbRoot/_lbVisibleLaunchers/_lbSettings">Settings</a> and
|
||||
look for the <i>Appearance</i> option on the left. Then look for the <i>Layout </i>section,
|
||||
where there is the possibility to switch between the two available layouts.</p>
|
||||
<p>Selecting an option will immediately apply the new layout by reloading
|
||||
the window.</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
@ -19,7 +19,7 @@
|
||||
the current app and note context, and widgets that export an object to
|
||||
Trilium to be used in the UI. In both cases, the frontend api of Trilium
|
||||
is available to scripts running in the frontend context as global variable <code>api</code>.
|
||||
The members and methods of the api can be seen on the <a href="../Advanced%20Usage/Code%20Notes/Script%20API.html">Script API</a> page.</p>
|
||||
The members and methods of the api can be seen on the <a href="../Note%20Types/Code/Script%20API.html">Script API</a> page.</p>
|
||||
|
||||
<h2>Scripts</h2>
|
||||
|
||||
|
@ -96,7 +96,7 @@ module.exports = new MyWidget();</code></pre>
|
||||
<h3>Step 4: Adding User Interaction</h3>
|
||||
|
||||
<p>Let’s make the button interactive by showing a message when it’s clicked.
|
||||
We'll use the <code>api.showMessage</code> method from the <a href="../Advanced%20Usage/Code%20Notes/Script%20API.html">Script API</a>.</p>
|
||||
We'll use the <code>api.showMessage</code> method from the <a href="../Note%20Types/Code/Script%20API.html">Script API</a>.</p>
|
||||
<pre><code class="language-text-x-trilium-auto">class MyWidget extends api.BasicWidget {
|
||||
get position() { return 1; }
|
||||
get parentWidget() { return "left-pane"; }
|
||||
|
@ -52,7 +52,7 @@
|
||||
<li>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
|
||||
<a
|
||||
href="Advanced%20Usage/Code%20Notes/Scripts.html">scripting</a>support would be a XSS security hole, while with the single
|
||||
href="Note%20Types/Code/Scripts.html">scripting</a>support would be a XSS security hole, while with the single
|
||||
user assumption it's an endless customizable tool.</li>
|
||||
</ul>
|
||||
|
||||
|
@ -59,7 +59,7 @@
|
||||
|
||||
<h2>Scripting</h2>
|
||||
|
||||
<p>You can alter the behavior with <a href="../Advanced%20Usage/Code%20Notes/Scripts.html">scripts</a> just
|
||||
<p>You can alter the behavior with <a href="../Note%20Types/Code/Scripts.html">scripts</a> just
|
||||
like for normal frontend. For script notes to be executed, they need to
|
||||
have labeled <code>#run=mobileStartup</code>.</p>
|
||||
</div>
|
||||
|
BIN
src/public/app/doc_notes/en/User Guide/User Guide/Note Types/1_Code_image.png
generated
Normal file
After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 68 KiB |
@ -12,7 +12,51 @@
|
||||
<div class="content">
|
||||
<h1 data-trilium-h1>Code</h1>
|
||||
|
||||
<div class="ck-content"></div>
|
||||
<div class="ck-content">
|
||||
<p>Trilium supports creating "code" notes, i.e. notes which contain some
|
||||
sort of formal code - be it programming language (C++, JavaScript), structured
|
||||
data (JSON, XML) or other types of codes (CSS etc.).</p>
|
||||
<p>This can be useful for a few things:</p>
|
||||
<ul>
|
||||
<li>computer programmers can store code snippets as notes with syntax highlighting</li>
|
||||
<li>JavaScript code notes can be executed inside Trilium for some extra functionality
|
||||
<ul>
|
||||
<li>we call such JavaScript code notes "scripts" - see <a href="Code/Scripts.html">Scripts</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>JSON, XML etc. can be used as storage for structured data (typically used
|
||||
in conjunction with scripting)</li>
|
||||
</ul>
|
||||
<p>For shorter snippets of code that can be embedded in <a class="reference-link"
|
||||
href="Text.html">Text</a> notes, see <a class="reference-link"
|
||||
href="Text/Code%20blocks.html">Code blocks</a>.</p>
|
||||
<figure class="image">
|
||||
<img style="aspect-ratio:910/703;" src="Code_image.png" alt="" width="910"
|
||||
height="703">
|
||||
</figure>
|
||||
<h2>Adjusting the language of a code note</h2>
|
||||
<p>In the <a class="reference-link" href="../Basic%20Concepts/UI%20Elements/Ribbon.html">Ribbon</a>,
|
||||
look for the <i>Note type</i> selector and click it to reveal the possible
|
||||
note types. Inside of it there will be a section called <i>Code</i>, select
|
||||
any one of the languages.</p>
|
||||
<p>
|
||||
<img src="1_Code_image.png" width="254" height="400">
|
||||
</p>
|
||||
<h2>Adjusting the list of languages</h2>
|
||||
<p>Trilium supports syntax highlighting for many languages, but by default
|
||||
displays only some of them. The supported languages can be adjusted by
|
||||
going to <a class="reference-link" href="../Basic%20Concepts/UI%20Elements/Options.html">Options</a>,
|
||||
then <i>Code Notes</i> and looking for the <i>Available MIME types in the dropdown</i> section.
|
||||
Simply check any of the items to add them to the list, or un-check them
|
||||
to remove them from the list.</p>
|
||||
<p>Note that the list of languages is not immediately refreshed, you'd have
|
||||
to manually <a href="../Troubleshooting/Refreshing%20the%20application.html">refresh the application</a>.</p>
|
||||
<p>The list of languages is also shared with the <a class="reference-link"
|
||||
href="Text/Code%20blocks.html">Code blocks</a> feature of
|
||||
<a
|
||||
class="reference-link" href="Text.html">Text</a> notes.</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
|
@ -36,7 +36,7 @@
|
||||
|
||||
<h2>Entity events</h2>
|
||||
|
||||
<p>Other events are bound to some entity, these are defined as <a href="../Attributes.html">relations</a> -
|
||||
<p>Other events are bound to some entity, these are defined as <a href="../../Advanced%20Usage/Attributes.html">relations</a> -
|
||||
meaning that script is triggered only if note has this script attached
|
||||
to it through relations (or it can inherit it).</p>
|
||||
<ul>
|
@ -13,10 +13,10 @@
|
||||
<h1 data-trilium-h1>Scripts</h1>
|
||||
|
||||
<div class="ck-content">
|
||||
<p>Trilium supports creating <a href="../Code%20Notes.html">code notes</a>,
|
||||
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 <a href="Script%20API.html">Script API</a> provide
|
||||
<p>Trilium supports creating <a href="../Code.html">code notes</a>, 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 <a href="Script%20API.html">Script API</a> provide
|
||||
extra functionality.</p>
|
||||
|
||||
<h2>Scripting</h2>
|
||||
@ -36,7 +36,7 @@
|
||||
|
||||
<h2>Button use case</h2>
|
||||
|
||||
<p>Let's take a look at our demo script (shipped with default Trilium <a href="../Database.html">database</a>)
|
||||
<p>Let's take a look at our demo script (shipped with default Trilium <a href="../../Advanced%20Usage/Database.html">database</a>)
|
||||
- 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).</p>
|
||||
@ -74,7 +74,7 @@
|
||||
by Trilium runtime so when we restart Trilium, button won't be there.</p>
|
||||
<p>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.</p>
|
||||
<p>The solution is marked by red circle at the bottom - this note has <a href="../Attributes.html">label</a> <code>#run=frontendStartup</code> -
|
||||
<p>The solution is marked by red circle at the bottom - this note has <a href="../../Advanced%20Usage/Attributes.html">label</a> <code>#run=frontendStartup</code> -
|
||||
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.</p>
|
||||
@ -83,7 +83,7 @@
|
||||
|
||||
<h3>More showcases</h3>
|
||||
|
||||
<p>You can see more scripting with explanation in <a href="../Advanced%20Showcases.html">Advanced showcases</a>
|
||||
<p>You can see more scripting with explanation in <a href="../../Advanced%20Usage/Advanced%20Showcases.html">Advanced showcases</a>
|
||||
</p>
|
||||
|
||||
<h2>Events</h2>
|
Before Width: | Height: | Size: 99 KiB After Width: | Height: | Size: 99 KiB |
BIN
src/public/app/doc_notes/en/User Guide/User Guide/Note Types/Text/1_Code blocks_image.png
generated
Normal file
After Width: | Height: | Size: 30 KiB |