mirror of
https://github.com/kovetskiy/mark.git
synced 2025-04-23 21:32:41 +08:00
add jira ticket template
This commit is contained in:
parent
07a8e3f9d7
commit
58f4a55100
11
README.md
11
README.md
@ -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.
|
||||
|
3
main.go
3
main.go
@ -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:
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user