I would like to inline syntax highlight super short code snippets where possible.
I am attempting to inline
1(message "this highlight shortcode")
Is there a way to fix it, may be using some custom shortcode?
.Inner
I am attempting to inline
(message "this hl2 shortcode")
I am attempting to inline
(message "this hl3 shortcode")
I am attempting to inline
(message "this hl4 shortcode")
. And this!! finally works.
hl4
Shortcode definition{{/* Replace the <div> tag with <span>,
and remove the <pre> tag entirely. */}}
{{- transform.Highlight .Inner (.Get 0) (.Get 1 | default "")
| replaceRE `^<div class="highlight"><pre [^>]+>(.*)</pre></div>$`
`<span class="highlight-inline">${1}</span>`
| safeHTML -}}
hl_inline
option on Hugo v0.94.xhighlight
shortcodesomething
(message
"this highlight shortcode")
transform.Highlight
methodsomething
(message "this highlight
shortcode")
highlight
functionsomething
(message "this highlight
shortcode")
@bep I hope you can add a feature to the highlight
shortcode where
a boolean arg like “inline” would do that same as the above shortcode
hack does.
git clone https://gitlab.com/hugo-mwe/hugo-mwe cd hugo-mwe git checkout inline-highlight-sc-attempt ./srv.sh