Skip to content

Commit d38b871

Browse files
jpe90alecthomas
authored andcommitted
Add linkable line number option to CLI
1 parent 9ac9b11 commit d38b871

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎cmd/chroma/main.go‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ command, for Go.
7171
HTMLHighlightStyle string `group:"html" help:"Style used for highlighting lines."`
7272
HTMLBaseLine int `group:"html" help:"Base line number." default:"1"`
7373
HTMLPreventSurroundingPre bool `group:"html" help:"Prevent the surrounding pre tag."`
74+
HTMLLinkableLines bool `group:"html" help:"Make the line numbers linkable and be a link to themselves."`
7475

7576
Files []string `arg:"" optional:"" help:"Files to highlight." type:"existingfile"`
7677
}
@@ -266,6 +267,7 @@ func configureHTMLFormatter(ctx *kong.Context) {
266267
html.WithLineNumbers(cli.HTMLLines),
267268
html.LineNumbersInTable(cli.HTMLLinesTable),
268269
html.PreventSurroundingPre(cli.HTMLPreventSurroundingPre),
270+
html.LinkableLineNumbers(cli.HTMLLinkableLines, "L"),
269271
}
270272
if len(cli.HTMLHighlight) > 0 {
271273
ranges := [][2]int{}

0 commit comments

Comments
 (0)