Add a label to codelines that includes the source file.
This commit is contained in:
parent
d3421733e1
commit
4be8a25699
|
@ -5,6 +5,16 @@ $code-color-keyword: black;
|
||||||
$code-color-type: black;
|
$code-color-type: black;
|
||||||
$code-color-comment: grey;
|
$code-color-comment: grey;
|
||||||
|
|
||||||
|
.highlight-label {
|
||||||
|
padding: 0.25rem 0.5rem 0.25rem 0.5rem;
|
||||||
|
border: $code-border;
|
||||||
|
border-bottom: none;
|
||||||
|
|
||||||
|
a {
|
||||||
|
font-family: $font-code;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
code {
|
code {
|
||||||
font-family: $font-code;
|
font-family: $font-code;
|
||||||
background-color: $code-color;
|
background-color: $code-color;
|
||||||
|
|
|
@ -11,4 +11,8 @@
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ .Scratch.Set "opts" "" }}
|
{{ .Scratch.Set "opts" "" }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
<div class="highlight-group">
|
||||||
|
<div class="highlight-label">From <a href="https://dev.danilafe.com/Web-Projects/blog-static/src/branch/master/code/{{ .Get 1 }}">{{ path.Base (.Get 1) }}</a>,
|
||||||
|
{{ if eq (.Get 2) (.Get 3) }}line {{ .Get 2 }}{{ else }} lines {{ .Get 2 }} through {{ .Get 3 }}{{ end }}</div>
|
||||||
{{ highlight (delimit $v "\n") (.Get 0) (printf "linenos=table,linenostart=%d%s" (.Get 2) (.Scratch.Get "opts")) }}
|
{{ highlight (delimit $v "\n") (.Get 0) (printf "linenos=table,linenostart=%d%s" (.Get 2) (.Scratch.Get "opts")) }}
|
||||||
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user