include in source code

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

include in source code

metro
Hi,

I want to show some examples of Asciidoctor source in my document. This source contains include statements.

How can I disable the processing of includes in a source code section?

MT
--
Reply | Threaded
Open this post in threaded view
|

Re: include in source code

rwinch
You can escape directives using a "\". For example:

----
\include::file.adoc[]
----
Reply | Threaded
Open this post in threaded view
|

Re: include in source code

metro
Thanks. The backslash does indeed do the trick.

I was hoping to be able to include adoc source without any changes. Is there an option to discard includes in the [source] statement?

Even better would be an option in the include statement that allows me to include existing asciidoctor file as is but treat it as literal. Is that possible?

MT
--


Reply | Threaded
Open this post in threaded view
|

Re: include in source code

mojavelinux
Administrator
In that case, you probably need to implement a custom include processor. You could detect when you want to ignore the include and return the include statement itself, thus restoring the original line. You could detect it perhaps by looking at the language on the source block (e.g., [source,asciidoc]) or the extension of the target (e.g., .adoc).


Aside from that, Asciidoctor doesn't have any special facility for recognizing and ignoring its own syntax.

-Dan

On Tue, Feb 3, 2015 at 10:59 AM, metro [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Thanks. The backslash does indeed do the trick.

I was hoping to be able to include adoc source without any changes. Is there an option to discard includes in the [source] statement?

Even better would be an option in the include statement that allows me to include existing asciidoctor file as is but treat it as literal. Is that possible?

MT
--





If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/include-in-source-code-tp2754p2758.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--