使用 asciidoctor 将多个标签组合成一个标签

grouping multiple tags into one with asciidoctor

我在我的 asciidoc 中做文档,我有很多这样的项目

# tag::checklist[]
[IMPORTANT.checklist,caption=Checklist]
====
this is the tagged checklist item
====
# end::checklist[]

有没有一种方法可以将它组合成一个语法更友好的宏,因为没有更好的术语,所以语法像这样

[checklist]
====
this is the tagged checklist item
====

呈现相同的东西?

哦,我也需要它来处理 docbook 和 pdf

不适用于本机 Asciidoctor。您需要编写一个扩展来处理 [checklist] 块并为当前正在使用的输出后端类型发出适当的输出。

通常,tag::end:: 用于包含文件的块定界符,通常是非 Asciidoc 源(想想代码示例)。由于这些包装 Asciidoc 源代码,您可以考虑将每个包装块分离到一个单独的文件中,并根据需要包含它们。这样做将消除对分隔符的需要,并简化涉及此内容的 include: 宏。它还会简化您的潜在扩展程序需要执行的工作。