本文整理了Java中org.asciidoctor.Attributes.setDocType()
方法的一些代码示例,展示了Attributes.setDocType()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Attributes.setDocType()
方法的具体详情如下:
包路径:org.asciidoctor.Attributes
类名称:Attributes
方法名:setDocType
[英]Sets the document type, which defines how a document and what parts are rendered. Possible values are:
代码示例来源:origin: asciidoctor/asciidoctorj
/**
* Sets doc type attribute.
*
* @param docType
* value.
* @return this instance.
*/
public AttributesBuilder docType(String docType) {
this.attributes.setDocType(docType);
return this;
}
代码示例来源:origin: org.asciidoctor/asciidoctor-java-integration
/**
* Sets doc type attribute.
*
* @param docType
* value.
* @return this instance.
*/
public AttributesBuilder docType(String docType) {
this.attributes.setDocType(docType);
return this;
}
代码示例来源:origin: org.asciidoctor/asciidoctorj-api
/**
* Sets doc type attribute.
*
* @param docType
* value.
* @return this instance.
*/
public AttributesBuilder docType(String docType) {
this.attributes.setDocType(docType);
return this;
}
代码示例来源:origin: pietermartin/sqlg
private void createDocs() {
String version = "2.0.0-SNAPSHOT";
Asciidoctor asciidoctor = create();
try {
File file = new File("sqlg-doc/docs/" + version + "/sqlg.adoc");
File html = new File("sqlg-doc/docs/" + version + "/index.html");
Attributes attributes = new Attributes();
attributes.setBackend("html5");
attributes.setStyleSheetName("asciidoctor-default.css");
attributes.setDocType("book");
attributes.setSourceHighlighter("highlightjs");
Map<String, Object> options = OptionsBuilder.options()
.attributes(attributes)
.toFile(new File(html.getPath()))
.headerFooter(true)
.safe(SafeMode.SERVER)
.asMap();
options.put("location", ":footer");
Docinfo docinfo = new Docinfo(options);
asciidoctor.javaExtensionRegistry().docinfoProcessor(docinfo);
asciidoctor.convertFile(
file,
options
);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
内容来源于网络,如有侵权,请联系作者删除!