From 9276b93fae4f116c4efea34b61b114e7770123d8 Mon Sep 17 00:00:00 2001 From: Konstantin Nazarov Date: Sat, 30 Sep 2023 21:30:57 +0100 Subject: [PATCH] Extend README.md with more examples --- README.md | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2b11a20..d660187 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ By default, `notes.sh` will create new entries in `~/Maildir/personal/Notes`, wh To create a new note (will open a new editor window): ```sh -./notes.sh -n +./notes.sh -n ``` To list all existing notes with their titles: @@ -37,12 +37,38 @@ To list all existing notes with their titles: ./notes.sh -l ``` -To select a note with fuzzy search and edit it: +To select a note with fuzzy search and edit it (needs [fzf](https://github.com/junegunn/fzf)): ```sh ./notes.sh -l | fzf --tac --with-nth="2..-1" | xargs -o ./notes.sh -e ``` + +## Aliases + +In day-to-day usage, you likely won't type the long commands for editing notes. +Just put the following aliases into `~/.bashrc` to make things easier: + +```sh +# Type "nn" to create a new note +alias nn="notes.sh -n" + +# Type "ne" to look up and edit an existing note +alias ne="notes.sh -l | fzf --tac --with-nth="2..-1" | xargs -o notes.sh -e" +``` + +## Publishing notes to HTML + +If you want to publish your notes to the web, you can use a simple converter from +Markdown to HTML that I wrote, which is similar in spirit to notes.sh (simple, single-file script). +You can find it here: [markdown.awk](https://git.sr.ht/~knazarov/markdown.awk). + +With it, you can do the following: + +``` +notes.sh --export | markdown.awk > result.html +``` + ## License Distributed under the terms of the BSD License