Installation
-
Download zet from https://git.goral.net.pl/zet.git/:
$ git clone https://git.goral.net.pl/zet.git
-
Compile and install
$ cd zet $ make $ make install
make install
respectsPREFIX
andDESTDIR
environent variables. By default zet is installed to~/.local
-
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"
-
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.
-
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"
-
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.
-
Initialize local Git repository
$ cd notebook $ git init $ git add *.md $ git commit -m "Initialize notebook"
-
Initialize remote
$ git remote add origin <url>
-
Configure
git-sync
$ git config.branch.master.sync true $ git config.branch.master.syncNewFiles true
-
Run
zet sync
-
(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
.
-
Initialize local Git repository
$ cd notebook $ git init $ git add *.md $ git commit -m "Initialize notebook"
-
Run
zet sync
Using Zet
$ zet note
$ zet note -t template.md
$ echo "quick note" | zet note -t template.md --stdin
$ zet open notebook:note.md
$ zet replace "foo bar" "baz"
$ zet replace --interactive "regular.*expression" "Regular Expression"
$ zet commands