Flattening documents with include::[]

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

Flattening documents with include::[]

jheckey
Is there a way to run asciidoctor to output a single .adoc file with all of the various text included? I have written up a brief hacky version in Python because I'm don't really know Ruby (not opposed, just limit time to learn) to change the source properly.

I'm working on a project that has multiple documents reusing includes::[]. The documents themselves have revision numbers that we use for tracking, but we want to keep canonical snapshots of the documents (images are handled by just creating a new version of the image) for legacy and comparison purposes. If the include files change, that would change the "canonical" document, so keeping the flat text would be preferred, especially for human readability.
Ted
Reply | Threaded
Open this post in threaded view
|

Re: Flattening documents with include::[]

Ted
jheckey wrote
Is there a way to run asciidoctor to output a single .adoc file with all of the various text included?
No.

With Asciidoctor, you could generate HTML from your .adoc file. I think that would be a good way to create your historical snapshots.
- Ted @TedAtCIS
Reply | Threaded
Open this post in threaded view
|

Re: Flattening documents with include::[]

mojavelinux
Administrator
In reply to this post by jheckey
Actually, yes.

I think you're looking for this script from the extensions lab. It still needs some work, but could get you most of the way there.


Cheers,

-Dan

On Mon, Apr 22, 2019 at 6:56 PM jheckey [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Is there a way to run asciidoctor to output a single .adoc file with all of the various text included? I have written up a brief hacky version in Python because I'm don't really know Ruby (not opposed, just limit time to learn) to change the source properly.

I'm working on a project that has multiple documents reusing includes::[]. The documents themselves have revision numbers that we use for tracking, but we want to keep canonical snapshots of the documents (images are handled by just creating a new version of the image) for legacy and comparison purposes. If the include files change, that would change the "canonical" document, so keeping the flat text would be preferred, especially for human readability.


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Flattening-documents-with-include-tp6861.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