Skip to content

Commit

Permalink
Add pagetreesearch macro
Browse files Browse the repository at this point in the history
  • Loading branch information
mrueg committed Aug 9, 2023
1 parent 4c81bbe commit 8b72bc8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,9 @@ By default, mark provides several built-in templates and macros:
- HideHeading: Determines whether the macro hides or displays the text 'Recently Updated' as a title above the list of content
- Labels: Filter the results by label. The macro will display only the pages etc which are tagged with the label(s) you specify here.

* template: `ac:pagetreesearch` to add a search box to your Confluence page.
- Root: Name of the root page whose hierarchy of pages will be searched by this macro. If this not specified, the root page is the current page.

* macro `@{...}` to mention user by name specified in the braces.

## Template & Macros Usecases
Expand Down
10 changes: 9 additions & 1 deletion pkg/mark/stdlib/stdlib.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,14 @@ func templates(api *confluence.API) (*template.Template, error) {
`</ac:structured-macro>`,
),

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

`ac:pagetreesearch`: text(
`<ac:structured-macro ac:name="pagetreesearch">`,
`{{ if .Root }}<ac:parameter ac:name="root">{{ .Root }}</ac:parameter>{{ end }}`,
`</ac:structured-macro>`,
),

/* https://confluence.atlassian.com/conf59/panel-macro-792499179.html */

`ac:panel`: text(
Expand All @@ -406,7 +414,7 @@ func templates(api *confluence.API) (*template.Template, error) {
`</ac:structured-macro>`,
),

/* */
/* https://confluence.atlassian.com/conf59/recently-updated-macro-792499187.html */
`ac:recently-updated`: text(
`<ac:structured-macro ac:name="recently-updated">`,
`{{ if .Spaces }}<ac:parameter ac:name="spaces"><ri:space ri:space-key={{ .Spaces }}/></ac:parameter>{{ end }}`,
Expand Down

0 comments on commit 8b72bc8

Please sign in to comment.