use*_*073 5 asciidoc asciidoctor
我正在使用 CMS 来发布我的博客文章。我正在寻找一种从简单文本文件离线创建 HTML 文章的方法。\n这是我通常在文章中使用的一段 HTML:
\n\n<p>\xc2\xa0We want to show how you can gather information such as the author name:</p>\n<pre class="brush:java">package com.sample;\n\nimport org.apache.camel.builder.RouteBuilder;\nimport org.apache.camel.main.Main;\n\n\npublic class XMLCamel {\n\n public static void main(String[] args) throws Exception {\n Main main = new Main();\n\n }\n}\n\nclass Sample extends RouteBuilder {\n\n @Override\n public void config() throws Exception {\n\n from("file:/usr/data/files?noop=true")\n .split(xpath("//catalog/book/author/text()")).to("stream:out"); \n\n }\n}</pre>\n<p>The above route will print the author names according to the <strong>XPath</strong> query: //catalog/book/author/text()</p>\n<p>The authors will be sent to the Stream.out so you will see them on the console once you run the code.</p>\n<p><strong>Result:</strong></p>\n<p><strong>John Smith Sally Joy</strong></p>\nRun Code Online (Sandbox Code Playgroud)\n\n正如您所看到的,我使用一些自定义来包装代码(课前等)。这是可以用 Asciidoctor 轻松完成的事情吗?我是 Asciidoctor 的新手,只是想知道是否值得为此目的投入时间学习它。
\n谢谢!
| 归档时间: |
|
| 查看次数: |
794 次 |
| 最近记录: |