Login  Register

Re: Do I need an extension or not for the following use case ?

Posted by mojavelinux on Apr 09, 2020; 10:18am
URL: https://discuss.asciidoctor.org/Do-I-need-an-extension-or-not-for-the-following-use-case-tp7854p7862.html

You could do it with a combination of the block macro and the tree processor. The block macro would be used for placing the block into the tree. But a block macro can't see parts of the tree that have no yet been parsed. So you'll likely create a stub block, then use the tree processor to come back to it and fill it in.

Cheers,

-Dan

On Thu, Apr 9, 2020 at 3:47 AM abelsromero [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I was hoping for you to go with the includes option. It's more cumbersome but I prefer out-of-the-box solutions -total personal preference-. The only problem with this I find is obtaining the command name from the section title.

About the extension, I can't really say, but just by process of elimination the Treeprocessor ...
- Preprocessor is the easier, it's only adding AsciiDoc line, but I don't recall includes are processed, you won't have access to the included content unless parsed manually.
- Postprocessor deals with raw output data, fine for HTML, but not for PDF which is binary.
- The other options make no sense to me.

-> Treeprocessors exposes the whole AST, so you have all info available, but you'll have to build the table also using the AST API.




If you reply to this email, your message will be added to the discussion below:
https://discuss.asciidoctor.org/Do-I-need-an-extension-or-not-for-the-following-use-case-tp7854p7859.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux