diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index f5e30323d..18ff8190b 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -1,9 +1,9 @@ name: Dev on: push: - branches-ignore: - - 'develop' - - 'feature/update**' + branches: [ develop ] + pull_request: + branches: [ develop ] concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/docs/User Guide/!!!meta.json b/docs/User Guide/!!!meta.json index 3761a28f7..b16a700b6 100644 --- a/docs/User Guide/!!!meta.json +++ b/docs/User Guide/!!!meta.json @@ -9,7 +9,7 @@ "pOsGYCXsbNQG" ], "title": "User Guide", - "notePosition": 90, + "notePosition": 10, "prefix": null, "isExpanded": false, "type": "text", @@ -1481,13 +1481,6 @@ "type": "text", "mime": "text/markdown", "attributes": [ - { - "type": "relation", - "name": "imageLink", - "value": "JXFeNgU8Xnp1", - "isInheritable": false, - "position": 10 - }, { "type": "relation", "name": "internalLink", @@ -1516,13 +1509,6 @@ "isInheritable": false, "position": 50 }, - { - "type": "relation", - "name": "internalLink", - "value": "BFs8mudNFgCS", - "isInheritable": false, - "position": 60 - }, { "type": "label", "name": "shareAlias", @@ -1648,13 +1634,6 @@ "isInheritable": false, "position": 40 }, - { - "type": "relation", - "name": "internalLink", - "value": "_lbSettings", - "isInheritable": false, - "position": 50 - }, { "type": "label", "name": "iconClass", @@ -6553,6 +6532,13 @@ "value": "bx bx-question-mark", "isInheritable": false, "position": 40 + }, + { + "type": "relation", + "name": "internalLink", + "value": "wy8So3yZZlH9", + "isInheritable": false, + "position": 80 } ], "format": "markdown", diff --git a/docs/User Guide/User Guide/Basic Concepts/Import & Export/Evernote.md b/docs/User Guide/User Guide/Basic Concepts/Import & Export/Evernote.md index 26136cb78..3815c2477 100644 --- a/docs/User Guide/User Guide/Basic Concepts/Import & Export/Evernote.md +++ b/docs/User Guide/User Guide/Basic Concepts/Import & Export/Evernote.md @@ -15,4 +15,4 @@ After importing the ENEX file, go over the imported notes and resources to be su All resources (except for images) are created as note's attachments. -HTML inside ENEX files is not exactly valid so some formatting maybe broken or lost. You can report major problems into [Trilium issue tracker](https://github.com/TriliumNext/Notes/issues). %%{WARNING}%% \ No newline at end of file +HTML inside ENEX files is not exactly valid so some formatting maybe broken or lost. You can report major problems into [Trilium issue tracker](https://github.com/TriliumNext/Notes/issues). \ No newline at end of file diff --git a/docs/User Guide/User Guide/FAQ.md b/docs/User Guide/User Guide/FAQ.md index b9ce905dd..da5cfa02a 100644 --- a/docs/User Guide/User Guide/FAQ.md +++ b/docs/User Guide/User Guide/FAQ.md @@ -1,23 +1,17 @@ # FAQ -## Mac OS support +## macOS support -Originally, desktop builds of Trilium Notes has been available for Windows & Linux, but there has been a considerable demand for macOS build. +Originally, Trilium Notes considered the macOS build unsupported. TriliumNext commits to make the experience on macOS as good as possible. -So I made one, but I underestimated the differences and specifics of Mac platform which seems to require special handling in several places. My lack of knowledge and frankly willingness to learn & code Mac specific functionality resulted in a current state where [Trilium does not integrate well into the OS](https://github.com/TriliumNext/Notes/issues/511)  +if you find any platform-specific issues, feel free to [report them](Troubleshooting/Reporting%20issues.md). -%%{WARNING}%%. +## Translation / localisation support -macOS build is from now on considered "unsupported". I will strive to keep it fundamentally functional, but I won't work on Mac specific features or integrations. Note that this is more of an acknowledgment of an existing state rather than sudden change of direction. +The original Trilium Notes application did not support multiple languages. Since we believe that internationalisation is a core part of an application, we have added support for it. -Of course, PRs are welcome. +Contributions to translations are welcome. -## Translation / localization support - -Trilium is currently available only in English. Translation to other languages is not planned in the near/medium term because it brings a significant maintenance overhead. This decision might be revisited once Trilium stabilizes into a more mature product. - -For Chinese, there's an unofficial fork [here](https://github.com/Nriver/trilium-translation). Use at your own risk. - -## Multi user support +## Multi-user support Common request is to allow multiple users collaborate, share notes etc. So far I'm resisting this because of these reasons: @@ -41,7 +35,9 @@ No. These general purpose sync apps are not suitable to sync database files which are open and being worked on by another application. The result is that they will corrupt the database file, resulting in data loss and this message in the Trilium logs: -> SqliteError: database disk image is malformed +``` +SqliteError: database disk image is malformed +``` The only supported way to sync Trilium's data across the network is to use a [sync/web server](Installation%20%26%20Setup/Synchronization.md). diff --git a/docs/User Guide/User Guide/Installation & Setup/Backup.md b/docs/User Guide/User Guide/Installation & Setup/Backup.md index 0f42dd79a..a67971a49 100644 --- a/docs/User Guide/User Guide/Installation & Setup/Backup.md +++ b/docs/User Guide/User Guide/Installation & Setup/Backup.md @@ -18,7 +18,7 @@ Let's assume you want to restore the weekly backup, here's how to do it: * find [data directory](Data%20directory.md) Trilium uses - easy way is to open "About Trilium Notes" from "Menu" in upper left corner and looking at "data directory" * I'll refer to `~/trilium-data` as data directory from now on -* find `~/trilium-data/backup/backup-weekly.db` - this is the [document](#root/xjSsCcvVZf6H)backup +* find `~/trilium-data/backup/backup-weekly.db` - this is the [document](#root/xjSsCcvVZf6H) backup * at this point stop/kill Trilium * delete `~/trilium-data/document.db`, `~/trilium-data/document.db-wal` and `~/trilium-data/document.db-shm` (latter two files are auto generated) * copy and rename this `~/trilium-data/backup/backup-weekly.db` to `~/trilium-data/document.db` @@ -40,4 +40,4 @@ noBackup=true You can also review the [configuration](../Advanced%20Usage/Configuration%20\(config.ini%20or%20e.md) file to provide all `config.ini` values as environment variables instead. -See [sample config](https://github.com/TriliumNext/Notes/blob/master/config-sample.ini). %%{WARNING}%% \ No newline at end of file +See [sample config](https://github.com/TriliumNext/Notes/blob/master/config-sample.ini). \ No newline at end of file diff --git a/docs/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Docker Server Installation.md b/docs/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Docker Server Installation.md index 1663494df..53d0d9dd2 100644 --- a/docs/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Docker Server Installation.md +++ b/docs/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Docker Server Installation.md @@ -9,7 +9,8 @@ If you need help installing Docker, reference the [Docker Installation Docs](htt **Note:** Trilium's Docker container requires root privileges to operate correctly. -> \[!WARNING\] If you're using a SMB/CIFS share or folder as your Trilium data directory, [you'll need](https://github.com/TriliumNext/Notes/issues/415#issuecomment-2344824400) to add the mount options of `nobrl` and `noperm` when mounting your SMB share. +> [!WARNING] +> If you're using a SMB/CIFS share or folder as your Trilium data directory, [you'll need](https://github.com/TriliumNext/Notes/issues/415#issuecomment-2344824400) to add the mount options of `nobrl` and `noperm` when mounting your SMB share. ## Running with Docker Compose diff --git a/docs/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Kubernetes server installation.md b/docs/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Kubernetes server installation.md index e78ea9ae5..8444cc185 100644 --- a/docs/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Kubernetes server installation.md +++ b/docs/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Kubernetes server installation.md @@ -5,7 +5,7 @@ The recommended way is to use a Helm chart. ## Root privileges -> \[!NOTE\] +> [!NOTE] > The Trilium container at this time needs to be run with root privileges. It will swap to UID and GID `1000:1000` to run the `node` process after execution though, so the main process doesn't run with root privileges. The Trilium docker container needs to be run with root privileges. The node process inside the container will be started with reduced privileges (uid:gid 1000:1000) after some initialization logic. Please make sure that you don't use a security context (PodSecurityContext) which changes the user ID. To use a different uid:gid for file storage and the application, please use the `USER_UID` & `USER_GID` environment variables. diff --git a/docs/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Manual server installation.md b/docs/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Manual server installation.md index 95f178c29..7f1778557 100644 --- a/docs/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Manual server installation.md +++ b/docs/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Manual server installation.md @@ -25,10 +25,12 @@ sudo apt install libpng16-16 libpng-dev pkg-config autoconf libtool build-essent ### Download -You can either download source code zip/tar from [https://github.com/TriliumNext/Notes/releases/latest\]\]](https://github.com/TriliumNext/Notes/releases/latest%5D%5D) %%{WARNING}%%or clone git repository **from stable branch** with +You can either download source code zip/tar from [https://github.com/TriliumNext/Notes/releases/latest](https://github.com/TriliumNext/Notes/releases/latest). + +For the latest version including betas, clone Git repository **from** `**master**` **branch** with: ``` -git clone -b stable https://github.com/triliumnext/notes.git %%{WARNING}%% +git clone -b master https://github.com/triliumnext/notes.git ``` ## Installation diff --git a/docs/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Packaged server installation.md b/docs/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Packaged server installation.md index 576c78891..c0842534e 100644 --- a/docs/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Packaged server installation.md +++ b/docs/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Packaged server installation.md @@ -3,9 +3,9 @@ This is essentially Trilium sources + node modules + node.js runtime packaged in ## Steps -* ssh into your server -* use `wget` (or `curl` or whatever) to download latest [trilium-linux-x64-server-\[VERSION\].xz](https://github.com/TriliumNext/Notes/releases/latest)%%{WARNING}%% (notice -server suffix) on your server -* unpack the archive, e.g. using `tar -xf -d trilium-linux-x64-server-[VERSION].tar.xz` +* SSH into your server +* use `wget` (or `curl`) to download latest `TriliumNextNotes-Server-[VERSION]-linux-x64.tar.xz` (notice `-Server` suffix) on your server. +* unpack the archive, e.g. using `tar -xf -d TriliumNextNotes-Server-[VERSION]-linux-x64.tar.xz` * `cd trilium-linux-x64-server` * `./trilium.sh` * you can open the browser and open http://\[your-server-hostname\]:8080 and you should see Trilium initialization page @@ -20,7 +20,7 @@ The problem with above steps is that once you close the SSH connection, the Tril * After downloading, extract and move Trilium: ``` -tar -xvf trilium-linux-x64-server-[VERSION].tar.xz +tar -xvf TriliumNextNotes-Server-[VERSION]-linux-x64.tar.xz sudo mv trilium-linux-x64-server /opt/trilium ``` diff --git a/docs/User Guide/User Guide/Installation & Setup/Web Clipper.md b/docs/User Guide/User Guide/Installation & Setup/Web Clipper.md index 1124e7346..f88570db2 100644 --- a/docs/User Guide/User Guide/Installation & Setup/Web Clipper.md +++ b/docs/User Guide/User Guide/Installation & Setup/Web Clipper.md @@ -24,7 +24,7 @@ If there's multiple clippings from the same page (and on the same day), then the **Extension is available from:** * [Project release page](https://github.com/TriliumNext/web-clipper/releases) - .xpi for Firefox and .zip for Chromium based browsers. -* %%{WARNING}%% [Chrome Web Store](https://chromewebstore.google.com/detail/trilium-web-clipper/dfhgmnfclbebfobmblelddiejjcijbjm) +* [Chrome Web Store](https://chromewebstore.google.com/detail/trilium-web-clipper/dfhgmnfclbebfobmblelddiejjcijbjm) ## Configuration diff --git a/docs/User Guide/User Guide/Note Types/Book/Calendar View.md b/docs/User Guide/User Guide/Note Types/Book/Calendar View.md index 03dcff25e..3aa113406 100644 --- a/docs/User Guide/User Guide/Note Types/Book/Calendar View.md +++ b/docs/User Guide/User Guide/Note Types/Book/Calendar View.md @@ -52,18 +52,22 @@ For each note of the calendar, the following attributes can be used: | `#calendar:color` | Similar to `#color`, but applies the color only for the event in the calendar and not for other places such as the note tree. | | `#iconClass` | If present, the icon of the note will be displayed to the left of the event title. | | `#calendar:title` | Changes the title of an event to point to an attribute of the note other than the title, either a label (e.g. `#assignee`) or a relation (e.g. `~for`). See _Advanced use-cases_ for more information. | -| `#calendar:promotedAttributes` | Allows displaying the value of one or more promoted attributes in the calendar like this: ![](13_Calendar%20View_image.png)

`
#label:weight="promoted,number,single,precision=1"
#label:mood="promoted,alias=Mood,single,text"
#calendar:promotedAttributes="label:weight,label:mood"
`

It can also be used with relations, case in which it will display the title of the target note:

`
#relation:assignee="promoted,alias=Assignee,single,text"
#calendar:promotedAttributes="relation:assignee"
~assignee=@My assignee 
` | -| `#calendar:startDate` | Allows using a different label to represent the start date, other than `#startDate` (e.g. `#expiryDate`). The label name must be prefixed with `#`. If the label is not defined for a note, the default will be used instead. | -| `#calendar:endDate` | Allows using a different label to represent the start date, other than `#endDate`. The label name must be prefixed with `#`. If the label is not defined for a note, the default will be used instead. | +| `#calendar:displayedAttributes` | Allows displaying the value of one or more attributes in the calendar like this: 

![](13_Calendar%20View_image.png)

```
#weight="70"
#Mood="Good"
#calendar:displayedAttributes="weight,Mood"
```

It can also be used with relations, case in which it will display the title of the target note:

```
~assignee=@My assignee
#calendar:displayedAttributes="assignee"
``` | +| `#calendar:startDate` | Allows using a different label to represent the start date, other than `startDate` (e.g. `expiryDate`). The label name **must not be** prefixed with `#`. If the label is not defined for a note, the default will be used instead. | +| `#calendar:endDate` | Allows using a different label to represent the start date, other than `endDate`. The label name **must not be** prefixed with `#`. If the label is not defined for a note, the default will be used instead. | ## How the calendar works -![](17_Calendar%20View_image.png)The calendar displays all the child notes of the book that have a `#startDate`. An `#endDate` can optionally be added. +![](17_Calendar%20View_image.png) + +The calendar displays all the child notes of the book that have a `#startDate`. An `#endDate` can optionally be added. If editing the start date and end date from the note itself is desirable, the following attributes can be added to the book note: ``` -#viewType=calendar #label:startDate(inheritable)="promoted,alias=Start Date,single,date" #label:endDate(inheritable)="promoted,alias=End Date,single,date" #hidePromotedAttributes +#viewType=calendar #label:startDate(inheritable)="promoted,alias=Start Date,single,date" +#label:endDate(inheritable)="promoted,alias=End Date,single,date" +#hidePromotedAttributes ``` This will result in: diff --git a/docs/User Guide/User Guide/Note Types/Text/Content language & Right-to-le.md b/docs/User Guide/User Guide/Note Types/Text/Content language & Right-to-le.md index 7fbee885a..81eb9bd15 100644 --- a/docs/User Guide/User Guide/Note Types/Text/Content language & Right-to-le.md +++ b/docs/User Guide/User Guide/Note Types/Text/Content language & Right-to-le.md @@ -1,5 +1,5 @@ # Content language & Right-to-left support -![](Content%20language%20&%20Right-t.png) +![](api/images/4yHAD34xyvAl/Content%20language%20&%20Right-t.png) A language hint can be provided for text notes. This option informs the browser or the desktop application about the language the note is written in (for example this might help with spellchecking), and it also determines whether the text is displayed from right-to-left for languages such as Arabic, Hebrew, etc. diff --git a/docs/User Guide/User Guide/Quick Start.md b/docs/User Guide/User Guide/Quick Start.md index 0cad4b291..e214387a6 100644 --- a/docs/User Guide/User Guide/Quick Start.md +++ b/docs/User Guide/User Guide/Quick Start.md @@ -9,16 +9,11 @@ 1. [Server installation](Installation%20%26%20Setup/Server%20Installation.md) 2. [Mobile frontend](Installation%20%26%20Setup/Mobile%20Frontend.md) (optional) -3. [![Deploy](Attachments/home-button.svg)](https://heroku.com/deploy?template=https://github.com/feilongfl/trilium-heroku) %%{WARNING}%% -4. [PikaPods managed hosting](https://www.pikapods.com/pods?run=trilium-next) +3. [PikaPods managed hosting](https://www.pikapods.com/pods?run=trilium-next) -**Combination of server and desktop/laptop** - Install the application on both a server, for web access and data synchronization, and desktop instance(s). This allows all the data to be stored on the server and either accessed from the web browser, or the desktop application. The desktop application will sync and store the data locally so that it can be used when offline. +**Combination of server and desktop/laptop** - Install the application on both a server, for web access and data synchronisation, and desktop instance(s). This allows all the data to be stored on the server and either accessed from the web browser, or the desktop application. The desktop application will sync and store the data locally so that it can be used when offline. 1. [Server installation](Installation%20%26%20Setup/Server%20Installation.md) 2. [Mobile frontend](Installation%20%26%20Setup/Mobile%20Frontend.md) (optional) 3. [Desktop installation](Installation%20%26%20Setup/Desktop%20Installation.md) -4. [Synchronization](Installation%20%26%20Setup/Synchronization.md) - -## Basic concepts - -1. Understand [Note](Basic%20Concepts/Note.md) \ No newline at end of file +4. [Synchronization](Installation%20%26%20Setup/Synchronization.md) \ No newline at end of file diff --git a/libraries/ckeditor/ckeditor-content.css b/libraries/ckeditor/ckeditor-content.css index 806e431a9..526d61f62 100644 --- a/libraries/ckeditor/ckeditor-content.css +++ b/libraries/ckeditor/ckeditor-content.css @@ -27,6 +27,7 @@ margin: 1.25em 0; margin-right: 14px; position: relative; + overflow: hidden; } .ck-content .admonition p:last-child { diff --git a/package-lock.json b/package-lock.json index 5203b393b..1d68efd74 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,7 +20,6 @@ "@mermaid-js/layout-elk": "0.1.7", "@mind-elixir/node-menu": "1.0.4", "@triliumnext/express-partial-content": "1.0.1", - "@types/html-minifier": "4.0.5", "archiver": "7.0.1", "async-mutex": "0.5.0", "autocomplete.js": "0.38.1", @@ -53,7 +52,6 @@ "fs-extra": "11.3.0", "helmet": "8.0.0", "html": "1.0.0", - "html-minifier": "4.0.0", "html2plaintext": "2.1.4", "http-proxy-agent": "7.0.2", "https-proxy-agent": "7.0.6", @@ -5247,16 +5245,6 @@ "@types/node": "*" } }, - "node_modules/@types/clean-css": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/@types/clean-css/-/clean-css-4.2.11.tgz", - "integrity": "sha512-Y8n81lQVTAfP2TOdtJJEsCoYl1AnOkqDqMvXb9/7pfgZZ7r8YrEyurrAvAoAjHOGXKRybay+5CsExqIH6liccw==", - "license": "MIT", - "dependencies": { - "@types/node": "*", - "source-map": "^0.6.0" - } - }, "node_modules/@types/cls-hooked": { "version": "4.3.9", "resolved": "https://registry.npmjs.org/@types/cls-hooked/-/cls-hooked-4.3.9.tgz", @@ -5705,17 +5693,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/html-minifier": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/@types/html-minifier/-/html-minifier-4.0.5.tgz", - "integrity": "sha512-LfE7f7MFd+YUfZnlBz8W43P4NgSObWiqyKapANsWCj63Aqeqli8/9gVsGP4CwC8jPpTTYlTopKCk9rJSuht/ew==", - "license": "MIT", - "dependencies": { - "@types/clean-css": "*", - "@types/relateurl": "*", - "@types/uglify-js": "*" - } - }, "node_modules/@types/http-cache-semantics": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.4.tgz", @@ -5957,12 +5934,6 @@ "@types/node": "*" } }, - "node_modules/@types/relateurl": { - "version": "0.2.33", - "resolved": "https://registry.npmjs.org/@types/relateurl/-/relateurl-0.2.33.tgz", - "integrity": "sha512-bTQCKsVbIdzLqZhLkF5fcJQreE4y1ro4DIyVrlDNSCJRRwHhB8Z+4zXXa8jN6eDvc2HbRsEYgbvrnGvi54EpSw==", - "license": "MIT" - }, "node_modules/@types/responselike": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.3.tgz", @@ -6133,15 +6104,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/uglify-js": { - "version": "3.17.5", - "resolved": "https://registry.npmjs.org/@types/uglify-js/-/uglify-js-3.17.5.tgz", - "integrity": "sha512-TU+fZFBTBcXj/GpDpDaBmgWk/gn96kMZ+uocaFUlV2f8a6WdMzzI44QBCmGcCiYR0Y6ZlNRiyUyKKt5nl/lbzQ==", - "license": "MIT", - "dependencies": { - "source-map": "^0.6.1" - } - }, "node_modules/@types/unist": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", @@ -8080,16 +8042,6 @@ "node": ">=6" } }, - "node_modules/camel-case": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-3.0.0.tgz", - "integrity": "sha512-+MbKztAYHXPr1jNTSKQF52VpcFjwY5RkR7fxksV8Doo4KAYc5Fl4UJRgthBbTmEx8C54DqahhbLJkDwjI3PI/w==", - "license": "MIT", - "dependencies": { - "no-case": "^2.2.0", - "upper-case": "^1.1.1" - } - }, "node_modules/caniuse-lite": { "version": "1.0.30001703", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001703.tgz", @@ -8331,18 +8283,6 @@ "license": "MIT", "optional": true }, - "node_modules/clean-css": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.4.tgz", - "integrity": "sha512-EJUDT7nDVFDvaQgAo2G/PJvxmp1o/c6iXLbswsBbUFXi1Nr+AjA2cKmfbKDMjMvzEe75g3P6JkaDDAKk96A85A==", - "license": "MIT", - "dependencies": { - "source-map": "~0.6.0" - }, - "engines": { - "node": ">= 4.0" - } - }, "node_modules/clean-stack": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", @@ -13034,33 +12974,6 @@ "dev": true, "license": "MIT" }, - "node_modules/html-minifier": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/html-minifier/-/html-minifier-4.0.0.tgz", - "integrity": "sha512-aoGxanpFPLg7MkIl/DDFYtb0iWz7jMFGqFhvEDZga6/4QTjneiD8I/NXL1x5aaoCp7FSIT6h/OhykDdPsbtMig==", - "license": "MIT", - "dependencies": { - "camel-case": "^3.0.0", - "clean-css": "^4.2.1", - "commander": "^2.19.0", - "he": "^1.2.0", - "param-case": "^2.1.1", - "relateurl": "^0.2.7", - "uglify-js": "^3.5.1" - }, - "bin": { - "html-minifier": "cli.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/html-minifier/node_modules/commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "license": "MIT" - }, "node_modules/html2plaintext": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/html2plaintext/-/html2plaintext-2.1.4.tgz", @@ -14803,12 +14716,6 @@ "dev": true, "license": "MIT" }, - "node_modules/lower-case": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-1.1.4.tgz", - "integrity": "sha512-2Fgx1Ycm599x+WGpIYwJOvsjmXFzTSc34IwDWALRA/8AopUKAVPwfJ+h5+f85BCp0PWmmJcWzEpxOpoXycMpdA==", - "license": "MIT" - }, "node_modules/lowercase-keys": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", @@ -16032,15 +15939,6 @@ "dev": true, "license": "MIT" }, - "node_modules/no-case": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/no-case/-/no-case-2.3.2.tgz", - "integrity": "sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ==", - "license": "MIT", - "dependencies": { - "lower-case": "^1.1.1" - } - }, "node_modules/node-abi": { "version": "3.71.0", "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.71.0.tgz", @@ -16671,15 +16569,6 @@ "wheel": "^1.0.0" } }, - "node_modules/param-case": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/param-case/-/param-case-2.1.1.tgz", - "integrity": "sha512-eQE845L6ot89sk2N8liD8HAuH4ca6Vvr7VWAWwt7+kvvG5aBcPmmphQ68JsEG2qa9n1TykS2DLeMt363AAH8/w==", - "license": "MIT", - "dependencies": { - "no-case": "^2.2.0" - } - }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -18227,15 +18116,6 @@ "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", "license": "MIT" }, - "node_modules/relateurl": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz", - "integrity": "sha512-G08Dxvm4iDN3MLM0EsP62EDV9IuhXPR6blNz6Utcp7zyV3tr4HVNINt6MpaRWbxoOHT3Q7YN2P+jaHX8vUbgog==", - "license": "MIT", - "engines": { - "node": ">= 0.10" - } - }, "node_modules/repeat-string": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", @@ -20778,18 +20658,6 @@ "integrity": "sha512-UsUk3byDzKd04EyoZ7U4DOlxQaD14JUKQl6/P7wiX4FNvUfm3XL246n9W5AmqwW5RSFJ27NAuM0iLscAOYUiGQ==", "license": "MIT" }, - "node_modules/uglify-js": { - "version": "3.19.3", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz", - "integrity": "sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==", - "license": "BSD-2-Clause", - "bin": { - "uglifyjs": "bin/uglifyjs" - }, - "engines": { - "node": ">=0.8.0" - } - }, "node_modules/uid-safe": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-2.1.5.tgz", @@ -20994,12 +20862,6 @@ "browserslist": ">= 4.21.0" } }, - "node_modules/upper-case": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/upper-case/-/upper-case-1.1.3.tgz", - "integrity": "sha512-WRbjgmYzgXkCV7zNVpy5YgrHgbBv126rMALQQMrmzOVC4GM2waQ9x7xtm8VU+1yF2kWyPzI9zbZ48n4vSxwfSA==", - "license": "MIT" - }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", diff --git a/package.json b/package.json index 4932a8a7b..ee1fd5356 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,6 @@ "@mermaid-js/layout-elk": "0.1.7", "@mind-elixir/node-menu": "1.0.4", "@triliumnext/express-partial-content": "1.0.1", - "@types/html-minifier": "4.0.5", "archiver": "7.0.1", "async-mutex": "0.5.0", "autocomplete.js": "0.38.1", @@ -113,7 +112,6 @@ "fs-extra": "11.3.0", "helmet": "8.0.0", "html": "1.0.0", - "html-minifier": "4.0.0", "html2plaintext": "2.1.4", "http-proxy-agent": "7.0.2", "https-proxy-agent": "7.0.6", diff --git a/src/public/app/doc_notes/en/User Guide/!!!meta.json b/src/public/app/doc_notes/en/User Guide/!!!meta.json index 542666e59..54c523b7a 100644 --- a/src/public/app/doc_notes/en/User Guide/!!!meta.json +++ b/src/public/app/doc_notes/en/User Guide/!!!meta.json @@ -9,9 +9,9 @@ "pOsGYCXsbNQG" ], "title": "User Guide", - "notePosition": 110, + "notePosition": 10, "prefix": null, - "isExpanded": false, + "isExpanded": true, "type": "text", "mime": "text/html", "attributes": [], @@ -1481,13 +1481,6 @@ "type": "text", "mime": "text/markdown", "attributes": [ - { - "type": "relation", - "name": "imageLink", - "value": "JXFeNgU8Xnp1", - "isInheritable": false, - "position": 10 - }, { "type": "relation", "name": "internalLink", @@ -1516,13 +1509,6 @@ "isInheritable": false, "position": 50 }, - { - "type": "relation", - "name": "internalLink", - "value": "BFs8mudNFgCS", - "isInheritable": false, - "position": 60 - }, { "type": "label", "name": "shareAlias", @@ -1552,7 +1538,7 @@ "title": "Basic Concepts", "notePosition": 60, "prefix": null, - "isExpanded": false, + "isExpanded": true, "type": "text", "mime": "text/html", "attributes": [ @@ -1648,13 +1634,6 @@ "isInheritable": false, "position": 40 }, - { - "type": "relation", - "name": "internalLink", - "value": "_lbSettings", - "isInheritable": false, - "position": 50 - }, { "type": "label", "name": "iconClass", @@ -3073,7 +3052,7 @@ "title": "Import & Export", "notePosition": 90, "prefix": null, - "isExpanded": false, + "isExpanded": true, "type": "text", "mime": "text/html", "attributes": [], @@ -5554,7 +5533,7 @@ "title": "Installation & Setup", "notePosition": 160, "prefix": null, - "isExpanded": false, + "isExpanded": true, "type": "text", "mime": "text/html", "attributes": [ @@ -5629,7 +5608,7 @@ "title": "Server Installation", "notePosition": 20, "prefix": null, - "isExpanded": false, + "isExpanded": true, "type": "text", "mime": "text/markdown", "attributes": [ @@ -5742,7 +5721,7 @@ "title": "1. Installing the server", "notePosition": 10, "prefix": null, - "isExpanded": false, + "isExpanded": true, "type": "text", "mime": "text/html", "attributes": [], @@ -6553,6 +6532,13 @@ "value": "bx bx-question-mark", "isInheritable": false, "position": 40 + }, + { + "type": "relation", + "name": "internalLink", + "value": "wy8So3yZZlH9", + "isInheritable": false, + "position": 80 } ], "format": "html", diff --git a/src/public/app/doc_notes/en/User Guide/User Guide/Basic Concepts/Import & Export/Evernote.html b/src/public/app/doc_notes/en/User Guide/User Guide/Basic Concepts/Import & Export/Evernote.html index 39a4d5c84..2d8457eba 100644 --- a/src/public/app/doc_notes/en/User Guide/User Guide/Basic Concepts/Import & Export/Evernote.html +++ b/src/public/app/doc_notes/en/User Guide/User Guide/Basic Concepts/Import & Export/Evernote.html @@ -28,8 +28,7 @@

Limitations

All resources (except for images) are created as note's attachments.

HTML inside ENEX files is not exactly valid so some formatting maybe broken - or lost. You can report major problems into Trilium issue tracker. - %%{WARNING}%%

+ or lost. You can report major problems into Trilium issue tracker.

diff --git a/src/public/app/doc_notes/en/User Guide/User Guide/FAQ.html b/src/public/app/doc_notes/en/User Guide/User Guide/FAQ.html index ed2c38ea2..1c841a973 100644 --- a/src/public/app/doc_notes/en/User Guide/User Guide/FAQ.html +++ b/src/public/app/doc_notes/en/User Guide/User Guide/FAQ.html @@ -13,27 +13,16 @@

FAQ

-

Mac OS support

-

Originally, desktop builds of Trilium Notes has been available for Windows - & Linux, but there has been a considerable demand for macOS build.

-

So I made one, but I underestimated the differences and specifics of Mac - platform which seems to require special handling in several places. My - lack of knowledge and frankly willingness to learn & code Mac specific - functionality resulted in a current state where Trilium does not integrate well into the OS 

-

%%{WARNING}%%.

-

macOS build is from now on considered "unsupported". I will strive to - keep it fundamentally functional, but I won't work on Mac specific features - or integrations. Note that this is more of an acknowledgment of an existing - state rather than sudden change of direction.

-

Of course, PRs are welcome.

-

Translation / localization support

-

Trilium is currently available only in English. Translation to other languages - is not planned in the near/medium term because it brings a significant - maintenance overhead. This decision might be revisited once Trilium stabilizes - into a more mature product.

-

For Chinese, there's an unofficial fork here. - Use at your own risk.

-

Multi user support

+

macOS support

+

Originally, Trilium Notes considered the macOS build unsupported. TriliumNext + commits to make the experience on macOS as good as possible.

+

if you find any platform-specific issues, feel free to report them.

+

Translation / localisation support

+

The original Trilium Notes application did not support multiple languages. + Since we believe that internationalisation is a core part of an application, + we have added support for it.

+

Contributions to translations are welcome.

+

Multi-user support

Common request is to allow multiple users collaborate, share notes etc. So far I'm resisting this because of these reasons:

diff --git a/src/public/app/doc_notes/en/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Docker Server Installation.html b/src/public/app/doc_notes/en/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Docker Server Installation.html index eb7fb661e..e56e70d01 100644 --- a/src/public/app/doc_notes/en/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Docker Server Installation.html +++ b/src/public/app/doc_notes/en/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Docker Server Installation.html @@ -23,12 +23,12 @@

Note: Trilium's Docker container requires root privileges to operate correctly.

-
-

[!WARNING] If you're using a SMB/CIFS share or folder as your Trilium - data directory, you'll need to - add the mount options of nobrl and noperm when mounting - your SMB share.

-
+

Running with Docker Compose

Grab the latest docker-compose.yml:

wget https://raw.githubusercontent.com/TriliumNext/Notes/master/docker-compose.yml

Optionally, edit the docker-compose.yml file to configure the diff --git a/src/public/app/doc_notes/en/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Kubernetes server installation.html b/src/public/app/doc_notes/en/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Kubernetes server installation.html index 4a78feb28..bc2f06ae3 100644 --- a/src/public/app/doc_notes/en/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Kubernetes server installation.html +++ b/src/public/app/doc_notes/en/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Kubernetes server installation.html @@ -18,12 +18,11 @@ own Kubernetes deployment.

The recommended way is to use a Helm chart.

Root privileges

-
-

[!NOTE] -
The Trilium container at this time needs to be run with root privileges. +

+

The Trilium docker container needs to be run with root privileges. The node process inside the container will be started with reduced privileges (uid:gid 1000:1000) after some initialization logic. Please make sure that diff --git a/src/public/app/doc_notes/en/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Manual server installation.html b/src/public/app/doc_notes/en/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Manual server installation.html index 48df65ee9..d125ca2c8 100644 --- a/src/public/app/doc_notes/en/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Manual server installation.html +++ b/src/public/app/doc_notes/en/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Manual server installation.html @@ -29,8 +29,8 @@ its derivatives (like Ubuntu) below:

sudo apt install libpng16-16 libpng-dev pkg-config autoconf libtool build-essential nasm libx11-dev libxkbfile-dev

Installation

Download

-

You can either download source code zip/tar from https://github.com/TriliumNext/Notes/releases/latest]] %%{WARNING}%%or - clone git repository from stable branch with

git clone -b stable https://github.com/triliumnext/notes.git %%{WARNING}%%
+

You can either download source code zip/tar from https://github.com/TriliumNext/Notes/releases/latest.

+

For the latest version including betas, clone Git repository from master branch with:

git clone -b master https://github.com/triliumnext/notes.git

Installation

cd trilium
 
 # download all node dependencies
diff --git a/src/public/app/doc_notes/en/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Packaged server installation.html b/src/public/app/doc_notes/en/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Packaged server installation.html
index 57c94f685..afbf79512 100644
--- a/src/public/app/doc_notes/en/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Packaged server installation.html	
+++ b/src/public/app/doc_notes/en/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Packaged server installation.html	
@@ -17,12 +17,10 @@
           into one 7z file.

Steps

tar -xvf TriliumNextNotes-Server-[VERSION]-linux-x64.tar.xz
 sudo mv trilium-linux-x64-server /opt/trilium
  1. Hello
  2. World
`; expect(markdownService.renderToHtml(input, "Troubleshooting")).toBe(expected); }); @@ -98,7 +99,7 @@ second line 2`; After`; const expected = `

Before

After

`; - expect(markdownService.renderToHtml(input, "Title")).toBe(expected); + expect(markdownService.renderToHtml(input, "Title")).toStrictEqual(expected); }); }); diff --git a/src/services/import/markdown.ts b/src/services/import/markdown.ts index e42846404..c0677b5f1 100644 --- a/src/services/import/markdown.ts +++ b/src/services/import/markdown.ts @@ -1,36 +1,61 @@ "use strict"; import { parse, Renderer, type Tokens } from "marked"; -import { minify as minifyHtml } from "html-minifier"; -// Keep renderer code up to date with https://github.com/markedjs/marked/blob/master/src/Renderer.ts. -const renderer = new Renderer({ async: false }); -renderer.code = ({ text, lang, escaped }: Tokens.Code) => { - if (!text) { - return ""; +/** + * Keep renderer code up to date with https://github.com/markedjs/marked/blob/master/src/Renderer.ts. + */ +class CustomMarkdownRenderer extends Renderer { + + heading(data: Tokens.Heading): string { + return super.heading(data).trimEnd(); } - const ckEditorLanguage = getNormalizedMimeFromMarkdownLanguage(lang); - return `
${text}
`; -}; -renderer.blockquote = ({ tokens }: Tokens.Blockquote) => { - const body = renderer.parser.parse(tokens); + paragraph(data: Tokens.Paragraph): string { + return super.paragraph(data).trimEnd(); + } - const admonitionMatch = /^

\[\!([A-Z]+)\]/.exec(body); - if (Array.isArray(admonitionMatch) && admonitionMatch.length === 2) { - const type = admonitionMatch[1].toLowerCase(); - - if (ADMONITION_TYPE_MAPPINGS[type]) { - const bodyWithoutHeader = body - .replace(/^

\[\!([A-Z]+)\]/, "

") - .replace(/^

<\/p>/, ""); // Having a heading will generate an empty paragraph that we need to remove. - - return `

\n`; + code({ text, lang }: Tokens.Code): string { + if (!text) { + return ""; } + + const ckEditorLanguage = getNormalizedMimeFromMarkdownLanguage(lang); + return `
${text}
`; } - return `
\n${body}
\n`; -}; + list(token: Tokens.List): string { + return super.list(token) + .replace("\n", "") // we replace the first one only. + .trimEnd(); + } + + listitem(item: Tokens.ListItem): string { + return super.listitem(item).trimEnd(); + } + + blockquote({ tokens }: Tokens.Blockquote): string { + const body = renderer.parser.parse(tokens); + + const admonitionMatch = /^

\[\!([A-Z]+)\]/.exec(body); + if (Array.isArray(admonitionMatch) && admonitionMatch.length === 2) { + const type = admonitionMatch[1].toLowerCase(); + + if (ADMONITION_TYPE_MAPPINGS[type]) { + const bodyWithoutHeader = body + .replace(/^

\[\!([A-Z]+)\]\s*/, "

") + .replace(/^

<\/p>/, ""); // Having a heading will generate an empty paragraph that we need to remove. + + return `

`; + } + } + + return `
${body}
`; + } + +} + +const renderer = new CustomMarkdownRenderer({ async: false }); import htmlSanitizer from "../html_sanitizer.js"; import importUtils from "./utils.js"; @@ -46,9 +71,6 @@ function renderToHtml(content: string, title: string) { // h1 handling needs to come before sanitization html = importUtils.handleH1(html, title); html = htmlSanitizer.sanitize(html); - html = minifyHtml(html, { - collapseWhitespace: true - }); return html; } diff --git a/src/services/import/single.spec.ts b/src/services/import/single.spec.ts index e04b657df..1eacd261b 100644 --- a/src/services/import/single.spec.ts +++ b/src/services/import/single.spec.ts @@ -87,7 +87,7 @@ describe("processNoteContent", () => { it("supports markdown note with UTF-16", async () => { const { importedNote } = await testImport("UTF-16LE Text Note.md", "text/markdown"); expect(importedNote.mime).toBe("text/html"); - expect(importedNote.getContent().toString()).toBe("

Hello world

\n

Plain text goes here.

\n"); + expect(importedNote.getContent().toString()).toBe("

Hello world

Plain text goes here.

"); }); it("supports excalidraw note", async () => { diff --git a/src/services/in_app_help.ts b/src/services/in_app_help.ts index b7fd30050..7841ee71b 100644 --- a/src/services/in_app_help.ts +++ b/src/services/in_app_help.ts @@ -13,9 +13,9 @@ export function getHelpHiddenSubtreeData() { const appDir = path.join(srcRoot, "public", isDev ? "app" : "app-dist"); const helpDir = path.join(appDir, "doc_notes", "en", "User Guide"); const metaFilePath = path.join(helpDir, "!!!meta.json"); - const metaFileContent = JSON.parse(fs.readFileSync(metaFilePath).toString("utf-8")); try { + const metaFileContent = JSON.parse(fs.readFileSync(metaFilePath).toString("utf-8")); return parseNoteMetaFile(metaFileContent as NoteMetaFile); } catch (e) { console.warn(e); diff --git a/src/share/routes.spec.ts b/src/share/routes.spec.ts index 86e1927bd..3c86a3f2f 100644 --- a/src/share/routes.spec.ts +++ b/src/share/routes.spec.ts @@ -27,6 +27,7 @@ describe("Share API test", () => { it("requests password for password-protected share", async () => { await supertest(app) .get("/share/YjlPRj2E9fOV") + .expect(401) .expect("WWW-Authenticate", 'Basic realm="User Visible Realm", charset="UTF-8"'); expect(cannotSetHeadersCount).toBe(0); }); diff --git a/src/share/routes.ts b/src/share/routes.ts index 3c6db87d5..9b6c2201d 100644 --- a/src/share/routes.ts +++ b/src/share/routes.ts @@ -131,6 +131,7 @@ function renderImageAttachment(image: SNote, res: Response, attachmentName: stri function register(router: Router) { function renderNote(note: SNote, req: Request, res: Response) { if (!note) { + console.log("Unable to find note ", note); res.status(404).render("share/404"); return; }