Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pagetree Macro and ReadMe.md update #329

Merged
merged 5 commits into from
Jun 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 41 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -530,8 +530,48 @@ 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 PageTree

```markdown
# My First Heading
<!-- Include: ac:pagetree -->
```

The pagetree macro works almost the same as the TOC above, but the tree behavior
is more desirable for creating placeholder pages above collections of SOPs.

The default pagetree macro behavior is to insert a tree rooted @self.

The following parameters can be used to alter your default configuration with
parameters described more in depth here:[Confluence Pagetree Macro].

Parameters:

* Title (of tree root page)
* Sort
* Excerpt
* Reverse
* SearchBox
* ExpandCollapseAll
* StartDepth

[Confluence Pagetree Macro]:https://confluence.atlassian.com/conf59/page-tree-macro-792499177.html

E.G.
```markdown
<!-- Macro: :pagetree:
Template: ac:pagetree
Reverse: 'true'
ExpandCollapseAll: 'true'
StartDepth: 2 -->

# My First Heading

:pagetree:
```

### Insert Children Display

To include Children Display (TOC displaying children pages) use following macro:
Expand Down
18 changes: 18 additions & 0 deletions pkg/mark/stdlib/stdlib.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,24 @@ func templates(api *confluence.API) (*template.Template, error) {
`</ac:structured-macro>`,
),

/* https://confluence.atlassian.com/conf59/page-tree-macro-792499177.html */

`ac:pagetree`: text(
`<ac:structured-macro ac:name="pagetree" ac:schema-version="1">`,
`<ac:parameter ac:name="root">`,
`<ac:link>`,
`<ri:page ri:content-title="@self"{{or .Title "" }}/>`,
`</ac:link>`,
`</ac:parameter>`,
`<ac:parameter ac:name="sort">{{ or .Sort "" }}</ac:parameter>`,
`<ac:parameter ac:name="excerpt">{{ or .Excerpt "" }}</ac:parameter>`,
`<ac:parameter ac:name="reverse">{{ or .Reverse "" }}</ac:parameter>`,
`<ac:parameter ac:name="searchBox">{{ or .SearchBox "" }}</ac:parameter>`,
`<ac:parameter ac:name="expandCollapseAll">{{ or .ExpandCollapseAll "" }}</ac:parameter>`,
`<ac:parameter ac:name="startDepth">{{ or .StartDepth "" }}</ac:parameter>`,
`</ac:structured-macro>`,
),

// TODO(seletskiy): more templates here
} {
templates, err = templates.New(name).Parse(body)
Expand Down