Login  Register

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

Posted by David Jencks on Apr 09, 2020; 2:43pm
URL: https://discuss.asciidoctor.org/Do-I-need-an-extension-or-not-for-the-following-use-case-tp7854p7867.html

I don’t know of an example.  I think the main point is that the two processors be in the same code so they can share state, namely the stub block that needs to be filled in by the tree processor.

FWIW I’ve been working on a related solution for Antora, where the index table and components are on different pages.  In that case the role of the tree processor is taken by querying the Antora content catalog, which can be done in the block processor.  The (javascript) code is at David Jencks / asciidoctor-antora-indexer and I’m working on using it for Camel at CAMEL-14874Generate component index page tables with Antora

Since my solution is intended to be fairly generic I do not have the block macro generate the entire table but rather run only when it immediately follows an existing table, to which it appends rows.  That way the block macro doesn’t need to deal with the complexity of generating the entire table structure, formatting, columns, header, etc etc.  If you adopt that strategy I think your block macro could basically serve to locate the table to append to, and then the tree processor actually do the appending.

David Jencks

On Apr 9, 2020, at 4:30 AM, ch007m [via Asciidoctor :: Discussion] <[hidden email]> wrote:

Is there an example available (stub processor) and covering that use case ?
Charles Moulliard
Apache Committer / Technologist Evangelist / Blogger / MiddleWare Specialist
Twitter : @cmoulliard



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-tp7854p7865.html
To start a new topic under Asciidoctor :: Discussion, [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML