Quoting a pipe from code when using include directive in a table

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

Quoting a pipe from code when using include directive in a table

apj68
Hi. . . I have a document that is including live code within a table, e.g.:

|===

|Name
|step_queue_earfiles

|Purpose
|Blah, blah

|Script
|
[source,groovy]
----
include::script_name.groovy[]
----

|Post Processing Script
|Etc
|===

I understand that to get a pipe in a cell  you have to use `{vbar}` but is there any alternative when using the include directive?  I don't want to maintain a special version of the code that replaces "|" with "{vbar}", I'd rather just include the actual, living source code in the document.

Thanks for any suggestions!

Andy
Reply | Threaded
Open this post in threaded view
|

Re: Quoting a pipe from code when using include directive in a table

mojavelinux
Administrator
At the moment, this is just a limitation. But, as with all things in Asciidoctor, there's always a way around it using extensions!

You could create a custom IncludeProcessor that automatically substitutes vertical bars with {vbar} if the table-escape option is set.

include::script_name.groovy[opts=table-escape]

Of course, we are in search of a general solution that we can weave into core, so if you have any ideas...please feel free to post them to the open issue I just created.


Cheers,

-Dan

On Thu, Jul 16, 2015 at 8:36 AM, apj68 [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hi. . . I have a document that is including live code within a table, e.g.:

|===

|Name
|step_queue_earfiles

|Purpose
|Blah, blah

|Script
|
[source,groovy]
----
include::script_name.groovy[]
----

|Post Processing Script
|Etc
|===

I understand that to get a pipe in a cell  you have to use `{vbar}` but is there any alternative when using the include directive?  I don't want to maintain a special version of the code that replaces "|" with "{vbar}", I'd rather just include the actual, living source code in the document.

Thanks for any suggestions!

Andy


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



--