Initial check-in after refactoring to use Hugo site generator with ReLearn template. HTTP Status Codes page not done--nor adwords added.

This commit is contained in:
Todd Fredrich
2022-11-07 09:48:25 -07:00
parent b9dc2eaf8d
commit 7675fcd740
353 changed files with 28093 additions and 1493 deletions

View File

@ -0,0 +1,13 @@
You can add standard markdown syntax:
- multiple paragraphs
- bullet point lists
- _emphasized_, **bold** and even **_bold emphasized_** text
- [links](https://example.com)
- etc.
```plaintext
...and even source code
```
> the possiblities are endless (almost - including other shortcodes may or may not work) (almost - including other shortcodes may or may not work)

View File

@ -0,0 +1,19 @@
+++
chapter = true
title = "Shortcodes"
weight = 3
+++
### Chapter 3
# Shortcodes
Hugo uses Markdown for its simple content format. However, there are a lot of things that Markdown doesnt support well. You could use pure HTML to expand possibilities.
But this happens to be a bad idea. Everyone uses Markdown because it's pure and simple to read even non-rendered. You should avoid HTML to keep it as simple as possible.
To avoid this limitations, Hugo created [shortcodes](https://gohugo.io/extras/shortcodes/). A shortcode is a simple snippet inside a page.
The Relearn theme provides multiple shortcodes on top of existing ones.
{{%children containerstyle="div" style="h2" description="true" %}}

View File

@ -0,0 +1,6 @@
+++
chapter = true
title = "Shorrrtcodes"
weight = 3
+++
{{< piratify >}}

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -0,0 +1 @@
This is a small text

View File

@ -0,0 +1,70 @@
+++
description = "List of files attached to a page"
title = "Attachments"
+++
The `attachments` shortcode displays a list of files attached to a page with adjustable color, title and icon.
{{% attachments /%}}
## Usage
````go
{{%/* attachments /*/%}}
````
The shortcurt lists files found in a specific folder.
Currently, it supports two implementations for pages
1. If your page is a Markdown file, attachements must be placed in a folder named like your page and ending with `.files`.
> * content
> * _index.md
> * **page.files**
> * attachment.pdf
> * page.md
2. If your page is a folder, attachements must be placed in a nested `files` folder.
> * content
> * _index.md
> * page
> * index.md
> * **files**
> * attachment.pdf
Be aware that if you use a multilingual website, you will need to have as many folders as languages.
### Parameter
| Name | Default | Notes |
|:------------|:--------------|:------------|
| **style** | `transparent` | The color scheme used to highlight the box content.<br/><br/>- by severity: `info`, `note`, `tip`, `warning`<nd color: `primary`, `secondary`<br/>- by color: `blue`, `green`, `grey`, `orange`, `red`<br/>- by special color: `default`,t` |
| **title** | see notes | Arbitray text for the box title. Depending on the **style** there may be a default title. Any given value will overwault.<br/><br/>- for severity styles: the matching title for the severity<br/>- for all other colors: `Attachments`<br/><br/>If you wa you have to set this parameter to `" "` (a non empty string filled with spaces) |
| **icon** | see notes | [Font Awesome icon name]({{%relref "cont/icons#finding-an-icon" %}}) set to the left of the title. Depending le** there may be a default icon. Any given value will overwrite the default.<br/><br/>- for severity styles: a nice matching iseverity<br/>- for all other colors: `paperclip`<br/><br/>If you want no icon, you have to set this parameter to `" "` (a non empty d with spaces) |
| **sort** | `asc` | Sorting the output in `asc`ending or `desc`ending order. |
| **pattern** | `.*` | A [regular expressions](https://en.wikipedia.org/wiki/Regular_expression), used to filter the attachments by file name. For example:<br/><br/>- to match a file suffix of 'jpg', use `.*jpg` (not `*.jpg`)<br/>- to match file names ending in `jpg` or `png`, use `.*(jpg\|png)` |
## Examples
### Custom Title, List of Attachments Ending in pdf or mp4
````go
{{%/* attachments title="Related files" pattern=".*(pdf|mp4)" /*/%}}
````
{{% attachments title="Related files" pattern=".*(pdf|mp4)" /%}}
### Info Styled Box, Descending Sort Order
````go
{{%/* attachments style="info" sort="desc" /*/%}}
````
{{% attachments style="info" sort="desc" /%}}
### Style and Icons
For further examples for **style**, **title** and **icon**, see the [`notice` shortcode]({{% relref "shortcodes/notice" %}}) documentation. The parameter are working the same way for both shortcodes, besides having different defaults.

View File

@ -0,0 +1 @@
Harrr, nothn' to see herre

View File

@ -0,0 +1,7 @@
+++
descrption = "Th' Attachments shorrrtcode displays a list o' files attached t' a plank"
title = "Attachments"
+++
{{% attachments /%}}
{{< piratify >}}

View File

@ -0,0 +1,119 @@
+++
description = "Clickable buttons"
title = "Button"
+++
The `button` shortcode displays a clickable button with adjustable color, title and icon.
{{% button href="https://gohugo.io/" %}}Get Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="warning" icon="dragon" %}}Get Hugo{{% /button %}}
## Usage
````go
{{%/* button href="https://gohugo.io/" %}}Get Hugo{{% /button */%}}
{{%/* button href="https://gohugo.io/" style="warning" icon="dragon" %}}Get Hugo{{% /button */%}}
````
Once the button is clicked, it opens another browser tab for the given URL.
### Parameter
| Name | Default | Notes |
|:----------------------|:----------------|:------------|
| **href** | _&lt;empty&gt;_ | The destination URL for the button. If this parameter is not set, the button will do nothing but is still displayed as clickable. |
| **style** | `transparent` | The color scheme used to paint the button.<br/><br/>- by severity: `info`, `note`, `tip`, `warning`<br/>- by brand color: `primary`, `secondary`<br/>- by color: `blue`, `green`, `grey`, `orange`, `red`<br/>- by special color: `default`, `transparent` |
| **icon** | see notes | [Font Awesome icon name]({{%relref "cont/icons#finding-an-icon" %}}) set to the left of the title. Depending on the **style** there may be a default icon. Any given value will overwrite the default.<br/><br/>- for severity styles: a nice matching icon for the severity<br/>- for all other colors: _&lt;empty&gt;_<br/><br/>If you want no icon for a severity style, you have to set this parameter to `" "` (a non empty string filled with spaces) |
| **iconposition** | `left` | Places the icon to the `left` or `right` of the title. |
| _**&lt;content&gt;**_ | see notes | Arbitray text for the button title. Depending on the **style** there may be a default title. Any given value will overwrite the default.<br/><br/>- for severity styles: the matching title for the severity<br/>- for all other colors: _&lt;empty&gt;_<br/><br/>If you want no title for a severity style, you have to set this parameter to `" "` (a non empty string filled with spaces) |
## Examples
### Style
#### By Severity
````go
{{%/* button href="https://gohugo.io/" style="info" %}}Get Hugo{{% /button */%}}
{{%/* button href="https://gohugo.io/" style="note" %}}Get Hugo{{% /button */%}}
{{%/* button href="https://gohugo.io/" style="tip" %}}Get Hugo{{% /button */%}}
{{%/* button href="https://gohugo.io/" style="warning" %}}Get Hugo{{% /button */%}}
````
{{% button href="https://gohugo.io/" style="info" %}}Get Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="note" %}}Get Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="tip" %}}Get Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="warning" %}}Get Hugo{{% /button %}}
#### By Brand Colors
````go
{{%/* button href="https://gohugo.io/" style="primary" %}}Get Hugo{{% /button */%}}
{{%/* button href="https://gohugo.io/" style="secondary" %}}Get Hugo{{% /button */%}}
````
{{% button href="https://gohugo.io/" style="primary" %}}Get Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="secondary" %}}Get Hugo{{% /button %}}
#### By Color
````go
{{%/* button href="https://gohugo.io/" style="blue" %}}Get Hugo{{% /button */%}}
{{%/* button href="https://gohugo.io/" style="green" %}}Get Hugo{{% /button */%}}
{{%/* button href="https://gohugo.io/" style="grey" %}}Get Hugo{{% /button */%}}
{{%/* button href="https://gohugo.io/" style="orange" %}}Get Hugo{{% /button */%}}
{{%/* button href="https://gohugo.io/" style="red" %}}Get Hugo{{% /button */%}}
````
{{% button href="https://gohugo.io/" style="blue" %}}Get Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="green" %}}Get Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="grey" %}}Get Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="orange" %}}Get Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="red" %}}Get Hugo{{% /button %}}
#### By Special Color
````go
{{%/* button href="https://gohugo.io/" style="default" %}}Get Hugo{{% /button */%}}
{{%/* button href="https://gohugo.io/" style="transparent" %}}Get Hugo{{% /button */%}}
````
{{% button href="https://gohugo.io/" style="default" %}}Get Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="transparent" %}}Get Hugo{{% /button %}}
### Icon
#### To the Left
````go
{{%/* button href="https://gohugo.io/" icon="download" %}}Get Hugo{{% /button */%}}
````
{{% button href="https://gohugo.io/" icon="download" %}}Get Hugo{{% /button %}}
#### To the Right
````go
{{%/* button href="https://gohugo.io/" icon="download" icon-position="right" %}}Get Hugo{{% /button */%}}
````
{{% button href="https://gohugo.io/" icon="download" icon-position="right" %}}Get Hugo{{% /button %}}
#### Override for Severity
````go
{{%/* button href="https://gohugo.io/" icon="dragon" style="warning" %}}Get Hugo{{% /button */%}}
````
{{% button href="https://gohugo.io/" icon="dragon" style="warning" %}}Get Hugo{{% /button %}}
### Other
#### Severity Style with all Defaults
````go
{{%/* button href="https://gohugo.io/" style="tip" %}}{{% /button */%}}
````
{{% button href="https://gohugo.io/" style="tip" %}}{{% /button %}}

View File

@ -0,0 +1,5 @@
+++
descrption = "Nice buttons on yer plank"
title = "Button"
+++
{{< piratify >}}

View File

@ -0,0 +1,67 @@
+++
alwaysopen = false
description = "List the child pages of a page"
title = "Children"
+++
The `children` shortcode lists the child pages of a page and its descendants .
## Usage
````go
{{%/* children */%}}
````
### Parameter
| Name | Default | Notes |
|:-------------------|:------------------|:------------|
| **page** | _&lt;current&gt;_ | Specify the page name (section name) to display children for. |
| **containerstyle** | `ul` | Choose the style used to group all children. It could be any HTML tag name. |
| **style** | `li` | Choose the style used to display each descendant. It could be any HTML tag name. |
| **showhidden** | `false` | When `true`, child pages hidden from the menu will be displayed aswell. |
| **description** | `false` | When `true` shows a short text under each page in the list. When no description or summary exists for the page, the first 70 words of the content is taken - [read more info about summaries on gohugo.io](https://gohugo.io/content/summaries/). |
| **depth** | `1` | The depth of descendants to display. For example, if the value is `2`, the shortcode will display two levels of child pages. To get all descendants, set this value to a high number eg. `999`. |
| **sort** | see notes | The sort order of the displayed list.<br/><br/>If not set it is sorted by the [`ordersectionsby`]({{% relref "basics/configuration#global-site-parameters" %}}) setting of the site and the pages frontmatter<br/><br/>- `weight`: to sort on menu order<br/>- `title`: to sort alphabetically on menu label. |
## Examples
### All Default
````go
{{%/* children */%}}
````
{{% children %}}
### With Description
````go
{{%/* children description="true" */%}}
````
{{%children description="true" %}}
### Infinte Depth and Hidden Pages
````go
{{%/* children depth="999" showhidden="true" */%}}
````
{{% children depth="999" showhidden="true" %}}
### Heading Styles for Container and Elements
````go
{{%/* children containerstyle="div" style="h2" depth="3" description="true" */%}}
````
{{% children containerstyle="div" style="h2" depth="3" description="true" %}}
### Divs for Group and Element Styles
````go
{{%/* children containerstyle="div" style="div" depth="3" */%}}
````
{{% children containerstyle="div" style="div" depth="3" %}}

View File

@ -0,0 +1,6 @@
+++
alwaysopen = false
descrption = "List th' child planks on a plank"
title = "Children"
+++
{{< piratify >}}

View File

@ -0,0 +1,13 @@
+++
alwaysopen = false
description = "This is a demo child page"
tags = ["children", "non-hidden"]
title = "page 1"
weight = 10
+++
This is a demo child page.
## Subpages of this page
{{% children showhidden="true" %}}

View File

@ -0,0 +1,8 @@
+++
alwaysopen = false
descrption = "This be a demo child plank"
tags = ["children", "non-hidden"]
title = "Plank 1"
weight = 10
+++
{{< piratify >}}

View File

@ -0,0 +1,12 @@
+++
alwaysopen = true
description = "This is a demo child page"
tags = ["children", "non-hidden"]
title = "page 1-1"
+++
This is a demo child page with a hidden child. You can still access the hidden child [directly]({{% relref "shortcodes/children/children-1/children-1-1/children-1-1-1" %}}) or via the search.
## Subpages of this page
{{% children showhidden="true" %}}

View File

@ -0,0 +1,7 @@
+++
alwaysopen = true
descrption = "This be a demo child plank"
tags = ["children", "non-hidden"]
title = "Plank 1-1"
+++
{{< piratify >}}

View File

@ -0,0 +1,12 @@
+++
description = "This is a hidden demo child page"
hidden = true
tags = ["children", "hidden"]
title = "page 1-1-1 (hidden)"
+++
This is a **hidden** demo child page. This page and all its children are hidden in the menu, arrow navigation and children shortcode as long as you aren't viewing this page or its children directly.
## Subpages of this page
{{% children showhidden="true" %}}

View File

@ -0,0 +1,7 @@
+++
descrption = "This be a hidden demo child plank"
hidden = true
tags = ["children", "hidden"]
title = "Plank 1-1-1 (hidden)"
+++
{{< piratify >}}

View File

@ -0,0 +1,11 @@
+++
description = "This is a non-hidden demo child page of a hidden parent page"
tags = ["children", "hidden"]
title = "page 1-1-1-1"
+++
This is a **non-hidden** demo child page of a hidden parent page with a hidden child. You can still access the hidden child [directly]({{% relref "shortcodes/children/children-1/children-1-1/children-1-1-1/children-1-1-1-1/children-1-1-1-1-1" %}}) or via the search.
## Subpages of this page
{{% children showhidden="true" %}}

View File

@ -0,0 +1,6 @@
+++
descrption = "This be a non-hidden demo child plank o' a hidden parrrent plank"
tags = ["children", "hidden"]
title = "Plank 1-1-1-1"
+++
{{< piratify >}}

View File

@ -0,0 +1,12 @@
+++
description = "This is a hidden demo child page"
hidden = true
tags = ["children", "hidden"]
title = "page 1-1-1-1-1 (hidden)"
+++
This is a **hidden** demo child page. This page and all its children are hidden in the menu, arrow navigation and children shortcode as long as you aren't viewing this page or its children directly.
## Subpages of this page
{{% children showhidden="true" %}}

View File

@ -0,0 +1,7 @@
+++
descrption = "This be a hidden demo child plank"
hidden = true
tags = ["children", "hidden"]
title = "Plank 1-1-1-1-1 (hidden)"
+++
{{< piratify >}}

View File

@ -0,0 +1,7 @@
+++
description = "This is a non-hidden demo child page of a hidden parent page"
tags = ["children", "hidden"]
title = "page 1-1-1-1-1-1"
+++
This is a **non-hidden** demo child page of a hidden parent page.

View File

@ -0,0 +1,6 @@
+++
descrption = "This be a non-hidden demo child plank on a hidden parrrent plank"
tags = ["children", "hidden"]
title = "Plank 1-1-1-1-1-1"
+++
{{< piratify >}}

View File

@ -0,0 +1,11 @@
+++
description = "This is a demo child page"
tags = ["children", "non-hidden"]
title = "page 1-1-2"
+++
This is a plain demo child page.
## Subpages of this page
{{% children showhidden="true" %}}

View File

@ -0,0 +1,6 @@
+++
descrption = "This be a demo child plank"
tags = ["children", "non-hidden"]
title = "Plank 1-1-2"
+++
{{< piratify >}}

View File

@ -0,0 +1,7 @@
+++
description = "This is a demo child page"
tags = ["children", "non-hidden"]
title = "page 1-1-2-1"
+++
This is a plain demo child page.

View File

@ -0,0 +1,6 @@
+++
descrption = "This be a demo child plank"
tags = ["children", "non-hidden"]
title = "Plank 1-1-2-1"
+++
{{< piratify >}}

View File

@ -0,0 +1,7 @@
+++
description = "This is a demo child page"
tags = ["children", "non-hidden"]
title = "page 1-1-2-2"
+++
This is a plain demo child page.

View File

@ -0,0 +1,6 @@
+++
descrption = "This be a demo child plank"
tags = ["children", "non-hidden"]
title = "Plank 1-1-2-2"
+++
{{< piratify >}}

View File

@ -0,0 +1,7 @@
+++
description = "This is a demo child page"
tags = ["children", "non-hidden"]
title = "page 1-1-3"
+++
This is a plain demo child page.

View File

@ -0,0 +1,6 @@
+++
descrption = "This be a demo child plank"
tags = ["children", "non-hidden"]
title = "Plank 1-1-3"
+++
{{< piratify >}}

View File

@ -0,0 +1,10 @@
+++
alwaysopen = false
tags = ["children", "non-hidden"]
title = "page 2"
weight = 20
+++
This is a demo child page with no description.
So its content is used as description.

View File

@ -0,0 +1,7 @@
+++
alwaysopen = false
tags = ["children", "non-hidden"]
title = "Plank 2"
weight = 20
+++
{{< piratify >}}

View File

@ -0,0 +1,13 @@
+++
alwaysopen = false
description = "This is a demo child page"
tags = ["children", "non-hidden"]
title = "page 3"
weight = 30
+++
This is a demo child page.
## Subpages of this page
{{% children showhidden="true" %}}

View File

@ -0,0 +1,8 @@
+++
alwaysopen = false
descrption = "This be a demo child plank"
tags = ["children", "non-hidden"]
title = "Plank 3"
weight = 30
+++
{{< piratify >}}

View File

@ -0,0 +1,7 @@
+++
description = "This is a plain page test nested in a parent"
tags = ["children", "non-hidden"]
title = "page 3-1"
+++
This is a plain demo child page.

View File

@ -0,0 +1,6 @@
+++
descrption = "This be a plain plank test nested 'n a parrrent"
tags = ["children", "non-hidden"]
title = "Plank 3-1"
+++
{{< piratify >}}

View File

@ -0,0 +1,10 @@
+++
alwaysopen = false
description = "This is a hidden demo child page"
hidden = true
tags = ["children", "hidden"]
title = "page 4 (hidden)"
weight = 40
+++
This is a **hidden** demo child page. This page and all its children are hidden in the menu, arrow navigation and children shortcode as long as you aren't viewing this page or its children directly.

View File

@ -0,0 +1,9 @@
+++
alwaysopen = false
descrption = "This be a hidden demo child plank"
hidden = true
tags = ["children", "hidden"]
title = "Plank 4 (hidden)"
weight = 40
+++
{{< piratify >}}

View File

@ -0,0 +1,8 @@
---
description: |
This is a plain page test, and the beginning of a YAML multiline description...
title: "page X"
weight: 1
---
This is a plain demo child page.

View File

@ -0,0 +1,6 @@
+++
descrption = "This be a plain plank test"
title = "Plank X"
weight = 1
+++
{{< piratify >}}

View File

@ -0,0 +1,91 @@
+++
description = "Expandable/collapsible sections of text"
title = "Expand"
+++
The `expand` shortcode displays an expandable/collapsible section of text.
{{% expand title="Expand me..." %}}Thank you!{{% /expand %}}
## Usage
While the examples are using named parameter you are free to use positional aswell.
{{< tabs groupId="shortcode-parameter">}}
{{% tab name="named" %}}
````go
{{%/* expand title="Expand me..." */%}}Thank you!{{%/* /expand */%}}
````
{{% /tab %}}
{{% tab name="positional" %}}
````go
{{%/* expand "Expand me..." */%}}Thank you!{{%/* /expand */%}}
````
{{% /tab %}}
{{< /tabs >}}
### Parameter
| Name | Position | Default | Notes |
|:----------------------|:---------|:-----------------|:------------|
| **title** | 1 | `"Expand me..."` | Arbitray text to appear next to the expand/collapse icon. |
| **open** | 2 | `false` | When `true` the content text will be initially shown as expanded. |
| _**&lt;content&gt;**_ | | _&lt;empty&gt;_ | Arbitray text to be displayed on expand. |
## Examples
### All Defaults
````go
{{%/* expand */%}}Yes, you did it!{{%/* /expand */%}}
````
{{% expand %}}Yes, you did it!{{% /expand %}}
### Initially Expanded
````go
{{%/* expand title="Expand me..." open="true" */%}}No need to press you!{{%/* /expand */%}}
````
{{% expand title="Expand me..." open="true" %}}No need to press you!{{% /expand %}}
### Arbitrary Text
````go
{{%/* expand title="Show me almost endless possibilities" */%}}
You can add standard markdown syntax:
- multiple paragraphs
- bullet point lists
- _emphasized_, **bold** and even **_bold emphasized_** text
- [links](https://example.com)
- etc.
```plaintext
...and even source code
```
> the possiblities are endless (almost - including other shortcodes may or may not work)
{{%/* /expand */%}}
````
{{% expand title="Show me almost endless possibilities" %}}
You can add standard markdown syntax:
- multiple paragraphs
- bullet point lists
- _emphasized_, **bold** and even **_bold emphasized_** text
- [links](https://example.com)
- etc.
```plaintext
...and even source code
```
> the possiblities are endless (almost - including other shortcodes may or may not work)
{{% /expand %}}

View File

@ -0,0 +1,5 @@
+++
descrption = "Displays an expand'ble/collaps'ble sect'n o' text on yer plank"
title = "Expand"
+++
{{< piratify >}}

View File

@ -0,0 +1,47 @@
+++
description = "Displays content from other files"
title = "Include"
+++
The `include` shortcode includes other files from your project inside of the current page.
## Usage
While the examples are using named parameter you are free to use positional aswell.
{{< tabs groupId="shortcode-parameter">}}
{{% tab name="named" %}}
````go
{{%/* include file="shortcodes/INCLUDE_ME.md" */%}}
````
{{% /tab %}}
{{% tab name="positional" %}}
````go
{{%/* include "shortcodes/INCLUDE_ME.md" */%}}
````
{{% /tab %}}
{{< /tabs >}}
The included files can even contain Markdown and will be taken into account when generating the table of contents.
### Parameter
| Name | Position | Default | Notes |
|:---------------------|:---------|:-----------------|:------------|
| **file** | 1 | _&lt;empty&gt;_ | The path to the file to be included. Path resolution adheres to [Hugo's build-in `readFile` function](https://gohugo.io/functions/readfile/) |
| **showfirstheading** | 2 | `true` | When `false` and the included file contains headings, the first heading will be hidden. This comes in handy, eg. if you include otherwise standalone Markdown files. |
## Examples
### Arbitray Content
````go
{{%/* include "shortcodes/INCLUDE_ME.md" */%}}
````
{{% include "shortcodes/INCLUDE_ME.md" %}}

View File

@ -0,0 +1,5 @@
+++
descrption = "Displays content from other Marrrkdown files"
title = "Include"
+++
{{< piratify >}}

View File

@ -0,0 +1,260 @@
+++
description = "Generate diagrams and flowcharts from text"
title = "Mermaid"
+++
With the [Mermaid](https://mermaidjs.github.io/) library and shortcode, you can generate diagrams and flowcharts from text, in a similar manner as Markdown.
{{< mermaid >}}
graph LR;
If --> Then
Then --> Else
{{< /mermaid >}}
{{% notice note %}}
This only works in modern browsers.
{{% /notice %}}
{{% notice warning %}}
Due to limitations with [Mermaid](https://github.com/mermaid-js/mermaid/issues/1846), it is currently not possible to use Mermaid code fences in an initially collapsed `expand` shortcode. This is a know issue and [can't be fixed by this theme](https://github.com/McShelby/hugo-theme-relearn/issues/187).
{{% /notice %}}
## Usage
The generated graphs can be be panned by dragging them and zoomed by using the mousewheel. On mobile devices you can use finger gestures.
While the examples are using shortcode syntax it is recommended to use codefence syntax instead. This is because more and more other software supports Mermaid codefences (eg. GitHub) and so your markdown becomes more portable.
{{% notice note %}}
To use codefence syntax you have to turn off `guessSyntax` for the `markup.highlight` setting ([see the configuration section](#configuration)).
{{% /notice %}}
{{< tabs groupId="shortcode-codefence">}}
{{% tab name="codefence" %}}
````plaintext
```mermaid
graph LR;
If --> Then
Then --> Else
```
````
{{% /tab %}}
{{% tab name="shortcode" %}}
````go
{{</* mermaid */>}}
graph LR;
If --> Then
Then --> Else
{{</* /mermaid */>}}
````
{{% /tab %}}
{{< /tabs >}}
### Parameter
Parameter are only supported when using shortcode syntax. Defaults are used when using codefence syntax.
| Name | Default | Notes |
|:----------------------|:-----------------|:------------|
| **align** | `center` | Allowed values are `left`, `center` or `right`. |
| _**&lt;content&gt;**_ | _&lt;empty&gt;_ | Your mermaid graph. |
## Configuration
Mermaid is configured with default settings. You can customize Mermaid's default settings for all of your files thru a JSON object in your `config.toml`, override these settings per page thru your pages frontmatter or override these setting per diagramm thru [diagram directives](https://mermaid-js.github.io/mermaid/#/directives?id=directives).
The JSON object of your `config.toml` / frontmatter is forwarded into Mermaid's `mermaid.initialize()` function.
See [Mermaid documentation](http://mermaid-js.github.io/mermaid/#/Setup?id=mermaidapi-configuration-defaults) for all allowed settings.
The `theme` setting can also be set by your used color variant. This will be the sitewide default and can - again - be overridden by your settings in `config.toml`, frontmatter or diagram directives.
{{% notice note %}}
To use codefence syntax you have to turn off `guessSyntax` for the `markup.highlight` setting.
{{% /notice %}}
### Global Configuration File
````toml
[params]
mermaidInitialize = "{ \"theme\": \"dark\" }"
[markup]
[markup.highlight]
# if set to `guessSyntax = true`, there will be no unstyled code even if no language
# was given BUT mermaid code fences will not work anymore! So this is a mandatory
# setting for your site
guessSyntax = false
````
### Page's Frontmatter
````toml
+++
mermaidInitialize = "{ \"theme\": \"dark\" }"
+++
````
## Examples
### Flowchart with Non-Default Mermaid Theme
````go
{{</* mermaid align="left" */>}}
%%{init:{"theme":"forest"}}%%
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]
{{</* /mermaid */>}}
````
{{< mermaid align="left" >}}
%%{init:{"theme":"forest"}}%%
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]
{{< /mermaid >}}
### Sequence
````go
{{</* mermaid */>}}
sequenceDiagram
participant Alice
participant Bob
Alice->>John: Hello John, how are you?
loop Healthcheck
John->John: Fight against hypochondria
end
Note right of John: Rational thoughts <br/>prevail...
John-->Alice: Great!
John->Bob: How about you?
Bob-->John: Jolly good!
{{</* /mermaid */>}}
````
{{< mermaid >}}
sequenceDiagram
participant Alice
participant Bob
Alice->>John: Hello John, how are you?
loop Healthcheck
John->John: Fight against hypochondria
end
Note right of John: Rational thoughts <br/>prevail...
John-->Alice: Great!
John->Bob: How about you?
Bob-->John: Jolly good!
{{< /mermaid >}}
### GANTT
````go
{{</* mermaid */>}}
gantt
dateFormat YYYY-MM-DD
title Adding GANTT diagram functionality to Mermaid
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 in the critical line :crit, done, 2014-01-06,24h
Implement parser and jison :crit, done, after des1, 2d
Create tests for parser :crit, active, 3d
Future task in critical line :crit, 5d
Create tests for renderer :2d
Add to Mermaid :1d
{{</* /mermaid */>}}
````
{{< mermaid >}}
gantt
dateFormat YYYY-MM-DD
title Adding GANTT diagram functionality to Mermaid
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 in the critical line :crit, done, 2014-01-06,24h
Implement parser and jison :crit, done, after des1, 2d
Create tests for parser :crit, active, 3d
Future task in critical line :crit, 5d
Create tests for renderer :2d
Add to Mermaid :1d
{{< /mermaid >}}
### Class
````go
{{</* mermaid */>}}
classDiagram
Class01 <|-- AveryLongClass : Cool
Class03 *-- Class04
Class05 o-- Class06
Class07 .. Class08
Class09 --> C2 : Where am i?
Class09 --* C3
Class09 --|> Class07
Class07 : equals()
Class07 : Object[] elementData
Class01 : size()
Class01 : int chimp
Class01 : int gorilla
Class08 <--> C2: Cool label
{{</* /mermaid */>}}
````
{{< mermaid >}}
classDiagram
Class01 <|-- AveryLongClass : Cool
Class03 *-- Class04
Class05 o-- Class06
Class07 .. Class08
Class09 --> C2 : Where am i?
Class09 --* C3
Class09 --|> Class07
Class07 : equals()
Class07 : Object[] elementData
Class01 : size()
Class01 : int chimp
Class01 : int gorilla
Class08 <--> C2: Cool label
{{< /mermaid >}}
### State Diagram with Codefence Syntax
````go
```mermaid
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
````

View File

@ -0,0 +1,5 @@
+++
descrption = "Generrrat'n o' diagrrram an' flowcharrrt frrrom text 'n a similar manner as Marrrkdown"
title = "Merrrmaid"
+++
{{< piratify >}}

View File

@ -0,0 +1,320 @@
+++
description = "Disclaimers to help you structure your page"
title = "Notice"
+++
The `notice` shortcode shows various types of disclaimers with adjustable color, title and icon to help you structure your page.
{{% notice style="primary" title="There may be pirates" icon="skull-crossbones" %}}
It is all about the boxes.
{{% /notice %}}
## Usage
While the examples are using named parameter you are free to use positional aswell.
{{< tabs groupId="shortcode-parameter">}}
{{% tab name="named" %}}
````go
{{%/* notice style="primary" title="There may be pirates" icon="skull-crossbones" */%}}
It is all about the boxes.
{{%/* /notice */%}}
````
{{% /tab %}}
{{% tab name="positional" %}}
````go
{{%/* notice primary "There may be pirates" "skull-crossbones" */%}}
It is all about the boxes.
{{%/* /notice */%}}
````
{{% /tab %}}
{{< /tabs >}}
### Parameter
| Name | Position | Default | Notes |
|:----------|:---------|:----------|:------------|
| **style** | 1 | `default` | The color scheme used to highlight the box content.<br/><br/>- by severity: `info`, `note`, `tip`, `warning`<br/>- by brand color: `primary`, `secondary`<br/>- by color: `blue`, `green`, `grey`, `orange`, `red`<br/>- by special color: `default`, `transparent` |
| **title** | 2 | see notes | Arbitray text for the box title. Depending on the **style** there may be a default title. Any given value will overwrite the default.<br/><br/>- for severity styles: the matching title for the severity<br/>- for all other colors: _&lt;empty&gt;_<br/><br/>If you want no title for a severity style, you have to set this parameter to `" "` (a non empty string filled with spaces) |
| **icon** | 3 | see notes | [Font Awesome icon name]({{%relref "cont/icons#finding-an-icon" %}}) set to the left of the title. Depending on the **style** there may be a default icon. Any given value will overwrite the default.<br/><br/>- for severity styles: a nice matching icon for the severity<br/>- for all other colors: _&lt;empty&gt;_<br/><br/>If you want no icon for a severity style, you have to set this parameter to `" "` (a non empty string filled with spaces) |
## Examples
### By Severity
#### Info with markup
{{% notice style="info" %}}
An **information** disclaimer
You can add standard markdown syntax:
- multiple paragraphs
- bullet point lists
- _emphasized_, **bold** and even **_bold emphasized_** text
- [links](https://example.com)
- etc.
```plaintext
...and even source code
```
> the possiblities are endless (almost - including other shortcodes may or may not work)
{{% /notice %}}
{{% expand "Show markup" %}}
````go
{{%/* notice style="info" */%}}
An **information** disclaimer
You can add standard markdown syntax:
- multiple paragraphs
- bullet point lists
- _emphasized_, **bold** and even ***bold emphasized*** text
- [links](https://example.com)
- etc.
```plaintext
...and even source code
```
> the possiblities are endless (almost - including other shortcodes may or may not work)
{{%/* /notice */%}}
````
{{% /expand %}}
#### Note
{{% notice style="note" %}}
A **notice** disclaimer
{{% /notice %}}
{{% expand "Show markup" %}}
````go
{{%/* notice style="note" */%}}
A **notice** disclaimer
{{%/* /notice */%}}
````
{{% /expand %}}
#### Tip
{{% notice style="tip" %}}
A **tip** disclaimer
{{% /notice %}}
{{% expand "Show markup" %}}
````go
{{%/* notice style="tip" */%}}
A **tip** disclaimer
````
{{% /expand %}}
#### Warning
{{% notice style="warning" %}}
A **warning** disclaimer
{{% /notice %}}
{{% expand "Show markup" %}}
````go
{{%/* notice style="warning" */%}}
A **warning** disclaimer
{{%/* /notice */%}}
````
{{% /expand %}}
#### Warning with Non-Default Title and Icon
{{% notice style="warning" title="Here are dragons" icon="dragon" %}}
A **warning** disclaimer
{{% /notice %}}
{{% expand "Show markup" %}}
````go
{{%/* notice style="warning" title="Here are dragons" icon="dragon" */%}}
A **warning** disclaimer
{{%/* /notice */%}}
````
{{% /expand %}}
#### Warning without a Title and Icon
{{% notice style="warning" title=" " icon=" " %}}
A **warning** disclaimer
{{% /notice %}}
{{% expand "Show markup" %}}
````go
{{%/* notice style="warning" title=" " icon=" " */%}}
A **warning** disclaimer
{{%/* /notice */%}}
````
{{% /expand %}}
### By Brand Colors
#### Primary with Title only
{{% notice style="primary" title="Primary" %}}
A **primary** disclaimer
{{% /notice %}}
{{% expand "Show markup" %}}
````go
{{%/* notice style="primary" title="Primary" */%}}
A **primary** disclaimer
{{%/* /notice */%}}
````
{{% /expand %}}
#### Secondary with Icon only
{{% notice style="secondary" icon="stopwatch" %}}
A **secondary** disclaimer
{{% /notice %}}
{{% expand "Show markup" %}}
````go
{{%/* notice style="secondary" icon="stopwatch" */%}}
A **secondary** disclaimer
{{%/* /notice */%}}
````
{{% /expand %}}
### By Color
#### Blue without a Title and Icon
{{% notice style="blue" %}}
A **blue** disclaimer
{{% /notice %}}
{{% expand "Show markup" %}}
````go
{{%/* notice style="blue" */%}}
A **blue** disclaimer
{{%/* /notice */%}}
````
{{% /expand %}}
#### Green with Title only
{{% notice style="green" title="Green" %}}
A **green** disclaimer
{{% /notice %}}
{{% expand "Show markup" %}}
````go
{{%/* notice style="green" title="Green" */%}}
A **green** disclaimer
{{%/* /notice */%}}
````
{{% /expand %}}
#### Grey with Icon only
{{% notice style="grey" icon="bug" %}}
A **grey** disclaimer
{{% /notice %}}
{{% expand "Show markup" %}}
````go
{{%/* notice style="grey" icon="bug" */%}}
A **grey** disclaimer
{{%/* /notice */%}}
````
{{% /expand %}}
#### Orange with Title and Icon
{{% notice style="orange" title="Orange" icon="bug" %}}
A **orange** disclaimer
{{% /notice %}}
{{% expand "Show markup" %}}
````go
{{%/* notice style="orange" title="Orange" icon="bug" */%}}
A **orange** disclaimer
{{%/* /notice */%}}
````
{{% /expand %}}
#### Red
{{% notice style="red" %}}
A **red** disclaimer
{{% /notice %}}
{{% expand "Show markup" %}}
````go
{{%/* notice style="red" */%}}
A **red** disclaimer
{{%/* /notice */%}}
````
{{% /expand %}}
### By Special Color
#### Default with Title and Icon
{{% notice default "Pay Attention to this Note!" "skull-crossbones" %}}
Some serious information.
{{% /notice %}}
{{% expand "Show markup" %}}
````go
{{%/* notice style="default" title"Pay Attention to this Note!" icon="skull-crossbones" */%}}
Some serious information.
{{%/* /notice */%}}
````
{{% /expand %}}
#### Transparent with Title and Icon
{{% notice style="transparent" title="Pay Attention to this Note!" icon="skull-crossbones" %}}
Some serious information.
{{% /notice %}}
{{% expand "Show markup" %}}
````go
{{%/* notice style="transparent" title"Pay Attention to this Note!" icon="skull-crossbones" */%}}
Some serious information.
{{%/* /notice */%}}
````
{{% /expand %}}

View File

@ -0,0 +1,5 @@
+++
descrption = "Disclaimerrrs t' help ye strrructurrre yer plank"
title = "Notice"
+++
{{< piratify >}}

View File

@ -0,0 +1,44 @@
+++
description = "Get value of site params"
title = "Site param"
+++
The `siteparam` shortcode prints values of site params.
## Usage
While the examples are using named parameter you are free to use positional aswell.
{{< tabs groupId="shortcode-parameter">}}
{{% tab name="named" %}}
````go
{{%/* siteparam name="editURL" */%}}
````
{{% /tab %}}
{{% tab name="positional" %}}
````go
{{%/* siteparam "editURL" */%}}
````
{{% /tab %}}
{{< /tabs >}}
### Parameter
| Name | Position | Default | Notes |
|:---------------------|:---------|:-----------------|:------------|
| **name** | 1 | _&lt;empty&gt;_ | The name of the site param to be displayed. |
## Examples
### `editURL` from `config.toml`
```go
`editURL` value: {{%/* siteparam name="editURL" */%}}
```
`editURL` value: {{% siteparam name="editURL" %}}

View File

@ -0,0 +1,5 @@
+++
descrption = "Get value o' ship parrrams varrriables 'n yer plank"
title = "Ship param"
+++
{{< piratify >}}

View File

@ -0,0 +1,48 @@
---
description: "UI for your Swagger / OpenAPI Specifications"
title: "Swagger"
---
This shortcode uses the [RapiDoc](https://mrin9.github.io/RapiDoc) library to display your Swagger / OpenAPI Specifications.
{{% notice note %}}
This only works in modern browsers.
{{% /notice %}}
## Usage
````go
{{</* swagger src="https://petstore3.swagger.io/api/v3/openapi.json" */>}}
````
### Parameter
| Name | Default | Notes |
|:---------------------|:-----------------|:------------|
| **src** | _&lt;empty&gt;_ | The URL to the OpenAPI Specification file. This can be relative to the URL of your page if it is a leaf or branch bundle. |
## Configuration
Swagger is configured with default settings. You can customize Swagger's default settings for all of your files thru a JSON object in your `config.toml` or override these settings per page thru your pages frontmatter.
The JSON object of your `config.toml` / frontmatter is forwarded into Swagger's initialization. At the moment, only the `theme` setting is supported.
The `theme` setting can also be set by your used color variant. This will be the sitewide default and can - again - be overridden by your settings in `config.toml` or frontmatter.
### Global Configuration File
````toml
[params]
swaggerInitialize = "{ \"theme\": \"dark\" }"
````
## Example
### Using Local File
````go
{{</* swagger src="petstore.json" */>}}
````
{{< swagger src="petstore.json" >}}

View File

@ -0,0 +1,5 @@
---
description: "Adds UI fer yer Swaggerrr / OpenAPI Specificat'ns"
title: "Swaggerrr"
---
{{< piratify >}}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,135 @@
+++
description = "Show content in tabbed views"
title = "Tabbed views"
+++
The `tabs` shortcode displays arbitrary content in unlimited number of tabs. This comes in handy eg. for providing code snippets for multiple languages or providing configuration in different formats.
{{< tabs groupId="tabs-example-language" >}}
{{% tab name="python" %}}
```python
print("Hello World!")
```
{{% /tab %}}
{{% tab name="bash" %}}
```bash
echo "Hello World!"
```
{{% /tab %}}
{{< /tabs >}}
## Usage
````go
{{</* tabs */>}}
{{%/* tab name="python" */%}}
```python
print("Hello World!")
```
{{%/* /tab */%}}
{{%/* tab name="bash" */%}}
```bash
echo "Hello World!"
```
{{%/* /tab */%}}
{{</* /tabs */>}}
````
### Parameter
| Name | Default | Notes |
|:----------------------|:-----------------|:------------|
| **groupId** | `default` | Arbitrary name of the group the tab view belongs to.<br/><br/>Tab views with the same **groupId** sychronize their selected tab. This sychronization applies to the whole site! |
| _**&lt;content&gt;**_ | _&lt;empty&gt;_ | Arbitrary number of tabs defined with the `tab` sub-shortcode. |
{{% notice warning %}}
When using tab views with different content sets, make sure to use a common `groupId` for equal sets of tabs but distinct `groupId` for different sets.
The tab selection is restored automatically based on the `groupId` and if it cannot find a tab item because it came from the `'default'` group on a different page then all tabs will be empty at first!
{{% /notice %}}
## Examples
### Distinct `groupId`
````go
{{</* tabs groupId="config" */>}}
{{%/* tab name="json" */%}}
```json
{
"Hello": "World"
}
```
{{%/* /tab */%}}
{{%/* tab name="XML" */%}}
```xml
<Hello>World</Hello>
```
{{%/* /tab */%}}
{{%/* tab name="properties" */%}}
```properties
Hello = World
```
{{%/* /tab */%}}
{{</* /tabs */>}}
````
{{< tabs groupId="tabs-example-config" >}}
{{% tab name="json" %}}
```json
{
"Hello": "World"
}
```
{{% /tab %}}
{{% tab name="XML" %}}
```xml
<Hello>World</Hello>
```
{{% /tab %}}
{{% tab name="properties" %}}
```ini
Hello = World
```
{{% /tab %}}
{{< /tabs >}}
### Non-Distinct `groupId`
See what happens to this tab view if you select **properties** tab from the previous example.
````go
{{</* tabs groupId="config" */>}}
{{%/* tab name="json" */%}}
```json
{
"Hello": "World"
}
```
{{%/* /tab */%}}
{{%/* tab name="XML" */%}}
```xml
<Hello>World</Hello>
```
{{%/* /tab */%}}
{{</* /tabs */>}}
````
{{< tabs groupId="tabs-example-config" >}}
{{% tab name="json" %}}
```json
{
"Hello": "World"
}
```
{{% /tab %}}
{{% tab name="XML" %}}
```xml
<Hello>World</Hello>
```
{{% /tab %}}
{{< /tabs >}}

View File

@ -0,0 +1,5 @@
+++
descrption = "Synchr'nize select'n o' content 'n different tabbed views"
title = "Tabbed views"
+++
{{< piratify >}}