Including ADOC code from txt file inside an adoc file

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

Including ADOC code from txt file inside an adoc file

smhanes15
Requesting help on how to import from files using include::filename.txt[tag=TAG] in such a way that TAG is itself ASCIIDOCTOR text inside a .txt file that includes other include(s) to tags inside that same .txt file as well as other ADOC elements.

I created a Pastebin with more details -- https://pastebin.com/9NgABGHa .
Reply | Threaded
Open this post in threaded view
|

Re: Including ADOC code from txt file inside an adoc file

mojavelinux
Administrator
Yes, this works. But you cannot indent the lines. AsciiDoc is left-aligned, so if you want the lines to be interpreted as AsciiDoc, they need to be flush to the left margin.

If you do want to store the lines indented, then you need to set the indent attribute on the include directive as follows:

include::filename.txt[indent=0]

That will strip the indentation before reading the lines.

-Dan

On Wed, Dec 13, 2017 at 11:09 AM, smhanes15 [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Requesting help on how to import from files using include::filename.txt[tag=TAG] in such a way that TAG is itself ASCIIDOCTOR text inside a .txt file that includes other include(s) to tags inside that same .txt file as well as other ADOC elements.

I created a Pastebin with more details -- https://pastebin.com/9NgABGHa .


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Including-ADOC-code-from-txt-file-inside-an-adoc-file-tp6080.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