fixed indent
This commit is contained in:
parent
9e79eb76d6
commit
b89699022e
25
README.md
25
README.md
@ -11,6 +11,7 @@ refer to the article [on my website](https://quintern.xyz/en/software/buwuma.htm
|
|||||||
- All commands must be located within a html comment what starts with `<!--` and ends with `-->`.
|
- All commands must be located within a html comment what starts with `<!--` and ends with `-->`.
|
||||||
- Commands start with a `#` character, the command must follow the `#` immediately.
|
- Commands start with a `#` character, the command must follow the `#` immediately.
|
||||||
- Everything after the command until the end of the comment or a newline character are considered the argument of the command.
|
- Everything after the command until the end of the comment or a newline character are considered the argument of the command.
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<!-- #command everything here is an argument -->
|
<!-- #command everything here is an argument -->
|
||||||
<!--
|
<!--
|
||||||
@ -20,18 +21,24 @@ refer to the article [on my website](https://quintern.xyz/en/software/buwuma.htm
|
|||||||
#comment This will be a single line html comment after the preprocessor finishes.
|
#comment This will be a single line html comment after the preprocessor finishes.
|
||||||
-->
|
-->
|
||||||
```
|
```
|
||||||
|
|
||||||
- All commands return a string, which can be empty.
|
- All commands return a string, which can be empty.
|
||||||
- If a comment contains a command, the entire comment will replaced with the return value of the command.
|
- If a comment contains a command, the entire comment will replaced with the return value of the command.
|
||||||
- If there are multiple commands in a command, it will be replaced by all the return values added together.
|
- If there are multiple commands in a command, it will be replaced by all the return values added together.
|
||||||
|
|
||||||
### Variables
|
### Variables
|
||||||
- Variable names must only consist of these characters: `a-zA-Z0-9_`
|
- Variable names must only consist of these characters: `a-zA-Z0-9_`
|
||||||
- A variable with name `varname` can be used like this: `#$(varname)`
|
- A variable with name `varname` can be used like this: `#$(varname)`
|
||||||
- A variable usage will be replaced by the value of the variable
|
- A variable usage will be replaced by the value of the variable
|
||||||
- Any variable that has is not defined has empty string as value
|
- Any variable that has is not defined has empty string as value
|
||||||
|
|
||||||
### General
|
### General
|
||||||
- Whitespaces around a token are ignored, so `<!--#include dir/file-->` is the same as `<!-- #include dir/file -->`
|
- Whitespaces around a token are ignored, so `<!--#include dir/file-->` is the same as `<!-- #include dir/file -->`
|
||||||
- If a command-comment takes up a whole line, the whole line including the newline character is replaced.
|
- If a command-comment takes up a whole line, the whole line including the newline character is replaced.
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
### include
|
### include
|
||||||
Include the content of a file at the position of the command.
|
Include the content of a file at the position of the command.
|
||||||
@ -41,6 +48,9 @@ refer to the article [on my website](https://quintern.xyz/en/software/buwuma.htm
|
|||||||
A absolute or relative path to a text file
|
A absolute or relative path to a text file
|
||||||
**Return Value**:
|
**Return Value**:
|
||||||
The content of the file or `<!-- Could not include '{args}' -->` empty string if the file can not be opened.
|
The content of the file or `<!-- Could not include '{args}' -->` empty string if the file can not be opened.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
### set
|
### set
|
||||||
Set the value of a variable
|
Set the value of a variable
|
||||||
**Synopsis**:
|
**Synopsis**:
|
||||||
@ -56,8 +66,12 @@ refer to the article [on my website](https://quintern.xyz/en/software/buwuma.htm
|
|||||||
In this case, `varname` will take the first value from the dictionary that matches tha value of `othervar`.
|
In this case, `varname` will take the first value from the dictionary that matches tha value of `othervar`.
|
||||||
`*` always everything and can be used as fallback. General wildcards like `a*` to match everything that starts with a are not supported.
|
`*` always everything and can be used as fallback. General wildcards like `a*` to match everything that starts with a are not supported.
|
||||||
Instead of commas `,` you can also use semicolons `;` as separators, but this must be consistend within the map.
|
Instead of commas `,` you can also use semicolons `;` as separators, but this must be consistend within the map.
|
||||||
|
|
||||||
### default
|
### default
|
||||||
Same as `set`, but it sets the variable's value only if it has no value yet.
|
Same as `set`, but it sets the variable's value only if it has no value yet.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
### comment
|
### comment
|
||||||
Comment the arguemnts.
|
Comment the arguemnts.
|
||||||
**Synopsis**:
|
**Synopsis**:
|
||||||
@ -68,6 +82,7 @@ refer to the article [on my website](https://quintern.xyz/en/software/buwuma.htm
|
|||||||
The argument in comment tags
|
The argument in comment tags
|
||||||
This can be useful in multiline comments that contain other commands: In that case, the comment tags will be removed and each command replaced with
|
This can be useful in multiline comments that contain other commands: In that case, the comment tags will be removed and each command replaced with
|
||||||
its return value, so if you want to just have commented text in there you can use `#comment`
|
its return value, so if you want to just have commented text in there you can use `#comment`
|
||||||
|
|
||||||
### uncomment
|
### uncomment
|
||||||
Uncomment the comment.
|
Uncomment the comment.
|
||||||
**Synopsis**:
|
**Synopsis**:
|
||||||
@ -77,30 +92,37 @@ refer to the article [on my website](https://quintern.xyz/en/software/buwuma.htm
|
|||||||
**Return Value**:
|
**Return Value**:
|
||||||
The argument
|
The argument
|
||||||
This can be useful when you want to look at the unprocessed html without variables or when your syntax highlighting gets confused by a variable.
|
This can be useful when you want to look at the unprocessed html without variables or when your syntax highlighting gets confused by a variable.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
### sidenav
|
### sidenav
|
||||||
Manage the generation of a content menu which contains links to all headings in your html that have an id. The menu is called sidenav here.
|
Manage the generation of a content menu which contains links to all headings in your html that have an id. The menu is called sidenav here.
|
||||||
An entry is a html heading with a id: `<h1 id=myheading>This heading will be linked in the sidenav</h1>`
|
An entry is a html heading with a id: `<h1 id=myheading>This heading will be linked in the sidenav</h1>`
|
||||||
**Synopsis**:
|
**Synopsis**:
|
||||||
`<!-- #sidenav sidenav-command arguments -->`
|
`<!-- #sidenav sidenav-command arguments -->`
|
||||||
sidenav-command must be one of the following:
|
sidenav-command must be one of the following:
|
||||||
|
|
||||||
#### `include`
|
#### `include`
|
||||||
Include the generated sidenav at this position.
|
Include the generated sidenav at this position.
|
||||||
**Argument**:
|
**Argument**:
|
||||||
Ignored
|
Ignored
|
||||||
**Return Value**:
|
**Return Value**:
|
||||||
The generated sidenav
|
The generated sidenav
|
||||||
|
|
||||||
#### `section`
|
#### `section`
|
||||||
Group all following entries in named section.
|
Group all following entries in named section.
|
||||||
**Argument**:
|
**Argument**:
|
||||||
The name of the section
|
The name of the section
|
||||||
**Return Value**
|
**Return Value**
|
||||||
Empty string
|
Empty string
|
||||||
|
|
||||||
#### `name`
|
#### `name`
|
||||||
Use a custom name instead of the heading itself for the link to the next heading.
|
Use a custom name instead of the heading itself for the link to the next heading.
|
||||||
**Argument**:
|
**Argument**:
|
||||||
The link-name of the next heading
|
The link-name of the next heading
|
||||||
**Return Value**:
|
**Return Value**:
|
||||||
Empty string
|
Empty string
|
||||||
|
|
||||||
#### `custom`
|
#### `custom`
|
||||||
Include a custom link in the sidenav.
|
Include a custom link in the sidenav.
|
||||||
**Synopsis**:
|
**Synopsis**:
|
||||||
@ -109,6 +131,9 @@ refer to the article [on my website](https://quintern.xyz/en/software/buwuma.htm
|
|||||||
Must be `href="..." name="..."`. Either single `'` or double `"` quotes are required.
|
Must be `href="..." name="..."`. Either single `'` or double `"` quotes are required.
|
||||||
**Return Value**:
|
**Return Value**:
|
||||||
Empty string
|
Empty string
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Pitfalls
|
## Pitfalls
|
||||||
- The `#include` command must not be in the last line of the file
|
- The `#include` command must not be in the last line of the file
|
||||||
- The maps in `set` have **at least 2** options
|
- The maps in `set` have **at least 2** options
|
||||||
|
Loading…
Reference in New Issue
Block a user