Publish
TreeWrite turns your document into a static website that looks like the editor. The demos were made this way.
Publishing
Section titled “Publishing”Click Publish in the header. TreeWrite builds the site in ./treewrite/{filename.jsonl}/publish, next to your .jsonl file, then runs your command inside that folder to upload it. Without a command, the site is only built, and you can upload the folder yourself.
The first time a command runs on a computer, and whenever it changes, TreeWrite shows it and asks before running it.
What is published
Section titled “What is published”Every bullet of the document is published, so keep private notes in another one. The site also gets the assets that bullets use, the theme, the Home, the tags, which sidebar features are on, the favorites when that feature is on, and the flashcards without what you learned. The settings of Git, of publishing and of flashcards, and the review log, are never published.
Settings
Section titled “Settings”In Settings › Publish:
- Command uploads the site. It runs in the site folder, also given in
TREEWRITE_PUBLISH_DIR, with the.jsonlfile inTREEWRITE_DOCUMENT. On Windows it runs incmd.exe, and on macOS and Linux in your login shell. - Site URL is where the site is found. It adds a preview picture to links, and a button to open the site.
The command cannot ask for anything, as a password: log in once in a terminal, or use a token. The folder is built again every time, so files the host needs there, as a CNAME, must be made by the command.
Examples
Section titled “Examples”These commands are for macOS and Linux.
| Host | Command | Site URL |
|---|---|---|
| GitHub Pages | CACHE_DIR="$HOME/.cache" npx gh-pages -d . --nojekyll |
https://{user}.github.io/{repository}/ |
| Cloudflare Pages | npx wrangler pages deploy . --project-name notes --branch main |
https://notes.pages.dev/ |
| Netlify | npx netlify-cli deploy --dir . --prod --site notes |
https://notes.netlify.app/ |
| Your own server | rsync -az --delete ./ user@example.com:/var/www/notes/ |
The address your server gives that folder |
- GitHub Pages: the document must be in a repository with a GitHub remote. On GitHub, deploy Pages from the
gh-pagesbranch. - Cloudflare Pages: log in once with
npx wrangler login, and create the project once withnpx wrangler pages project create notes --production-branch main. - Netlify: log in once with
npx netlify-cli login, and create the site once withnpx netlify-cli sites:create --name notes. - Your own server: use an SSH key without a passphrase, or one loaded in your SSH agent.