当前位置: 首页>>代码示例>>Java>>正文


Java JRubyAsciidoctor.create方法代码示例

本文整理汇总了Java中org.asciidoctor.internal.JRubyAsciidoctor.create方法的典型用法代码示例。如果您正苦于以下问题:Java JRubyAsciidoctor.create方法的具体用法?Java JRubyAsciidoctor.create怎么用?Java JRubyAsciidoctor.create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.asciidoctor.internal.JRubyAsciidoctor的用法示例。


在下文中一共展示了JRubyAsciidoctor.create方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: renderFiles

import org.asciidoctor.internal.JRubyAsciidoctor; //导入方法依赖的package包/类
private void renderFiles(List<String> inputFiles, ZipOutputStream zip) throws IOException {
  Asciidoctor asciidoctor = JRubyAsciidoctor.create();
  for (String inputFile : inputFiles) {
    String outName = mapInFileToOutFile(inputFile, inExt, outExt);
    File out = bazel ? new File(outName) : new File(tmpdir, outName);
    if (!bazel) {
      out.getParentFile().mkdirs();
    }
    File input = new File(inputFile);
    Options options = createOptions(basedir != null ? basedir : input.getParentFile(), out);
    asciidoctor.renderFile(input, options);
    if (zip != null) {
      zipFile(out, outName, zip);
    }
  }
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:17,代码来源:AsciiDoctor.java

示例2: buildAsciidoctorJInstance

import org.asciidoctor.internal.JRubyAsciidoctor; //导入方法依赖的package包/类
private Asciidoctor buildAsciidoctorJInstance(AsciidoctorCliOptions asciidoctorCliOptions) {
    Asciidoctor asciidoctor;
    if (asciidoctorCliOptions.isLoadPaths()) {
        asciidoctor = JRubyAsciidoctor.create(asciidoctorCliOptions.getLoadPaths());   
    } else {
        asciidoctor = JRubyAsciidoctor.create((String) null);
    }
    return asciidoctor;
}
 
开发者ID:asciidoctor,项目名称:asciidoctorj,代码行数:10,代码来源:AsciidoctorInvoker.java

示例3: extensions_should_be_correctly_added

import org.asciidoctor.internal.JRubyAsciidoctor; //导入方法依赖的package包/类
@Ignore("Test is ignored because currently it is not possible to register two block extensions in same instance. This may require deep changes on Asciidoctor Extensions API")
@Test
public void extensions_should_be_correctly_added() throws IOException {

    Asciidoctor asciidoctor = JRubyAsciidoctor.create();
    
    //To avoid registering the same extension over and over for all tests, service is instantiated manually.
    new ArrowsAndBoxesExtension().register(asciidoctor);
    
    Options options = options().inPlace(false)
            .toFile(new File(testFolder.getRoot(), "rendersample.html"))
            .safe(SafeMode.UNSAFE).get();

    asciidoctor.renderFile(classpath.getResource("arrows-and-boxes-example.ad"), options);

    File renderedFile = new File(testFolder.getRoot(), "rendersample.html");
    Document doc = Jsoup.parse(renderedFile, "UTF-8");
    
    Element arrowsJs = doc.select("script[src=http://www.headjump.de/javascripts/arrowsandboxes.js").first();
    assertThat(arrowsJs, is(notNullValue()));
    
    Element arrowsCss = doc.select("link[href=http://www.headjump.de/stylesheets/arrowsandboxes.css").first();
    assertThat(arrowsCss, is(notNullValue()));
    
    Element arrowsAndBoxes = doc.select("pre[class=arrows-and-boxes").first();
    assertThat(arrowsAndBoxes, is(notNullValue()));
    
}
 
开发者ID:asciidoctor,项目名称:asciidoctorj,代码行数:29,代码来源:WhenExtensionIsRegisteredAsService.java

示例4: create

import org.asciidoctor.internal.JRubyAsciidoctor; //导入方法依赖的package包/类
/**
 * Creates a new instance of Asciidoctor.
 * 
 * @return Asciidoctor instance which uses JRuby to wraps Asciidoctor
 *         Ruby calls.
 */
public static Asciidoctor create() {
    return JRubyAsciidoctor.create();
}
 
开发者ID:asciidoctor,项目名称:asciidoctorj,代码行数:10,代码来源:Asciidoctor.java


注:本文中的org.asciidoctor.internal.JRubyAsciidoctor.create方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。