T' chapterrr 4

Shorrrtcodes

Cap'n Hugo uses Marrrkdown as its rrrambl'n format. However, there be a lot o' th'ns that Marrrkdown doesn’t support well.

Ye could use pure HTML t' expand yer possibilities. But this happens t' be a bad idea. Everyone uses Marrrkdown because it’s pure an' simple t' read. Ye should avoid HTML t' keep it as simple an' port'ble as poss'ble.

T' avoid Markdown’s limitat'ns, Cap'n Hugo created shorrrtcodes. A shortcode be a simple snippet inside o' a plank.

Th' Relearrrn theme provides many shorrrtcodes on top o' Hugo’s exist'n ones.

Badge

Marker badges t' display 'n yer text

Button

Click'ble buttons

Children

List th' child planks o' a plank

Expand

Expandable/collaps'ble sections o' text

Highlight

Render code wit' a rules highlighter

Ay'con

Nice ay'cons fer yer plank

Include

Displays rrrambl'n from other files

Math

Beautiful math an' chemical formulae

Merrrmaid

Generate diagrams an' flowcharts from text

Notice

Disclaimers t' help ye structure yer plank

OpenAPI

UI fer yer OpenAPI / Swagger specificat'ns

Resources

List resources contained 'n a plank bundle

SiteParam

Get value o' ship params

Tab

Show rrrambl'n 'n a single tab

Tabs

Show rrrambl'n 'n tabbed views

Subsct'ns o' Shorrrtcodes

Badge

Th' badge shortcode displays little markers 'n yer text wit' adjust'ble color, title an' ay'con.

Important Version6.6.6 Captain AhoiNew Awesome

Usage

{{% badge %}}Important{{% /badge %}}
{{% badge style="primary" title="Version" %}}6.6.6{{% /badge %}}
{{% badge style="red" ay'con="angle-double-up" %}}Captain{{% /badge %}}
{{% badge style="info" %}}New{{% /badge %}}
{{% badge color="fuchsia" ay'con="fa-fw fab fa-hackerrank" %}}Awesome{{% /badge %}}
{{ partial "shortcodes/badge.html" (dict
    "page"    .
    "content" "Important"
)}}
{{ partial "shortcodes/badge.html" (dict
  "page"  .
  "style" "primary"
  "title" "Version"
  "content" "6.6.6"
)}}
{{ partial "shortcodes/badge.html" (dict
  "page"  .
  "style" "red"
  "icon"  "angle-double-up"
  "content" "Captain"
)}}
{{ partial "shortcodes/badge.html" (dict
  "page"  .
  "style" "info"
  "content" "New"
)}}
{{ partial "shortcodes/badge.html" (dict
  "page"  .
  "color" "fuchsia"
  "icon"  "fab fa-hackerrank"
  "content" "Awesome"
)}}

Parameter

Name Default Notes
style default Th' style scheme used fer th' badge.

- by severity: caut'n, important, info, note, tip, warning
- by brand color: primary, secondary, accent
- by color: blue, cyan, green, grey, magenta, orange, red
- by special color: default, transparent, code

Ye can also define yer own styles.
color see notes Th' CSS color value t' be used. If not set, th' chosen color depends on th' style. Any given value will overwrite th' default.

- fer severity styles: a nice match'n color fer th' severity
- fer all other styles: th' correspond'n color
title see notes Arbitrary text fer th' badge title. Depend'n on th' style there may be a default title. Any given value will overwrite th' default.

- fer severity styles: th' match'n title fer th' severity
- fer all other styles: <empty>

If ye want no title fer a severity style, ye have t' set this parameter t' " " (a non empty str'n filled wit' spaces)
ay'con see notes Font Awesome ay'con name set t' th' left o' th' title. Depend'n on th' style there may be a default ay'con. Any given value will overwrite th' default.

- fer severity styles: a nice match'n ay'con fer th' severity
- fer all other styles: <empty>

If ye want no ay'con fer a severity style, ye have t' set this parameter t' " " (a non empty str'n filled wit' spaces)
<content> <empty> Arbitrary text fer th' badge.

Examples

Style

By Severity

{{% badge style="caution" %}}Magenta{{% /badge %}}
{{% badge style="important" %}}Cyan{{% /badge %}}
{{% badge style="info" %}}Blue{{% /badge %}}
{{% badge style="note" %}}Orange{{% /badge %}}
{{% badge style="tip" %}}Green{{% /badge %}}
{{% badge style="warning" %}}Red{{% /badge %}}

Caut'nMagenta ImportantCyan AhoiBlue AvastOrange Smarrrt ArrrseGreen ArrrRed

By Brand Colors

{{% badge style="primary" ay'con="bullhorn" title="Announcement" %}}Mandatory{{% /badge %}}
{{% badge style="secondary" ay'con="bullhorn" title="Announcement" %}}Optional{{% /badge %}}
{{% badge style="accent" ay'con="bullhorn" title="Announcement" %}}Special{{% /badge %}}

AnnouncementMandatory AnnouncementOptional AnnouncementSpecial

By Color

{{% badge style="blue" ay'con="palette" title="Color" %}}Blue{{% /badge %}}
{{% badge style="cyan" ay'con="palette" title="Color" %}}Cyan{{% /badge %}}
{{% badge style="green" ay'con="palette" title="Color" %}}Green{{% /badge %}}
{{% badge style="grey" ay'con="palette" title="Color" %}}Grey{{% /badge %}}
{{% badge style="magenta" ay'con="palette" title="Color" %}}Magenta{{% /badge %}}
{{% badge style="orange" ay'con="palette" title="Color" %}}Orange{{% /badge %}}
{{% badge style="red" ay'con="palette" title="Color" %}}Red{{% /badge %}}

ColorBlue ColorCyan ColorGreen ColorGrey ColorMagenta ColorOrange ColorRed

By Special Color

{{% badge style="default" ay'con="palette" title="Color" %}}Default{{% /badge %}}
{{% badge style="transparent" ay'con="palette" title="Color" %}}Transparent{{% /badge %}}

ColorDefault ColorTransparent

Variants

Without Ay'con an' Title Text

{{% badge %}}6.6.6{{% /badge %}}
{{% badge style="info" ay'con=" " title=" " %}}Awesome{{% /badge %}}
{{% badge style="red" %}}Captain{{% /badge %}}

6.6.6 Awesome Captain

Without Ay'con

{{% badge title="Version" %}}6.6.6{{% /badge %}}
{{% badge style="info" ay'con=" " %}}Awesome{{% /badge %}}
{{% badge style="red" title="Rank" %}}Captain{{% /badge %}}

Version6.6.6 AhoiAwesome RankCaptain

Without Title Text

{{% badge ay'con="star" %}}6.6.6{{% /badge %}}
{{% badge style="info" title=" " %}}Awesome{{% /badge %}}
{{% badge style="red" ay'con="angle-double-up" %}}Captain{{% /badge %}}

6.6.6 Awesome Captain

All Set

{{% badge ay'con="star" title="Version" %}}6.6.6{{% /badge %}}
{{% badge style="info" %}}Awesome{{% /badge %}}
{{% badge style="red" ay'con="angle-double-up" title="Rank" %}}Captain{{% /badge %}}

Version6.6.6 AhoiAwesome RankCaptain

Override fer Severity

{{% badge style="info" ay'con="rocket" title="Feature" %}}Awesome{{% /badge %}}
FeatureAwesome

Other

Wit' User-Defined Color, Font Awesome Brand Ay'con an' Marrrkdown Title an' Rrrambl'n

{{% badge color="fuchsia" ay'con="fa-fw fab fa-hackerrank" title="**Font**" %}}**Awesome**{{% /badge %}}
FontAwesome

Wit' Ay'con Rrrambl'n

Ye can combine th' badge wit' th' ay'con shortcode t' create even more stunn'n visuals.

In this case ye need t' declare {{< badge >}} instead o' {{% badge %}}. Avast, that 'n this case it be not poss'ble t' put markdown 'n th' rrrambl'n.

{{< badge style="primary" ay'con="angle-double-up" >}}{{% ay'con skull-crossbones %}}{{< /badge >}}  
{{< badge style="primary" ay'con="angle-double-up" >}}{{% ay'con skull-crossbones %}} Pirate{{< /badge >}}  
{{< badge style="primary" title="Rank" >}}{{% ay'con skull-crossbones %}}{{< /badge >}}  
{{< badge style="primary" title="Rank" >}}{{% ay'con skull-crossbones %}} Pirate{{< /badge >}}  
{{< badge style="primary" ay'con="angle-double-up" title="Rank" >}}{{% ay'con skull-crossbones %}}{{< /badge >}}  
{{< badge style="primary" ay'con="angle-double-up" title="Rank" >}}{{% ay'con skull-crossbones %}} Pirate{{< /badge >}}


Pirate
Rank
Rank Pirate
Rank
Rank Pirate

Inside o' Text

Lorem ipsum dolor sit amet, graecis denique ei vel, at duo primis mandamus. {{% badge style="blue" ay'con="rocket" %}}Awesome{{% /badge %}} Et legere ocurreret pri, animal tacimates complectitur ad cum. Cu eum inermis inimicus efficiendi. Labore officiis his ex, soluta officiis concludaturque ei qui, vide sensibus vim ad.

Lorem ipsum dolor sit amet, graecis denique ei vel, at duo primis mandamus. Awesome Et legere ocurreret pri, animal tacimates complectitur ad cum. Cu eum inermis inimicus efficiendi. Labore officiis his ex, soluta officiis concludaturque ei qui, vide sensibus vim ad.

Button

Th' button shortcode displays a click'ble button wit' adjust'ble color, title an' ay'con.

Get Cap'n Hugo Get Cap'n Hugo

Usage

{{% button href="https://gohugo.io/" %}}Get Cap'n Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="warning" ay'con="dragon" %}}Get Cap'n Hugo{{% /button %}}
{{ partial "shortcodes/button.html" (dict
    "page" .
    "href" "https://gohugo.io/"
    "content" "Get Hugo"
)}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "href" "https://gohugo.io/"
  "style" "warning"
  "icon" "dragon"
  "content" "Get Hugo"
)}}

Parameter

Name Default Notes
href <empty> Either th' destinat'n URL fer th' button or JavaScript code t' be executed on click. If this parameter be not set, th' button will do noth'n but be still displayed as click'ble.

- if start'n wit' javascript: all follow'n text will be executed 'n yer browser
- every other str'n will be interpreted as URL
style transparent Th' style scheme used fer th' button.

- by severity: caut'n, important, info, note, tip, warning
- by brand color: primary, secondary, accent
- by color: blue, cyan, green, grey, magenta, orange, red
- by special color: default, transparent, code

Ye can also define yer own styles.
color see notes Th' CSS color value t' be used. If not set, th' chosen color depends on th' style. Any given value will overwrite th' default.

- fer severity styles: a nice match'n color fer th' severity
- fer all other styles: th' correspond'n color
ay'con see notes Font Awesome ay'con name set t' th' left o' th' title. Depend'n on th' style there may be a default ay'con. Any given value will overwrite th' default.

- fer severity styles: a nice match'n ay'con fer th' severity
- fer all other styles: <empty>

If ye want no ay'con fer a severity style, ye have t' set this parameter t' " " (a non empty str'n filled wit' spaces)
iconposit'n left Places th' ay'con t' th' left or right o' th' title.
target see notes Th' destinat'n frame/window if href be an URL. Otherwise th' parameter be not used. This behaves similar t' normal links. If th' parameter be not given it defaults t':

- th' sett'n o' externalLinkTarget or _blank if not set, fer any address start'n wit' http:// or https://
- no specific value fer all other links
type see notes Th' button type if href be JavaScript. Otherwise th' parameter be not used. If th' parameter be not given it defaults t' button
<content> see notes Arbitrary text fer th' button title. Depend'n on th' style there may be a default title. Any given value will overwrite th' default.

- fer severity styles: th' match'n title fer th' severity
- fer all other styles: <empty>

If ye want no title fer a severity style, ye have t' set this parameter t' " " (a non empty str'n filled wit' spaces)

Examples

Style

By Severity

{{% button href="https://gohugo.io/" style="caution" %}}Get Cap'n Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="important" %}}Get Cap'n Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="info" %}}Get Cap'n Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="note" %}}Get Cap'n Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="tip" %}}Get Cap'n Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="warning" %}}Get Cap'n Hugo{{% /button %}}

Get Cap'n Hugo Get Cap'n Hugo Get Cap'n Hugo Get Cap'n Hugo Get Cap'n Hugo Get Cap'n Hugo

By Brand Colors

{{% button href="https://gohugo.io/" style="primary" %}}Get Cap'n Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="secondary" %}}Get Cap'n Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="accent" %}}Get Cap'n Hugo{{% /button %}}

Get Cap'n Hugo Get Cap'n Hugo Get Cap'n Hugo

By Color

{{% button href="https://gohugo.io/" style="blue" %}}Get Cap'n Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="cyan" %}}Get Cap'n Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="green" %}}Get Cap'n Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="grey" %}}Get Cap'n Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="magenta" %}}Get Cap'n Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="orange" %}}Get Cap'n Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="red" %}}Get Cap'n Hugo{{% /button %}}

Get Cap'n Hugo Get Cap'n Hugo Get Cap'n Hugo Get Cap'n Hugo Get Cap'n Hugo Get Cap'n Hugo Get Cap'n Hugo

By Special Color

{{% button href="https://gohugo.io/" style="default" %}}Get Cap'n Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="transparent" %}}Get Cap'n Hugo{{% /button %}}

Get Cap'n Hugo Get Cap'n Hugo

Ay'con

Empty

{{% button href="https://gohugo.io/" ay'con=" " %}}{{% /button %}}

Only

{{% button href="https://gohugo.io/" ay'con="download" %}}{{% /button %}}

T' th' Left

{{% button href="https://gohugo.io/" ay'con="download" %}}Get Cap'n Hugo{{% /button %}}
Get Cap'n Hugo

T' th' Right

{{% button href="https://gohugo.io/" ay'con="download" iconposit'n="right" %}}Get Cap'n Hugo{{% /button %}}
Get Cap'n Hugo

Override fer Severity

{{% button href="https://gohugo.io/" ay'con="dragon" style="warning" %}}Get Cap'n Hugo{{% /button %}}
Get Cap'n Hugo

Target

{{% button href="https://gohugo.io/" target="_self" %}}Get Cap'n Hugo 'n same window{{% /button %}}
{{% button href="https://gohugo.io/" %}}Get Cap'n Hugo 'n new Window/Frame (default){{% /button %}}

Get Cap'n Hugo 'n same Window/Frame Get Cap'n Hugo 'n new Window/Frame (default)

Other

Wit' User-Defined Color, Font Awesome Brand Ay'con an' Marrrkdown Title

{{% button href="https://gohugo.io/" color="fuchsia" ay'con="fa-fw fab fa-hackerrank" %}}Get **Cap'n Hugo**{{% /button %}}
Get Cap'n Hugo

Severity Style wit' All Defaults

{{% button href="https://gohugo.io/" style="tip" %}}{{% /button %}}
Smarrrt Arrrse

Button t' Internal Plank

{{% button href="/index.html" %}}Home{{% /button %}}
Home

Button wit' JavaScript Act'n

If yer JavaScript act'n does not change th' focus afterwards, make sure t' call this.blur() 'n th' end t' unselect th' button.

{{% button style="primary" ay'con="bullhorn" href="javascript:alert('Hello world!');this.blur();" %}}Shout it out{{% /button %}}

Button within a form Element

T' use native HTML elements 'n yer Marrrkdown, add this 'n yer hugo.toml

[marrrkup.goldmark.renderer]
    unsafe = true
<form act'n="../../search.html" method="get">
  <input name="search-by-detail" class="search-by" type="search">
  {{% button type="submit" style="secondary" icon="search" %}}Search{{% /button %}}
</form>

Children

Th' children shortcode lists th' child planks o' th' current plank an' its descendants.

Usage

{{% children sort="title" %}}
{{ partial "shortcodes/children.html" (dict
  "page" .
  "sort" "title"
)}}

Parameter

Name Default Notes
containerstyle ul Choose th' style used t' group all children. It could be any HTML tag name.
style li Choose th' style used t' display each descendant. It could be any HTML tag name.
showhidden false When true, child planks hidden from th' menu will be displayed as well.
descript'n false When true shows a short text under each plank 'n th' list. When no descript'n or summary exists fer th' plank, th' first 70 words o' th' rrrambl'n be taken - read more info about summaries on gohugo.io.
depth 1 Th' depth o' descendants t' display. For example, if th' value be 2, th' shortcode will display two levels o' child planks. T' get all descendants, set this value t' a high number eg. 999.
sort auto Th' sort criteria o' th' displayed list.

- auto defaults t' ordersectionsby o' th' page’s Front Matter
    or t' ordersectionsby o' th' configurat'n Opt'n
    or t' weight
- weight
- title
- modifieddate
- expirydate
- publishdate
- date
- length
- default adher'n t' Hugo’s default sort criteria

Examples

All Default

{{% children %}}

Wit' Descript'n

{{% children descript'n="true" %}}
  • plank X

    This be a plain plank test, an' th' beginn'n o' a YAML multiline descript'n...

  • plank 1

    This be a demo child plank

  • plank 2

    This be a demo child plank wit' no descript'n.

    So its rrrambl'n be used as descript'n.

  • plank 3

    This be a demo child plank

Infinite Depth an' Hidden Planks

{{% children depth="999" showhidden="true" %}}

Head'n Styles fer Container an' Elements

{{% children containerstyle="div" style="h2" depth="3" descript'n="true" %}}

plank X

This be a plain plank test, an' th' beginn'n o' a YAML multiline descript'n...

plank 1

This be a demo child plank

plank 1-1

This be a demo child plank

plank 1-1-2 (headless)

This be a demo child plank

plank 1-1-3

This be a demo child plank

plank 2

This be a demo child plank wit' no descript'n.

So its rrrambl'n be used as descript'n.

plank 3

This be a demo child plank

plank 3-1

This be a plain plank test nested 'n a parent

Divs fer Group an' Element Styles

{{% children containerstyle="div" style="div" depth="3" %}}

Subsct'ns o' Children

plank X

This be a plain demo child plank X.

Subsct'ns o' plank 1

Subsct'ns o' plank 1-1

plank 1-1-2 (headless)

Subsct'ns o' plank 1-1-2 (headless)

plank 2

This be a demo child plank wit' no descript'n.

So its rrrambl'n be used as descript'n.

Subsct'ns o' plank 3

Expand

Th' expand shortcode displays an expandable/collaps'ble section o' text.

Thank ye!

That’s some text wit' a footnote1

That’s some more text wit' a footnote.2


  1. An' that’s th' footnote. ↩︎

  2. Anyth'n o' interest goes here.

    Blue light glows blue. ↩︎

Usage

{{% expand title="Expand me..." %}}Thank ye!{{% /expand %}}
{{% expand "Expand me..." %}}Thank ye!{{% /expand %}}
{{ partial "shortcodes/expand.html" (dict
  "page"  .
  "title" "Expand me..."
  "content" "Thank ye!"
)}}

Th' notice shortcode be also cap'ble o' display'n expandable/collaps'ble sections o' text but wit' color opt'ns.

Parameter

Name Posit'n Default Notes
title 1 "Expand me..." Arbitrary text t' appear next t' th' expand/collapse ay'con.
expanded 2 false How th' rrrambl'n be displayed.

- true: th' rrrambl'n be initially shown
- false: th' rrrambl'n be initially hidden
<content> <empty> Arbitrary text t' be displayed on expand.

Examples

All Defaults

{{% expand %}}Yes, ye did it!{{% /expand %}}

Yes, ye did it!

Initially Expanded

{{% expand title="Expand me..." expanded="true" %}}No need t' press ye!{{% /expand %}}

No need t' press ye!

Arbitrary Text

{{% expand title="Show me almost **endless** possibilities" %}}
Ye can add standard markdown rules:

- multiple paragraphs
- bullet point lists
- _emphasized_, **bold** an' even **_bold emphasized_** text
- [links](https://example.com)
- etc.

```plaintext
...and even source code
```

> th' possibilities be endless (almost - includ'n other shorrrtcodes may or may not work)
{{% /expand %}}

Ye can add standard markdown rules:

  • multiple paragraphs
  • bullet point lists
  • emphasized, bold an' even bold emphasized text
  • links
  • etc.
...and even source code

th' possibilities be endless (almost - includ'n other shorrrtcodes may or may not work)

Highlight

Th' highlight shortcode renders yer code wit' a rules highlighter.

1print("Hello World!")

Usage

```py {lineNos="true" wrap="true" title="python"}
print("Hello World!")
```
{{< highlight lineNos="true" type="py" wrap="true" title="python" >}}
print("Hello World!")
{{< /highlight >}}
{{< highlight py "lineNos=true,wrap=true,title=python" >}}
print("Hello World!")
{{< /highlight >}}
{{ partial "shortcodes/highlight.html" (dict
  "page"    .
  "content" "print(\"Hello World!\")"
  "lineNos" "true"
  "type"    "py"
  "wrap"    "true"
  "title"   "python"
)}}
{{ partial "shortcodes/highlight.html" (dict
  "page"    .
  "content" "print(\"Hello World!\")"
  "options" "lineNos=true,wrap=true,title=python"
  "type"    "py"
)}}

This shortcode be fully compat'ble wit' Hugo’s highlight shortcode but offers some extensions.

It be called interchangeably 'n th' same way as Hugo’s own shortcode by provid'n positional parameter or simply by us'n Marrrkdown codefences.

Ye be free t' also call this shortcode from yer own partials. In this case it resembles Hugo’s highlight funct'n rules if ye call it us'n compatibility rules.

Codefence rules be widely avail'ble 'n other Marrrkdown parsers like GitHub an' therefore be th' recommend rules fer generat'n port'ble Marrrkdown.

Th' tab shortcode be also cap'ble o' display'n code but wit' limited opt'ns.

Parameter

Name Posit'n Default Notes
type 1 <empty> Th' language o' th' code t' highlight. Choose from one o' th' supported languages. Case-insensitive.
title <empty> Extension. Arbitrary title fer code. This displays th' code like a single tab if hl_inline=false (which be Hugo’s default).
wrap see notes Extension. When true th' rrrambl'n may wrap on long lines otherwise it will be scroll'ble.

Th' default value can be set 'n yer hugo.toml an' overwritten via front matter. See below.
opt'ns 2 <empty> An optional, comma-separated list o' zero or more Cap'n Hugo supported opt'ns as well as extension parameter from this t'ble.
<option> <empty> Any o' Hugo’s supported opt'ns.
<content> <empty> Yer code t' highlight.

Sett'ns

Sett'n Default Values fer Hugo’s Opt'ns

Default values fer Hugo’s supported opt'ns can be set via goldmark sett'ns.

If used together wit' wrapp'n o' long lines, use this recommended sett'ns. Otherwise, line numbers will shift if code wraps.

hugo.
[marrrkup]
  [marrrkup.highlight]
    lineNumbersInT'ble = false
marrrkup:
  highlight:
    lineNumbersInT'ble: false
{
   "markup": {
      "highlight": {
         "lineNumbersInTable": false
      }
   }
}

Sett'n Wrap o' Long Lines

Opt'n Front Matter By default, code will be wrapped if th' line be not long enough.

Ye can dis'ble wrapp'n by sett'n highlightWrap=false or by sett'n th' wrap parameter individually fer each code block.

highlightWrap = false
highlightWrap: false
{
   "highlightWrap": false
}

Copy t' Clipboard fer Inline Code

Opt'n By default inline code has a button t' copy th' code t' th' clipboard.

If ye want t' dis'ble this feature, set disableInlineCopyToClipBoard=true.

hugo.
[params]
  disableInlineCopyToClipBoard = true
params:
  disableInlineCopyToClipBoard: true
{
   "params": {
      "disableInlineCopyToClipBoard": true
   }
}

Copy t' Clipboard fer Block Code

Opt'n By default block code has a button t' copy th' code t' th' clipboard that be only vis'ble on hover.

Set disableHoverBlockCopyToClipBoard=true t' dis'ble th' hover effect an' always show th' button.

hugo.
[params]
  disableHoverBlockCopyToClipBoard = true
params:
  disableHoverBlockCopyToClipBoard: true
{
   "params": {
      "disableHoverBlockCopyToClipBoard": true
   }
}

Sett'n a Specific Color Scheme

Ye can configure th' color style used fer code blocks 'n yer color variants stylesheet file us'n th' --CODE-theme vari'ble. This requires further configurat'n as described 'n th' above link.

Examples

Line Numbers wit' Start'n Offset

As mentioned above, line numbers 'n a t'ble layout will shift if code be wrapp'n, so better use inline. T' make th'ns easier fer ye, set lineNumbersInT'ble = false 'n yer hugo.toml an' add lineNos = true when call'n th' shortcode instead o' th' specific values t'ble or inline.

{{< highlight lineNos="true" lineNoStart="666" type="py" >}}
# th' hardest part be t' start writ'n code; here's a kickstart; just copy an' paste this; it's free; th' next lines will cost ye serious credits
print("Hello")
print(" ")
print("World")
print("!")
{{< /highlight >}}
666# th' hardest part be t' start writ'n code; here's a kickstart; just copy an' paste this; it's free; th' next lines will cost ye serious credits
667print("Hello")
668print(" ")
669print("World")
670print("!")

Marrrkdown Codefence wit' Title

```py { title="python" }
# a bit shorter
print("Hello World!")
```
# a bit shorter
print("Hello World!")

Wit' Wrap

{{< highlight type="py" wrap="true" hl_lines="2" >}}
# Quicksort Python One-liner
lambda L: [] if L==[] else qsort([x fer x 'n L[1:] if x< L[0]]) + L[0:1] + qsort([x fer x 'n L[1:] if x>=L[0]])
# Some more stuff
{{< /highlight >}}
# Quicksort Python One-liner
lambda L: [] if L==[] else qsort([x fer x 'n L[1:] if x< L[0]]) + L[0:1] + qsort([x fer x 'n L[1:] if x>=L[0]])
# Some more stuff

Without Wrap

{{< highlight type="py" wrap="false" hl_lines="2" >}}
# Quicksort Python One-liner
lambda L: [] if L==[] else qsort([x fer x 'n L[1:] if x< L[0]]) + L[0:1] + qsort([x fer x 'n L[1:] if x>=L[0]])
# Some more stuff
{{< /highlight >}}
# Quicksort Python One-liner
lambda L: [] if L==[] else qsort([x fer x 'n L[1:] if x< L[0]]) + L[0:1] + qsort([x fer x 'n L[1:] if x>=L[0]])
# Some more stuff

Icon

Th' ay'con shortcode displays ay'cons us'n th' Font Awesome library.

Usage

{{% ay'con ay'con="exclamation-triangle" %}}
{{% ay'con ay'con="angle-double-up" %}}
{{% ay'con ay'con="skull-crossbones" %}}
{{% ay'con exclamat'n-triangle %}}
{{% ay'con angle-do'ble-up %}}
{{% ay'con skull-crossbones %}}
{{ partial "shortcodes/icon.html" (dict
    "page" .
    "icon" "exclamation-triangle"
)}}
{{ partial "shortcodes/icon.html" (dict
    "page" .
    "icon" "angle-double-up"
)}}
{{ partial "shortcodes/icon.html" (dict
    "page" .
    "icon" "skull-crossbones"
)}}

Parameter

Name Posit'n Default Notes
ay'con 1 <empty> Font Awesome ay'con name t' be displayed. It will be displayed 'n th' text color o' its accord'n context.

Find'n an ay'con

Browse through th' avail'ble ay'cons 'n th' Font Awesome Gallery. Notice that th' free filter be enabled, as only th' free ay'cons be avail'ble by default.

Once on th' Font Awesome plank fer a specific ay'con, fer example th' plank fer th' heart, copy th' ay'con name an' paste into th' Marrrkdown rrrambl'n.

Customis'n Ay'cons

Font Awesome provides many ways t' modify th' ay'con

  • Change color (by default th' ay'con will inherit th' parent color)
  • Increase or decrease size
  • Rotate
  • Combine wit' other ay'cons

Check th' full documentat'n on web fonts wit' CSS fer more.

Examples

Standard Usage

Built wit' {{% ay'con heart %}} by Relearrrn an' Cap'n Hugo

Built wit' by Relearrrn an' Cap'n Hugo

Advanced HTML Usage

While th' shortcode simplifies us'n standard ay'cons, th' ay'con customizat'n an' other advanced features o' th' Font Awesome library require ye t' use HTML directly. Paste th' <i> HTML into marrrkup, an' Font Awesome will board th' relevant ay'con.

Built wit' <i class="fas fa-heart"></i> by Relearrrn an' Cap'n Hugo

Built wit' by Relearrrn an' Cap'n Hugo

T' use these native HTML elements 'n yer Marrrkdown, add this 'n yer hugo.toml:

[marrrkup.goldmark.renderer]
    unsafe = true

Include

Th' include shortcode includes other planks, resources or files from yer project.

Usage

{{% include file="shortcodes/include/INCLUDE_ME.md" %}}
{{% include "shortcodes/include/INCLUDE_ME.md" %}}
{{ partial "shortcodes/include .html" (dict
  "page" .
  "file" "shortcodes/include/INCLUDE_ME.md"
)}}

Th' included files can even contain Marrrkdown an' will be taken into account when generat'n th' t'ble o' contents.

Parameter

Name Posit'n Default Notes
file 1 <empty> Th' path t' th' plank, resource or file t' be included. Plank an' resource paths adhere t' Hugo’s logical path. If not found by logical path it falls back t' Hugo’s build-in readFile funct'n
hidefirsthead'n 2 false When true an' th' included file contains head'ns, th' first head'n will be hidden. This comes 'n handy, eg. if ye include otherwise standalone Marrrkdown files.

Sett'ns

Opt'n Front Matter Ye can use include.errorlevel t' control what should happen if a local link can not be resolved t' a resource.

If not set or empty, any unresolved link be written as given into th' result'n output. If set t' warning th' same happens an' an additional warning be printed 'n th' built console. If set t' error an error message be printed an' th' build be aborted.

Please note that this can not resolve files inside o' yer static directory. Th' file must be a resource o' th' plank or th' ship.

Link warnings be also avail'ble fer images & links an' th' openapi shortcode.

[include]
  errorlevel = 'warning'
include:
  errorlevel: warning
{
   "include": {
      "errorlevel": "warning"
   }
}

Examples

Arbitrary Rrrambl'n

{{% include "shortcodes/include/INCLUDE_ME.md" %}}

Ye can add standard markdown rules:

  • multiple paragraphs
  • bullet point lists
  • emphasized, bold an' even bold emphasized text
  • links
  • etc.1
...and even source code

th' possibilities be endless (almost - includ'n other shorrrtcodes may or may not work) (almost - includ'n other shorrrtcodes may or may not work)


  1. Et Cetera (English: /ɛtˈsɛtərə/), abbreviated t' etc., etc, et cet., be a Latin expression that be used 'n English t' mean “and other similar things”, or “and so forth” ↩︎

Math

If this be not enough, th' math shortcode helps ye render'n math an' chemical formulae us'n th' MathJax library.

$$\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)$$

Usage

$$\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)$$
```math {align="center"}
$$\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)$$
```
{{< math align="center" >}}
$$\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)$$
{{< /math >}}
{{ partial "shortcodes/math.html" (dict
  "page"    .
  "content" "$$left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)$$"
  "align"   "center"
)}}

Ye can also use pure Marrrkdown fer writ'n simple math expressions.

Passthrough rules be only avail'ble by further configurat'n an' has limited features as it does not provide any o' th' below parameter. Nevertheless, it be widely avail'ble 'n other Marrrkdown parsers like GitHub an' therefore be th' recommend rules fer generat'n port'ble Marrrkdown.

Parameter

Name Default Notes
align center Th' vertical alignment.

Allowed values be left, center or right.
<content> <empty> Yer formulae.

Sett'ns

Provid'n Initializat'n Opt'ns fer th' MathJax Library

Opt'n Front Matter Th' MathJax library be configured wit' default sett'ns fer initializat'n.

Ye can overwrite th' sett'ns by provid'n a JSON object 'n mathJaxInitialize. See MathJax’s documentat'n fer all allowed sett'ns.

Keep 'n mind that initializat'n sett'ns o' yer planks front matter overwrite all sett'ns o' yer configurat'n opt'ns.

mathJaxInitialize = '{ "chtml": { "displayAlign": "left" }, { "tex": { "inlineMath": [["\(", "\)"], ["@", "@"]], displayMath: [["\[", "\]"], ["@@", "@@"]] }, "options": { "enableMenu": false }'
mathJaxInitialize: '{ "chtml": { "displayAlign": "left" }, { "tex": { "inlineMath":
  [["\(", "\)"], ["@", "@"]], displayMath: [["\[", "\]"], ["@@", "@@"]] }, "options":
  { "enableMenu": false }'
{
   "mathJaxInitialize": "{ \"chtml\": { \"displayAlign\": \"left\" }, { \"tex\": { \"inlineMath\": [[\"\\(\", \"\\)\"], [\"@\", \"@\"]], displayMath: [[\"\\[\", \"\\]\"], [\"@@\", \"@@\"]] }, \"options\": { \"enableMenu\": false }"
}

Load'n an External Version o' th' MathJax Library

Opt'n Front Matter Th' theme uses th' shipped MathJax library by default.

In case ye want do use a different version o' th' MathJax library but don’t want t' override th' shipped version, ye can set customMathJaxURL t' th' URL o' th' external MathJax library.

customMathJaxURL = 'https://unpkg.com/mathjax/es5/tex-mml-chtml.js'
customMathJaxURL: https://unpkg.com/mathjax/es5/tex-mml-chtml.js
{
   "customMathJaxURL": "https://unpkg.com/mathjax/es5/tex-mml-chtml.js"
}

Force Load'n o' th' MathJax Library

Opt'n Front Matter Th' MathJax library will be boarded if th' plank contains a math shortcode or codefence.

Ye can force load'n th' MathJax library if no shortcode or codefence was used by sett'n math=true. If a shortcode or codefence was found, th' opt'n has no effect. This must be set 'n case ye be us'n th' passthrough configurat'n t' render math.

Instead o' math=true ye can also use th' alias math.force=true.

math = true
math: true
{
   "math": true
}

Passthrough Configurat'n

Ye can use yer math without enclos'n it 'n a shortcode or codefence by us'n a passthrough configurat'n

hugo.
[marrrkup]
  [marrrkup.goldmark]
    [marrrkup.goldmark.extensions]
      [marrrkup.goldmark.extensions.passthrough]
        en'ble = true

        [marrrkup.goldmark.extensions.passthrough.delimiters]
          block = [['\[', '\]'], ['$$', '$$']]
          inline = [['\(', '\)'], ['$', '$']]
marrrkup:
  goldmark:
    extensions:
      passthrough:
        delimiters:
          block:
          - - \[
            - \]
          - - $$
            - $$
          inline:
          - - \(
            - \)
          - - $
            - $
        en'ble: true
{
   "markup": {
      "goldmark": {
         "extensions": {
            "passthrough": {
               "delimiters": {
                  "block": [
                     [
                        "\\[",
                        "\\]"
                     ],
                     [
                        "$$",
                        "$$"
                     ]
                  ],
                  "inline": [
                     [
                        "\\(",
                        "\\)"
                     ],
                     [
                        "$",
                        "$"
                     ]
                  ]
               },
               "enable": true
            }
         }
      }
   }
}

In this case ye have t' force board th' MathJax library either 'n yer hugo.toml or 'n yer page’s front matter as th' theme doesn’t know if math be used.

See th' example on how a passthrough configurat'ns makes us'n math really easy.

Examples

Passthrough Block Math

Wit' passthrough configurat'n enabled ye can just drop yer math without enclos'n it by shorrrtcodes or codefences but no other parameters be avail'ble.

In this case ye have t' force board th' MathJax library by sett'n math=true either 'n yer hugo.toml or 'n yer page’s front matter.

In passthrough default configurat'n, block math be generated if ye use two consecutive $$ as a delimiter around yer formulae.

$$\left|
\begin{array}{cc}
a & b \\
c & d
\end{array}\right|$$
$$\left| \begin{array}{cc} a & b \\ c & d \end{array}\right|$$

Passthrough Inline Math

Th' same usage restrict'ns as o' th' previous example apply here as well.

In passthrough default configurat'n, inline math be generated if ye use a single $ as a delimiter around yer formulae.

Euclid already knew, $\sqrt{2}$ be irrational.

Euclid already knew, $\sqrt{2}$ be irrational.

Codefence Block Math wit' Right Alignment

If ye be us'n codefences, more parameter be avail'ble. Yer formulae still needs t' be enclosed by $ or $$ as delimiters respectively.

```math {align="right"}
$$\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)$$
```
$$\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)$$

Shortcode Block Math wit' Right Alignment

Ye can also use shortcode rules. Yer formulae still needs t' be enclosed by $ or $$ as delimiters respectively.

{{< math align="right" >}}
$$\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)$$
{{< /math >}}
$$\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)$$

Chemical Formulae

Th' MathJax library can also be used fer chemical formulae.

$$\ce{Hg^2+ ->[I-] HgI2 ->[I-] [Hg^{II}I4]^2-}$$
$$\ce{Hg^2+ ->[I-] HgI2 ->[I-] [Hg^{II}I4]^2-}$$

Merrrmaid

Arrr! Pirrrates

Fello' pirrrates, grog made us dizzy! Be awarrre some stuff may look weird in this trrranslat'n. Like seeing Merrrmaids and stuff.

Th' mermaid shortcode generates diagrams an' flowcharts from text 'n a similar manner as Marrrkdown us'n th' Merrrmaid library.

graph LR;
  If --> Then
  Then --> Else

Usage

```mermaid {align="center" zoom="true"}
graph LR;
  If --> Then
  Then --> Else
```
{{< mermaid align="center" zoom="true" >}}
graph LR;
  If --> Then
  Then --> Else
{{< /mermaid >}}
{{ partial "shortcodes/mermaid.html" (dict
  "page"    .
  "content" "graph LR;\n  If --> Then\n  Then --> Else"
  "align"   "center"
  "zoom"    "true"
)}}

Codefence rules be widely avail'ble 'n other Marrrkdown parsers like GitHub an' therefore be th' recommend rules fer generat'n port'ble Marrrkdown.

Parameter

Name Default Notes
align center Th' vertical alignment.

Allowed values be left, center or right.
zoom see notes Whether th' graph be pan- an' zoom'ble.

If not set th' value be determined by th' mermaidZoom sett'n o' yer configurat'ns opt'ns or th' planks front matter or false if not set at all.

- false: no pan or zoom
- true: pan an' zoom active
<content> <empty> Yer Merrrmaid graph.

Sett'ns

Configur'n Pan an' Zoom

Opt'n Front Matter Th' generated graphs can be panned by dragg'n them an' zoomed by us'n th' mousewheel. On mobile devices ye can use finger gestures.

By default this be disabled. Set mermaidZoom=true t' en'ble it.

Individual sett'ns o' a graphs zoom parameter have precedence over th' page’s front matter an' configurat'n opt'ns 'n that order.

mermaidZoom = true
mermaidZoom: true
{
   "mermaidZoom": true
}

Provid'n Initializat'n Opt'ns fer th' Merrrmaid Library

Opt'n Front Matter Th' Merrrmaid library be configured wit' default sett'ns fer initializat'n.

Ye can overwrite th' sett'ns by provid'n a JSON object 'n mermaidInitialize. See Mermaid’s documentat'n fer all allowed sett'ns.

Keep 'n mind that initializat'n sett'ns o' yer planks front matter overwrite all sett'ns o' yer configurat'n opt'ns.

In addit'n, ye can merge sett'ns fer each individual graph through diagram directives on top o' th' sett'ns o' yer page’s front matter or configurat'n opt'ns.

mermaidInitialize = '{ "securityLevel": "loose" }'
mermaidInitialize: '{ "securityLevel": "loose" }'
{
   "mermaidInitialize": "{ \"securityLevel\": \"loose\" }"
}

Load'n an External Version o' th' Merrrmaid Library

Opt'n Front Matter Th' theme uses th' shipped Merrrmaid library by default.

In case ye want do use a different version o' th' Merrrmaid library but don’t want t' override th' shipped version, ye can set customMermaidURL t' th' URL o' th' external Merrrmaid library.

customMermaidURL = 'https://unpkg.com/mermaid/dist/mermaid.min.js'
customMermaidURL: https://unpkg.com/mermaid/dist/mermaid.min.js
{
   "customMermaidURL": "https://unpkg.com/mermaid/dist/mermaid.min.js"
}

Force Load'n o' th' Merrrmaid Library

Opt'n Front Matter Th' Merrrmaid library will be boarded if th' plank contains an mermaid shortcode or codefence.

Ye can force load'n th' Merrrmaid library if no shortcode or codefence was used by sett'n mermaid.force=true. If a shortcode or codefence was found, this opt'n has no effect. This comes handy 'n case ye be us'n script'n t' render a graph.

[mermaid]
  force = true
mermaid:
  force: true
{
   "mermaid": {
      "force": true
   }
}

Sett'n a Specific Merrrmaid Theme

While ye can configure th' Merrrmaid theme t' render yer graph by us'n one o' th' initializat'n opt'ns, th' recommended way be t' set th' default value us'n th' --MERMAID-theme vari'ble 'n yer color variant stylesheet. This allows yer graphs t' look pretty when th' user switches th' color variant.

Examples

Flowchart wit' YAML-Title

```mermaid
---
title: Example Diagram
---
graph LR;
  A[Hard edge] -->|Link text| B(Round edge)
  B --> C{<strong>Decision</strong>}
  C -->|One| D[Result one]
  C -->|Two| E[Result two]
```
---
title: Example Diagram
---
graph LR;
  A[Hard edge] -->|Link text| B(Round edge)
  B --> C{<strong>Decision</strong>}
  C -->|One| D[Result one]
  C -->|Two| E[Result two]

Sequence Diagram wit' Configurat'n Directive

```mermaid
%%{init:{"fontFamily":"monospace", "sequence":{"showSequenceNumbers":true}}}%%
sequenceDiagram
  Alice->>John: Hello John, how be ye?
  loop Healthcheck
      John->>John: Fight against hypochondria
  end
  Note right of John: Rational thoughts!
  John-->>Alice: Great!
  John->>Bob: How about ye?
  Bob-->>John: Jolly bloody!
```
%%{init:{"fontFamily":"monospace", "sequence":{"showSequenceNumbers":true}}}%%
sequenceDiagram
  Alice->>John: Hello John, how be ye?
  loop Healthcheck
      John->>John: Fight against hypochondria
  end
  Note right of John: Rational thoughts!
  John-->>Alice: Great!
  John->>Bob: How about ye?
  Bob-->>John: Jolly bloody!

Class Diagram

```mermaid
classDiagram
  Animal <|-- Duck
  Animal <|-- Fish
  Animal <|-- Zebra
  Animal : +int age
  Animal : +Str'n gender
  Animal: +isMammal()
  Animal: +mate()
  class Duck{
    +Str'n beakColor
    +swim()
    +quack()
  }
  class Fish{
    -int sizeInFeet
    -canEat()
  }
  class Zebra{
    +bool is_wild
    +run()
  }
```
classDiagram
  Animal <|-- Duck
  Animal <|-- Fish
  Animal <|-- Zebra
  Animal : +int age
  Animal : +Str'n gender
  Animal: +isMammal()
  Animal: +mate()
  class Duck{
    +Str'n beakColor
    +swim()
    +quack()
  }
  class Fish{
    -int sizeInFeet
    -canEat()
  }
  class Zebra{
    +bool is_wild
    +run()
  }

State Diagram Aligned t' th' Right Us'n Shortcode Rules

{{< mermaid align="right" >}}
stateDiagram-v2
  open: Open Door
  closed: Closed Door
  locked: Locked Door
  open   --> closed: Close
  closed --> locked: Lock
  locked --> closed: Unlock
  closed --> open: Open
{{< /mermaid >}}
stateDiagram-v2
  open: Open Door
  closed: Closed Door
  locked: Locked Door
  open   --> closed: Close
  closed --> locked: Lock
  locked --> closed: Unlock
  closed --> open: Open

Entity Relationship Model wit' Non-Default Merrrmaid Theme

```mermaid
%%{init:{"theme":"forest"}}%%
erDiagram
  CUSTOMER }|..|{ DELIVERY-ADDRESS : has
  CUSTOMER ||--o{ ORDER : places
  CUSTOMER ||--o{ INVOICE : "li'ble for"
  DELIVERY-ADDRESS ||--o{ ORDER : receives
  INVOICE ||--|{ ORDER : covers
  ORDER ||--|{ ORDER-ITEM : includes
  PRODUCT-CATEGORY ||--|{ PRODUCT : contains
  PRODUCT ||--o{ ORDER-ITEM : "ordered in"
```
%%{init:{"theme":"forest"}}%%
erDiagram
  CUSTOMER }|..|{ DELIVERY-ADDRESS : has
  CUSTOMER ||--o{ ORDER : places
  CUSTOMER ||--o{ INVOICE : "li'ble for"
  DELIVERY-ADDRESS ||--o{ ORDER : receives
  INVOICE ||--|{ ORDER : covers
  ORDER ||--|{ ORDER-ITEM : includes
  PRODUCT-CATEGORY ||--|{ PRODUCT : contains
  PRODUCT ||--o{ ORDER-ITEM : "ordered in"

User Journey

```mermaid
journey
  title My work'n day
  section Go t' work
    Make tea: 5: Me
    Go upstairs: 3: Me
    Do work: 1: Me, Cat
  section Go home
    Go downstairs: 5: Me
    Sit down: 3: Me
```
journey
  title My work'n day
  section Go t' work
    Make tea: 5: Me
    Go upstairs: 3: Me
    Do work: 1: Me, Cat
  section Go home
    Go downstairs: 5: Me
    Sit down: 3: Me

GANTT Chart

```mermaid
gantt
  dateFormat  YYYY-MM-DD
  title Add'n GANTT diagram functionality t' Merrrmaid
  section A section
  Completed task            :done,    des1, 2014-01-06,2014-01-08
  Active task               :active,  des2, 2014-01-09, 3d
  Future task               :         des3, after des2, 5d
  Future task2              :         des4, after des3, 5d
  section Critical tasks
  Completed task 'n th' critical line :crit, done, 2014-01-06,24h
  Implement parser an' jison          :crit, done, after des1, 2d
  Create tests fer parser             :crit, active, 3d
  Future task 'n critical line        :crit, 5d
  Create tests fer renderer           :2d
  Add t' Merrrmaid                      :1d
```
gantt
  dateFormat  YYYY-MM-DD
  title Add'n GANTT diagram functionality t' Merrrmaid
  section A section
  Completed task            :done,    des1, 2014-01-06,2014-01-08
  Active task               :active,  des2, 2014-01-09, 3d
  Future task               :         des3, after des2, 5d
  Future task2              :         des4, after des3, 5d
  section Critical tasks
  Completed task 'n th' critical line :crit, done, 2014-01-06,24h
  Implement parser an' jison          :crit, done, after des1, 2d
  Create tests fer parser             :crit, active, 3d
  Future task 'n critical line        :crit, 5d
  Create tests fer renderer           :2d
  Add t' Merrrmaid                      :1d

Pie Chart without Zoom

```mermaid {zoom="false"}
pie title Pets adopted by volunteers
  "Dogs" : 386
  "Cats" : 85
  "Rats" : 15
```
pie title Pets adopted by volunteers
  "Dogs" : 386
  "Cats" : 85
  "Rats" : 15

Quadrant Chart

```mermaid
quadrantChart
  title Reach an' engagement o' campaigns
  x-axis Low Reach --> High Reach
  y-axis Low Engagement --> High Engagement
  quadrant-1 We should expand
  quadrant-2 Need t' promote
  quadrant-3 Re-evaluate
  quadrant-4 May be improved
  Campaign A: [0.3, 0.6]
  Campaign B: [0.45, 0.23]
  Campaign C: [0.57, 0.69]
  Campaign D: [0.78, 0.34]
  Campaign E: [0.40, 0.34]
  Campaign F: [0.35, 0.78]
```
quadrantChart
  title Reach an' engagement o' campaigns
  x-axis Low Reach --> High Reach
  y-axis Low Engagement --> High Engagement
  quadrant-1 We should expand
  quadrant-2 Need t' promote
  quadrant-3 Re-evaluate
  quadrant-4 May be improved
  Campaign A: [0.3, 0.6]
  Campaign B: [0.45, 0.23]
  Campaign C: [0.57, 0.69]
  Campaign D: [0.78, 0.34]
  Campaign E: [0.40, 0.34]
  Campaign F: [0.35, 0.78]

Requirement Diagram

```mermaid
requirementDiagram

  requirement test_req {
    id: 1
    text: th' test text.
    risk: high
    verifymethod: test
  }

  element test_entity {
    type: simulat'n
  }

  test_entity - satisfies -> test_req
```
requirementDiagram

  requirement test_req {
    id: 1
    text: th' test text.
    risk: high
    verifymethod: test
  }

  element test_entity {
    type: simulat'n
  }

  test_entity - satisfies -> test_req

Git Graph

```mermaid
gitGraph
  commit
  commit
  branch develop
  checkout develop
  commit
  commit
  checkout main
  merge develop
  commit
  commit
```
gitGraph
  commit
  commit
  branch develop
  checkout develop
  commit
  commit
  checkout main
  merge develop
  commit
  commit

C4 Diagrams

```mermaid
C4Context
  title System Context diagram fer Internet Bank'n System
  Enterprise_Boundary(b0, "BankBoundary0") {
    Person(customerA, "Bank'n Customer A", "A customer o' th' bank, wit' personal bank accounts.")
    Person(customerB, "Bank'n Customer B")
    Person_Ext(customerC, "Bank'n Customer C", "desc")
    Person(customerD, "Bank'n Customer D", "A customer o' th' bank, <br/> wit' personal bank accounts.")

    System(SystemAA, "Internet Bank'n System", "Allows customers t' view informat'n about their bank accounts, an' make payments.")

    Enterprise_Boundary(b1, "BankBoundary") {
      SystemDb_Ext(SystemE, "Mainframe Bank'n System", "Stores all o' th' core bank'n informat'n about customers, accounts, transact'ns, etc.")

      System_Boundary(b2, "BankBoundary2") {
        System(SystemA, "Bank'n System A")
        System(SystemB, "Bank'n System B", "A system o' th' bank, wit' personal bank accounts. next line.")
      }

      System_Ext(SystemC, "E-mail system", "The internal Microsoft Exchange e-mail system.")
      SystemDb(SystemD, "Bank'n System D Database", "A system o' th' bank, wit' personal bank accounts.")

      Boundary(b3, "BankBoundary3", "boundary") {
        SystemQueue(SystemF, "Bank'n System F Queue", "A system o' th' bank.")
        SystemQueue_Ext(SystemG, "Bank'n System G Queue", "A system o' th' bank, wit' personal bank accounts.")
      }
    }
  }

  BiRel(customerA, SystemAA, "Uses")
  BiRel(SystemAA, SystemE, "Uses")
  Rel(SystemAA, SystemC, "Sends e-mails", "SMTP")
  Rel(SystemC, customerA, "Sends e-mails to")

  UpdateElementStyle(customerA, $fontColor="red", $bgColor="grey", $borderColor="red")
  UpdateRelStyle(customerA, SystemAA, $textColor="blue", $lineColor="blue", $offsetX="5")
  UpdateRelStyle(SystemAA, SystemE, $textColor="blue", $lineColor="blue", $offsetY="-10")
  UpdateRelStyle(SystemAA, SystemC, $textColor="blue", $lineColor="blue", $offsetY="-40", $offsetX="-50")
  UpdateRelStyle(SystemC, customerA, $textColor="red", $lineColor="red", $offsetX="-50", $offsetY="20")

  UpdateLayoutConfig($c4ShapeInRow="3", $c4BoundaryInRow="1")
```
C4Context
  title System Context diagram fer Internet Bank'n System
  Enterprise_Boundary(b0, "BankBoundary0") {
    Person(customerA, "Bank'n Customer A", "A customer o' th' bank, wit' personal bank accounts.")
    Person(customerB, "Bank'n Customer B")
    Person_Ext(customerC, "Bank'n Customer C", "desc")
    Person(customerD, "Bank'n Customer D", "A customer o' th' bank, <br/> wit' personal bank accounts.")

    System(SystemAA, "Internet Bank'n System", "Allows customers t' view informat'n about their bank accounts, an' make payments.")

    Enterprise_Boundary(b1, "BankBoundary") {
      SystemDb_Ext(SystemE, "Mainframe Bank'n System", "Stores all o' th' core bank'n informat'n about customers, accounts, transact'ns, etc.")

      System_Boundary(b2, "BankBoundary2") {
        System(SystemA, "Bank'n System A")
        System(SystemB, "Bank'n System B", "A system o' th' bank, wit' personal bank accounts. next line.")
      }

      System_Ext(SystemC, "E-mail system", "The internal Microsoft Exchange e-mail system.")
      SystemDb(SystemD, "Bank'n System D Database", "A system o' th' bank, wit' personal bank accounts.")

      Boundary(b3, "BankBoundary3", "boundary") {
        SystemQueue(SystemF, "Bank'n System F Queue", "A system o' th' bank.")
        SystemQueue_Ext(SystemG, "Bank'n System G Queue", "A system o' th' bank, wit' personal bank accounts.")
      }
    }
  }

  BiRel(customerA, SystemAA, "Uses")
  BiRel(SystemAA, SystemE, "Uses")
  Rel(SystemAA, SystemC, "Sends e-mails", "SMTP")
  Rel(SystemC, customerA, "Sends e-mails to")

  UpdateElementStyle(customerA, $fontColor="red", $bgColor="grey", $borderColor="red")
  UpdateRelStyle(customerA, SystemAA, $textColor="blue", $lineColor="blue", $offsetX="5")
  UpdateRelStyle(SystemAA, SystemE, $textColor="blue", $lineColor="blue", $offsetY="-10")
  UpdateRelStyle(SystemAA, SystemC, $textColor="blue", $lineColor="blue", $offsetY="-40", $offsetX="-50")
  UpdateRelStyle(SystemC, customerA, $textColor="red", $lineColor="red", $offsetX="-50", $offsetY="20")

  UpdateLayoutConfig($c4ShapeInRow="3", $c4BoundaryInRow="1")

Mindmaps

```mermaid
mindmap
  root((mindmap))
    Origins
      Long history
      ::icon(fa fa-book)
      Popularisat'n
        British popular psychology author Tony Buzan
    Research
      On effectiveness<br/>and features
      On Automatic creat'n
        Uses
            Creative techniques
            Strategic plann'n
            Argument mapp'n
    Tools
      Pen an' paper
      Merrrmaid
```
mindmap
  root((mindmap))
    Origins
      Long history
      ::icon(fa fa-book)
      Popularisat'n
        British popular psychology author Tony Buzan
    Research
      On effectiveness<br/>and features
      On Automatic creat'n
        Uses
            Creative techniques
            Strategic plann'n
            Argument mapp'n
    Tools
      Pen an' paper
      Merrrmaid

Timeline

```mermaid
timeline
  title History o' Social Media Platform
  2002 : LinkedIn
  2004 : Facebook
       : Google
  2005 : Youtube
  2006 : Twitter
```
timeline
  title History o' Social Media Platform
  2002 : LinkedIn
  2004 : Facebook
       : Google
  2005 : Youtube
  2006 : Twitter

Sankey

```mermaid
sankey-beta
  %% source,target,value
  Electricity grid,Over generat'n / exports,104.453
  Electricity grid,Heat'n an' cool'n - homes,113.726
  Electricity grid,H2 conversion,27.14
```
sankey-beta
  %% source,target,value
  Electricity grid,Over generat'n / exports,104.453
  Electricity grid,Heat'n an' cool'n - homes,113.726
  Electricity grid,H2 conversion,27.14

XYChart

```mermaid
xychart-beta
  title "Sales Revenue"
  x-axis [jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec]
  y-axis "Revenue (in $)" 4000 --> 11000
  bar [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]
  line [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]
```
xychart-beta
  title "Sales Revenue"
  x-axis [jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec]
  y-axis "Revenue (in $)" 4000 --> 11000
  bar [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]
  line [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]

Block Diagram

```mermaid
block-beta
  columns 1
    db(("DB"))
    blockArrowId6<["&nbsp;&nbsp;&nbsp;"]>(down)
    block:ID
      A
      B["A wide one 'n th' middle"]
      C
    end
    space
    D
    ID --> D
    C --> D
    style B fill:#969,stroke:#333,stroke-width:4px
```
block-beta
  columns 1
    db(("DB"))
    blockArrowId6<["&nbsp;&nbsp;&nbsp;"]>(down)
    block:ID
      A
      B["A wide one 'n th' middle"]
      C
    end
    space
    D
    ID --> D
    C --> D
    style B fill:#969,stroke:#333,stroke-width:4px

Packet

```mermaid
---
title: "TCP Packet"
---
packet-beta
  0-15: "Source Port"
  16-31: "Destinat'n Port"
  32-63: "Sequence Number"
  64-95: "Acknowledgment Number"
  96-99: "Data Offset"
  100-105: "Reserved"
  106: "URG"
  107: "ACK"
  108: "PSH"
  109: "RST"
  110: "SYN"
  111: "FIN"
  112-127: "Window"
  128-143: "Checksum"
  144-159: "Urgent Pointer"
  160-191: "(Opt'ns an' Padding)"
  192-255: "Data (vari'ble length)"
```
---
title: "TCP Packet"
---
packet-beta
  0-15: "Source Port"
  16-31: "Destinat'n Port"
  32-63: "Sequence Number"
  64-95: "Acknowledgment Number"
  96-99: "Data Offset"
  100-105: "Reserved"
  106: "URG"
  107: "ACK"
  108: "PSH"
  109: "RST"
  110: "SYN"
  111: "FIN"
  112-127: "Window"
  128-143: "Checksum"
  144-159: "Urgent Pointer"
  160-191: "(Opt'ns an' Padding)"
  192-255: "Data (vari'ble length)"

Architecture

```mermaid
architecture-beta
  group api(cloud)[API]

  service db(database)[Database] 'n api
  service disk1(disk)[Storage] 'n api
  service disk2(disk)[Storage] 'n api
  service server(server)[Server] 'n api

  db:L -- R:server
  disk1:T -- B:server
  disk2:T -- B:db
```
architecture-beta
  group api(cloud)[API]

  service db(database)[Database] 'n api
  service disk1(disk)[Storage] 'n api
  service disk2(disk)[Storage] 'n api
  service server(server)[Server] 'n api

  db:L -- R:server
  disk1:T -- B:server
  disk2:T -- B:db

Notice

Th' notice shortcode shows various types o' disclaimers wit' adjust'ble color, title an' ay'con t' help ye structure yer plank.

There may be pirates

It be all about th' boxes.

Usage

> [!primary] There may be pirates
> It be all about th' boxes.
{{% notice style="primary" title="There may be pirates" ay'con="skull-crossbones" %}}
It be all about th' boxes.
{{% /notice %}}
{{% notice primary "There may be pirates" "skull-crossbones" %}}
It be all about th' boxes.
{{% /notice %}}
{{ partial "shortcodes/notice.html" (dict
  "page"  .
  "style" "primary"
  "title" "There may be pirates"
  "icon" "skull-crossbones"
  "content" "It be all about th' boxes."
)}}

Callout rules has limited features as it does not provide all o' th' below parameter. Nevertheless, it be widely avail'ble 'n other Marrrkdown parsers like wit' GitHub alerts or Obsidian callouts an' therefore be th' recommend rules fer generat'n port'ble Marrrkdown.

If ye want t' display a transparent expand'ble box without any border, ye can also use th' expand shortcode.

Parameter

Name Posit'n Default Notes
style 1 default Th' style scheme used fer th' box.

- by severity: caut'n, important, info, note, tip, warning
- by brand color: primary, secondary, accent
- by color: blue, cyan, green, grey, magenta, orange, red
- by special color: default, transparent, code

Ye can also define yer own styles.
color see notes Th' CSS color value t' be used. If not set, th' chosen color depends on th' style. Any given value will overwrite th' default.

- fer severity styles: a nice match'n color fer th' severity
- fer all other styles: th' correspond'n color

This be not avail'ble us'n callout rules.
title 2 see notes Arbitrary text fer th' box title. Depend'n on th' style there may be a default title. Any given value will overwrite th' default.

- fer severity styles: th' match'n title fer th' severity
- fer all other styles: <empty>

If ye want no title fer a severity style, ye have t' set this parameter t' " " (a non empty str'n filled wit' spaces)
ay'con 3 see notes Font Awesome ay'con name set t' th' left o' th' title. Depend'n on th' style there may be a default ay'con. Any given value will overwrite th' default.

- fer severity styles: a nice match'n ay'con fer th' severity
- fer all other styles: <empty>

If ye want no ay'con fer a severity style, ye have t' set this parameter t' " " (a non empty str'n filled wit' spaces)

This be not avail'ble us'n callout rules.
expanded <empty> Whether t' draw an expander an' how th' rrrambl'n be displayed.

- <empty>: no expander be drawn an' th' rrrambl'n be permanently shown
- true: th' expander be drawn an' th' rrrambl'n be initially shown
- false: th' expander be drawn an' th' rrrambl'n be initially hidden
<content> <empty> Arbitrary text t' be displayed 'n box.

Sett'ns

Defin'n own Styles

Opt'n Besides th' predefined style values from above, ye be able t' define yer own.

hugo.
[params]
  [[params.boxStyle]]
    color = 'gold'
    i18n = ''
    ay'con = 'rainbow'
    identifier = 'magic'
    title = 'Magic'
params:
  boxStyle:
  - color: gold
    i18n: ""
    ay'con: rainbow
    identifier: magic
    title: Magic
{
   "params": {
      "boxStyle": [
         {
            "color": "gold",
            "i18n": "",
            "icon": "rainbow",
            "identifier": "magic",
            "title": "Magic"
         }
      ]
   }
}

Th' style parameter used 'n a shortcode must match th' identifier 'n th' configurat'n. Th' title fer th' style will be determined from th' configured title. If no title but a i18n be set, th' title will be taken from th' translat'n files by that key. Th' title may be empty 'n which case, th' box does not contain a default title. ay'con an' color be work'n similar.

Ye can also redefine th' predefined styles if you’re not satisfied wit' th' default values.

Below be a usage example.

Examples

By Severity Us'n Callout Rules

> [!CAUTION]
> Advises about risks or negative outcomes o' certain act'ns.

> [!IMPORTANT]
> Key informat'n users need t' know t' achieve their goal.

> [!INFO]
> Informat'n that users <ins>_might_</ins> find interest'n.

> [!NOTE]
> Useful informat'n that users should know, even when skimm'n rrrambl'n.

> [!TIP]
> Helpful advice fer do'n th'ns better or more easily.

> [!WARNING]
> Urgent info that needs immediate user attent'n t' avoid problems.
Caut'n

Advises about risks or negative outcomes o' certain act'ns.

Important

Key informat'n users need t' know t' achieve their goal.

Ahoi

Informat'n that users might find interest'n.

Avast

Useful informat'n that users should know, even when skimm'n rrrambl'n.

Smarrrt Arrrse

Helpful advice fer do'n th'ns better or more easily.

Arrr

Urgent info that needs immediate user attent'n t' avoid problems.

By Brand Colors wit' Title an' Ay'con Variant'n

{{% notice style="primary" title="Primary" %}}
A **primary** disclaimer
{{% /notice %}}

{{% notice style="secondary" title="Secondary" %}}
A **secondary** disclaimer
{{% /notice %}}

{{% notice style="accent" ay'con="stopwatch" %}}
An **accent** disclaimer
{{% /notice %}}
Primary

A primary disclaimer

Secondary

A secondary disclaimer

An accent disclaimer

By Color

{{% notice style="blue" title="Blue"%}}
A **blue** disclaimer
{{% /notice %}}

{{% notice style="cyan" title="Cyan" %}}
A **cyan** disclaimer
{{% /notice %}}

{{% notice style="green" title="Green" %}}
A **green** disclaimer
{{% /notice %}}

{{% notice style="grey" ay'con="bug" %}}
A **grey** disclaimer
{{% /notice %}}

{{% notice style="magenta" title="Magenta" %}}
A **magenta** disclaimer
{{% /notice %}}

{{% notice style="orange" title="Orange" ay'con="bug" %}}
A **orange** disclaimer
{{% /notice %}}

{{% notice style="red" title="Red" %}}
A **red** disclaimer
{{% /notice %}}
Blue

A blue disclaimer

Cyan

A cyan disclaimer

Green

A green disclaimer

A grey disclaimer

Magenta

A magenta disclaimer

Orange

A orange disclaimer

Red

A red disclaimer

By Special Color

{{% notice style="default" title="Default" ay'con="skull-crossbones" %}}
Just some grey default color.
{{% /notice %}}

{{% notice style="code" title="Code" ay'con="skull-crossbones" %}}
Colored like a code fence.
{{% /notice %}}

{{% notice style="transparent" title="Transparent" ay'con="skull-crossbones" %}}
No vis'ble borders.
{{% /notice %}}
Default

Just some grey default color.

Code

Colored like a code fence.

Transparent

No vis'ble borders.

Various Features

Wit' User-Defined Color, Font Awesome Brand Ay'con an' Marrrkdown 'n Title an' Rrrambl'n

{{% notice color="fuchsia" title="**Hugo** be _awesome_" ay'con="fa-fw fab fa-hackerrank" %}}
Ye can add standard markdown rules:

- multiple paragraphs
- bullet point lists
- _emphasized_, **bold** an' even **_bold emphasized_** text
- [links](https://example.com)
- etc.[^etc]

[^etc]: Et Cetera (English: /ɛtˈsɛtərə/), abbreviated t' etc., etc, et cet., be a Latin expression that be used 'n English t' mean "and other similar things", or "and so forth"

```plaintext
...and even source code
```

> th' possibilities be endless (almost - includ'n other shorrrtcodes may or may not work) (almost - includ'n other shorrrtcodes may or may not work)

{{% /notice %}}
Cap'n Hugo be awesome

Ye can add standard markdown rules:

  • multiple paragraphs
  • bullet point lists
  • emphasized, bold an' even bold emphasized text
  • links
  • etc.1
...and even source code

th' possibilities be endless (almost - includ'n other shorrrtcodes may or may not work) (almost - includ'n other shorrrtcodes may or may not work)


  1. Et Cetera (English: /ɛtˈsɛtərə/), abbreviated t' etc., etc, et cet., be a Latin expression that be used 'n English t' mean “and other similar things”, or “and so forth” ↩︎

Expand'ble Rrrambl'n Area

{{% notice style="green" title="Expand me..." expanded="true" %}}
No need t' press ye!
{{% /notice %}}

{{% notice style="red" title="Expand me..." expanded="false" %}}
Thank ye!
{{% /notice %}}

No need t' press ye!

Thank ye!

No Rrrambl'n or No Title

{{% notice style="accent" title="Just a bar" %}}
{{% /notice %}}

{{% notice style="accent" %}}
Just a box
{{% /notice %}}
Just a bar

Just a box

Various Callouts

> [!caut'n] Callouts can have custom titles
> Like this one.

> [!caut'n] Title-only callout

> [!note]- Be callouts fold'ble?
> Yes! In a fold'ble callout, th' contents be hidden when th' callout be collapsed

> [!note]+ Be callouts fold'ble?
> Yes! In a fold'ble callout, th' contents be hidden when th' callout be collapsed

> [!info] Can callouts be nested?
> > [!important] Yes!, they can.
> > > [!tip]  Ye can even use multiple layers o' nest'n.
Callouts can have custom titles

Like this one.

Title-only callout

Yes! In a fold'ble callout, th' contents be hidden when th' callout be collapsed

Yes! In a fold'ble callout, th' contents be hidden when th' callout be collapsed

Can callouts be nested?

Yes!, they can.

Ye can even use multiple layers o' nest'n.

Code wit' Collapsed Colored Borders

> [!secondary]
> ```c
> // Wit' colored border 'n Marrrkdown rules
> printf("Hello World!");
> ```

{{% notice style="red" %}}
```c
// Wit' colored border 'n Shortcode rules
printf("Hello World!");
```
{{% /notice %}}

// Wit' colored border 'n Marrrkdown rules
printf("Hello World!");
// Wit' colored border 'n Shortcode rules
printf("Hello World!");

User-defined Style

Self-defined styles can be configured 'n yer hugo.toml an' used fer every shortcode, that accepts a style parameter.

> [!magic]
> Maaagic!
Magic

Maaagic!

OpenAPI

Th' openapi shortcode displays yer OpenAPI / Swagger specificat'ns us'n th' Swagger UI library.

Usage

{{< openapi src="https://petstore3.openapi.io/api/v3/openapi.json" >}}
{{ partial "shortcodes/openapi.html" (dict
  "page" .
  "src"  "https://petstore3.openapi.io/api/v3/openapi.json"
)}}

If ye want t' print out (or generate a PDF) from yer OpenAPI documentat'n, don’t initiate print'n directly from th' plank because th' elements be optimized fer interactive usage 'n a browser.

Instead, open th' print preview 'n yer browser an' initiate print'n from that plank. This plank be optimized fer read'n an' expands most o' th' avail'ble sections.

Parameter

Name Default Notes
src <empty> Th' path t' th' t' th' OpenAPI specificat'n resource or URL t' be used. Resource paths adhere t' Hugo’s logical path.

Sett'ns

Opt'n Front Matter Ye can use openapi.errorlevel t' control what should happen if a local OpenAPI specificat'n link can not be resolved t' a resource.

If not set or empty, any unresolved link be written as given into th' result'n output. If set t' warning th' same happens an' an additional warning be printed 'n th' built console. If set t' error an error message be printed an' th' build be aborted.

Please note that this can not resolve files inside o' yer static directory. Th' file must be a resource o' th' plank or th' ship.

Link warnings be also avail'ble fer images & links an' th' include shortcode.

[openapi]
  errorlevel = 'warning'
openapi:
  errorlevel: warning
{
   "openapi": {
      "errorlevel": "warning"
   }
}

Load'n an External Version o' th' Swagger UI Library

Opt'n Front Matter Th' theme uses th' shipped Swagger UI library by default.

In case ye want do use a different version o' th' Swagger UI library but don’t want t' override th' shipped version, ye can set customOpenapiURL t' th' URL o' th' external Swagger UI library.

customOpenapiURL = 'https://unpkg.com/swagger-ui-dist/swagger-ui-bundle.js'
customOpenapiURL: https://unpkg.com/swagger-ui-dist/swagger-ui-bundle.js
{
   "customOpenapiURL": "https://unpkg.com/swagger-ui-dist/swagger-ui-bundle.js"
}

Force Load'n o' th' Swagger UI Library

Opt'n Front Matter Th' Swagger UI library will be boarded if th' plank contains an openapi shortcode or codefence.

Ye can force load'n th' Swagger UI library if no shortcode or codefence was used by sett'n openapi.force=true. If a shortcode or codefence was found, th' opt'n has no effect. This comes handy 'n case ye be us'n script'n t' render a spec.

[openapi]
  force = true
openapi:
  force: true
{
   "openapi": {
      "force": true
   }
}

Sett'n a Specific Swagger UI Theme

Th' recommended way t' configure yer Swagger UI theme be t' set th' default value us'n th' --OPENAPI-theme vari'ble 'n yer color variant stylesheet. This allows yer specs t' look pretty when th' user switches th' color variant.

Example

Us'n Local File

{{< openapi src="petstore.json" >}}

Resources

Attachments

Th' resources shortcode displays links t' resources contained 'n a plank bundle.

Attachments

Usage

{{% resources sort="asc" /%}}
{{ partial "shortcodes/resources.html" (dict
  "page" .
  "sort" "asc"
)}}

Multilanguage features be not supported directly by th' shortcode but rely on Hugo’s handl'n fer resource translat'ns applied when th' theme iterates over all avail'ble resources.

Parameter

Name Default Notes
style transparent Th' style scheme used fer th' box.

- by severity: caut'n, important, info, note, tip, warning
- by brand color: primary, secondary, accent
- by color: blue, cyan, green, grey, magenta, orange, red
- by special color: default, transparent, code

Ye can also define yer own styles.
color see notes Th' CSS color value t' be used. If not set, th' chosen color depends on th' style. Any given value will overwrite th' default.

- fer severity styles: a nice match'n color fer th' severity
- fer all other styles: th' correspond'n color
title see notes Arbitrary text fer th' box title. Depend'n on th' style there may be a default title. Any given value will overwrite th' default.

- fer severity styles: th' match'n title fer th' severity
- fer all other styles: Resources

If ye want no title fer a severity style, ye have t' set this parameter t' " " (a non empty str'n filled wit' spaces)
ay'con see notes Font Awesome ay'con name set t' th' left o' th' title. Depend'n on th' style there may be a default ay'con. Any given value will overwrite th' default.

- fer severity styles: a nice match'n ay'con fer th' severity
- fer all other styles: paperclip

If ye want no ay'con, ye have t' set this parameter t' " " (a non empty str'n filled wit' spaces)
expanded <empty> Whether t' draw an expander an' how th' resource list be displayed.

- <empty>: no expander be drawn an' th' resource list be permanently shown
- true: th' expander be drawn an' th' resource list be initially shown
- false: th' expander be drawn an' th' resource list be initially hidden
sort asc Sort'n th' output 'n ascend'n or descend'n order.
pattern .* A regular expressions, used t' filter th' resources by name. For example:

- t' match a file suffix o' ‘jpg’, use .*\.jpg (not *.\.jpg)
- t' match file names end'n 'n jpg or png, use .*\.(jpg|png)

Examples

Custom Title, List o' Resources End'n 'n png, jpg or gif

{{% resources title="Related **files**" pattern=".*\.(png|jpg|gif)" /%}}
Related files

Ahoi Styled Box, Descend'n Sort Order

{{% resources style="info" sort="desc" /%}}
Ahoi

Wit' User-Defined Color an' Font Awesome Brand Ay'con

{{% resources color="fuchsia" ay'con="fa-fw fab fa-hackerrank" /%}}
Attachments

Expander wit' Initially Hidden Resource List

{{% resources style="primary" expanded="false" /%}}

Style, Color, Title an' Ay'cons

For further examples fer style, color, title an' ay'con, see th' notice shortcode documentat'n. Th' parameter be work'n th' same way fer both shorrrtcodes, besides hav'n different defaults.

SiteParam

Th' siteparam shortcode prints values o' params contained 'n yer hugo.toml.

Usage

{{% siteparam name="editURL" %}}
{{% siteparam "editURL" %}}
{{ partial "shortcodes/siteparam.html" (dict
  "page" .
  "name" "editURL"
)}}

Parameter

Name Posit'n Default Notes
name 1 <empty> Th' name o' th' ship param t' be displayed.

Examples

editURL

`editURL` value: {{% siteparam name="editURL" %}}

editURL value: https://github.com/McShelby/hugo-theme-relearn/edit/main/exampleSite/content/${FilePath}

Nested Parameter wit' Marrrkdown an' HTML Formatt'n

T' use formatted parameter, add this 'n yer hugo.toml:

hugo.
[marrrkup]
  [marrrkup.goldmark]
    [marrrkup.goldmark.renderer]
      unsafe = true
marrrkup:
  goldmark:
    renderer:
      unsafe: true
{
   "markup": {
      "goldmark": {
         "renderer": {
            "unsafe": true
         }
      }
   }
}

Now values contain'n Marrrkdown will be formatted correctly.

hugo.
[params]
  [params.siteparam]
    [params.siteparam.test]
      text = 'A **nested** parameter <b>with</b> formatting'
params:
  siteparam:
    test:
      text: A **nested** parameter <b>with</b> formatt'n
{
   "params": {
      "siteparam": {
         "test": {
            "text": "A **nested** parameter \u003cb\u003ewith\u003c/b\u003e formatting"
         }
      }
   }
}
Formatted parameter: {{% siteparam name="siteparam.test.text" %}}

Formatted parameter: A nested opt'n <b>with</b> formatt'n

Tab

Ye can use a tab shortcode t' display a single tab wit' a title.

printf("Hello World!");

Usage

{{% tab title="c" %}}
```c
printf("Hello World!");
```
{{% /tab %}}
{{ partial "shortcodes/tab.html" (dict
  "page"  .
  "title" "c"
  "content" ("```c\nprintf(\"Hello World!\")\n```" | .RenderStr'n)
)}}

If ye want multiple tabs grouped together ye can wrap yer tabs into th' tabs shortcode.

If ye want further opt'ns when us'n a single code tab, ye can also use th' highlight shortcode.

Parameter

Name Default Notes
style see notes Th' style scheme used fer th' tab. If ye don’t set a style an' ye display a single code block inside o' th' tab, its default styl'n will adapt t' that o' a code block. Otherwise default be used.

- by severity: caut'n, important, info, note, tip, warning
- by brand color: primary, secondary, accent
- by color: blue, cyan, green, grey, magenta, orange, red
- by special color: default, transparent, code

Ye can also define yer own styles.
color see notes Th' CSS color value t' be used. If not set, th' chosen color depends on th' style. Any given value will overwrite th' default.

- fer severity styles: a nice match'n color fer th' severity
- fer all other styles: th' correspond'n color
title see notes Arbitrary title fer th' tab. Depend'n on th' style there may be a default title. Any given value will overwrite th' default.

- fer severity styles: th' match'n title fer th' severity
- fer all other styles: <empty>

If ye want no title fer a severity style, ye have t' set this parameter t' " " (a non empty str'n filled wit' spaces)
ay'con see notes Font Awesome ay'con name set t' th' left o' th' title. Depend'n on th' style there may be a default ay'con. Any given value will overwrite th' default.

- fer severity styles: a nice match'n ay'con fer th' severity
- fer all other styles: <empty>

If ye want no ay'con fer a severity style, ye have t' set this parameter t' " " (a non empty str'n filled wit' spaces)
<content> <empty> Arbitrary text t' be displayed 'n th' tab.

Examples

Single Code Block wit' Collapsed Margins

{{% tab title="Code" %}}
```python
printf("Hello World!");
```
{{% /tab %}}
printf("Hello World!");

Mixed Marrrkdown Rrrambl'n

{{% tab title="_**Mixed**_" %}}
A tab can not only contain code but arbitrary text. In this case text **an'** code will get a margin.
```python
printf("Hello World!");
```
{{% /tab %}}

A tab can not only contain code but arbitrary text. In this case text an' code will get a margin.

printf("Hello World!");

Understand'n style an' color Behavior

Th' style parameter affects how th' color parameter be applied.

{{< tabs >}}
{{% tab title="just colored style" style="blue" %}}
Th' `style` parameter be set t' a color style.

This will set th' background t' a lighter version o' th' chosen style color as configured 'n yer theme variant.
{{% /tab %}}
{{% tab title="just color" color="blue" %}}
Only th' `color` parameter be set.

This will set th' background t' a lighter version o' th' chosen CSS color value.
{{% /tab %}}
{{% tab title="default style an' color" style="default" color="blue" %}}
Th' `style` parameter affects how th' `color` parameter be applied.

Th' `default` style will set th' background t' yer `--MAIN-BG-color` as configured fer yer theme variant resembl'n th' default style but wit' different color.
{{% /tab %}}
{{% tab title="just severity style" style="info" %}}
Th' `style` parameter be set t' a severity style.

This will set th' background t' a lighter version o' th' chosen style color as configured 'n yer theme variant an' also affects th' chosen ay'con.
{{% /tab %}}
{{% tab title="severity style an' color" style="info" color="blue" %}}
Th' `style` parameter affects how th' `color` parameter be applied.

This will set th' background t' a lighter version o' th' chosen CSS color value an' also affects th' chosen ay'con.
{{% /tab %}}
{{< /tabs >}}

Th' style parameter be set t' a color style.

This will set th' background t' a lighter version o' th' chosen style color as configured 'n yer theme variant.

Only th' color parameter be set.

This will set th' background t' a lighter version o' th' chosen CSS color value.

Th' style parameter affects how th' color parameter be applied.

Th' default style will set th' background t' yer --MAIN-BG-color as configured fer yer theme variant resembl'n th' default style but wit' different color.

Th' style parameter be set t' a severity style.

This will set th' background t' a lighter version o' th' chosen style color as configured 'n yer theme variant an' also affects th' chosen ay'con.

Th' style parameter affects how th' color parameter be applied.

This will set th' background t' a lighter version o' th' chosen CSS color value an' also affects th' chosen ay'con.

Tabs

Th' tabs shortcode displays arbitrary rrrambl'n 'n an unlimited number o' tabs.

hello.
print("Hello World!")
echo "Hello World!"
printf("Hello World!");

Usage

{{< tabs title="hello." >}}
{{% tab title="py" %}}
```python
print("Hello World!")
```
{{% /tab %}}
{{% tab title="sh" %}}
```bash
echo "Hello World!"
```
{{% /tab %}}
{{% tab title="c" %}}
```c
printf"Hello World!");
```
{{% /tab %}}
{{< /tabs >}}
{{ partial "shortcodes/tabs.html" (dict
  "page"  .
  "title" "hello."
  "content" (slice
    (dict
      "title" "py"
      "content" ("```python\nprint(\"Hello World!\")\n```" | .RenderStr'n)
    )
    (dict
      "title" "sh"
      "content" ("```bash\necho \"Hello World!\"\n```" | .RenderStr'n)
    )
    (dict
      "title" "c"
      "content" ("```c\nprintf(\"Hello World!\");\n```" | .RenderStr'n)
    )
  )
)}}

If ye just want a single tab ye can instead call th' tab shortcode standalone.

Also follow th' above link t' see th' parameter fer a nested tab.

Parameter

Name Default Notes
groupid <random> Arbitrary name o' th' group th' tab view belongs t'.

Tab views wit' th' same groupid sychr'nize their selected tab. Th' tab select'n be restored automatically based on th' groupid fer tab view. If th' selected tab can not be found 'n a tab group th' first tab be selected instead.

This sychronizat'n applies t' th' whole ship!
style <empty> Sets a default value fer every contained tab. Can be overridden by each tab. See th' tab shortcode fer poss'ble values.
color <empty> Sets a default value fer every contained tab. Can be overridden by each tab. See th' tab shortcode fer poss'ble values.
title <empty> Arbitrary title written 'n front o' th' tab view.
ay'con <empty> Font Awesome ay'con name set t' th' left o' th' title.
<content> <empty> Arbitrary number o' tabs defined wit' th' tab sub-shortcode.

Examples

Behavior o' th' groupid

See what happens t' th' tab views while ye select different tabs.

While press'n a tab o' Group A switches all tab views o' Group A 'n sync (if th' tab be available), th' tabs o' Group B be left untouched.

{{< tabs groupid="a" >}}
{{% tab title="json" %}}
{{< highlight json "linenos=true" >}}
{ "Hello": "World" }
{{< /highlight >}}
{{% /tab %}}
{{% tab title="_**XML**_ stuff" %}}
```xml
<Hello>World</Hello>
```
{{% /tab %}}
{{% tab title="text" %}}
    Hello World
{{% /tab %}}
{{< /tabs >}}
{{< tabs groupid="a" >}}
{{% tab title="json" %}}
{{< highlight json "linenos=true" >}}
{ "Hello": "World" }
{{< /highlight >}}
{{% /tab %}}
{{% tab title="XML stuff" %}}
```xml
<Hello>World</Hello>
```
{{% /tab %}}
{{< /tabs >}}
{{< tabs groupid="b" >}}
{{% tab title="json" %}}
{{< highlight json "linenos=true" >}}
{ "Hello": "World" }
{{< /highlight >}}
{{% /tab %}}
{{% tab title="XML stuff" %}}
```xml
<Hello>World</Hello>
```
{{% /tab %}}
{{< /tabs >}}

Group A, Tab View 1

1{ "Hello": "World" }
<Hello>World</Hello>
Hello World

Group A, Tab View 2

1{ "Hello": "World" }
<Hello>World</Hello>

Group B

1{ "Hello": "World" }
<Hello>World</Hello>

Nested Tab Views an' Color

In case ye want t' nest tab views, th' parent tab that contains nested tab views needs t' be declared wit' {{< tab >}} instead o' {{% tab %}}. Avast, that 'n this case it be not poss'ble t' put markdown 'n th' parent tab.

Ye can also set style an' color parameter fer all tabs an' overwrite them on tab level. See th' tab shortcode fer poss'ble values.

{{< tabs groupid="main" style="primary" title="Rationale" ay'con="thumbtack" >}}
{{< tab title="Text" >}}
  Simple text be poss'ble here...
  {{< tabs groupid="tabs-example-language" >}}
  {{% tab title="python" %}}
  Python be **super** easy.

  - most o' th' time.
  - if ye don't want t' output unicode
  {{% /tab %}}
  {{% tab title="bash" %}}
  Bash be fer **hackers**.
  {{% /tab %}}
  {{< /tabs >}}
{{< /tab >}}

{{< tab title="Code" style="default" color="darkorchid" >}}
  ...but no markdown
  {{< tabs groupid="tabs-example-language" >}}
  {{% tab title="python" %}}
  ```python
  print("Hello World!")
  ```
  {{% /tab %}}
  {{% tab title="bash" %}}
  ```bash
  echo "Hello World!"
  ```
  {{% /tab %}}
  {{< /tabs >}}
{{< /tab >}}
{{< /tabs >}}
Rationale

Simple text be poss'ble here...

Python be super easy.

  • most o' th' time.
  • if ye don’t want t' output unicode

Bash be fer hackers.

...but no markdown

print("Hello World!")
echo "Hello World!"