Warning: this is a work-in-progress. Probably it will not work on your machine.
When you don't have time to organize your notes but you need a fast way to dump them:
postit.sh
: single command which adds a notes on a daily markdown post in a given folder- & some other fancy features:
- commit everything with one command
- modify previous notes
- private notes
The result is a big folder of markdown files barely stitched together.
postit.sh
- create a file for the current day or opens it if it already exists
- add a new post section with title, tags and some useful stuff
The command is registered as a system command in the setup with a given target folder, so that you can invoke it from everywhere.
The script accepts the following arguments:
-r
: "read mode", display the last note in your default Markdown viewer/editor-z
: "modify mode", edit the last note instead of adding a post to it-c
: "commit mode", commit everything in the folder with one click and push it upstream. Poor man backup. The default commit message is just the current day.
-d
: open file fromd
days before, or yesterday file if no argument is given-D
: open file which matchesD
regex (viagrep
) , or yesterday file if no argument is given
TIP: to get a list of all the notes by day just run grep -r "### *"
-s
: rerun the setup script. Useful if you want to modify the target folder or thepostit.sh
script.
-
-p
: by default notes are pushed to an upstream git folder, which you can choose to leave public. The assumption here is that these notes could be safely converted in blog posts (hence the markdown format), as developer diaries.On the contrary, if you want some notes to be private, by default a
personal
folder is set up in the target folder which commits to a separate git repository and is never pushed upstream (TODO: push to private repo).All the other commands, when
-p
is used, work as before with thepersonal
folder as target.
Download the postit.sh
and setup_postit.sh
scripts in a folder. Run bash setup_postit.sh
for the default installation.
By default the setup script does the following:
- registers the current folder as target in a config file (optional)
- creates the
notes
andpersonal
folders in the target folder - initiates two separate
git
repository in the two above folders (optional) - register
postit.sh
as a system wide command (optional)- here the customized procedure allow non sudoers to use the script without any hussle
- TODO: registers the current editor to make posts (optional). For the moment I have just used mine (micro)
- TODO: set upstream git folders
Optional elements can be customized by running the script with the-u
switch. TODO: allow setting the options separately.