我正在使用asciidoctor使用asciidoctor-maven-plugin。在我的文档(实际上是文档)中,有一个块重复了很多次。是否有任何方法可以包含参数。
在伪代码中,我想要的是,我找不到如何写它:
模板:
=== HTTP request
include::{snippets}/{variable}/http-request.adoc[]
=== HTTP response
include::{snippets}/{variable}/http-response.adoc[]用法
include template[variable=customer]谢谢。
发布于 2016-01-27 09:00:23
我想你可以重新定义属性。用这棵树:
Folder
| main.adoc
| template.adoc
|
\---code
+---first
| http-request.adoc
| http-response.adoc
|
\---second
http-request.adoc
http-response.adoc我的main.adoc文件如下所示:
:snippets: code
== First Chapter
:variable: first
include::template.adoc[]
== Second Chapter
:variable: second
include::template.adoc[]
== End
This is the end.前面的例子很有效,但我觉得这并不完全是您想要的。
如果您正在寻找一个宏示例,请查看这个maven & java示例:java-扩展-示例。
https://stackoverflow.com/questions/35012544
复制相似问题