From 3534b2f4ed4ee682d2c09aa501e77338c0e166f7 Mon Sep 17 00:00:00 2001 From: Marc Coquand Date: Mon, 13 May 2024 11:10:51 -0500 Subject: Initial commit x2 --- README | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 76 ----------------------------------------------------- lib/zipper.ml | 22 ---------------- test/dune | 2 +- test/test_apbox.ml | 0 test/test_stitch.ml | 0 6 files changed, 77 insertions(+), 99 deletions(-) create mode 100644 README delete mode 100644 README.md delete mode 100644 lib/zipper.ml delete mode 100644 test/test_apbox.ml create mode 100644 test/test_stitch.ml diff --git a/README b/README new file mode 100644 index 0000000..7af7768 --- /dev/null +++ b/README @@ -0,0 +1,76 @@ +Stitch - Note Composer + +Stitch is a minimal grep-based CLI tool for composing notes. +It is built around the idea of writing notes separately and then +using tags to compose these notes together. + +Stitch does not have any opinion about which file +format you use for file capturing, use org, markdown, whatever you +want. You can customize the grep command. + +Stitch limits itself only to note composing. For capturing notes, you +will have to set up your own system. + +AIMS + +- Single binary +- Minimal +- Work with any file format + +CREDIT + +Stitch is based and largely a stripped down copy of the note composing +system of Howm for Emacs. + +INSTALLATION + +Chmod +x the binary and put in PATH. + +Set the environment variables: + +STICH_DIRECTORY +STICH_GREP_CMD (default "grep") +STITCH_HEADLINE_PATTERN (default "^\* ") +STITCH_TAG_PATTERN (default ":[a-z]:") + +SPEED UP + +Stitch uses grep by default. As your notes grow, this will +become rather slow. To speed it up, you can replace it grep with ugrep. + +DEVELOPMENT + +To set up the project, easiest way is to just install Nix, direnv and +enable nix flakes. Then to compile: + +dune build + +And to run: + +dune exec -- stitch + + +RECIPES + +Building a journaling system +--- + +You can build a basic capture command using $EDITOR and date command: + +alias capture="JRNL=\"$STITCH_DIRECTORY/$(date +'%Y-%m-%d %H:%M').org\" echo '* :journal:' > $JRNL_FILE && $EDITOR $JRNL_FILE + +and then you can find your journal entries, automatically sorted by creation date with +stitch and the journal tag: + +alias jrnl="stitch -t journal" + +LICENSE + +License is BSD-3-Clause + +KNOWN ISSUES + +- Resizing the screen when editor is open causes panic + + + diff --git a/README.md b/README.md deleted file mode 100644 index 7af7768..0000000 --- a/README.md +++ /dev/null @@ -1,76 +0,0 @@ -Stitch - Note Composer - -Stitch is a minimal grep-based CLI tool for composing notes. -It is built around the idea of writing notes separately and then -using tags to compose these notes together. - -Stitch does not have any opinion about which file -format you use for file capturing, use org, markdown, whatever you -want. You can customize the grep command. - -Stitch limits itself only to note composing. For capturing notes, you -will have to set up your own system. - -AIMS - -- Single binary -- Minimal -- Work with any file format - -CREDIT - -Stitch is based and largely a stripped down copy of the note composing -system of Howm for Emacs. - -INSTALLATION - -Chmod +x the binary and put in PATH. - -Set the environment variables: - -STICH_DIRECTORY -STICH_GREP_CMD (default "grep") -STITCH_HEADLINE_PATTERN (default "^\* ") -STITCH_TAG_PATTERN (default ":[a-z]:") - -SPEED UP - -Stitch uses grep by default. As your notes grow, this will -become rather slow. To speed it up, you can replace it grep with ugrep. - -DEVELOPMENT - -To set up the project, easiest way is to just install Nix, direnv and -enable nix flakes. Then to compile: - -dune build - -And to run: - -dune exec -- stitch - - -RECIPES - -Building a journaling system ---- - -You can build a basic capture command using $EDITOR and date command: - -alias capture="JRNL=\"$STITCH_DIRECTORY/$(date +'%Y-%m-%d %H:%M').org\" echo '* :journal:' > $JRNL_FILE && $EDITOR $JRNL_FILE - -and then you can find your journal entries, automatically sorted by creation date with -stitch and the journal tag: - -alias jrnl="stitch -t journal" - -LICENSE - -License is BSD-3-Clause - -KNOWN ISSUES - -- Resizing the screen when editor is open causes panic - - - diff --git a/lib/zipper.ml b/lib/zipper.ml deleted file mode 100644 index 37e14de..0000000 --- a/lib/zipper.ml +++ /dev/null @@ -1,22 +0,0 @@ -type zipper = - { above : string list - ; selected : string - ; below : string list - } - -let up (zipper : zipper) = - match zipper.above with - | [] -> zipper - | a :: rest -> { above = rest; selected = a; below = zipper.selected :: zipper.below } - - -let down (zipper : zipper) = - match zipper.below with - | [] -> zipper - | a :: rest -> { below = rest; selected = a; above = zipper.selected :: zipper.above } - - -let selected zipper = zipper.selected - -let to_array zipper = - List.concat [ zipper.above; [ zipper.selected ]; zipper.below ] |> Array.of_list diff --git a/test/dune b/test/dune index d392dd2..adbe4c1 100644 --- a/test/dune +++ b/test/dune @@ -1,2 +1,2 @@ (test - (name test_apbox)) + (name test_stitch)) diff --git a/test/test_apbox.ml b/test/test_apbox.ml deleted file mode 100644 index e69de29..0000000 diff --git a/test/test_stitch.ml b/test/test_stitch.ml new file mode 100644 index 0000000..e69de29 -- cgit v1.2.3