diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 895793470..28347d8b6 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -5,9 +5,9 @@ labels: "Type: Bug" body: - type: input attributes: - label: Trilium Version - description: What version of Trilium are you using? - placeholder: 0.57.0-beta + label: TriliumNext Version + description: What version of TriliumNext are you using? + placeholder: 0.90.0-beta validations: required: true - type: dropdown @@ -24,7 +24,7 @@ body: - type: dropdown attributes: label: What is your setup? - description: https://github.com/zadam/trilium/wiki#choose-the-setup + description: https://triliumnext.github.io/Docs/Wiki/quick-start.html options: - Local (no sync) - Local + server sync @@ -47,6 +47,6 @@ body: - type: textarea attributes: label: Error logs - description: Please provide error logs, see [wiki page](https://github.com/zadam/trilium/wiki/Error-logs) for instructions on how to submit them. + description: Please provide error logs, see [wiki page](https://triliumnext.github.io/Docs/Wiki/error-logs.html) for instructions on how to submit them. validations: required: false diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a43a1858d..407323c85 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,17 +2,23 @@ name: Main on: push: branches: - - 'develop' - - 'feature/update*' + - "develop" + - "feature/update**" + - "feature/server_esm**" paths-ignore: - - 'docs/**' + - "docs/**" + - "bin/**" + tags: + - "v*" + workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true env: - REGISTRY: ghcr.io + GHCR_REGISTRY: ghcr.io + DOCKERHUB_REGISTRY: docker.io IMAGE_NAME: ${{ github.repository }} jobs: @@ -138,7 +144,7 @@ jobs: name: TriliumNext Notes for Windows (Setup) path: out/make/squirrel.windows/x64/*.exe build_docker: - name: Build Docker image + name: Build Docker images runs-on: ubuntu-latest permissions: contents: read @@ -147,40 +153,68 @@ jobs: id-token: write steps: - uses: actions/checkout@v4 - - name: Log in to the Container registry - uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + - name: Extract metadata (tags, labels) for GHCR image + id: ghcr-meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Extract metadata (tags, labels) for Docker - id: meta + images: ${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }} + - name: Extract metadata (tags, labels) for DockerHub image + id: dh-meta uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + images: ${{ env.DOCKERHUB_REGISTRY }}/${{ env.IMAGE_NAME }} - name: Set up node & dependencies uses: actions/setup-node@v4 with: node-version: 20 cache: "npm" - - run: npm ci + - run: npm ci - name: Run the TypeScript build run: npx tsc - name: Create server-package.json run: cat package.json | grep -v electron > server-package.json + - name: Log in to the GHCR container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ${{ env.GHCR_REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - uses: docker/setup-buildx-action@v3 - - uses: docker/build-push-action@v6 - id: push + - name: Build and push container image to GHCR + uses: docker/build-push-action@v6 + id: ghcr-push + with: + context: . + push: true + tags: ${{ steps.ghcr-meta.outputs.tags }} + labels: ${{ steps.ghcr-meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max + - name: Generate and push artifact attestation to GHCR + uses: actions/attest-build-provenance@v1 + with: + subject-name: ${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME}} + subject-digest: ${{ steps.ghcr-push.outputs.digest }} + push-to-registry: true + - name: Log in to the DockerHub container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ${{ env.DOCKERHUB_REGISTRY }} + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build and push image to DockerHub + uses: docker/build-push-action@v6 + id: dh-push with: context: . push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} + tags: ${{ steps.dh-meta.outputs.tags }} + labels: ${{ steps.dh-meta.outputs.labels }} cache-from: type=gha cache-to: type=gha,mode=max - - name: Generate artifact attestation + - name: Generate and push artifact attestation to DockerHub uses: actions/attest-build-provenance@v1 with: - subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} - subject-digest: ${{ steps.push.outputs.digest }} - push-to-registry: true \ No newline at end of file + subject-name: ${{ env.DOCKERHUB_REGISTRY }}/${{ env.IMAGE_NAME}} + subject-digest: ${{ steps.dh-push.outputs.digest }} + push-to-registry: true diff --git a/.gitignore b/.gitignore index 526624336..c87703b2b 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,10 @@ data-test/ tmp/ .eslintcache -out/ \ No newline at end of file +out/ + +images/app-icons/png/16x16.png +images/app-icons/png/32x32.png +images/app-icons/png/512x512.png +images/app-icons/png/1024x1024.png +images/app-icons/mac/*.png \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 01d9b230e..f2a732507 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -8,4 +8,7 @@ "i18n-ally.localesPaths": [ "./src/public/translations" ], + "[jsonc]": { + "editor.defaultFormatter": "vscode.json-language-features" + }, } diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 000000000..d5fb9133e --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,17 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "type": "npm", + "script": "errors", + "problemMatcher": "$tsc-watch", + "isBackground": true, + "presentation": { + "revealProblems": "never" + }, + "runOptions": { + "runOn": "folderOpen" + } + } + ] + } \ No newline at end of file diff --git a/README.md b/README.md index c3d80c4f9..c6782e48f 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [English](https://github.com/TriliumNext/Notes/blob/master/README.md) | [Chinese](https://github.com/TriliumNext/Notes/blob/master/README-ZH_CN.md) | [Russian](https://github.com/TriliumNext/Notes/blob/master/README.ru.md) | [Japanese](https://github.com/TriliumNext/Notes/blob/master/README.ja.md) | [Italian](https://github.com/TriliumNext/Notes/blob/master/README.it.md) -TriliumNext Notes is a hierarchical note taking application with focus on building large personal knowledge bases. +TriliumNext Notes is an open-source, cross-platform hierarchical note taking application with focus on building large personal knowledge bases. See [screenshots](https://triliumnext.github.io/Docs/Wiki/screenshot-tour) for quick overview: @@ -12,20 +12,15 @@ See [screenshots](https://triliumnext.github.io/Docs/Wiki/screenshot-tour) for q [The original Trilium project is in maintenance mode](https://github.com/zadam/trilium/issues/4620) -## 🗭 Discuss with us +## 💬 Discuss with us -Feel free to join our official discussions and community. We are focused on the development on Trilium, and would love to hear what features, suggestions, or issues you may have! +Feel free to join our official conversations. We would love to hear what features, suggestions, or issues you may have! - [Matrix](https://matrix.to/#/#triliumnext:matrix.org) (For synchronous discussions) + - The `General` Matrix room is also bridged to [XMPP](xmpp:discuss@trilium.thisgreat.party?join) - [Github Discussions](https://github.com/TriliumNext/Notes/discussions) (For Asynchronous discussions) - [Wiki](https://triliumnext.github.io/Docs/) (For common how-to questions and user guides) -The two rooms linked above are mirrored, so you can use either XMPP or Matrix, from any client you prefer, on pretty much any platform under the sun! - -### Unofficial Communities - -[Trilium Rocks](https://discord.gg/aqdX9mXX4r) - ## 🎁 Features * Notes can be arranged into arbitrarily deep tree. Single note can be placed into multiple places in the tree (see [cloning](https://triliumnext.github.io/Docs/Wiki/cloning-notes) @@ -48,28 +43,38 @@ The two rooms linked above are mirrored, so you can use either XMPP or Matrix, f * [Evernote](https://triliumnext.github.io/Docs/Wiki/evernote-import) and [Markdown import & export](https://triliumnext.github.io/Docs/Wiki/markdown) * [Web Clipper](https://triliumnext.github.io/Docs/Wiki/web-clipper) for easy saving of web content -✨ Check out the following third-party resources for more TriliumNext related goodies: +✨ Check out the following third-party resources/communities for more TriliumNext related goodies: - [awesome-trilium](https://github.com/Nriver/awesome-trilium) for 3rd party themes, scripts, plugins and more. - [TriliumRocks!](https://trilium.rocks/) for tutorials, guides, and much more. -## 🏗 Builds +## 🏗 Installation + +### Desktop + +To use TriliumNext on your desktop machine (Linux, MacOS, and Windows) you have a few options: + +* Download the binary release for your platform from the [latest release page](https://github.com/TriliumNext/Notes/releases/latest), unzip the package and run the ```trilium``` executable. +* Access TriliumNext via the web interface of a server installation (see below) + * Currently only the latest versions of Chrome & Firefox are supported (and tested). +* (Coming Soon) TriliumNext will also be provided as a Flatpak + +### Mobile -Trilium is provided as either desktop application (Linux and Windows) or web application hosted on your server (Linux). Mac OS desktop build is available, but it is [unsupported](https://triliumnext.github.io/Docs/Wiki/faq#mac-os-support). +To use TriliumNext on a mobile device: -* If you want to use TriliumNext on the desktop, download binary release for your platform from [latest release](https://github.com/TriliumNext/Notes/releases/latest), unzip the package and run ```trilium``` executable. -* If you want to install TriliumNext on your own server, follow [this page](https://triliumnext.github.io/Docs/Wiki/server-installation). - * Currently only recent versions of Chrome and Firefox are supported (tested) browsers. +* Use a mobile web browser to access the mobile interface of a server installation (see below) +* Use of a mobile app is not yet supported ([see here](https://github.com/TriliumNext/Notes/issues/72)) to track mobile improvements. -TriliumNext will also provided as a Flatpak: +### Server - +To install TriliumNext on your own server (including via Docker) follow [the server installation docs](https://triliumnext.github.io/Docs/Wiki/server-installation). ## 📝 Documentation [See wiki for complete list of documentation pages.](https://triliumnext.github.io/Docs) -You can also read [Patterns of personal knowledge base](https://triliumnext.github.io/Docs/Wiki/patterns-of-personal-knowledge) to get some inspiration on how you might use Trilium. +You can also read [Patterns of personal knowledge base](https://triliumnext.github.io/Docs/Wiki/patterns-of-personal-knowledge) to get some inspiration on how you might use TriliumNext. ## 💻 Contribute @@ -82,7 +87,7 @@ npm run start-server ## 👏 Shoutouts * [CKEditor 5](https://github.com/ckeditor/ckeditor5) - best WYSIWYG editor on the market, very interactive and listening team -* [FancyTree](https://github.com/mar10/fancytree) - very feature rich tree library without real competition. Trilium Notes would not be the same without it. +* [FancyTree](https://github.com/mar10/fancytree) - very feature rich tree library without real competition. TriliumNext Notes would not be the same without it. * [CodeMirror](https://github.com/codemirror/CodeMirror) - code editor with support for huge amount of languages * [jsPlumb](https://github.com/jsplumb/jsplumb) - visual connectivity library without competition. Used in [relation maps](https://triliumnext.github.io/Docs/Wiki/Relation-map) and [link maps](https://triliumnext.github.io/Docs/Wiki/Link-map) diff --git a/SECURITY.md b/SECURITY.md index 55ea001dc..0c7e17bd6 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -10,4 +10,4 @@ Description above is a general rule and may be altered on case by case basis. ## Reporting a Vulnerability -You can report low severity vulnerabilities as GitHub issues, more severe vulnerabilities should be reported to the email zadam.apps@gmail.com +You can report low severity vulnerabilities as GitHub issues, more severe vulnerabilities should be reported to the email [contact@eliandoran.me](mailto:contact@eliandoran.me) diff --git a/bin/better-sqlite3/linux-desktop-better_sqlite3.node b/bin/better-sqlite3/linux-desktop-better_sqlite3.node old mode 100644 new mode 100755 index 180186307..dc587cec5 Binary files a/bin/better-sqlite3/linux-desktop-better_sqlite3.node and b/bin/better-sqlite3/linux-desktop-better_sqlite3.node differ diff --git a/bin/better-sqlite3/linux-server-better_sqlite3.node b/bin/better-sqlite3/linux-server-better_sqlite3.node old mode 100644 new mode 100755 index ca173a3c6..00c00a96f Binary files a/bin/better-sqlite3/linux-server-better_sqlite3.node and b/bin/better-sqlite3/linux-server-better_sqlite3.node differ diff --git a/bin/better-sqlite3/mac-arm64-better_sqlite3.node b/bin/better-sqlite3/mac-arm64-better_sqlite3.node old mode 100644 new mode 100755 index 9709dcd23..3eadd64bc Binary files a/bin/better-sqlite3/mac-arm64-better_sqlite3.node and b/bin/better-sqlite3/mac-arm64-better_sqlite3.node differ diff --git a/bin/better-sqlite3/mac-x64-better_sqlite3.node b/bin/better-sqlite3/mac-x64-better_sqlite3.node old mode 100644 new mode 100755 index 70835a3f8..0bb7c6a56 Binary files a/bin/better-sqlite3/mac-x64-better_sqlite3.node and b/bin/better-sqlite3/mac-x64-better_sqlite3.node differ diff --git a/bin/better-sqlite3/update.sh b/bin/better-sqlite3/update.sh new file mode 100755 index 000000000..74dbeb01b --- /dev/null +++ b/bin/better-sqlite3/update.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash +ELECTRON_VERSION="electron-v125" +NODE_VERSION="node-v115" + +if ! command -v jq &> /dev/null; then + echo "Missing command: jq" + exit 1 +fi + +script_dir=$(realpath $(dirname $0)) +cd "$script_dir" +BETTER_SQLITE3_VERSION=$(jq -r '.dependencies.["better-sqlite3"]' ../../package.json | grep -oP "\d+\.\d+\.\d+") + +if [ -z $BETTER_SQLITE3_VERSION ]; then + echo "Unable to determine better-sqlite3 version." + exit 2 +fi + +echo "Version: $BETTER_SQLITE3_VERSION" + +function download() { + version="$1" + platform="$2" + dest_name="$3" + url=https://github.com/WiseLibs/better-sqlite3/releases/download/v${BETTER_SQLITE3_VERSION}/better-sqlite3-v${BETTER_SQLITE3_VERSION}-${version}-${platform}.tar.gz + temp_file="temp.tar.gz" + curl -L "$url" -o "$temp_file" + tar -xzvf "$temp_file" + mv build/Release/better_sqlite3.node "$dest_name-better_sqlite3.node" + rm -rf build + rm -f "$temp_file" +} + +download $NODE_VERSION "linux-x64" "linux-server" +download $ELECTRON_VERSION "linux-x64" "linux-desktop" +download $ELECTRON_VERSION "win32-x64" "win" +download $ELECTRON_VERSION "darwin-x64" "mac-x64" +download $ELECTRON_VERSION "darwin-arm64" "mac-arm64" \ No newline at end of file diff --git a/bin/better-sqlite3/win-better_sqlite3.node b/bin/better-sqlite3/win-better_sqlite3.node index b5ced20b5..5020e45eb 100644 Binary files a/bin/better-sqlite3/win-better_sqlite3.node and b/bin/better-sqlite3/win-better_sqlite3.node differ diff --git a/bin/build-debian.sh b/bin/build-debian.sh index d973d2f36..ecf88f359 100755 --- a/bin/build-debian.sh +++ b/bin/build-debian.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -e # Fail on any command error + if ! command -v dpkg-deb &> /dev/null; then echo "Missing command: dpkg-deb" exit 1 diff --git a/bin/build-docker.sh b/bin/build-docker.sh index 2b3794677..9d614eb2b 100755 --- a/bin/build-docker.sh +++ b/bin/build-docker.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -e # Fail on any command error + VERSION=`jq -r ".version" package.json` SERIES=${VERSION:0:4}-latest diff --git a/bin/build-linux-x64.sh b/bin/build-linux-x64.sh index 7b7b91a8a..8003c9d73 100755 --- a/bin/build-linux-x64.sh +++ b/bin/build-linux-x64.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -e # Fail on any command error + if ! command -v jq &> /dev/null; then echo "Missing command: jq" exit 1 @@ -24,8 +26,6 @@ SRC_DIR=./dist/trilium-linux-x64-src [ "$1" != "DONTCOPY" ] && ./bin/copy-trilium.sh "$SRC_DIR" -rm -r "$SRC_DIR"/src/public/app-dist/*.mobile.* - echo "Copying required linux-x64 binaries" cp -r bin/better-sqlite3/linux-desktop-better_sqlite3.node "$SRC_DIR"/node_modules/better-sqlite3/build/Release/better_sqlite3.node diff --git a/bin/build-mac-arm64.sh b/bin/build-mac-arm64.sh index 219435344..c1b4ff144 100755 --- a/bin/build-mac-arm64.sh +++ b/bin/build-mac-arm64.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -e # Fail on any command error + SRC_DIR=./dist/trilium-mac-arm64-src if [ "$1" != "DONTCOPY" ] @@ -11,8 +13,6 @@ echo "Copying required mac arm64 binaries" cp -r bin/better-sqlite3/mac-arm64-better_sqlite3.node $SRC_DIR/node_modules/better-sqlite3/build/Release/better_sqlite3.node -rm -r $SRC_DIR/src/public/app-dist/*.mobile.* - echo "Packaging mac arm64 electron build" ./node_modules/.bin/electron-packager $SRC_DIR --asar --out=dist --executable-name=trilium --platform=darwin --arch=arm64 --overwrite --icon=images/app-icons/mac/icon.icns @@ -34,5 +34,4 @@ VERSION=`jq -r ".version" package.json` cd dist -rm trilium-mac-arm64-${VERSION}.zip zip -r9 --symlinks trilium-mac-arm64-${VERSION}.zip trilium-mac-arm64 diff --git a/bin/build-mac-x64.sh b/bin/build-mac-x64.sh index ba05322ae..890cf6d3d 100755 --- a/bin/build-mac-x64.sh +++ b/bin/build-mac-x64.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -e # Fail on any command error + SRC_DIR=./dist/trilium-mac-x64-src if [ "$1" != "DONTCOPY" ] @@ -11,8 +13,6 @@ echo "Copying required mac x64 binaries" cp -r bin/better-sqlite3/mac-x64-better_sqlite3.node $SRC_DIR/node_modules/better-sqlite3/build/Release/better_sqlite3.node -rm -r $SRC_DIR/src/public/app-dist/*.mobile.* - echo "Packaging mac x64 electron build" ./node_modules/.bin/electron-packager $SRC_DIR --asar --out=dist --executable-name=trilium --platform=darwin --arch=x64 --overwrite --icon=images/app-icons/mac/icon.icns @@ -34,5 +34,4 @@ VERSION=`jq -r ".version" package.json` cd dist -rm trilium-mac-x64-${VERSION}.zip zip -r9 --symlinks trilium-mac-x64-${VERSION}.zip trilium-mac-x64 diff --git a/bin/build-server.sh b/bin/build-server.sh index 94a3650ef..33a93bf5a 100755 --- a/bin/build-server.sh +++ b/bin/build-server.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -e # Fail on any command error + PKG_DIR=dist/trilium-linux-x64-server NODE_VERSION=20.15.1 @@ -20,7 +22,6 @@ rm -r $PKG_DIR/node/lib/node_modules/npm rm -r $PKG_DIR/node/include/node rm -r $PKG_DIR/node_modules/electron* -rm -r $PKG_DIR/webpack* rm -r $PKG_DIR/electron.js cp -r bin/better-sqlite3/linux-server-better_sqlite3.node $PKG_DIR/node_modules/better-sqlite3/build/Release/better_sqlite3.node diff --git a/bin/build-win-x64.sh b/bin/build-win-x64.sh index f71296cd5..1d5780d2a 100755 --- a/bin/build-win-x64.sh +++ b/bin/build-win-x64.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -e # Fail on any command error + if ! command -v wine &> /dev/null; then echo "Missing command: wine" exit 1 @@ -16,8 +18,6 @@ echo "Copying required windows binaries" cp -r bin/better-sqlite3/win-better_sqlite3.node $SRC_DIR/node_modules/better-sqlite3/build/Release/better_sqlite3.node -rm -r $SRC_DIR/src/public/app-dist/*.mobile.* - echo "Packaging windows x64 electron build" ./node_modules/.bin/electron-packager $SRC_DIR --asar --out=dist --executable-name=trilium --platform=win32 --arch=x64 --overwrite --icon=images/app-icons/win/icon.ico diff --git a/bin/build.sh b/bin/build.sh index 513bd1129..7fb41cfcb 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -e # Fail on any command error + if ! command -v jq &> /dev/null; then echo "Missing command: jq" exit 1 @@ -40,7 +42,6 @@ cp -r $SRC_DIR ./dist/trilium-windows-x64-src cp -r $SRC_DIR ./dist/trilium-mac-x64-src cp -r $SRC_DIR ./dist/trilium-mac-arm64-src -set -e bin/build-win-x64.sh DONTCOPY bin/build-mac-x64.sh DONTCOPY diff --git a/bin/copy-dist.ts b/bin/copy-dist.ts index 3c80598c3..820c6c864 100644 --- a/bin/copy-dist.ts +++ b/bin/copy-dist.ts @@ -5,11 +5,19 @@ const DEST_DIR = "./dist"; const DEST_DIR_SRC = path.join(DEST_DIR, "src"); const DEST_DIR_NODE_MODULES = path.join(DEST_DIR, "node_modules"); +const VERBOSE = process.env.VERBOSE; + +function log(...args) { + if (VERBOSE) { + console.log(args); + } +} + async function copyNodeModuleFileOrFolder(source: string) { const adjustedSource = source.substring(13); const destination = path.join(DEST_DIR_NODE_MODULES, adjustedSource); - console.log(`Copying ${source} to ${destination}`); + log(`Copying ${source} to ${destination}`); await fs.ensureDir(path.dirname(destination)); await fs.copy(source, destination); } @@ -17,25 +25,25 @@ async function copyNodeModuleFileOrFolder(source: string) { const copy = async () => { for (const srcFile of fs.readdirSync("build")) { const destFile = path.join(DEST_DIR, path.basename(srcFile)); - console.log(`Copying source ${srcFile} -> ${destFile}.`); + log(`Copying source ${srcFile} -> ${destFile}.`); fs.copySync(path.join("build", srcFile), destFile, { recursive: true }); } const filesToCopy = ["config-sample.ini"]; for (const file of filesToCopy) { - console.log(`Copying ${file}`); + log(`Copying ${file}`); await fs.copy(file, path.join(DEST_DIR, file)); } const dirsToCopy = ["images", "libraries", "db"]; for (const dir of dirsToCopy) { - console.log(`Copying ${dir}`); + log(`Copying ${dir}`); await fs.copy(dir, path.join(DEST_DIR, dir)); } const srcDirsToCopy = ["./src/public", "./src/views", "./build"]; for (const dir of srcDirsToCopy) { - console.log(`Copying ${dir}`); + log(`Copying ${dir}`); await fs.copy(dir, path.join(DEST_DIR_SRC, path.basename(dir))); } @@ -66,6 +74,8 @@ const copy = async () => { "node_modules/print-this/", "node_modules/split.js/dist/", "node_modules/panzoom/dist/", + "node_modules/i18next/", + "node_modules/i18next-http-backend/" ]; for (const folder of nodeModulesFolder) { diff --git a/bin/copy-trilium.sh b/bin/copy-trilium.sh index c8b38e25c..9f63aaaa8 100755 --- a/bin/copy-trilium.sh +++ b/bin/copy-trilium.sh @@ -1,5 +1,6 @@ #!/usr/bin/env bash +set -e # Fail on any command error shopt -s globstar if [[ $# -eq 0 ]] ; then diff --git a/bin/create-icons.sh b/bin/create-icons.sh new file mode 100755 index 000000000..90015d9d0 --- /dev/null +++ b/bin/create-icons.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash + +if ! command -v magick &> /dev/null; then + echo "This tool requires ImageMagick to be installed in order to create the icons." + exit 1 +fi + +if ! command -v inkscape &> /dev/null; then + echo "This tool requires Inkscape to be render sharper SVGs than ImageMagick." + exit 1 +fi + +if ! command -v icnsutil &> /dev/null; then + echo "This tool requires icnsutil to be installed in order to generate macOS icons." + exit 1 +fi + +script_dir=$(realpath $(dirname $0)) +cd "${script_dir}/../images/app-icons" +inkscape -w 180 -h 180 "../icon-color.svg" -o "./ios/apple-touch-icon.png" + +# Build PNGs +inkscape -w 128 -h 128 "../icon-color.svg" -o "./png/128x128.png" +inkscape -w 256 -h 256 "../icon-color.svg" -o "./png/256x256.png" +inkscape -w 256 -h 256 "../icon-purple.svg" -o "./png/256x256-dev.png" + +# Build Mac .icns +declare -a sizes=("16" "32" "512" "1024") +for size in "${sizes[@]}"; do + inkscape -w $size -h $size "../icon-color.svg" -o "./png/${size}x${size}.png" +done + +mkdir -p fakeapp.app +npx iconsur set fakeapp.app -l -i "png/1024x1024.png" -o "mac/1024x1024.png" -s 0.8 +declare -a sizes=("16x16" "32x32" "128x128" "512x512") +for size in "${sizes[@]}"; do + magick "mac/1024x1024.png" -resize "${size}" "mac/${size}.png" +done +icnsutil compose -f "mac/icon.icns" ./mac/*.png + +# Build Windows icon +magick -background none "../icon-color.svg" -define icon:auto-resize=16,32,48,64,128,256 "./win/icon.ico" + +# Build Squirrel splash image +magick "./png/256x256.png" -background "#ffffff" -gravity center -extent 640x480 "./win/setup-banner.gif" \ No newline at end of file diff --git a/bin/docs/.env.example b/bin/docs/.env.example index 51661dcd3..03006fb86 100644 --- a/bin/docs/.env.example +++ b/bin/docs/.env.example @@ -1 +1,3 @@ -SHARE_URL=https://notes.example.com/share/4yYHqKbLovVY \ No newline at end of file +SHARE_PROTOCOL=http +SHARE_HOST=notes.johnsmith.me +ROOT_NOTE_ID=4yYHqKbLovVX \ No newline at end of file diff --git a/bin/docs/assets/v0.63.6/app-dist/share.js b/bin/docs/assets/v0.63.6/app-dist/share.js new file mode 100644 index 000000000..03ad92515 --- /dev/null +++ b/bin/docs/assets/v0.63.6/app-dist/share.js @@ -0,0 +1,23 @@ +/** + * Fetch note with given ID from backend + * + * @param noteId of the given note to be fetched. If false, fetches current note. + */ +async function fetchNote(noteId = null) { + if (!noteId) { + noteId = document.body.getAttribute("data-note-id"); + } + + const resp = await fetch(`api/notes/${noteId}`); + + return await resp.json(); +} + +document.addEventListener('DOMContentLoaded', () => { + const toggleMenuButton = document.getElementById('toggleMenuButton'); + const layout = document.getElementById('layout'); + + if (toggleMenuButton && layout) { + toggleMenuButton.addEventListener('click', () => layout.classList.toggle('showMenu')); + } +}, false); diff --git a/bin/docs/assets/v0.63.6/libraries/ckeditor/ckeditor-content.css b/bin/docs/assets/v0.63.6/libraries/ckeditor/ckeditor-content.css new file mode 100644 index 000000000..47274e5f4 --- /dev/null +++ b/bin/docs/assets/v0.63.6/libraries/ckeditor/ckeditor-content.css @@ -0,0 +1,551 @@ +/* !!!!!! TRILIUM CUSTOM CHANGES !!!!!! */ + +.printed-content .ck-widget__selection-handle, .printed-content .ck-widget__type-around { /* gets rid of triangles: https://github.com/zadam/trilium/issues/1129 */ + display: none; +} + +/* + * CKEditor 5 (v41.0.0) content styles. + * Generated on Fri, 26 Jan 2024 10:23:49 GMT. + * For more information, check out https://ckeditor.com/docs/ckeditor5/latest/installation/advanced/content-styles.html + */ + +:root { + --ck-color-image-caption-background: hsl(0, 0%, 97%); + --ck-color-image-caption-text: hsl(0, 0%, 20%); + --ck-color-mention-background: hsla(341, 100%, 30%, 0.1); + --ck-color-mention-text: hsl(341, 100%, 30%); + --ck-color-selector-caption-background: hsl(0, 0%, 97%); + --ck-color-selector-caption-text: hsl(0, 0%, 20%); + --ck-highlight-marker-blue: hsl(201, 97%, 72%); + --ck-highlight-marker-green: hsl(120, 93%, 68%); + --ck-highlight-marker-pink: hsl(345, 96%, 73%); + --ck-highlight-marker-yellow: hsl(60, 97%, 73%); + --ck-highlight-pen-green: hsl(112, 100%, 27%); + --ck-highlight-pen-red: hsl(0, 85%, 49%); + --ck-image-style-spacing: 1.5em; + --ck-inline-image-style-spacing: calc(var(--ck-image-style-spacing) / 2); + --ck-todo-list-checkmark-size: 16px; +} + +/* @ckeditor/ckeditor5-table/theme/tablecolumnresize.css */ +.ck-content .table .ck-table-resized { + table-layout: fixed; +} +/* @ckeditor/ckeditor5-table/theme/tablecolumnresize.css */ +.ck-content .table table { + overflow: hidden; +} +/* @ckeditor/ckeditor5-table/theme/tablecolumnresize.css */ +.ck-content .table td, +.ck-content .table th { + overflow-wrap: break-word; + position: relative; +} +/* @ckeditor/ckeditor5-table/theme/table.css */ +.ck-content .table { + margin: 0.9em auto; + display: table; +} +/* @ckeditor/ckeditor5-table/theme/table.css */ +.ck-content .table table { + border-collapse: collapse; + border-spacing: 0; + width: 100%; + height: 100%; + border: 1px double hsl(0, 0%, 70%); +} +/* @ckeditor/ckeditor5-table/theme/table.css */ +.ck-content .table table td, +.ck-content .table table th { + min-width: 2em; + padding: .4em; + border: 1px solid hsl(0, 0%, 75%); +} +/* @ckeditor/ckeditor5-table/theme/table.css */ +.ck-content .table table th { + font-weight: bold; + background: hsla(0, 0%, 0%, 5%); +} +/* @ckeditor/ckeditor5-table/theme/table.css */ +.ck-content[dir="rtl"] .table th { + text-align: right; +} +/* @ckeditor/ckeditor5-table/theme/table.css */ +.ck-content[dir="ltr"] .table th { + text-align: left; +} +/* @ckeditor/ckeditor5-table/theme/tablecaption.css */ +.ck-content .table > figcaption { + display: table-caption; + caption-side: top; + word-break: break-word; + text-align: center; + color: var(--ck-color-selector-caption-text); + background-color: var(--ck-color-selector-caption-background); + padding: .6em; + font-size: .75em; + outline-offset: -1px; +} +/* @ckeditor/ckeditor5-page-break/theme/pagebreak.css */ +.ck-content .page-break { + position: relative; + clear: both; + padding: 5px 0; + display: flex; + align-items: center; + justify-content: center; +} +/* @ckeditor/ckeditor5-page-break/theme/pagebreak.css */ +.ck-content .page-break::after { + content: ''; + position: absolute; + border-bottom: 2px dashed hsl(0, 0%, 77%); + width: 100%; +} +/* @ckeditor/ckeditor5-page-break/theme/pagebreak.css */ +.ck-content .page-break__label { + position: relative; + z-index: 1; + padding: .3em .6em; + display: block; + text-transform: uppercase; + border: 1px solid hsl(0, 0%, 77%); + border-radius: 2px; + font-family: Helvetica, Arial, Tahoma, Verdana, Sans-Serif; + font-size: 0.75em; + font-weight: bold; + color: hsl(0, 0%, 20%); + background: hsl(0, 0%, 100%); + box-shadow: 2px 2px 1px hsla(0, 0%, 0%, 0.15); + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +/* @ckeditor/ckeditor5-media-embed/theme/mediaembed.css */ +.ck-content .media { + clear: both; + margin: 0.9em 0; + display: block; + min-width: 15em; +} +/* @ckeditor/ckeditor5-list/theme/todolist.css */ +.ck-content .todo-list { + list-style: none; +} +/* @ckeditor/ckeditor5-list/theme/todolist.css */ +.ck-content .todo-list li { + position: relative; + margin-bottom: 5px; +} +/* @ckeditor/ckeditor5-list/theme/todolist.css */ +.ck-content .todo-list li .todo-list { + margin-top: 5px; +} +/* @ckeditor/ckeditor5-list/theme/todolist.css */ +.ck-content .todo-list .todo-list__label > input { + -webkit-appearance: none; + display: inline-block; + position: relative; + width: var(--ck-todo-list-checkmark-size); + height: var(--ck-todo-list-checkmark-size); + vertical-align: middle; + border: 0; + left: -25px; + margin-right: -15px; + right: 0; + margin-left: 0; +} +/* @ckeditor/ckeditor5-list/theme/todolist.css */ +.ck-content[dir=rtl] .todo-list .todo-list__label > input { + left: 0; + margin-right: 0; + right: -25px; + margin-left: -15px; +} +/* @ckeditor/ckeditor5-list/theme/todolist.css */ +.ck-content .todo-list .todo-list__label > input::before { + display: block; + position: absolute; + box-sizing: border-box; + content: ''; + width: 100%; + height: 100%; + border: 1px solid hsl(0, 0%, 20%); + border-radius: 2px; + transition: 250ms ease-in-out box-shadow; +} +/* @ckeditor/ckeditor5-list/theme/todolist.css */ +.ck-content .todo-list .todo-list__label > input::after { + display: block; + position: absolute; + box-sizing: content-box; + pointer-events: none; + content: ''; + left: calc( var(--ck-todo-list-checkmark-size) / 3 ); + top: calc( var(--ck-todo-list-checkmark-size) / 5.3 ); + width: calc( var(--ck-todo-list-checkmark-size) / 5.3 ); + height: calc( var(--ck-todo-list-checkmark-size) / 2.6 ); + border-style: solid; + border-color: transparent; + border-width: 0 calc( var(--ck-todo-list-checkmark-size) / 8 ) calc( var(--ck-todo-list-checkmark-size) / 8 ) 0; + transform: rotate(45deg); +} +/* @ckeditor/ckeditor5-list/theme/todolist.css */ +.ck-content .todo-list .todo-list__label > input[checked]::before { + background: hsl(126, 64%, 41%); + border-color: hsl(126, 64%, 41%); +} +/* @ckeditor/ckeditor5-list/theme/todolist.css */ +.ck-content .todo-list .todo-list__label > input[checked]::after { + border-color: hsl(0, 0%, 100%); +} +/* @ckeditor/ckeditor5-list/theme/todolist.css */ +.ck-content .todo-list .todo-list__label .todo-list__label__description { + vertical-align: middle; +} +/* @ckeditor/ckeditor5-list/theme/todolist.css */ +.ck-content .todo-list .todo-list__label.todo-list__label_without-description input[type=checkbox] { + position: absolute; +} +/* @ckeditor/ckeditor5-list/theme/todolist.css */ +.ck-editor__editable.ck-content .todo-list .todo-list__label > input, +.ck-editor__editable.ck-content .todo-list .todo-list__label > span[contenteditable=false] > input { + cursor: pointer; +} +/* @ckeditor/ckeditor5-list/theme/todolist.css */ +.ck-editor__editable.ck-content .todo-list .todo-list__label > input:hover::before, .ck-editor__editable.ck-content .todo-list .todo-list__label > span[contenteditable=false] > input:hover::before { + box-shadow: 0 0 0 5px hsla(0, 0%, 0%, 0.1); +} +/* @ckeditor/ckeditor5-list/theme/todolist.css */ +.ck-editor__editable.ck-content .todo-list .todo-list__label > span[contenteditable=false] > input { + -webkit-appearance: none; + display: inline-block; + position: relative; + width: var(--ck-todo-list-checkmark-size); + height: var(--ck-todo-list-checkmark-size); + vertical-align: middle; + border: 0; + left: -25px; + margin-right: -15px; + right: 0; + margin-left: 0; +} +/* @ckeditor/ckeditor5-list/theme/todolist.css */ +.ck-editor__editable.ck-content[dir=rtl] .todo-list .todo-list__label > span[contenteditable=false] > input { + left: 0; + margin-right: 0; + right: -25px; + margin-left: -15px; +} +/* @ckeditor/ckeditor5-list/theme/todolist.css */ +.ck-editor__editable.ck-content .todo-list .todo-list__label > span[contenteditable=false] > input::before { + display: block; + position: absolute; + box-sizing: border-box; + content: ''; + width: 100%; + height: 100%; + border: 1px solid hsl(0, 0%, 20%); + border-radius: 2px; + transition: 250ms ease-in-out box-shadow; +} +/* @ckeditor/ckeditor5-list/theme/todolist.css */ +.ck-editor__editable.ck-content .todo-list .todo-list__label > span[contenteditable=false] > input::after { + display: block; + position: absolute; + box-sizing: content-box; + pointer-events: none; + content: ''; + left: calc( var(--ck-todo-list-checkmark-size) / 3 ); + top: calc( var(--ck-todo-list-checkmark-size) / 5.3 ); + width: calc( var(--ck-todo-list-checkmark-size) / 5.3 ); + height: calc( var(--ck-todo-list-checkmark-size) / 2.6 ); + border-style: solid; + border-color: transparent; + border-width: 0 calc( var(--ck-todo-list-checkmark-size) / 8 ) calc( var(--ck-todo-list-checkmark-size) / 8 ) 0; + transform: rotate(45deg); +} +/* @ckeditor/ckeditor5-list/theme/todolist.css */ +.ck-editor__editable.ck-content .todo-list .todo-list__label > span[contenteditable=false] > input[checked]::before { + background: hsl(126, 64%, 41%); + border-color: hsl(126, 64%, 41%); +} +/* @ckeditor/ckeditor5-list/theme/todolist.css */ +.ck-editor__editable.ck-content .todo-list .todo-list__label > span[contenteditable=false] > input[checked]::after { + border-color: hsl(0, 0%, 100%); +} +/* @ckeditor/ckeditor5-list/theme/todolist.css */ +.ck-editor__editable.ck-content .todo-list .todo-list__label.todo-list__label_without-description input[type=checkbox] { + position: absolute; +} +/* @ckeditor/ckeditor5-list/theme/list.css */ +.ck-content ol { + list-style-type: decimal; +} +/* @ckeditor/ckeditor5-list/theme/list.css */ +.ck-content ol ol { + list-style-type: lower-latin; +} +/* @ckeditor/ckeditor5-list/theme/list.css */ +.ck-content ol ol ol { + list-style-type: lower-roman; +} +/* @ckeditor/ckeditor5-list/theme/list.css */ +.ck-content ol ol ol ol { + list-style-type: upper-latin; +} +/* @ckeditor/ckeditor5-list/theme/list.css */ +.ck-content ol ol ol ol ol { + list-style-type: upper-roman; +} +/* @ckeditor/ckeditor5-list/theme/list.css */ +.ck-content ul { + list-style-type: disc; +} +/* @ckeditor/ckeditor5-list/theme/list.css */ +.ck-content ul ul { + list-style-type: circle; +} +/* @ckeditor/ckeditor5-list/theme/list.css */ +.ck-content ul ul ul { + list-style-type: square; +} +/* @ckeditor/ckeditor5-list/theme/list.css */ +.ck-content ul ul ul ul { + list-style-type: square; +} +/* @ckeditor/ckeditor5-image/theme/image.css */ +.ck-content .image { + display: table; + clear: both; + text-align: center; + margin: 0.9em auto; + min-width: 50px; +} +/* @ckeditor/ckeditor5-image/theme/image.css */ +.ck-content .image img { + display: block; + margin: 0 auto; + max-width: 100%; + min-width: 100%; + height: auto; +} +/* @ckeditor/ckeditor5-image/theme/image.css */ +.ck-content .image-inline { + /* + * Normally, the .image-inline would have "display: inline-block" and "img { width: 100% }" (to follow the wrapper while resizing).; + * Unfortunately, together with "srcset", it gets automatically stretched up to the width of the editing root. + * This strange behavior does not happen with inline-flex. + */ + display: inline-flex; + max-width: 100%; + align-items: flex-start; +} +/* @ckeditor/ckeditor5-image/theme/image.css */ +.ck-content .image-inline picture { + display: flex; +} +/* @ckeditor/ckeditor5-image/theme/image.css */ +.ck-content .image-inline picture, +.ck-content .image-inline img { + flex-grow: 1; + flex-shrink: 1; + max-width: 100%; +} +/* @ckeditor/ckeditor5-image/theme/imageresize.css */ +.ck-content img.image_resized { + height: auto; +} +/* @ckeditor/ckeditor5-image/theme/imageresize.css */ +.ck-content .image.image_resized { + max-width: 100%; + display: block; + box-sizing: border-box; +} +/* @ckeditor/ckeditor5-image/theme/imageresize.css */ +.ck-content .image.image_resized img { + width: 100%; +} +/* @ckeditor/ckeditor5-image/theme/imageresize.css */ +.ck-content .image.image_resized > figcaption { + display: block; +} +/* @ckeditor/ckeditor5-image/theme/imagecaption.css */ +.ck-content .image > figcaption { + display: table-caption; + caption-side: bottom; + word-break: break-word; + color: var(--ck-color-image-caption-text); + background-color: var(--ck-color-image-caption-background); + padding: .6em; + font-size: .75em; + outline-offset: -1px; +} +/* @ckeditor/ckeditor5-image/theme/imagestyle.css */ +.ck-content .image-style-block-align-left, +.ck-content .image-style-block-align-right { + max-width: calc(100% - var(--ck-image-style-spacing)); +} +/* @ckeditor/ckeditor5-image/theme/imagestyle.css */ +.ck-content .image-style-align-left, +.ck-content .image-style-align-right { + clear: none; +} +/* @ckeditor/ckeditor5-image/theme/imagestyle.css */ +.ck-content .image-style-side { + float: right; + margin-left: var(--ck-image-style-spacing); + max-width: 50%; +} +/* @ckeditor/ckeditor5-image/theme/imagestyle.css */ +.ck-content .image-style-align-left { + float: left; + margin-right: var(--ck-image-style-spacing); +} +/* @ckeditor/ckeditor5-image/theme/imagestyle.css */ +.ck-content .image-style-align-center { + margin-left: auto; + margin-right: auto; +} +/* @ckeditor/ckeditor5-image/theme/imagestyle.css */ +.ck-content .image-style-align-right { + float: right; + margin-left: var(--ck-image-style-spacing); +} +/* @ckeditor/ckeditor5-image/theme/imagestyle.css */ +.ck-content .image-style-block-align-right { + margin-right: 0; + margin-left: auto; +} +/* @ckeditor/ckeditor5-image/theme/imagestyle.css */ +.ck-content .image-style-block-align-left { + margin-left: 0; + margin-right: auto; +} +/* @ckeditor/ckeditor5-image/theme/imagestyle.css */ +.ck-content p + .image-style-align-left, +.ck-content p + .image-style-align-right, +.ck-content p + .image-style-side { + margin-top: 0; +} +/* @ckeditor/ckeditor5-image/theme/imagestyle.css */ +.ck-content .image-inline.image-style-align-left, +.ck-content .image-inline.image-style-align-right { + margin-top: var(--ck-inline-image-style-spacing); + margin-bottom: var(--ck-inline-image-style-spacing); +} +/* @ckeditor/ckeditor5-image/theme/imagestyle.css */ +.ck-content .image-inline.image-style-align-left { + margin-right: var(--ck-inline-image-style-spacing); +} +/* @ckeditor/ckeditor5-image/theme/imagestyle.css */ +.ck-content .image-inline.image-style-align-right { + margin-left: var(--ck-inline-image-style-spacing); +} +/* @ckeditor/ckeditor5-highlight/theme/highlight.css */ +.ck-content .marker-yellow { + background-color: var(--ck-highlight-marker-yellow); +} +/* @ckeditor/ckeditor5-highlight/theme/highlight.css */ +.ck-content .marker-green { + background-color: var(--ck-highlight-marker-green); +} +/* @ckeditor/ckeditor5-highlight/theme/highlight.css */ +.ck-content .marker-pink { + background-color: var(--ck-highlight-marker-pink); +} +/* @ckeditor/ckeditor5-highlight/theme/highlight.css */ +.ck-content .marker-blue { + background-color: var(--ck-highlight-marker-blue); +} +/* @ckeditor/ckeditor5-highlight/theme/highlight.css */ +.ck-content .pen-red { + color: var(--ck-highlight-pen-red); + background-color: transparent; +} +/* @ckeditor/ckeditor5-highlight/theme/highlight.css */ +.ck-content .pen-green { + color: var(--ck-highlight-pen-green); + background-color: transparent; +} +/* @ckeditor/ckeditor5-block-quote/theme/blockquote.css */ +.ck-content blockquote { + overflow: hidden; + padding-right: 1.5em; + padding-left: 1.5em; + margin-left: 0; + margin-right: 0; + font-style: italic; + border-left: solid 5px hsl(0, 0%, 80%); +} +/* @ckeditor/ckeditor5-block-quote/theme/blockquote.css */ +.ck-content[dir="rtl"] blockquote { + border-left: 0; + border-right: solid 5px hsl(0, 0%, 80%); +} +/* @ckeditor/ckeditor5-basic-styles/theme/code.css */ +.ck-content code { + background-color: hsla(0, 0%, 78%, 0.3); + padding: .15em; + border-radius: 2px; +} +/* @ckeditor/ckeditor5-font/theme/fontsize.css */ +.ck-content .text-tiny { + font-size: .7em; +} +/* @ckeditor/ckeditor5-font/theme/fontsize.css */ +.ck-content .text-small { + font-size: .85em; +} +/* @ckeditor/ckeditor5-font/theme/fontsize.css */ +.ck-content .text-big { + font-size: 1.4em; +} +/* @ckeditor/ckeditor5-font/theme/fontsize.css */ +.ck-content .text-huge { + font-size: 1.8em; +} +/* @ckeditor/ckeditor5-mention/theme/mention.css */ +.ck-content .mention { + background: var(--ck-color-mention-background); + color: var(--ck-color-mention-text); +} +/* @ckeditor/ckeditor5-horizontal-line/theme/horizontalline.css */ +.ck-content hr { + margin: 15px 0; + height: 4px; + background: hsl(0, 0%, 87%); + border: 0; +} +/* @ckeditor/ckeditor5-code-block/theme/codeblock.css */ +.ck-content pre { + padding: 1em; + color: hsl(0, 0%, 20.8%); + background: hsla(0, 0%, 78%, 0.3); + border: 1px solid hsl(0, 0%, 77%); + border-radius: 2px; + text-align: left; + direction: ltr; + tab-size: 4; + white-space: pre-wrap; + font-style: normal; + min-width: 200px; +} +/* @ckeditor/ckeditor5-code-block/theme/codeblock.css */ +.ck-content pre code { + background: unset; + padding: 0; + border-radius: 0; +} +@media print { + /* @ckeditor/ckeditor5-page-break/theme/pagebreak.css */ + .ck-content .page-break { + padding: 0; + } + /* @ckeditor/ckeditor5-page-break/theme/pagebreak.css */ + .ck-content .page-break::after { + display: none; + } +} diff --git a/bin/docs/assets/v0.63.6/libraries/normalize.min.css b/bin/docs/assets/v0.63.6/libraries/normalize.min.css new file mode 100644 index 000000000..87aa24dc5 --- /dev/null +++ b/bin/docs/assets/v0.63.6/libraries/normalize.min.css @@ -0,0 +1,2 @@ +/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none} +/*# sourceMappingURL=normalize.min.css.map */ \ No newline at end of file diff --git a/bin/docs/assets/v0.63.6/stylesheets/share.css b/bin/docs/assets/v0.63.6/stylesheets/share.css new file mode 100644 index 000000000..718f8594c --- /dev/null +++ b/bin/docs/assets/v0.63.6/stylesheets/share.css @@ -0,0 +1,165 @@ +body { + font-family: 'Lucida Grande', 'Lucida Sans Unicode', arial, sans-serif; + line-height: 1.5; +} + +#layout { + max-width: 1200px; + margin: 0 auto; + display: flex; + flex-direction: row-reverse; +} + +#menu { + padding: 25px; + flex-basis: 0; + flex-grow: 1; + overflow: auto; +} + +#menu p { + margin: 0; +} + +#menu > p { + font-weight: bold; + font-size: 110%; +} + +#menu ul { + padding-left: 20px; +} + +#main { + flex-basis: 0; + flex-grow: 3; + overflow: auto; + padding: 10px 20px 20px 20px; +} + +#parentLink { + float: right; + margin-top: 20px; +} + +#title { + margin: 0; + padding-top: 10px; +} + +img { + max-width: 100%; +} + +pre { + white-space: pre-wrap; + word-wrap: anywhere; +} + +iframe.pdf-view { + width: 100%; + height: 800px; +} + +#toggleMenuButton { + display: none; + position: fixed; + top: 8px; + left: 5px; + width: 1.4em; + border-radius: 5px; + border: 1px solid #aaa; + font-size: 2rem; + z-index: 10; + height: auto; + color: black; + cursor: pointer; +} + +#childLinks.grid ul { + list-style-type: none; + display: flex; + flex-wrap: wrap; + padding: 0; +} + +#childLinks.grid ul li { + width: 180px; + height: 140px; + padding: 10px; +} + +#childLinks.grid ul li a { + display: flex; + flex-direction: column; + height: 100%; + width: 100%; + border: 1px solid #ddd; + border-radius: 5px; + justify-content: center; + align-content: center; + text-align: center; + font-size: large; +} + +#childLinks.grid ul li a:hover { + background: #eee; +} + +#childLinks.list ul { + list-style-type: none; + display: inline-flex; + flex-wrap: wrap; + padding: 0; + margin-top: 5px; +} + +#childLinks.list ul li { + margin-right: 20px; +} + +#noteClippedFrom { + padding: 10px 0 10px 0; + margin: 20px 0 20px 0; + color: #666; + border: 1px solid #ddd; + border-left: 0; + border-right: 0; +} + +#toggleMenuButton::after { + position: relative; + top: -2px; + left: 1px; +} + +@media (max-width: 48em) { + #layout.showMenu #menu { + display: block; + margin-top: 40px; + } + + #toggleMenuButton { + display: block; + } + + #layout.showMenu #main { + display: none; + } + + #title { + padding-left: 60px; + } + + #layout.showMenu #toggleMenuButton::after { + content: "«"; + } + + #toggleMenuButton::after { + content: "»"; + } + + #menu { + display: none; + } +} diff --git a/bin/docs/prepare.sh b/bin/docs/prepare.sh index 84ef77f6c..35e761b6d 100755 --- a/bin/docs/prepare.sh +++ b/bin/docs/prepare.sh @@ -1,21 +1,30 @@ #!/usr/bin/env bash -if [ ! -f .env ]; then +script_dir=$(realpath $(dirname $0)) + +cd "$script_dir" + +env_file="$script_dir/.env" + +if [ ! -f "$env_file" ]; then echo "Missing .env file, cannot proceed." exit 1 fi -script_dir=$(realpath $(dirname $0)) -output_dir="$script_dir/../docs" +output_dir="$script_dir/../../docs" mkdir -p "$output_dir" rm -f "$output_dir"/* rm -rf "$output_dir"/{assets,share} -source ./.env +source "$env_file" # Download everything in output/notes.example.com/share/... share_url="$SHARE_PROTOCOL://$SHARE_HOST/share/$ROOT_NOTE_ID" wget -rpEk -e robots=off "$share_url" -P "$output_dir" +if [ $? -ne 0 ]; then + echo -e \\nDownloading failed, make sure you are using the real wget package and not the busybox one. + exit 1 +fi # Get rid of the domain in the output folder mv "$output_dir/$SHARE_HOST"/* "$output_dir/" @@ -30,5 +39,5 @@ sed -i "s/{{ROOT_NOTE_ID}}/$ROOT_NOTE_ID/g" "$index_dest_path" sed -i "s/ + + + + + + + + + + + + + + + + + + + + + + Branch prefixes + + +
+
+ + + + +

Branch prefixes

+ + + + + + +

This note has no content.

+ +
+ + + + + + +
+ + diff --git a/docs/1pOWnHdGAuWR.html b/docs/1pOWnHdGAuWR.html new file mode 100644 index 000000000..43efb41f2 --- /dev/null +++ b/docs/1pOWnHdGAuWR.html @@ -0,0 +1,866 @@ + + + + + + + + + + + + + + + + + + + + + + + Widgets + + +
+
+ + + + +

Widgets

+ + + + +
+

To create a basic widget, simply create a code note with type “JS frontend”. Add the #widget label in order for it to be loaded at startup.

const template = `<div id="my-widget"><button>Click Me!</button></div>`;
+
+class MyWidget extends api.BasicWidget {
+    get position() { return 1; }
+    get parentWidget() { return "left-pane" }
+    
+    doRender() {
+        this.$widget = $(template);
+        return this.$widget;
+    }
+}
+
+module.exports = new MyWidget();

parentWidget() can be given the following values:

  • left-pane - This renders the widget on the left side of the screen where the note tree lives.
  • center-pane - This renders the widget in the center of the layout in the same location that notes and splits appear.
  • note-detail-pane - This renders the widget with the note in the center pane. This means it can appear multiple times with splits.
  • right-pane - This renders the widget to the right of any opened notes.

Reference:

+
+ + + + + +
+ + + + + + +
+ + diff --git a/docs/3eTu21fjtZkj.html b/docs/3eTu21fjtZkj.html new file mode 100644 index 000000000..b71857435 --- /dev/null +++ b/docs/3eTu21fjtZkj.html @@ -0,0 +1,842 @@ + + + + + + + + + + + + + + + + + + + + + + + Scripting + + +
+
+ + + + +

Scripting

+ + + + + + + + +
+ + + + + + +
+ + diff --git a/docs/3jc1nUXyteo0.html b/docs/3jc1nUXyteo0.html new file mode 100644 index 000000000..39ee0ed82 --- /dev/null +++ b/docs/3jc1nUXyteo0.html @@ -0,0 +1,833 @@ + + + + + + + + + + + + + + + + + + + + + + + Themes + + +
+
+ + + + +

Themes

+ + + + +
+

Server-side

  • There are two themes embedded in the application:
    • light, located in src\public\stylesheets\theme-light.css
    • dark, located in src\public\stylesheets\theme-dark.css
  • The default theme is set only once, when the database is created and is managed by options_init#initNotSyncedOptions.
    • On Electron, the choice between light and dark is done based on the OS preference.
    • Otherwise, the theme is always dark.
  • The theme is served via src\routes\index.ts, in the getThemeCssUrl method.

Client-side

  • The two predefined themes are hard-coded in the client in src\public\app\widgets\type_widgets\options\appearance\theme.js.
  • The user-defined themes are obtained via a call to the server: options/user-themes.
  • The theme retrieval is done via a request
+
+ + + +
+ + + + + + +
+ + diff --git a/docs/4FXLAtcPhZFo.html b/docs/4FXLAtcPhZFo.html new file mode 100644 index 000000000..e32f4377c --- /dev/null +++ b/docs/4FXLAtcPhZFo.html @@ -0,0 +1,838 @@ + + + + + + + + + + + + + + + + + + + + + + + CSS + + +
+
+ + + + +

CSS

+ + + + +
+

In doRender():

this.cssBlock(`#my-widget {
+	position: absolute;
+    bottom: 40px;
+    left: 60px;
+    z-index: 1;
+}`)

Reference: https://trilium.rocks/X7pxYpiu0lgU 

+
+ + + +
+ + + + + + +
+ + diff --git a/docs/4yYHqKbLovVX.html b/docs/4yYHqKbLovVX.html index f2fb532a9..fca1bfba9 100644 --- a/docs/4yYHqKbLovVX.html +++ b/docs/4yYHqKbLovVX.html @@ -40,13 +40,28 @@ @@ -76,7 +91,20 @@ - Internationalisation + Dependency Management + +

+ + + + + + + +
  • + +

    + + + + Building and deployment

    @@ -103,12 +150,696 @@ - Adding a new client library + Documentation + +

    + + + +
  • + +
  • + +

    + + + + Running a development build + +

    + + + +
  • + +
  • + +

    + + + + Build deliveries locally + +

    + + + +
  • + +
  • + +

    + + + + Releasing a version + +

    + + + +
  • + +
  • + +

    + + + + CI + +

    + + + + + +
  • + + + + + + +
  • + +

    + + + + Project maintenance + +

    + + + + + +
  • + +
  • + +

    + + + + Development and architecture + +

    + + + + + +
  • + +
  • + +

    + + + + Scripting + +

    + + + diff --git a/docs/6x42mhlfLo0o.html b/docs/6x42mhlfLo0o.html new file mode 100644 index 000000000..3149fba73 --- /dev/null +++ b/docs/6x42mhlfLo0o.html @@ -0,0 +1,833 @@ + + + + + + + + + + + + + + + + + + + + + + + blobs + + +
    +
    + + + + +

    blobs

    + + + + +
    +
    Column NameData TypeNullityDefault valueDescription
    blobIdTextNon-null The unique ID of the blob (e.g. XXbfAJXqWrYnSXcelLFA).
    contentTextNullablenull

    The content of the blob, can be either:

    • text (for plain text notes or HTML notes).
    • binary (for images and other types of attachments)
    dateModifiedTextNon-null Localized modification date (e.g. 2023-11-08 18:43:44.204+0200)
    utcDateModifiedTextNon-null Modification date in UTC format (e.g. 2023-11-08 16:43:44.204Z)
    +
    + + + +
    + + + + + + +
    + + diff --git a/docs/8jWguCtuKsAt.html b/docs/8jWguCtuKsAt.html new file mode 100644 index 000000000..6d845c16e --- /dev/null +++ b/docs/8jWguCtuKsAt.html @@ -0,0 +1,855 @@ + + + + + + + + + + + + + + + + + + + + + + + Right pane widget + + +
    +
    + + + + +

    Right pane widget

    + + + + +
    +
    • doRender must not be overridden, instead doRenderBody() has to be overridden.
    • parentWidget() must be set to “rightPane”.
    • widgetTitle() getter can optionally be overriden, otherwise the widget will be displayed as “Untitled widget”.
    const template = `<div>Hi</div>`;
    +
    +class ToDoListWidget extends api.RightPanelWidget {
    +    
    +    get widgetTitle() {
    +        return "Title goes here";
    +    }
    +        
    +    get parentWidget() { return "right-pane" }
    +    
    +    doRenderBody() {
    +        this.$body.empty().append($(template));
    +    }   
    +    
    +    async refreshWithNote(note) {
    +        this.toggleInt(false);                
    +        this.triggerCommand("reEvaluateRightPaneVisibility");
    +        this.toggleInt(true);
    +        this.triggerCommand("reEvaluateRightPaneVisibility");
    +    }
    +}
    +
    +module.exports = new ToDoListWidget();

    The implementation is in src/public/app/widgets/right_panel_widget.js.

    +
    + + + +
    + + + + + + +
    + + diff --git a/docs/B8hxg4e66cVL.html b/docs/B8hxg4e66cVL.html new file mode 100644 index 000000000..2d2e330df --- /dev/null +++ b/docs/B8hxg4e66cVL.html @@ -0,0 +1,907 @@ + + + + + + + + + + + + + + + + + + + + + + + Development and architecture + + +
    +
    + + + + +

    Development and architecture

    + + + + + + + + +
    + + + + + + +
    + + diff --git a/docs/BhE2WFknKKHG.html b/docs/BhE2WFknKKHG.html new file mode 100644 index 000000000..f34dcf1f8 --- /dev/null +++ b/docs/BhE2WFknKKHG.html @@ -0,0 +1,833 @@ + + + + + + + + + + + + + + + + + + + + + + + Main + + +
    +
    + + + + +

    Main

    + + + + +
    +

    The main workflow of the CI:

    • Builds the Docker image and publishes in the GitHub Docker registry.
    • Builds using a portion of the delivery script artifacts for the following platforms:
      • Windows x86_64 as .zip file
      • Windows x86_64 installer (using Squirrel)
      • macOS x86_64 and aarch64.
      • Linux x86_64
      • Linux server x86_64.

    The main workflow of the CI runs on develop branches as well as any branch that starts with feature/update_.

    Downloading the artifacts from the main branch

    Simply go to the develop branch on GitHub and look at the commit bar:

    Press the green checkmark (or red cross if something went bad). Then look at the list of jobs and their status:

    Then look for any of the entires that starts with “Main” and press the “Details” link next to it. It doesn't really matter which platform you'll choose as the artifacts are available on the same page.

     

    +
    + + + +
    + + + + + + +
    + + diff --git a/docs/C09Dou56ffMe.html b/docs/C09Dou56ffMe.html new file mode 100644 index 000000000..fa3c94613 --- /dev/null +++ b/docs/C09Dou56ffMe.html @@ -0,0 +1,833 @@ + + + + + + + + + + + + + + + + + + + + + + + Having a simpler packaging system + + +
    +
    + + + + +

    Having a simpler packaging system

    + + + + +
    +

    The current build scripts are a bit complicated and maintaining them is not easy.

    Electron Forge seems more mature and has a boatload of features, including Flatpak, snaps, Windows installers & more.

    Have a look also at the Plugins section since there are quite a few interesting things there as well.

    Afterwards consider running a new round of Reducing binary size, especially taking into consideration removing of the unnecessary locales.

    +
    + + + +
    + + + + + + +
    + + diff --git a/docs/FJ4VR6G2M6VD.html b/docs/FJ4VR6G2M6VD.html new file mode 100644 index 000000000..9d7ac0869 --- /dev/null +++ b/docs/FJ4VR6G2M6VD.html @@ -0,0 +1,831 @@ + + + + + + + + + + + + + + + + + + + + + + + Special notes + + +
    +
    + + + + +

    Special notes

    + + + + + + +

    This note has no content.

    + +
    + + + + + + +
    + + diff --git a/docs/FSZoX3cJlJE7.html b/docs/FSZoX3cJlJE7.html new file mode 100644 index 000000000..45b704d1e --- /dev/null +++ b/docs/FSZoX3cJlJE7.html @@ -0,0 +1,833 @@ + + + + + + + + + + + + + + + + + + + + + + + options + + +
    +
    + + + + +

    options

    + + + + +
    +
    Column NameData TypeNullityDefault valueDescription
    nameTextNon-null The name of option (e.g. maxContentWidth)
    valueTextNon-null The value of the option.
    isSyncedIntegerNon-null00 if the option is not synchronized and thus can differ between clients, 1 if the option is synchronized.
    utcDateModifiedTextNon-null Modification date in UTC format (e.g. 2023-11-08 16:43:44.204Z)
    +
    + + + +
    + + + + + + +
    + + diff --git a/docs/GMta9hBHsXHQ.html b/docs/GMta9hBHsXHQ.html new file mode 100644 index 000000000..f1cee5cd8 --- /dev/null +++ b/docs/GMta9hBHsXHQ.html @@ -0,0 +1,833 @@ + + + + + + + + + + + + + + + + + + + + + + + Node.js, Electron and `better-sqlite3` + + +
    +
    + + + + +

    Node.js, Electron and `better-sqlite3`

    + + + + +
    +

    better-sqlite3 requires a native module in order to work. In order to ease the installation process, prebuilt binaries are provided by the library developers.

    Trilium Next started with version 8.4.0 for better-sqlite3

    better-sqlite3 versionSQLite versionNode.js prebuildsElectron.js prebuilds
    8.4.0<3.43.0v20???
    8.5.0v20v25
    8.5.1 v26
    8.5.2v20 (macOS + arm64)
    8.6.03.43.0 
    8.7.03.43.1 
    9.0.03.43.2 v27
    9.1.03.44.0 
    9.1.1macOS + Alpine
    9.2.03.44.2 
    9.2.1 / 9.2.2 v28
    9.3.03.45.0 
    9.4.03.45.1 
    9.4.1Windows arm, arm64
    9.4.2 <v29
    9.4.3 <v29
    9.4.4 v29
    9.4.5Better prebuilds
    9.5.03.45.2 
    9.6.03.45.3 v30
    10.0.0v22
    10.1.03.46.0 
    11.0.0>21
    11.1.0 (prerelease)  v31
    11.1.1  
    11.1.2  
    +
    + + + +
    + + + + + + +
    + + diff --git a/docs/IuxV242YGaN5.html b/docs/IuxV242YGaN5.html new file mode 100644 index 000000000..c9c418a23 --- /dev/null +++ b/docs/IuxV242YGaN5.html @@ -0,0 +1,831 @@ + + + + + + + + + + + + + + + + + + + + + + + Deleted notes + + +
    +
    + + + + +

    Deleted notes

    + + + + + + +

    This note has no content.

    + +
    + + + + + + +
    + + diff --git a/docs/KRC2O84LekPz.html b/docs/KRC2O84LekPz.html new file mode 100644 index 000000000..56a2ea347 --- /dev/null +++ b/docs/KRC2O84LekPz.html @@ -0,0 +1,833 @@ + + + + + + + + + + + + + + + + + + + + + + + i18n-ally + + +
    +
    + + + + +

    i18n-ally

    + + + + +
    +

    i18n-ally is a VS Code extension that aids in internationalization.

    It is currently integrated in the project and offers features such as:

    • Highlight, autocomplete translations.
    • Display translations inline.
    • Extract messages into translation.

    Extracting messages into translation

    1. Open any .js file and select an untranslated string inside a template (TPL).
    2. Press Ctrl+P and look for “i18n Ally: Extract text into i18n messages”
    3. Select the first template.
    4. Select the path of translation, taking into consideration the Guidelines (e.g. jump_to_note.search-for-note-by-its-name).
    +
    + + + +
    + + + + + + +
    + + diff --git a/docs/KbwD5mDpD4CV.html b/docs/KbwD5mDpD4CV.html new file mode 100644 index 000000000..58b06cdea --- /dev/null +++ b/docs/KbwD5mDpD4CV.html @@ -0,0 +1,833 @@ + + + + + + + + + + + + + + + + + + + + + + + Protected entities + + +
    +
    + + + + +

    Protected entities

    + + + + +
    +

    The following entities can be made protected, via their isProtected flag:

    +
    + + + +
    + + + + + + +
    + + diff --git a/docs/MUGBo4n67kBI.html b/docs/MUGBo4n67kBI.html new file mode 100644 index 000000000..54ce1b705 --- /dev/null +++ b/docs/MUGBo4n67kBI.html @@ -0,0 +1,835 @@ + + + + + + + + + + + + + + + + + + + + + + + Environment setup + + +
    +
    + + + + +

    Environment setup

    + + + + +
    +

    To set up the repository:

    git clone https://github.com/TriliumNext/trilium-ckeditor5.git
    +cd trilium-ckeditor5.git
    +yarn install

    To trigger the build run:

    yarn build
    +
    + + + +
    + + + + + + +
    + + diff --git a/docs/PHqgH8FCfcod.html b/docs/PHqgH8FCfcod.html new file mode 100644 index 000000000..e7bd1f015 --- /dev/null +++ b/docs/PHqgH8FCfcod.html @@ -0,0 +1,833 @@ + + + + + + + + + + + + + + + + + + + + + + + Documentation + + +
    +
    + + + + +

    Documentation

    + + + + +
    +

    Development notes are published on triliumnext.github.io/Notes by the CI using GitHub Pages.

    The GitHub Pages deployment works by taking the files from the Notes repository, in the docs directory.

    How it works

    There is a script that uses wget to download all the files from a share, that means:

    1. You must have a local instance of Trilium Notes server.
    2. You must have the documentation imported, up to date and shared.

    Note that currently the documentation source file is not distributed (the note export), until a way is found to automate this process. Contact eliandoran should you require to obtain a copy of the documentation.

    Setting up .env file

    Go to bin/docs and copy .env.example to .env and edit it:

    1. Change the SHARE_PROTOCOL to either http or https depending on your setup.
    2. Change SHARE_HOST to match the domain name or the URL to the host (without the protocol or any slashes).

    Generally ROOT_NOTE_ID should not be changed since the note ID must match if the files were imported correctly.

    Triggering a build

    Run:

    ./bin/docs/prepare.sh

    This will attempt to download all the notes from the share URL and put them in docs, rewritten for GitHub Pages.

    Commit the results and follow the normal development process to push them.

    +
    + + + +
    + + + + + + +
    + + diff --git a/docs/QSkfVssHIngA.html b/docs/QSkfVssHIngA.html new file mode 100644 index 000000000..a0b3a9fbd --- /dev/null +++ b/docs/QSkfVssHIngA.html @@ -0,0 +1,831 @@ + + + + + + + + + + + + + + + + + + + + + + + Revisions + + +
    +
    + + + + +

    Revisions

    + + + + + + +

    This note has no content.

    + +
    + + + + + + +
    + + diff --git a/docs/QXCi6Y1SYulw.html b/docs/QXCi6Y1SYulw.html index 3e5f58f87..1f760cea8 100644 --- a/docs/QXCi6Y1SYulw.html +++ b/docs/QXCi6Y1SYulw.html @@ -86,7 +86,7 @@ node_modules/i18next + I18NEXT }

    Step 4. Using the library

    To import the library, simply use the following mechanism:

    import library_loader from "./library_loader.js";
     
    -await library_loader.requireLibrary(library_loader.I18NEXT);

    Make sure to replace I18NEXT with the library that was created at the previous steps.

    Note that because we are not using a module management mechanism such as ES Modules or Common.js modules, the requireLibrary method does not actually return anything. 

    To benefit from the library, it must export on its own an object in window.

    In the case of i18next, it sets window.i18next and that can be used directly:

    i18next.init({});
    +await library_loader.requireLibrary(library_loader.I18NEXT);

    Make sure to replace I18NEXT with the library that was created at the previous steps.

    Note that because we are not using a module management mechanism such as ES Modules or Common.js modules, the requireLibrary method does not actually return anything. 

    To benefit from the library, it must export on its own an object in window.

    In the case of i18next, it sets window.i18next and that can be used directly:

    i18next.init({});

    Step 5. Adding Electron support

    For Electron, the node_modules are copied as a separate step by bin/copy-dist.ts.

    Scroll all the way down to the nodeModulesFolder and append an entry for the newly added libraries.

    @@ -115,7 +115,457 @@ await library_loader.requireLibrary(library_loader.I18NEXT);

    Make - Internationalisation + Dependency Management + +

    + + + + + +
  • + +
  • + +

    + + + + Building and deployment + +

    + + + + + +
  • + +
  • + +

    + + + + Project maintenance + +

    + + + + + +
  • + +
  • + +

    + + + + Development and architecture + +

    + + + + + +
  • + +
  • + +

    + + + + Scripting

    @@ -142,7 +826,34 @@ await library_loader.requireLibrary(library_loader.I18NEXT);

    Make - Adding a new client library + Widgets + +

    + + + +
  • + + + + diff --git a/docs/QYMncZf5Bu3D.html b/docs/QYMncZf5Bu3D.html new file mode 100644 index 000000000..d57d258a3 --- /dev/null +++ b/docs/QYMncZf5Bu3D.html @@ -0,0 +1,833 @@ + + + + + + + + + + + + + + + + + + + + + + + revisions + + +
    +
    + + + + +

    revisions

    + + + + +
    +
    Column NameData TypeNullityDefault valueDescription
    revisionIdTextTextNon-null Unique ID of the revision (e.g. 0GjgUqnEudI8).
    noteIdTextNon-null ID of the note this revision belongs to.
    typeTextNon-null""The type of note (i.e. text, file, code, relationMap, mermaid, canvas).
    mimeTextNon-null""The MIME type of the note (e.g. text/html).
    titleTextNon-null The title of the note, as defined by the user.
    isProtectedIntegerNon-null01 if the entity is protected, 0 otherwise.
    blobIdTextNullablenullThe corresponding ID from blobs. Although it can theoretically be NULL, haven't found any such note yet.
    utcDateLastEditedTextNon-null Not sure how it differs from modification date.
    utcDateCreatedTextNon-null Creation date in UTC format (e.g. 2023-11-08 16:43:44.204Z)
    utcDateModifiedTextNon-null Modification date in UTC format (e.g. 2023-11-08 16:43:44.204Z)
    dateLastEditedTextNon-null Not sure how it differs from modification date.
    dateCreatedTextNon-null Localized creatino date (e.g. 2023-08-12 15:10:04.045+0300)
    +
    + + + +
    + + + + + + +
    + + diff --git a/docs/U5RtMeGPeZ29.html b/docs/U5RtMeGPeZ29.html new file mode 100644 index 000000000..b38b57fc0 --- /dev/null +++ b/docs/U5RtMeGPeZ29.html @@ -0,0 +1,842 @@ + + + + + + + + + + + + + + + + + + + + + + + Synchronisation + + +
    +
    + + + + +

    Synchronisation

    + + + + + + + + +
    + + + + + + +
    + + diff --git a/docs/UDBwK5Fhr2CT.html b/docs/UDBwK5Fhr2CT.html new file mode 100644 index 000000000..a5ec6ac73 --- /dev/null +++ b/docs/UDBwK5Fhr2CT.html @@ -0,0 +1,833 @@ + + + + + + + + + + + + + + + + + + + + + + + Safe mode + + +
    +
    + + + + +

    Safe mode

    + + + + +
    +

    Safe mode is triggered by setting the TRILIUM_SAFE_MODE to a truthy value, usually 1.

    In each artifact there is a trilium-safe-mode.sh (or .bat) script to enable it.

    What it does:

    • Disables customWidget launcher types in app/widgets/containers/launcher.js.
    • Disables the running of mobileStartup or frontendStartup scripts.
    • Displays the root note instead of the previously saved session.
    • Disables the running of backendStartup, hourly, daily scripts and checks for the hidden subtree.
    +
    + + + +
    + + + + + + +
    + + diff --git a/docs/UTB518X6X9Uh.html b/docs/UTB518X6X9Uh.html new file mode 100644 index 000000000..bfd2e0c96 --- /dev/null +++ b/docs/UTB518X6X9Uh.html @@ -0,0 +1,837 @@ + + + + + + + + + + + + + + + + + + + + + + + Build deliveries locally + + +
    +
    + + + + +

    Build deliveries locally

    + + + + +
    +

    In the project root:

    PlatformArchitectureApplicationBuild command
    macOSx86_64Desktop / Electron app./bin/build-mac-x64.sh
    ARM 64Desktop / Electron app./bin/build-mac-arm64.sh
    Linuxx86_64Desktop / Electron app./bin/build-linux-x64.sh
    Server./bin/build-server.sh
    Windowsx86_64Desktop / Electron app./bin/build-win-x64.sh

    Under NixOS the following nix-shell is needed:

    nix-shell -p jq

    For Linux builds:

    nix-shell -p jq fakeroot dpkg

    The resulting build will be in the dist directory under the project root.

    Testing the Linux builds under NixOS

    Desktop clientServer
    $ NIXPKGS_ALLOW_UNFREE=1 nix-shell -p steam-run
    +[nix-shell] cd dist/trilium-linux-x64
    +[nix-shell] steam-run ./trilium
    $ NIXPKGS_ALLOW_UNFREE=1 nix-shell -p steam-run
    +[nix-shell] cd dist/trilium-linux-x64-server
    +[nix-shell] steam-run ./trilium.sh
    +
    + + + +
    + + + + + + +
    + + diff --git a/docs/VS22Hq5PBFNf.html b/docs/VS22Hq5PBFNf.html index 126d58524..fdea454f9 100644 --- a/docs/VS22Hq5PBFNf.html +++ b/docs/VS22Hq5PBFNf.html @@ -49,6 +49,11 @@ class="type-text">Adding a new client library +
  • + Having a simpler packaging system +
  • + @@ -76,7 +81,20 @@ - Internationalisation + Dependency Management + +

    + + + + + + + +
  • + +

    + + + + Building and deployment

    @@ -103,11 +140,695 @@ - Adding a new client library + Documentation + +

    + + + +
  • + +
  • + +

    + + + + Running a development build + +

    + + + +
  • + +
  • + +

    + + + + Build deliveries locally + +

    + + + +
  • + +
  • + +

    + + + + Releasing a version + +

    + + + +
  • + +
  • + +

    + + + + CI + +

    + + + + + +
  • + + + + + + +
  • + +

    + + + + Project maintenance + +

    + + + + + +
  • + +
  • + +

    + + + + Development and architecture

    + + + +
  • + +
  • + +

    + + + + Scripting + +

    + + + + + +
  • + +
  • + +

    + + + + Project maintenance + +

    + + + + + +
  • + +
  • + +

    + + + + Development and architecture

    + + + +
  • + +
  • + +

    + + + + Scripting + +

    + + +