From b41fa5366a234547f97812940fff20e8d147c7f5 Mon Sep 17 00:00:00 2001 From: Dakota Chambers Date: Tue, 28 Jul 2020 22:26:04 -0500 Subject: [PATCH 1/4] Change directoy structure to `.../$YEAR/$MONTH/$DAY/...` to better handle multiple notes in a single day. --- note | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/note b/note index 6197aca..41a71e5 100755 --- a/note +++ b/note @@ -3,12 +3,14 @@ YEAR=$(date +'%Y') MONTH=$(date +'%m') DAY=$(date +'%d') -NOTE_DIR="$HOME/notes/$YEAR/$MONTH" -NOTE_NAME="$DAY.md" +NOTE_DIR="$HOME/notes" +NOTE_NAME="$YEAR-$MONTH-$DAY.md" NOTERC="${XDG_CONFIG_HOME:-$HOME/.config}/notekeeper/noterc" if [ -f "$NOTERC" ]; then source "$NOTERC"; fi +NOTE_DIR="$NOTE_DIR/$YEAR/$MONTH/$DAY" + create_note() { if [ ! -f "$NOTE_DIR/$NOTE_NAME" ]; then mkdir -p "$NOTE_DIR" From f9e1f567103fde68a1d72d7384849f54dd961ea8 Mon Sep 17 00:00:00 2001 From: Dakota Chambers Date: Tue, 28 Jul 2020 22:41:34 -0500 Subject: [PATCH 2/4] Update README with new file tree and improved noterc documentation --- README.md | 45 +++++++++++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index f2396ba..d82e26b 100644 --- a/README.md +++ b/README.md @@ -73,15 +73,18 @@ note file in Vim. ## File Organization ```shell -$ tree ~/notes +❱❱ tree ~/notes /home/username/notes -└── 2018 - ├── 07 - │   └── 31.md - └── 08 - ├── 01.md - └── 02.md - +└── 2020 + ├── 06 + │   ├── 21 + │   │   └── 2020-06-21.md + │   └── 22 + │   └── 2020-06-22.md + └── 07 + └── 28 + ├── 2020-07-28.md + └── another-note.md ``` ## Configuration @@ -90,14 +93,24 @@ $ tree ~/notes * If no default editor is set, it will use *Vim*. * It opens *vim* in insert mode. * The default location to store notes is in the `~/notes/` directory. - * To change this, create the file `${XDG_CONFIG_HOME:-$HOME}/notekeeper/noterc` + * To change this, set a `NOTE_DIR` value in your `noterc` file. -### noterc Variables + create the file `${XDG_CONFIG_HOME}/notekeeper/noterc` -```shell -# Directory where the current note should be stored -NOTE_DIR="$HOME/notes/$YEAR/$MONTH" +### noterc -# Name of the Note -NOTE_NAME="$DAY.md" -``` +You can use a `noterc` file to customize Notekeeper! + +* Create this file at `${XDG_CONFIG_HOME}/notekeeper/noterc` + * On MacOS, this will be `~/.config/notekeeper/noterc` + +The following variables can be set to overwrite Notekeeper defaults: + +* `NOTE_DIR` - The base directory for storing notes. + * Default is `$HOME/notes` + +* `EDITOR` + * By default Notekeeper uses whatever is in your `$EDITOR` variable, and falls back to vim if none is set. + +* `NOTE_NAME` + * Default is `$YEAR-$MONTH-$DAY.md` From 550e09033b71f2fe8fc0b7e44a1e7a8b9309bb09 Mon Sep 17 00:00:00 2001 From: Dakota Chambers Date: Tue, 28 Jul 2020 22:44:06 -0500 Subject: [PATCH 3/4] Update noterc documentation --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index d82e26b..6708e47 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,6 @@ note file in Vim. * The default location to store notes is in the `~/notes/` directory. * To change this, set a `NOTE_DIR` value in your `noterc` file. - create the file `${XDG_CONFIG_HOME}/notekeeper/noterc` ### noterc @@ -107,7 +106,7 @@ You can use a `noterc` file to customize Notekeeper! The following variables can be set to overwrite Notekeeper defaults: * `NOTE_DIR` - The base directory for storing notes. - * Default is `$HOME/notes` + * Default is `~/notes` * `EDITOR` * By default Notekeeper uses whatever is in your `$EDITOR` variable, and falls back to vim if none is set. From 02eff74e622b06ce4a9e40aef49c268a6b194dbb Mon Sep 17 00:00:00 2001 From: Dakota Chambers Date: Sat, 27 Mar 2021 22:53:08 -0500 Subject: [PATCH 4/4] Trigger Build