Extend README.md with more examples

This commit is contained in:
Konstantin Nazarov 2023-09-30 21:30:57 +01:00
parent 2b00252635
commit 9276b93fae
Signed by: knazarov
GPG key ID: 4CFE0A42FA409C22

View file

@ -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): To create a new note (will open a new editor window):
```sh ```sh
./notes.sh -n ./notes.sh -n
``` ```
To list all existing notes with their titles: To list all existing notes with their titles:
@ -37,12 +37,38 @@ To list all existing notes with their titles:
./notes.sh -l ./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 ```sh
./notes.sh -l | fzf --tac --with-nth="2..-1" | xargs -o ./notes.sh -e ./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 <note id> | markdown.awk > result.html
```
## License ## License
Distributed under the terms of the BSD License Distributed under the terms of the BSD License