List of included files

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

List of included files

Thalamos
Is it possible to receive a list of included files through the plugin api? So basically the 'target' value of an IncludeProcessor but without actually having to implement the logic of such a processor. I'd like to generate a file that has all includes listed and therefore can be used by a Makefile that would put all necessary files into an archive.
Reply | Threaded
Open this post in threaded view
|

Re: List of included files

mojavelinux
Administrator
Yes, the files that are included get put into the following collection:

doc = Asciidoctor.load_file 'sample.adoc', safe: :safe
doc.catalog[:includes]

The other option is to use a custom include processor, which will get called each time an include directive is found.

Best,

-Dan

On Mon, Oct 14, 2019 at 2:06 PM Thalamos [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Is it possible to receive a list of included files through the plugin api? So basically the 'target' value of an IncludeProcessor but without actually having to implement the logic of such a processor. I'd like to generate a file that has all includes listed and therefore can be used by a Makefile that would put all necessary files into an archive.


If you reply to this email, your message will be added to the discussion below:
https://discuss.asciidoctor.org/List-of-included-files-tp7225.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
Reply | Threaded
Open this post in threaded view
|

Re: List of included files

Thalamos
Hey Dan,
thank you for your fast response. I've already had an eye on the doc.catalog variant but as I'm stuck to using the plugin system I cannot go with that (I assume the other processors are called per document). So my assumption was right that the IncludeProcessor is the way to go. Thank you very much for your input.

- Andy

P.s: Thanks for Asciidoctor in general. Couldn't live without that tool anymore.