mirror of
https://github.com/kovetskiy/mark.git
synced 2025-04-24 05:42:40 +08:00
Parametrize the toc but have default values (#38)
This commit is contained in:
parent
f8e70476bd
commit
27e7af5b85
23
README.md
23
README.md
@ -162,6 +162,29 @@ This is my article.
|
||||
<!-- Include: ac:toc -->
|
||||
```
|
||||
|
||||
If default TOC looks don't find a way to your heart, try [parametrizing it][Confluence TOC Macro], for example:
|
||||
|
||||
```markdown
|
||||
<!-- Macro: :toc:
|
||||
Template: ac:toc
|
||||
Printable: 'false'
|
||||
MinLevel: 2 -->
|
||||
|
||||
# This is my nice title
|
||||
|
||||
:toc:
|
||||
```
|
||||
|
||||
You can call the `Macro` as you like but the `Template` field must have the `ac:toc` value.
|
||||
Also, note the single quotes around `'false'`.
|
||||
|
||||
See [Confluence TOC Macro] for the list of parameters - keep in mind that here
|
||||
they start with capital letters. Every skipped field will have the default
|
||||
value, so feel free to include only the ones that you require.
|
||||
|
||||
|
||||
[Confluence TOC Macro]:https://confluence.atlassian.com/conf59/table-of-contents-macro-792499210.html
|
||||
|
||||
### Insert Jira Ticket
|
||||
|
||||
**article.md**
|
||||
|
@ -139,14 +139,17 @@ func templates(api *confluence.API) (*template.Template, error) {
|
||||
/* https://confluence.atlassian.com/conf59/table-of-contents-macro-792499210.html */
|
||||
|
||||
`ac:toc`: text(
|
||||
`<ac:structured-macro ac:name="toc">`,
|
||||
`<ac:parameter ac:name="printable">true</ac:parameter>`,
|
||||
`<ac:parameter ac:name="style">disc</ac:parameter>`,
|
||||
`<ac:parameter ac:name="maxLevel">7</ac:parameter>`,
|
||||
`<ac:parameter ac:name="minLevel">1</ac:parameter>`,
|
||||
`<ac:parameter ac:name="exclude">{{ .Exclude }}</ac:parameter>`,
|
||||
`<ac:parameter ac:name="outline">false</ac:parameter>`,
|
||||
`</ac:structured-macro>`,
|
||||
`<ac:structured-macro ac:name="toc">{{printf "\n"}}`,
|
||||
`<ac:parameter ac:name="printable">{{ or .Printable "true" }}</ac:parameter>{{printf "\n"}}`,
|
||||
`<ac:parameter ac:name="style">{{ or .Style "disc" }}</ac:parameter>{{printf "\n"}}`,
|
||||
`<ac:parameter ac:name="maxLevel">{{ or .MaxLevel "7" }}</ac:parameter>{{printf "\n"}}`,
|
||||
`<ac:parameter ac:name="indent">{{ or .Indent "" }}</ac:parameter>{{printf "\n"}}`,
|
||||
`<ac:parameter ac:name="minLevel">{{ or .MinLevel "1" }}</ac:parameter>{{printf "\n"}}`,
|
||||
`<ac:parameter ac:name="exclude">{{ or .Exclude "" }}</ac:parameter>{{printf "\n"}}`,
|
||||
`<ac:parameter ac:name="type">{{ or .Type "list" }}</ac:parameter>{{printf "\n"}}`,
|
||||
`<ac:parameter ac:name="outline">{{ or .Outline "clear" }}</ac:parameter>{{printf "\n"}}`,
|
||||
`<ac:parameter ac:name="include">{{ or .Include "" }}</ac:parameter>{{printf "\n"}}`,
|
||||
`</ac:structured-macro>{{printf "\n"}}`,
|
||||
),
|
||||
|
||||
// TODO(seletskiy): more templates here
|
||||
|
Loading…
x
Reference in New Issue
Block a user