Skip to content

Commit

Permalink
Add linkable line number option to CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
jpe90 authored and alecthomas committed Oct 2, 2022
1 parent 9ac9b11 commit d38b871
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/chroma/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}
Expand Down Expand Up @@ -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{}
Expand Down

0 comments on commit d38b871

Please sign in to comment.