docs: switch to some kind of EBNF for shortcodes

This commit is contained in:
Sören Weber 2021-10-24 11:34:29 +02:00
parent 20a73e3492
commit 3ffdf79c27
No known key found for this signature in database
GPG key ID: 07D17FF580AE7589
5 changed files with 24 additions and 12 deletions

View file

@ -8,7 +8,7 @@ The Expand shortcode displays an expandable/collapsible section of text on your
## Usage ## Usage
````go ````go
{{%/* expand "Does this Relearn theme rock?" { "true" | "false" } */%}} {{%/* expand [ <string> [ "true" | "false" ] ] */%}}
Yes! Yes!
{{%/* /expand */%}} {{%/* /expand */%}}
```` ````

View file

@ -8,12 +8,12 @@ The include shortcode includes other files from your project inside of the curre
## Usage ## Usage
````go ````go
{{%/* include "<file>" { "true" | "false" } */%}} {{%/* include <string> [ "true" | "false" ] */%}}
```` ````
The first parameter is the path to the file to be included. The first required parameter is the path to the file to be included.
If the file's content will be displayed as HTML, the second optional parameter controls if the first heading of the included file should be displayed ("true")- which is the default - or be hidden. If the file's content will be displayed as HTML, the second optional parameter controls if the first heading of the included file should be displayed (`"true"`)- which is the default - or be hidden.
## Examples ## Examples

View file

@ -10,13 +10,13 @@ title = "Mermaid"
Just insert your Mermaid code in the `mermaid` shortcode like this: Just insert your Mermaid code in the `mermaid` shortcode like this:
````go ````go
{{</* mermaid [ align=(left|right|center|justify) ] */>}} {{</* mermaid [ align=("left"|"right"|"center"|"justify") ] */>}}
classDiagram classDiagram
Person *-- Dog Person *-- Dog
{{</* /mermaid */>}} {{</* /mermaid */>}}
```` ````
You can set an optional `align` attribute which defaults to `center`. You can set an optional `align` attribute which defaults to `"center"`.
If you don't need alignment you can use the alternative syntax using code fences if you have turned off `guessSyntax` for the `markup.highlight` setting (see below): If you don't need alignment you can use the alternative syntax using code fences if you have turned off `guessSyntax` for the `markup.highlight` setting (see below):

View file

@ -8,7 +8,7 @@ The notice shortcode shows four types of disclaimers to help you structure your
## Usage ## Usage
````go ````go
{{%/* notice [ note | info | tip | warning ] [?string] */%}} {{%/* notice ( note | info | tip | warning ) [ <string> ] */%}}
Some markup Some markup
{{%/* /notice */%}} {{%/* /notice */%}}
```` ````
@ -199,12 +199,14 @@ You can add:
You can customize the title of the notice by passing it as a second parameter. You can customize the title of the notice by passing it as a second parameter.
{{% notice note "Pay Attention to this Note!" %}}
The title is now the parameter that was provided.
{{% /notice %}}
{{% expand "Show markup" %}}
````go ````go
{{%/* notice note "Pay Attention to this Note!" */%}} {{%/* notice note "Pay Attention to this Note!" */%}}
The title is now the parameter that was provided. The title is now the parameter that was provided.
{{%/* /notice */%}} {{%/* /notice */%}}
```` ````
{{% /expand %}}
{{% notice note "Pay Attention to this Note!" %}}
The title is now the parameter that was provided.
{{% /notice %}}

View file

@ -3,7 +3,17 @@ description = "Get value of site params variables in your page"
title = "Site param" title = "Site param"
+++ +++
`siteparam` shortcode is used to help you print values of site params. The `siteparam` shortcode is used to help you print values of site params.
## Usage
````go
{{%/* siteparam <string */%}}
````
The first required parameter is the name of the site param to be displayed.
## Examples
For instance, in this current site, the `editURL` variable is used in `config.toml` For instance, in this current site, the `editURL` variable is used in `config.toml`