scphantm
scphantm

Reputation: 4563

grouping multiple tags into one with asciidoctor

I am doing documentation in my asciidoc, I have many items like this

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

is there a way where i can combine this into a more, syntax friendly macro, for lack of a better term, to have syntax like this

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

that renders the same thing?

Oh, and i need this to work for docbook and pdf as well

Upvotes: 0

Views: 327

Answers (1)

eskwayrd
eskwayrd

Reputation: 4531

Not with native Asciidoctor. You would need to write an extension to handle [checklist] blocks and emit the appropriate output for the kind of output backend currently in use.

Normally, the tag:: and end:: are used block delimiters for included files, which typically would be non-Asciidoc source (think code samples). Since these wrap Asciidoc source, you might consider separating each wrapped block into a separate file, and include them as needed. Doing so would remove the need for the delimiters, and simplify your include: macros that involve this content. It would also simplify the work your potential extension would need to perform.

Upvotes: 1

Related Questions