Dear Hugo pros,
I would like to embed code with proper highlighting from an external source, means:
- read external file determined by an URL, i.e.
readFile $url
- use the capabilities of
highlight
function - even be able to only render a part of the external file by specifying a
lineStart
andlineEnd
- directly embed it via shortcode to my regular hugo markdown content
basically something like:
{{< highlight go "url=https://foo.bar/baz.go,lineStart=3,lineEnd=20,hl_lines=8 15-17" >}}
{{< /highlight >}}
I am not yet familiar with the power of Hugo, so I didn’t find out how I could realize this.
Is this possible these days and if yes, how?
Thank you and kind regards
ITler