From 0eadf387e68830759c212ca694650f43fd319b48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reynir=20Bj=C3=B6rnsson?= Date: Wed, 9 Dec 2020 13:44:44 +0100 Subject: [PATCH] Add anchor to timestamps --- lib/views.ml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/views.ml b/lib/views.ml index 3d37d20..69c371e 100644 --- a/lib/views.ml +++ b/lib/views.ml @@ -81,12 +81,14 @@ let job_run p [txtf "Execution result: %a." Builder.pp_execution_result result]; table (List.mapi (fun idx (ts, line) -> + let ts_id = "L" ^ string_of_int idx in tr [ td ~a:[ a_class ["output-ts"]; - a_id ("L" ^ string_of_int idx); + a_id ts_id; ] - [txtf "%#d ms" (Duration.to_ms (Int64.of_int ts))]; + [a ~a:[a_href ("#"^ts_id); a_class ["output-ts-anchor"]] + [code [txtf "%#d ms" (Duration.to_ms (Int64.of_int ts))]]]; td ~a:[a_class ["output-code"]] [code [txt line]]; ])