Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- buildscript {
- repositories {
- jcenter()
- }
- dependencies {
- classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.3'
- }
- }
- apply plugin: 'org.asciidoctor.convert'
- asciidoctorj {
- version = '1.6.0-alpha.3'
- groovyDslVersion = '1.6.0-alpha.1'
- }
- version '1.0-SNAPSHOT'
- repositories {
- jcenter ()
- }
- asciidoctor {
- extensions {
- block(name: 'BIG', contexts: [':paragraph']) {
- parent, reader, attributes ->
- def upperLines = reader.readLines()
- .collect {it.toUpperCase()}
- .inject('') {a, b -> a + '\n' + b}
- createBlock(parent, 'paragraph', [upperLines], attributes, [:])
- }
- block('small') {
- parent, reader, attributes ->
- def lowerLines = reader.readLines()
- .collect {it.toLowerCase()}
- .inject('') {a, b -> a + '\n' + b}
- createBlock(parent, 'paragraph', [lowerLines], attributes, [:])
- }
- blockmacro('capitalize') {
- parent, target, attributes ->
- def capitalLines = target.toLowerCase()
- .tokenize('_')
- .collect { it.capitalize() }
- .join(' ')
- createBlock(parent, 'pass', [capitalLines], attributes)
- }
- inline_macro('man') {
- parent, target, attributes ->
- def options = ["type": ":link", "target": target + ".html"]
- createPhraseNode(parent, "anchor", target, attributes, options).convert()
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement