diff --git a/README.md b/README.md index 0731fb4..7de857c 100644 --- a/README.md +++ b/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. See task MYJIRA-123. diff --git a/main.go b/main.go index ac4a6ac..45996f2 100644 --- a/main.go +++ b/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: diff --git a/pkg/mark/stdlib/stdlib.go b/pkg/mark/stdlib/stdlib.go index a3beed1..d9dd0e9 100644 --- a/pkg/mark/stdlib/stdlib.go +++ b/pkg/mark/stdlib/stdlib.go @@ -130,6 +130,12 @@ func templates(api *confluence.API) (*template.Template, error) { `{{ end }}`, ), + `ac:jira:ticket`: text( + ``, + `{{ .Ticket }}`, + ``, + ), + // TODO(seletskiy): more templates here } { templates, err = templates.New(name).Parse(body)