2023-10-09 14:40:07 -07:00
|
|
|
{{- $repo := .Get 0 -}}
|
|
|
|
{{- $commit := .Get 1 -}}
|
|
|
|
{{- $file := .Get 2 -}}
|
|
|
|
{{- $lang := .Get 3 -}}
|
|
|
|
{{- $line := .Get 4 -}}
|
|
|
|
{{- $lines := split (trim .Inner "\n") "\n" -}}
|
|
|
|
|
2024-06-09 18:36:54 -07:00
|
|
|
{{- $scratch := newScratch -}}
|
2023-10-09 14:40:07 -07:00
|
|
|
{{- $url := printf "https://github.com/%s/blob/%s/%s#L%d" $repo $commit $file $line -}}
|
2024-06-09 18:36:54 -07:00
|
|
|
{{- partial "linerangestr.html" (dict "scratch" $scratch "from" 0 "to" $line) -}}
|
|
|
|
{{- partial "highlightgroup.html" (dict "url" $url "path" $file "comment" ($scratch.Get "comment") "code" (trim .Inner "\n") "language" $lang) -}}
|