【发布时间】:2015-04-18 11:49:00
【问题描述】:
我可以包含完整的Greet.java 文件
public class Greet {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
从 asciidoc 文件中
== Hello Java
This is how one greets in Java:
[source,java]
.Greet.java
----
include::Greet.java
----
制作文档
但假设我只想包含由标签分隔的代码的摘录。在上面的代码中,假设我只想包含main 函数。
我在documentation 中没有看到符号标签,但this 页面表明它足以编写
public class Greet {
// tag::helloMethod[]
public static void main(String[] args) {
System.out.println("Hello World!");
}
// end::helloMethod[]
}
和
== Hello Java
This is how one greets in Java:
[source,java]
.Greet.java
----
include::Greet.java[tags=helloMethod]
----
这只是产生:
您能否建议一种仅包含摘录的方法?我正在使用 asciidoc 8.6.9。
【问题讨论】:
标签: documentation literate-programming asciidoc