mirror of
https://github.com/kovetskiy/mark.git
synced 2025-04-24 05:42:40 +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
|
- true
|
||||||
- false
|
- 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
|
See: https://confluence.atlassian.com/conf59/status-macro-792499207.html
|
||||||
|
|
||||||
* macro `@{...}` to mention user by name specified in the braces.
|
* macro `@{...}` to mention user by name specified in the braces.
|
||||||
@ -133,12 +136,6 @@ This is my article.
|
|||||||
|
|
||||||
## Insert Jira Ticket
|
## Insert Jira Ticket
|
||||||
|
|
||||||
**ticket.md**
|
|
||||||
|
|
||||||
```markdown
|
|
||||||
[{{ .Ticket }}](http://myjira.atlassian.net/browse/{{ .Ticket }})
|
|
||||||
```
|
|
||||||
|
|
||||||
**article.md**
|
**article.md**
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
@ -146,7 +143,7 @@ This is my article.
|
|||||||
<!-- Title: TODO List -->
|
<!-- Title: TODO List -->
|
||||||
|
|
||||||
<!-- Macro: MYJIRA-\d+
|
<!-- Macro: MYJIRA-\d+
|
||||||
Template: ticket.md
|
Template: ac:jira:ticket
|
||||||
Ticket: ${0} -->
|
Ticket: ${0} -->
|
||||||
|
|
||||||
See task MYJIRA-123.
|
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
|
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.
|
* macro '@{...}' to mention user by name specified in the braces.
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
|
@ -130,6 +130,12 @@ func templates(api *confluence.API) (*template.Template, error) {
|
|||||||
`{{ end }}`,
|
`{{ 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
|
// TODO(seletskiy): more templates here
|
||||||
} {
|
} {
|
||||||
templates, err = templates.New(name).Parse(body)
|
templates, err = templates.New(name).Parse(body)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user