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
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::
andend::
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 yourinclude:
macros that involve this content. It would also simplify the work your potential extension would need to perform.