Skip to content

Commit

Permalink
Add Page properties macro
Browse files Browse the repository at this point in the history
  • Loading branch information
mrueg committed May 25, 2023
1 parent 28ee195 commit 0988a7a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,9 @@ By default, mark provides several built-in templates and macros:
- CQL: The CQL query to discover the pages
- SortBy: Sort by a specific column heading

* template: `ac:details` to create page properties
- Body: Must contain a table with two rows, the table headings are used as property key. The table content is the value.

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

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

/* https://confluence.atlassian.com/conf59/page-properties-macro-792499154.html */

`ac:details`: text(
`<ac:structured-macro ac:name="details" ac:schema-version="1"">`,
`<ac:rich-text-body>{{ .Body }}</ac:rich-text-body>`,
`</ac:structured-macro>`,
),

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

0 comments on commit 0988a7a

Please sign in to comment.