Skip to content

Instantly share code, notes, and snippets.

@mrhaki
Created February 23, 2015 12:54
Show Gist options
  • Save mrhaki/f5cfb32a28086bd00236 to your computer and use it in GitHub Desktop.
Save mrhaki/f5cfb32a28086bd00236 to your computer and use it in GitHub Desktop.
Simple inline macro for JIRA issue linking in Asciidoctor with Gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.2'
}
}
apply plugin: 'org.asciidoctor.convert'
asciidoctor {
extensions {
inlinemacro (name: "jira") {
parent, target, attributes ->
options = [
"type": ":link",
"target": "http://www.jira.com/browse/${target}".toString()
]
createInline(parent, "anchor", target, attributes, options).render()
}
}
}

Sample

This is a JIRA issue jira:PRJ-200[].

<div class="paragraph">
<p>This is a JIRA issue <a href="http://www.jira.com/browser/PRJ-200">PRJ-200</a>.</p>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment