2014-01-10 134 views
3

过程Asciidoc我想一些AsciiDoc .adoc文件转换为HTML和使用摇篮为。与摇篮任务

我是新来的摇篮。我发现https://github.com/asciidoctor/asciidoctor-gradle-plugin 及以下build.gradle那就要做到这一点,但我的摇篮的水平,我不知道下一步该怎么做

// https://github.com/asciidoctor/asciidoctor-gradle-plugin 

buildscript { 
    repositories { 
     maven { 
      name 'Bintray Asciidoctor repo' 
      url 'http://dl.bintray.com/content/aalmiray/asciidoctor' 
     } 
     jcenter() 
    } 

    dependencies { 
     classpath 'org.asciidoctor:asciidoctor-gradle-plugin:0.7.0' 
    } 
} 

apply plugin: 'asciidoctor' 

// append below the line: apply plugin: 'asciidoctor' 

asciidoctor { 
    outputDir = new File("$buildDir/docs") 
    options = [ 
     eruby: 'erubis', 
     attributes: [ 
      'source-highlighter': 'coderay', 
      toc: '', 
      idprefix: '', 
      idseparator: '-' 
     ] 
    ] 
    //+ 
    //sourceDir = new File(".") 
} 
+0

如果学习插件文档和普通AsciiDoctor文档没有帮助,也许看看一些其他的那些已经在使用这个插件(格里芬的,Groovy等)的基础之上。 –

+0

也许我的Ruby的例子可以帮助:[Guardfile(https://gist.github.com/craibuc/9323879) – craig

回答

1

首先,确保你有Gradle installed

然后,确保您的文件名结尾为.adoc,.asciidoc,.asc.ad。它们应该位于项目的src/asciidoc子目录中。

然后,用下面的命令从命令行运行摇篮:

gradle asciidoctor

3

我得到了我的设置与this tutorial工作。您没有明确设置JCenter库,因为它可以与jcenter()作为你已经离开。

我不知道这是怎么回事与asciidoctor插件,但我不得不使用版本0.5.0作为0.7.0失败的内部错误和失败0.6.0一些Ruby的问题。