stitch
Note taking for messy minimalists
git clone git://mccd.space/stitchcommit af84c15e6c4696c57567764d9035d1e48ab3754d
parent 4c895f9e4a8607fb06c712aaca50a82d23eca05b
Author: Marc Coquand <marc@mccd.space>
Date: Mon, 20 May 2024 09:38:01 -0500
Add search query to title in full view
Diffstat:
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/lib/stitched_article.ml b/lib/stitched_article.ml
@@ -16,7 +16,12 @@ type state =
; tag : string
}
-let title = I.strf ~attr:A.(st bold) "%s" "Notes" |> I.pad ~l:0 ~t:0
+let title ~tag =
+ match tag with
+ | "" -> I.strf ~attr:A.(st bold) "%s" "Notes" |> I.pad ~l:0 ~t:0
+ | a -> I.strf ~attr:A.(st bold) "%s > %s" "Notes" a |> I.pad ~l:0 ~t:0
+
+
let content_start = 1
(* TODO: Use grep -l to filter notes by regexp and rerender those files*)
@@ -49,7 +54,7 @@ let rec render
(Array.to_seq content_pretty |> Seq.drop scroll |> Array.of_seq)
in
let open I in
- output_info </> Array.fold_left (fun sum el -> el </> sum) title elements
+ output_info </> Array.fold_left (fun sum el -> el </> sum) (title ~tag) elements
in
Common.Term.image t img;
let content_length = Array.length content_pretty in