diff --git a/README.md b/README.md index 52057ef..8ad370c 100644 --- a/README.md +++ b/README.md @@ -204,6 +204,37 @@ By default, mark provides several built-in templates and macros: See: https://confluence.atlassian.com/doc/widget-connector-macro-171180449.html#WidgetConnectorMacro-YouTube +* template: `ac:children` to include Children Display macro + - Reverse (Reverse Sort): Use with the `Sort Children By` parameter. When set, the sort order changes from ascending to descending. + - `true` + - `false` (Default) + - Sort (Sort Children By): + - `creation` — to sort by content creation date + - `title` — to sort alphabetically on title + - `modified` — to sort of last modification date. + - If not specified, manual sorting is used if manually ordered, otherwise alphabetical. + - Style (Heading Style): Choose the style used to display descendants. + - from `h1` to `h6` + - If not specified, default style is applied. + - Page (Parent Page): + - `/` — to list the top-level pages of the current space, i.e. those without parents. + - `pagename` — to list the children of the specified page. + - `spacekey:pagename` — to list the children of the specified page in the specified space. + - If not specified, the current page is used. + - Excerpt (Include Excerpts): Allows you to include a short excerpt under each page in the list. + - `none` - no excerpt will be displayed. (Default) + - `simple` - displays the first line of text contained in an Excerpt macro any of the returned pages. If there is not an Excerpt macro on the page, nothing will be shown. + - `rich content` - displays the contents of an Excerpt macro, or if there is not an Excerpt macro on the page, the first part of the page content, including formatted text, images and some macros. + - First (Number of Children): Restrict the number of child pages that are displayed at the top level. + - If not specified, no limit is applied. + - Depth (Depth of Descendants): Enter a number to specify the depth of descendants to display. For example, if the value is 2, the macro will display 2 levels of child pages. This setting has no effect if `Show Descendants` is enabled. + - If not specified, no limit is applied. + - All (Show Descendants): Choose whether to display all the parent page's descendants. + - `true` + - `false` (Default) + + See: https://confluence.atlassian.com/doc/children-display-macro-139501.html + * macro `@{...}` to mention user by name specified in the braces. ## Template & Macros Usecases @@ -297,7 +328,38 @@ 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 Children Display +To include Children Display (TOC displaying children pages) use following macro: + +```markdown + + +# This is my nicer title + +:children: +``` + +You can use various [parameters](https://confluence.atlassian.com/conf59/children-display-macro-792499081.html) to modify Children Display: + +```markdown + + +# This is my nicest title + +:children: +``` ### Insert Jira Ticket **article.md** @@ -487,4 +549,4 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d -This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! +This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! \ No newline at end of file diff --git a/pkg/mark/stdlib/stdlib.go b/pkg/mark/stdlib/stdlib.go index e9d4d57..de092f2 100644 --- a/pkg/mark/stdlib/stdlib.go +++ b/pkg/mark/stdlib/stdlib.go @@ -171,6 +171,27 @@ func templates(api *confluence.API) (*template.Template, error) { `{{printf "\n"}}`, ), + /* https://confluence.atlassian.com/doc/children-display-macro-139501.html */ + + `ac:children`: text( + `{{printf "\n"}}`, + `{{ if .Reverse}}{{ or .Reverse }}{{printf "\n"}}{{end}}`, + `{{ if .Sort}}{{ .Sort }}{{printf "\n"}}{{end}}`, + `{{ if .Style}}{{ .Style }}{{printf "\n"}}{{end}}`, + `{{ if .Page}}`, + /**/ ``, + /**/ ``, + /**/ ``, + /**/ ``, + /**/ ``, + `{{printf "\n"}}{{end}}`, + `{{ if .Excerpt}}{{ .Excerpt }}{{printf "\n"}}{{end}}`, + `{{ if .First}}{{ .First }}{{printf "\n"}}{{end}}`, + `{{ if .Depth}}{{ .Depth }}{{printf "\n"}}{{end}}`, + `{{ if .All}}{{ .All }}{{printf "\n"}}{{end}}`, + `{{printf "\n"}}`, + ), + /* https://confluence.atlassian.com/doc/confluence-storage-format-790796544.html */ `ac:emoticon`: text(