我正在使用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>
你可以看到,我使用一些自定义操作来包装代码(pre class等)。这是Asciidoctor可以轻松完成的吗?我对Asciidoctor还不熟悉,只是想知道是否值得花时间学习它以实现此目的。
谢谢!