Skip to content

Publish

TreeWrite turns your document into a static website that looks like the editor. The demos were made this way.

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.

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.

In Settings › Publish:

  • Command uploads the site. It runs in the site folder, also given in TREEWRITE_PUBLISH_DIR, with the .jsonl file in TREEWRITE_DOCUMENT. On Windows it runs in cmd.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.

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-pages branch.
  • Cloudflare Pages: log in once with npx wrangler login, and create the project once with npx wrangler pages project create notes --production-branch main.
  • Netlify: log in once with npx netlify-cli login, and create the site once with npx netlify-cli sites:create --name notes.
  • Your own server: use an SSH key without a passphrase, or one loaded in your SSH agent.