From d38b87110b078027006bc34aa27a065fa22295a1 Mon Sep 17 00:00:00 2001 From: Jon Eskin Date: Sun, 2 Oct 2022 13:56:35 -0400 Subject: [PATCH] Add linkable line number option to CLI --- cmd/chroma/main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/chroma/main.go b/cmd/chroma/main.go index 284409f8b..a1086419b 100644 --- a/cmd/chroma/main.go +++ b/cmd/chroma/main.go @@ -71,6 +71,7 @@ command, for Go. HTMLHighlightStyle string `group:"html" help:"Style used for highlighting lines."` HTMLBaseLine int `group:"html" help:"Base line number." default:"1"` HTMLPreventSurroundingPre bool `group:"html" help:"Prevent the surrounding pre tag."` + HTMLLinkableLines bool `group:"html" help:"Make the line numbers linkable and be a link to themselves."` Files []string `arg:"" optional:"" help:"Files to highlight." type:"existingfile"` } @@ -266,6 +267,7 @@ func configureHTMLFormatter(ctx *kong.Context) { html.WithLineNumbers(cli.HTMLLines), html.LineNumbersInTable(cli.HTMLLinesTable), html.PreventSurroundingPre(cli.HTMLPreventSurroundingPre), + html.LinkableLineNumbers(cli.HTMLLinkableLines, "L"), } if len(cli.HTMLHighlight) > 0 { ranges := [][2]int{}