diff options
author | Marc Coquand <marc@mccd.space> | 2024-05-20 09:38:01 -0500 |
---|---|---|
committer | Marc Coquand <marc@mccd.space> | 2024-05-20 09:38:01 -0500 |
commit | af84c15e6c4696c57567764d9035d1e48ab3754d (patch) | |
tree | 4335064da0f0b3e87190d002510295cc7dc8b039 /lib/stitched_article.ml | |
parent | 4c895f9e4a8607fb06c712aaca50a82d23eca05b (diff) | |
download | stitch-af84c15e6c4696c57567764d9035d1e48ab3754d.tar.gz stitch-af84c15e6c4696c57567764d9035d1e48ab3754d.tar.bz2 stitch-af84c15e6c4696c57567764d9035d1e48ab3754d.zip |
Add search query to title in full view
Diffstat (limited to 'lib/stitched_article.ml')
-rw-r--r-- | lib/stitched_article.ml | 9 |
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 |