docs(dev): integrate more of the old documentation

This commit is contained in:
Elian Doran
2025-11-03 22:48:14 +02:00
parent d9071f2d8e
commit 686c8936cb
21 changed files with 433 additions and 903 deletions

View File

@@ -0,0 +1,34 @@
# Build deliveries locally
## Building the desktop
Go to `apps/desktop`, and:
* To generate the packages, run `pnpm electron-forge:make`.
* To only build the Flatpak, run `pnpm electron-forge:make-flatpak`.
* To only build without packaging it, run `pnpm electron-forge:package`.
## Building the server
Go to `apps/server` and run `pnpm package` to run the build script. The built artifacts will appear in `apps/server/dist`, whereas the packaged build will be available in `apps/server/out`.
## On NixOS
Under NixOS the following `nix-shell` is needed:
```
nix-shell -p jq
```
For Linux builds:
```
nix-shell -p jq fakeroot dpkg
```
To test the Linux builds, use `steam-run`:
```javascript
$ NIXPKGS_ALLOW_UNFREE=1 nix-shell -p steam-run
[nix-shell] cd dist/trilium-linux-x64
[nix-shell] steam-run ./trilium
```

View File

@@ -0,0 +1,17 @@
# Documentation
## Automation
The documentation is built via `apps/build-docs`:
1. The output directory is cleared.
2. The User Guide and the Developer Guide are built.
1. The documentation from the repo is archived and imported into an in-memory instance.
2. The documentation is exported using the shared theme.
3. The API docs (internal and ETAPI) are statically rendered via Redocly.
4. The script API is generated via `typedoc`
The `deploy-docs` workflow triggers the documentation build and uploads it to CloudFlare Pages.
## Building locally
In the Git root, run `pnpm docs:build`. The built documentation will be available in `site` at Git root.

View File

@@ -0,0 +1,33 @@
# Running a development build
First, follow the <a class="reference-link" href="../Environment%20Setup.md">Environment Setup</a>.
## Client
The client is not meant to be run by itself, despite being described as an app. See the documentation on the server instead.
## Server
* To run the server in development mode, run `server:start`. The dev port is `8080`.
* To run the server in production mode (with its own copy of the assets), run `server:start-prod`.
* To build for Docker, see <a class="reference-link" href="Docker.md">Docker</a>.
To run with a custom port, change the `TRILIUM_PORT` environment variable from the `package.json`.
## Desktop
* To run in development mode, use `pnpm desktop:start`.
* To run in production mode, use `pnpm desktop:start-prod`.
## Safe mode
Safe mode is off by default, to enable it temporarily on a Unix shell, prepend the environment variable setting:
```
pnpm cross-env TRILIUM_SAFE_MODE=1 pnpm server:start
```
## Running on NixOS
When doing development, the Electron binary retrieved from NPM is not going to be compatible with NixOS, resulting in errors when trying to run it. However Trilium handles it automatically when running `pnpm desktop:start`.
If there's no `electron` the system path it will attempt to use `nix-shell` to obtain it.