diff --git a/README_terminal.md b/README_terminal.md index a8e225af8b..a0ae662485 100644 --- a/README_terminal.md +++ b/README_terminal.md @@ -35,7 +35,7 @@ To start it, type `demo-joplin`. # Usage -To start the application type `joplin`. This will open the user interface, which has three main panes: Notebooks, Notes and the text of the current note. There are also additional panels that can be toggled on and off via [shortcuts](#available-shortcuts). +To start the application type `joplin`. This will open the user interface, which has three main panes: Notebooks, Notes and the text of the current note. There are also additional panels that can be toggled on and off via [shortcuts](#shortcuts). @@ -45,11 +45,11 @@ Joplin user interface is partly based on the text editor Vim and offers two diff ### Normal mode -Allows moving from one pane to another using the `Tab` and `Shift-Tab` keys, and to select/view notes using the arrow keys. Text area can be scrolled using the arrow keys too. Press `Enter` to edit a note. Various other [shortcuts](#available-shortcuts) are available. +Allows moving from one pane to another using the `Tab` and `Shift-Tab` keys, and to select/view notes using the arrow keys. Text area can be scrolled using the arrow keys too. Press `Enter` to edit a note. Various other [shortcuts](#shortcuts) are available. ### Command-line mode -Press `:` to enter command line mode. From there, the Joplin commands such as `mknote` or `search` are available. See the [full list of commands](#available-commands). +Press `:` to enter command line mode. From there, the Joplin commands such as `mknote` or `search` are available. See the [full list of commands](#commands). It is possible to refer to a note or notebook by title or ID. However the simplest way is to refer to the currently selected item using one of these shortcuts: @@ -175,7 +175,7 @@ Give a new title to the note: $ joplin set fe889 title "New title" -# Available shortcuts +# Shortcuts There are two types of shortcuts: those that manipulate the user interface directly, such as `TAB` to move from one pane to another, and those that are simply shortcuts to actual commands. In a way similar to Vim, these shortcuts are generally a verb followed by an object. For example, typing `mn` ([m]ake [n]ote), is used to create a new note: it will switch the interface to command line mode and pre-fill it with `mknote ""` from where the title of the note can be entered. See below for the full list of default shortcuts: @@ -200,32 +200,7 @@ There are two types of shortcuts: those that manipulate the user interface direc Shortcut can be configured by adding a file `keymap.json` to the profile directory. The content of this file is a JSON array with each entry defining a command and the keys associated with it. -Each entry can have the following properties: - -Name | Description ------|------------ -`keys` | The array of keys that will trigger the action. Special keys such as page up, down arrow, etc. needs to be specified UPPERCASE. See the [list of available special keys](https://github.com/cronvel/terminal-kit/blob/3114206a9556f518cc63abbcb3d188fe1995100d/lib/termconfig/xterm.js#L531). For example, `['DELETE', 'BACKSPACE']` means the command will run if the user pressed either the delete or backspace key. Key combinations can also be provided - in that case specify them lowercase. For example "tc" means that the command will be executed when the user pressed "t" then "c". Special keys can also be used in this fashion - simply write them one after the other. For instance, `CTRL_WCTRL_W` means the action would be executed if the user pressed "ctrl-w ctrl-w". -`type` | The command type. It can have the value "exec", "function" or "prompt". **exec**: Simply execute the provided command. For example `edit $n` would edit the selected note. **function**: Run a special commands (see below for the list of function. **prompt**: A bit similar to "exec", except that the command is not going to be executed immediately - this allows the user to provide additional data. For example `mknote ""` would fill the command line with this command and allow the user to set the title. A prompt command can also take a `cursorPosition` parameter (see below) -`command` | The command that needs to be executed -`cusorPosition` | An integer. For prompt commands, tells where the cursor (caret) should start at. This is convenient for example to position the cursor between quotes. Use a negative value to set a position starting from the end. - -This is the list of available functions: - -Name | Description ------|------------ -enter_command_line_mode | Enter command line mode -focus_next | Focus next pane (or widget) -focus_previous | Focus previous pane (or widget) -move_up | Move up (in a list for example) -move_down | Move down (in a list for example) -page_up | Page up -page_down | Page down -activate | Activates the selected item. If the item is a note for example it will be open in the editor -delete | Deletes the selected item -toggle_console | Toggle the console -toggle_metadata | Toggle note metadata - -As an example, this is the default keymap: +As an example, this is the default keymap, but read below for a detailed explanation of each property. ```json [ @@ -250,7 +225,32 @@ As an example, this is the default keymap: ] ``` -# Available commands +Each entry can have the following properties: + +Name | Description +-----|------------ +`keys` | The array of keys that will trigger the action. Special keys such as page up, down arrow, etc. needs to be specified UPPERCASE. See the [list of available special keys](https://github.com/cronvel/terminal-kit/blob/3114206a9556f518cc63abbcb3d188fe1995100d/lib/termconfig/xterm.js#L531). For example, `['DELETE', 'BACKSPACE']` means the command will run if the user pressed either the delete or backspace key. Key combinations can also be provided - in that case specify them lowercase. For example "tc" means that the command will be executed when the user pressed "t" then "c". Special keys can also be used in this fashion - simply write them one after the other. For instance, `CTRL_WCTRL_W` means the action would be executed if the user pressed "ctrl-w ctrl-w". +`type` | The command type. It can have the value "exec", "function" or "prompt". **exec**: Simply execute the provided [command](#commands). For example `edit $n` would edit the selected note. **function**: Run a special commands (see below for the list of functions). **prompt**: A bit similar to "exec", except that the command is not going to be executed immediately - this allows the user to provide additional data. For example `mknote ""` would fill the command line with this command and allow the user to set the title. A prompt command can also take a `cursorPosition` parameter (see below) +`command` | The command that needs to be executed +`cusorPosition` | An integer. For prompt commands, tells where the cursor (caret) should start at. This is convenient for example to position the cursor between quotes. Use a negative value to set a position starting from the end. A value of "0" means positioning the caret at the first character. A value of "-1" means positioning it at the end. + +This is the list of special functions: + +Name | Description +-----|------------ +enter_command_line_mode | Enter command line mode +focus_next | Focus next pane (or widget) +focus_previous | Focus previous pane (or widget) +move_up | Move up (in a list for example) +move_down | Move down (in a list for example) +page_up | Page up +page_down | Page down +activate | Activates the selected item. If the item is a note for example it will be open in the editor +delete | Deletes the selected item +toggle_console | Toggle the console +toggle_metadata | Toggle note metadata + +# Commands The following commands are available in [command-line mode](#command-line-mode): @@ -258,6 +258,12 @@ The following commands are available in [command-line mode](#command-line-mode): Attaches the given file to the note. + cat + + Displays the given note. + + -v, --verbose Displays the complete information about note. + config [name] [value] Gets or sets a config value. If [value] is not provided, it will show the @@ -268,11 +274,6 @@ The following commands are available in [command-line mode](#command-line-mode): Possible keys/values: - sync.2.path File system synchronisation target directory. - The path to synchronise with when file system - synchronisation is enabled. See `sync.target`. - Type: string. - editor Text editor. The editor that will be used to open a note. If none is provided it will try to auto-detect the @@ -281,8 +282,12 @@ The following commands are available in [command-line mode](#command-line-mode): locale Language. Type: Enum. - Possible values: en_GB (English), es_CR (Español), - fr_FR (Français). + Possible values: en_GB (English), de_DE (Deutsch), + es_CR (Español (Costa Rica)), es_ES (Español), eu + (Basque), fr_FR (Français), hr_HR (Croatian), it_IT + (Italiano), ja_JP (日本語), nl_BE (Nederlands), pt_BR + (Português (Brasil)), ru_RU (Русский), zh_CN (中文 + (简体)). Default: "en_GB" dateFormat Date format. @@ -313,13 +318,37 @@ The following commands are available in [command-line mode](#command-line-mode): Default: 300 sync.target Synchronisation target. - The target to synchonise to. If synchronising with - the file system, set `sync.2.path` to specify the - target directory. + The target to synchonise to. Each sync target may + have additional parameters which are named as + `sync.NUM.NAME` (all documented below). Type: Enum. Possible values: 2 (File system), 3 (OneDrive), 4 - (OneDrive Dev (For testing only)). + (OneDrive Dev (For testing only)), 5 (Nextcloud), 6 + (WebDAV). Default: 3 + + sync.2.path Directory to synchronise with (absolute path). + The path to synchronise with when file system + synchronisation is enabled. See `sync.target`. + Type: string. + + sync.5.path Nexcloud WebDAV URL. + Type: string. + + sync.5.username Nexcloud username. + Type: string. + + sync.5.password Nexcloud password. + Type: string. + + sync.6.path WebDAV URL. + Type: string. + + sync.6.username WebDAV username. + Type: string. + + sync.6.password WebDAV password. + Type: string. cp [notebook] @@ -330,13 +359,36 @@ The following commands are available in [command-line mode](#command-line-mode): Marks a to-do as done. + e2ee [path] + + Manages E2EE configuration. Commands are `enable`, `disable`, `decrypt`, + `status` and `target-status`. + + -p, --password Use this password as master password (For + security reasons, it is not recommended to use + this option). + -v, --verbose More verbose output for the `target-status` + command + edit Edit note. - exit + encrypt-config - Exits the application. + Manages encryption configuration. + + -p, --password Use this password as master password (For + security reasons, it is not recommended to use + this option). + + encryption + + Manages encryption configuration. + + -p, --password Use this password as master password (For + security reasons, it is not recommended to use + this option). export @@ -392,9 +444,18 @@ The following commands are available in [command-line mode](#command-line-mode): -f, --force Deletes the notes without asking for confirmation. - search [notebook] + set [value] - Searches for the given in all the notes. + Sets the property of the given to the given [value]. + Possible properties are: + + parent_id (text), title (text), body (text), created_time (int), + updated_time (int), is_conflict (int), latitude (numeric), longitude + (numeric), altitude (numeric), author (text), source_url (text), is_todo + (int), todo_due (int), todo_completed (int), source (text), + source_application (text), application_data (text), order (int), + user_created_time (int), user_updated_time (int), encryption_cipher_text + (text), encryption_applied (int) status @@ -406,7 +467,6 @@ The following commands are available in [command-line mode](#command-line-mode): --target Sync to provided target (defaults to sync.target config value) - --random-failures For debugging purposes. Do not use. tag [tag] [note] @@ -425,6 +485,11 @@ The following commands are available in [command-line mode](#command-line-mode): Marks a to-do as non-completed. + use + + Switches to [notebook] - all further operations will happen within this + notebook. + version Displays version information diff --git a/docs/index.html b/docs/index.html index bedbc2e3d4..ff594f781d 100644 --- a/docs/index.html +++ b/docs/index.html @@ -392,14 +392,14 @@ $$ Croatian hr_HR -Hrvoje Mandić trbuhom@net.hr +Hrvoje Mandić trbuhom@net.hr 71% Deutsch de_DE -Tobias Strobel git@strobeltobias.de +Tobias Strobel git@strobeltobias.de 90% @@ -413,7 +413,7 @@ $$ Español es_ES -Fernando Martín f@mrtn.es +Fernando Martín f@mrtn.es 98% @@ -455,14 +455,14 @@ $$ Русский ru_RU -Artyom Karlov artyom.karlov@gmail.com +Artyom Karlov artyom.karlov@gmail.com 92% 中文 (简体) zh_CN -RCJacH RCJacH@outlook.com +RCJacH RCJacH@outlook.com 75% diff --git a/docs/terminal/index.html b/docs/terminal/index.html index 3c18f3a971..5ebb4b2336 100644 --- a/docs/terminal/index.html +++ b/docs/terminal/index.html @@ -217,14 +217,14 @@ sudo ln -s ~/.joplin-bin/bin/joplin /usr/bin/joplin
npm install -g demo-joplin
 

To start it, type demo-joplin.

Usage

-

To start the application type joplin. This will open the user interface, which has three main panes: Notebooks, Notes and the text of the current note. There are also additional panels that can be toggled on and off via shortcuts.

+

To start the application type joplin. This will open the user interface, which has three main panes: Notebooks, Notes and the text of the current note. There are also additional panels that can be toggled on and off via shortcuts.

Input modes

Joplin user interface is partly based on the text editor Vim and offers two different modes to interact with the notes and notebooks:

Normal mode

-

Allows moving from one pane to another using the Tab and Shift-Tab keys, and to select/view notes using the arrow keys. Text area can be scrolled using the arrow keys too. Press Enter to edit a note. Various other shortcuts are available.

+

Allows moving from one pane to another using the Tab and Shift-Tab keys, and to select/view notes using the arrow keys. Text area can be scrolled using the arrow keys too. Press Enter to edit a note. Various other shortcuts are available.

Command-line mode

-

Press : to enter command line mode. From there, the Joplin commands such as mknote or search are available. See the full list of commands.

+

Press : to enter command line mode. From there, the Joplin commands such as mknote or search are available. See the full list of commands.

It is possible to refer to a note or notebook by title or ID. However the simplest way is to refer to the currently selected item using one of these shortcuts:

@@ -331,7 +331,7 @@ $ joplin mknote "My note" fe889 07/12/2017 17:57 My note

Give a new title to the note:

$ joplin set fe889 title "New title"
-

Available shortcuts

+

Shortcuts

There are two types of shortcuts: those that manipulate the user interface directly, such as TAB to move from one pane to another, and those that are simply shortcuts to actual commands. In a way similar to Vim, these shortcuts are generally a verb followed by an object. For example, typing mn ([m]ake [n]ote), is used to create a new note: it will switch the interface to command line mode and pre-fill it with mknote "" from where the title of the note can be entered. See below for the full list of default shortcuts:

:                 enter_command_line_mode
 TAB               focus_next
@@ -352,6 +352,28 @@ mb                mkbook ""
 yn                cp $n ""
 dn                mv $n ""
 

Shortcut can be configured by adding a file keymap.json to the profile directory. The content of this file is a JSON array with each entry defining a command and the keys associated with it.

+

As an example, this is the default keymap, but read below for a detailed explanation of each property.

+
[
+    { "keys": [":"], "type": "function", "command": "enter_command_line_mode" },
+    { "keys": ["TAB"], "type": "function", "command": "focus_next" },
+    { "keys": ["SHIFT_TAB"], "type": "function", "command": "focus_previous" },
+    { "keys": ["UP"], "type": "function", "command": "move_up" },
+    { "keys": ["DOWN"], "type": "function", "command": "move_down" },
+    { "keys": ["PAGE_UP"], "type": "function", "command": "page_up" },
+    { "keys": ["PAGE_DOWN"], "type": "function", "command": "page_down" },
+    { "keys": ["ENTER"], "type": "function", "command": "activate" },
+    { "keys": ["DELETE", "BACKSPACE"], "type": "function", "command": "delete" },
+    { "keys": [" "], "command": "todo toggle $n" },
+    { "keys": ["tc"], "type": "function", "command": "toggle_console" },
+    { "keys": ["tm"], "type": "function", "command": "toggle_metadata" },
+    { "keys": ["/"], "type": "prompt", "command": "search \"\"", "cursorPosition": -2 },
+    { "keys": ["mn"], "type": "prompt", "command": "mknote \"\"", "cursorPosition": -2 },
+    { "keys": ["mt"], "type": "prompt", "command": "mktodo \"\"", "cursorPosition": -2 },
+    { "keys": ["mb"], "type": "prompt", "command": "mkbook \"\"", "cursorPosition": -2 },
+    { "keys": ["yn"], "type": "prompt", "command": "cp $n \"\"", "cursorPosition": -2 },
+    { "keys": ["dn"], "type": "prompt", "command": "mv $n \"\"", "cursorPosition": -2 }
+]
+

Each entry can have the following properties:

@@ -367,7 +389,7 @@ dn mv $n "" - + @@ -375,11 +397,11 @@ dn mv $n "" - +
typeThe command type. It can have the value "exec", "function" or "prompt". exec: Simply execute the provided command. For example edit $n would edit the selected note. function: Run a special commands (see below for the list of function. prompt: A bit similar to "exec", except that the command is not going to be executed immediately - this allows the user to provide additional data. For example mknote "" would fill the command line with this command and allow the user to set the title. A prompt command can also take a cursorPosition parameter (see below)The command type. It can have the value "exec", "function" or "prompt". exec: Simply execute the provided command. For example edit $n would edit the selected note. function: Run a special commands (see below for the list of functions). prompt: A bit similar to "exec", except that the command is not going to be executed immediately - this allows the user to provide additional data. For example mknote "" would fill the command line with this command and allow the user to set the title. A prompt command can also take a cursorPosition parameter (see below)
command
cusorPositionAn integer. For prompt commands, tells where the cursor (caret) should start at. This is convenient for example to position the cursor between quotes. Use a negative value to set a position starting from the end.An integer. For prompt commands, tells where the cursor (caret) should start at. This is convenient for example to position the cursor between quotes. Use a negative value to set a position starting from the end. A value of "0" means positioning the caret at the first character. A value of "-1" means positioning it at the end.
-

This is the list of available functions:

+

This is the list of special functions:

@@ -434,34 +456,18 @@ dn mv $n ""
-

As an example, this is the default keymap:

-
[
-    { "keys": [":"], "type": "function", "command": "enter_command_line_mode" },
-    { "keys": ["TAB"], "type": "function", "command": "focus_next" },
-    { "keys": ["SHIFT_TAB"], "type": "function", "command": "focus_previous" },
-    { "keys": ["UP"], "type": "function", "command": "move_up" },
-    { "keys": ["DOWN"], "type": "function", "command": "move_down" },
-    { "keys": ["PAGE_UP"], "type": "function", "command": "page_up" },
-    { "keys": ["PAGE_DOWN"], "type": "function", "command": "page_down" },
-    { "keys": ["ENTER"], "type": "function", "command": "activate" },
-    { "keys": ["DELETE", "BACKSPACE"], "type": "function", "command": "delete" },
-    { "keys": [" "], "command": "todo toggle $n" },
-    { "keys": ["tc"], "type": "function", "command": "toggle_console" },
-    { "keys": ["tm"], "type": "function", "command": "toggle_metadata" },
-    { "keys": ["/"], "type": "prompt", "command": "search \"\"", "cursorPosition": -2 },
-    { "keys": ["mn"], "type": "prompt", "command": "mknote \"\"", "cursorPosition": -2 },
-    { "keys": ["mt"], "type": "prompt", "command": "mktodo \"\"", "cursorPosition": -2 },
-    { "keys": ["mb"], "type": "prompt", "command": "mkbook \"\"", "cursorPosition": -2 },
-    { "keys": ["yn"], "type": "prompt", "command": "cp $n \"\"", "cursorPosition": -2 },
-    { "keys": ["dn"], "type": "prompt", "command": "mv $n \"\"", "cursorPosition": -2 }
-]
-
-

Available commands

+

Commands

The following commands are available in command-line mode:

attach <note> <file>
 
     Attaches the given file to the note.
 
+cat <note>
+
+    Displays the given note.
+
+    -v, --verbose  Displays the complete information about note.
+
 config [name] [value]
 
     Gets or sets a config value. If [value] is not provided, it will show the 
@@ -472,11 +478,6 @@ config [name] [value]
 
 Possible keys/values:
 
-    sync.2.path            File system synchronisation target directory.
-                           The path to synchronise with when file system 
-                           synchronisation is enabled. See `sync.target`.
-                           Type: string.
-
     editor                 Text editor.
                            The editor that will be used to open a note. If 
                            none is provided it will try to auto-detect the 
@@ -485,8 +486,12 @@ Possible keys/values:
 
     locale                 Language.
                            Type: Enum.
-                           Possible values: en_GB (English), es_CR (Español), 
-                           fr_FR (Français).
+                           Possible values: en_GB (English), de_DE (Deutsch), 
+                           es_CR (Español (Costa Rica)), es_ES (Español), eu 
+                           (Basque), fr_FR (Français), hr_HR (Croatian), it_IT 
+                           (Italiano), ja_JP (日本語), nl_BE (Nederlands), pt_BR 
+                           (Português (Brasil)), ru_RU (Русский), zh_CN (中文 
+                           (简体)).
                            Default: "en_GB"
 
     dateFormat             Date format.
@@ -517,14 +522,38 @@ Possible keys/values:
                            Default: 300
 
     sync.target            Synchronisation target.
-                           The target to synchonise to. If synchronising with 
-                           the file system, set `sync.2.path` to specify the 
-                           target directory.
+                           The target to synchonise to. Each sync target may 
+                           have additional parameters which are named as 
+                           `sync.NUM.NAME` (all documented below).
                            Type: Enum.
                            Possible values: 2 (File system), 3 (OneDrive), 4 
-                           (OneDrive Dev (For testing only)).
+                           (OneDrive Dev (For testing only)), 5 (Nextcloud), 6 
+                           (WebDAV).
                            Default: 3
 
+    sync.2.path            Directory to synchronise with (absolute path).
+                           The path to synchronise with when file system 
+                           synchronisation is enabled. See `sync.target`.
+                           Type: string.
+
+    sync.5.path            Nexcloud WebDAV URL.
+                           Type: string.
+
+    sync.5.username        Nexcloud username.
+                           Type: string.
+
+    sync.5.password        Nexcloud password.
+                           Type: string.
+
+    sync.6.path            WebDAV URL.
+                           Type: string.
+
+    sync.6.username        WebDAV username.
+                           Type: string.
+
+    sync.6.password        WebDAV password.
+                           Type: string.
+
 cp <note> [notebook]
 
     Duplicates the notes matching <note> to [notebook]. If no notebook is 
@@ -534,13 +563,36 @@ done <note>
 
     Marks a to-do as done.
 
+e2ee <command> [path]
+
+    Manages E2EE configuration. Commands are `enable`, `disable`, `decrypt`, 
+    `status` and `target-status`.
+
+    -p, --password <password>  Use this password as master password (For 
+                               security reasons, it is not recommended to use 
+                               this option).
+    -v, --verbose              More verbose output for the `target-status` 
+                               command
+
 edit <note>
 
     Edit note.
 
-exit
+encrypt-config <command>
 
-    Exits the application.
+    Manages encryption configuration.
+
+    -p, --password <password>  Use this password as master password (For 
+                               security reasons, it is not recommended to use 
+                               this option).
+
+encryption <command>
+
+    Manages encryption configuration.
+
+    -p, --password <password>  Use this password as master password (For 
+                               security reasons, it is not recommended to use 
+                               this option).
 
 export <directory>
 
@@ -596,9 +648,18 @@ rmnote <note-pattern>
 
     -f, --force  Deletes the notes without asking for confirmation.
 
-search <pattern> [notebook]
+set <note> <name> [value]
 
-    Searches for the given <pattern> in all the notes.
+    Sets the property <name> of the given <note> to the given [value]. 
+    Possible properties are:
+
+    parent_id (text), title (text), body (text), created_time (int), 
+    updated_time (int), is_conflict (int), latitude (numeric), longitude 
+    (numeric), altitude (numeric), author (text), source_url (text), is_todo 
+    (int), todo_due (int), todo_completed (int), source (text), 
+    source_application (text), application_data (text), order (int), 
+    user_created_time (int), user_updated_time (int), encryption_cipher_text 
+    (text), encryption_applied (int)
 
 status
 
@@ -610,7 +671,6 @@ sync
 
     --target <target>  Sync to provided target (defaults to sync.target config 
                        value)
-    --random-failures  For debugging purposes. Do not use.
 
 tag <tag-command> [tag] [note]
 
@@ -629,6 +689,11 @@ undone <note>
 
     Marks a to-do as non-completed.
 
+use <notebook>
+
+    Switches to [notebook] - all further operations will happen within this 
+    notebook.
+
 version
 
     Displays version information