add jira ticket template

This commit is contained in:
Stanislav Seletskiy 2019-08-06 18:07:40 +03:00
parent 07a8e3f9d7
commit 58f4a55100
No known key found for this signature in database
GPG Key ID: E6B40F71C367E6B5
3 changed files with 13 additions and 7 deletions

View File

@ -85,6 +85,9 @@ By default, mark provides several built-in templates and macros:
- true
- false
* template `ac:jira:ticket` to include JIRA ticket link. Parameters:
- Ticket: Jira ticket number like BUGS-123.
See: https://confluence.atlassian.com/conf59/status-macro-792499207.html
* macro `@{...}` to mention user by name specified in the braces.
@ -133,12 +136,6 @@ This is my article.
## Insert Jira Ticket
**ticket.md**
```markdown
[{{ .Ticket }}](http://myjira.atlassian.net/browse/{{ .Ticket }})
```
**article.md**
```markdown
@ -146,7 +143,7 @@ This is my article.
<!-- Title: TODO List -->
<!-- Macro: MYJIRA-\d+
Template: ticket.md
Template: ac:jira:ticket
Ticket: ${0} -->
See task MYJIRA-123.

View File

@ -94,6 +94,9 @@ By default, mark provides several built-in templates and macros:
See: https://confluence.atlassian.com/conf59/status-macro-792499207.html
* template 'ac:jira:ticket' to include JIRA ticket link. Parameters:
- Ticket: Jira ticket number like BUGS-123.
* macro '@{...}' to mention user by name specified in the braces.
Usage:

View File

@ -130,6 +130,12 @@ func templates(api *confluence.API) (*template.Template, error) {
`{{ end }}`,
),
`ac:jira:ticket`: text(
`<ac:structured-macro ac:name="jira">`,
`<ac:parameter ac:name="key">{{ .Ticket }}</ac:parameter>`,
`</ac:structured-macro>`,
),
// TODO(seletskiy): more templates here
} {
templates, err = templates.New(name).Parse(body)