aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMarc Coquand <marc@mccd.space>2024-05-20 09:38:01 -0500
committerMarc Coquand <marc@mccd.space>2024-05-20 09:38:01 -0500
commitaf84c15e6c4696c57567764d9035d1e48ab3754d (patch)
tree4335064da0f0b3e87190d002510295cc7dc8b039 /lib
parent4c895f9e4a8607fb06c712aaca50a82d23eca05b (diff)
downloadstitch-af84c15e6c4696c57567764d9035d1e48ab3754d.tar.gz
stitch-af84c15e6c4696c57567764d9035d1e48ab3754d.tar.bz2
stitch-af84c15e6c4696c57567764d9035d1e48ab3754d.zip
Add search query to title in full view
Diffstat (limited to 'lib')
-rw-r--r--lib/stitched_article.ml9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/stitched_article.ml b/lib/stitched_article.ml
index d338912..12b207f 100644
--- 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