Go to file
Radar231 5146d4f0d0 made the delete interactive to prevent invisible unintended deletions 2023-09-04 15:51:24 -04:00
README.md updated readme with zetz gist link 2023-09-02 16:01:26 -04:00
bash_aliases_clip added scripts to list (ztl.sh) or search (zts.sh) tags 2022-05-08 10:44:54 -04:00
zn made the delete interactive to prevent invisible unintended deletions 2023-09-04 15:51:24 -04:00
zn-tag-list.sh cleaned up helper scripts 2022-02-01 15:05:47 -05:00
zn-title-list.sh cleaned up helper scripts 2022-02-01 15:05:47 -05:00
ztl.sh added scripts to list (ztl.sh) or search (zts.sh) tags 2022-05-08 10:44:54 -04:00
zts.sh added scripts to list (ztl.sh) or search (zts.sh) tags 2022-05-08 10:44:54 -04:00

README.md

YANA: zn

  • (YANA: Yet Another Note-taking Application)

Introduction

This repo contains zn, a simple note taking shell script. It is conceptually inspired by zetz, written by Guy Valariola (kutacoder). His github gist page for zetz is located at;

Prerequisites

This script requires the following programs;

All of these should also be available via the package management system in most distributions.

Setup

Note Directory

The first step to perform is creation of the note storage directory. This can be nested or not, depending on your requirements. In my case I nest a number of note storage directories under $HOME/.notes;

$ tree -d .notes
.notes
├── journal
└── notes

There is a variable in the script named "NOTEPATH" where you can set up a default note storage directory.

Git Setup

The next thing to do is set up git for revision control of your notes. You can either set up a git repo for each note directory (if running with more than one) or set up a git repo in the parent directory if using a nested directory setup.

Once you've identified where you'll place your git repo, simply cd into that directory and run git init.

Using git for revision control of your notes can be disabled by commenting out the line starting with git add . && ... in the script.

Command Line Options

Usage: zn [-p <path to note directory>] [-t]

-p Path to desired note directory. Can be relative or absolute.
    ie, "-p $HOME/.notes/notes"

-t Use tag search (default is to use title search)

Bash Aliases

I use aliased commands to interact with my notebooks.

$ cat bash_aliases_clip 

# zn aliases
alias zn="zn -p $HOME/.notes/notes"
alias znt="zn -p $HOME/.notes/notes -t"
alias zj="zn -p $HOME/.notes/journal"
alias zjt="zn -p $HOME/.notes/journal -t"

Note File Format

This script is set up to work with Markdown formatted note files. There are only two requirements that must be observed for the note files in order for the zn script to function properly.

The first line of the note file is the title of the note, and should be written as a level 1 header.

The other requirement is tags. You can have any number of tags in your note files. Tags should be placed starting on line three, with a blank line between the tags and the title, and another blank line between the tags and the body of the note. Each tag should start with a "#" character with no space between it and the tag itself.

In actuality, tags can be placed anywhere within the note file, and the script will find them just fine. The above recommendation is for readability.

  • Example Note File
$ cat 20220125141537.md

# LXD Documentation Links

#LXD
#Links
#Docs

* https://linuxcontainers.org/lxd/
* https://github.com/lxc/lxd
* https://ubuntu.com/server/docs/containers-lxd
* https://snapcraft.io/lxd

Note files are created with a date-time formatted filename, in the format of 'YYYYMMDDHHMMSS.md'.

Search List Format

Based on the previous example note file, these are examples of the search list format for both title search, as well as tag search.

(20220125): LXD Documentation Links
1/1
> 
(20220125): #LXD: LXD Documentation Links
(20220125): #Links: LXD Documentation Links
(20220125): #Docs: LXD Documentation Links
3/3
>