Class reference
Core modes used
- hljs.NUMBER_MODE
- hljs.QUOTE_STRING_MODE
- hljs.APOS_STRING_MODE
- hljs.COMMENT
Standard scopes (classes)
The following standard scopes are used to style the output. Make sure your style has a definition for them.
operator
Used for the following items :
|,,,=,:=property
We style every dot word chain as property except if it starts with a built_in. In these cases we use built_in for the start (one or two words). see also title.function.invoke below.
punctuation
Used for opening and closing parenthesis of sub expressions:
(,)string
Strings and used for Names used in
block,define, andpartialactions.template-tag
Used for opening and closing template tags. {{ printf “
{{{{--}}}}” }}template-variable
Used for template variables starting with a
$(example$myvar)title.function.invoke (special)
If a built_in is followed by a dot it must return an object. Knowing it’s something special and it definitely calls something else we assign title.function.invoke. Up-to-date themes may have a style configured. If not you can create your own or live with the fallback.
New scopes (classes)
template-variable.context
The Context – a leading
.or$.– is a special thing in Go/Hugo templating. We use a dedicated class here to allow emphasis. Use it in your CSS to create a different visual appearance for Context. keep in mind, that all styles out there do not define this one. If you want it, define a style or take the fallback which istemplate-variable.string.raw
A raw string in Go/Hugo templates is a sequence of characters enclosed in backticks. All characters enclosed are taken literally.
Keywords used
We divide Go/Hugo keywords into the following standard scopes.
literal
false,trueandnilkeyword
For Hugo as documented in Hugo - go template functions except
urlquery1For Go as documented in Go template actions and
define2built_in
For Hugo as documented in Hugo - Functions excluding the keywords from above. We include both; the real namespaced function name and aliases.
For Go as documented in Go Template-Text Predefined template functions
HINT: We generate the Keywords for Hugo at build time using the recent version of the docs. Means highlighting old code won’t detect ancient keywords/buildtins.all keywords. The Go template keywords are handcrafted from the docs. Hupefull thts a complete fetch.
Submodes
highlighjs-hugo-html uses the Highlight.js builtin xml for highlighting HTML as subLanguage.
See their documentation for scopes used.