本文整理汇总了Java中org.asciidoctor.internal.JRubyAsciidoctor类的典型用法代码示例。如果您正苦于以下问题:Java JRubyAsciidoctor类的具体用法?Java JRubyAsciidoctor怎么用?Java JRubyAsciidoctor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JRubyAsciidoctor类属于org.asciidoctor.internal包,在下文中一共展示了JRubyAsciidoctor类的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);
}
}
}
示例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;
}
示例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()));
}
示例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();
}