From af84c15e6c4696c57567764d9035d1e48ab3754d Mon Sep 17 00:00:00 2001 From: Marc Coquand Date: Mon, 20 May 2024 09:38:01 -0500 Subject: Add search query to title in full view --- lib/stitched_article.ml | 9 +++++++-- 1 file 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 -- cgit v1.2.3