Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. buildscript {
  2. repositories {
  3. jcenter()
  4. }
  5.  
  6. dependencies {
  7. classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.3'
  8. }
  9. }
  10.  
  11. apply plugin: 'org.asciidoctor.convert'
  12.  
  13. asciidoctorj {
  14. version = '1.6.0-alpha.3'
  15. groovyDslVersion = '1.6.0-alpha.1'
  16. }
  17.  
  18. version '1.0-SNAPSHOT'
  19.  
  20. repositories {
  21. jcenter ()
  22. }
  23.  
  24. asciidoctor {
  25. extensions {
  26. block(name: 'BIG', contexts: [':paragraph']) {
  27. parent, reader, attributes ->
  28. def upperLines = reader.readLines()
  29. .collect {it.toUpperCase()}
  30. .inject('') {a, b -> a + '\n' + b}
  31.  
  32. createBlock(parent, 'paragraph', [upperLines], attributes, [:])
  33. }
  34. block('small') {
  35. parent, reader, attributes ->
  36. def lowerLines = reader.readLines()
  37. .collect {it.toLowerCase()}
  38. .inject('') {a, b -> a + '\n' + b}
  39.  
  40. createBlock(parent, 'paragraph', [lowerLines], attributes, [:])
  41. }
  42. blockmacro('capitalize') {
  43. parent, target, attributes ->
  44. def capitalLines = target.toLowerCase()
  45. .tokenize('_')
  46. .collect { it.capitalize() }
  47. .join(' ')
  48. createBlock(parent, 'pass', [capitalLines], attributes)
  49. }
  50. inline_macro('man') {
  51. parent, target, attributes ->
  52. def options = ["type": ":link", "target": target + ".html"]
  53. createPhraseNode(parent, "anchor", target, attributes, options).convert()
  54. }
  55. }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement