我正在使用 CMS 来发布我的博客文章。我正在寻找一种从简单的文本文件离线创建 HTML 文章的方法。
这是我通常在文章中使用的一段 HTML:
<p> We want to show how you can gather information such as the author name:</p>
<pre class="brush:java">package com.sample;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.main.Main;
public class XMLCamel {
public static void main(String[] args) throws Exception {
Main main = new Main();
}
}
class Sample extends RouteBuilder {
@Override
public void config() throws Exception {
from("file:/usr/data/files?noop=true")
.split(xpath("//catalog/book/author/text()")).to("stream:out");
}
}</pre>
<p>The above route will print the author names according to the <strong>XPath</strong> query: //catalog/book/author/text()</p>
<p>The authors will be sent to the Stream.out so you will see them on the console once you run the code.</p>
<p><strong>Result:</strong></p>
<p><strong>John Smith Sally Joy</strong></p>
正如您所看到的,我使用一些自定义来包装代码(课前等)。这是可以用 Asciidoctor 轻松完成的事情吗?我是 Asciidoctor 的新手,只是想知道是否值得为此目的投入时间学习它。
Thanks!
回答这个问题,是的,这是可能的。然而,对于像这样的小事情,asciidoctor ootb 的输出以及选择的荧光笔可能适合您正在做的事情。
如果您需要自定义一些内容,则需要创建自定义后端。由于创建自定义后端的文档尚未完成这个邮件列表帖子 http://discuss.asciidoctor.org/How-to-create-a-custom-backend-td2494.html应该有帮助。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)