Sunday, August 18, 2013

How to convert asciidoc text to html using Groovy

Here is how you can convert asciidoc text using Groovy script:

// filename: RunAsciidoc.groovy
import org.asciidoctor.*
def asciidoctor = Asciidoctor.Factory.create()
def output = asciidoctor.renderFile(new File(args[0]),  [:])

Now you may run it

groovy RunAsciidoc.groovy myarticle.txt

Many thanks to the project!

No comments:

Post a Comment