Installation

  1. Download zet from https://git.goral.net.pl/zet.git/:

    $ git clone https://git.goral.net.pl/zet.git
  2. Compile and install

    $ cd zet
    $ make
    $ make install
    make install respects PREFIX and DESTDIR environent variables. By default zet is installed to ~/.local
  3. Initialize the first notebook

    $ cd ~/notebooks
    $ zet init
    if you already have a directory with your notes, you can point zet to it: zet init path/to/notes "My Notebook Name"
  4. Set $ZET_ROOT to use zet from anywhere

    $ echo "export ZET_ROOT=\"${HOME}/notebooks\"" >> ~/.bashrc

Setup Synchronization

If you keep your notebooks in Git repositories, you may use git-sync to synchronize them. zet sync is a command which you should use each time you want to synchronize.

The prerequisite for all below methods is that git-sync script is downloaded and installed in your $PATH.

Existing Remote Repositories

This method works when you have existing Git repository which you would like import fresh to zet.

  1. Add configuration for the new notebook to zet.toml. Point remote field to Git address you would like to fetch.

    [[notebooks]]
    name = "My Synchronized Notebook"
    path = "my-notebook"
    remote = "ssh://git@example.com/my-notebook.git"
  2. Run zet sync

Existing Notebook

If you already have a notebook, you can synchronize it with Git simply by making sure that it points to the remote repository.

  1. Initialize local Git repository

    $ cd notebook
    $ git init
    $ git add *.md
    $ git commit -m "Initialize notebook"
  2. Initialize remote

    $ git remote add origin <url>
  3. Configure git-sync

    $ git config.branch.master.sync true
    $ git config.branch.master.syncNewFiles true
  4. Run zet sync

  5. (optional) Add remote field to notebook’s section in zet.toml to easy and fast cloning in the future.

Local Only Notebooks

This is a variation of Existing Notebook method which stores notebook in local Git repository. There isn’t any remote configured, so all notes stay locally on your computer. Notes are automatically committed during zet sync.

  1. Initialize local Git repository

    $ cd notebook
    $ git init
    $ git add *.md
    $ git commit -m "Initialize notebook"
  2. Run zet sync

Using Zet

Write a note
$ zet note
$ zet note -t template.md
$ echo "quick note" | zet note -t template.md --stdin
Open existing notes
$ zet open notebook:note.md
Search and replace
$ zet replace "foo bar" "baz"
$ zet replace --interactive "regular.*expression" "Regular Expression"
List all available commands
$ zet commands