callout in bash source code with line continuation
2 posts
If I create documentation like this:
[source,bash]
----
ls \
-lrt
----
asciidoctor will render html that can be copied and pasted into a bash shell. It executes without errors. Is there a way to add a callout for line 1 without causing errors when copied and pasted into a bash shell? I have tried this:
[source,bash]
----
ls \ <1>
-lrt
----
<1> this is line 1
The issue it seems is that the callout mechanism requires a space to be added at the end of line 1 of the bash script in order for the <1> to be recognized. The bash backslash character is intended to escape the newline and not the space character. Is there a way to prevent the rendered html to exclude the literal space in line 1, for example?
Re: callout in bash source code with line continuation
Administrator
2681 posts
To my knowledge, there doesn't seem to be a way to add a callout without breaking the raw source. I was going to suggest using a trailing line comment, but that seems to break the behavior of bash as well.
On Wed, Mar 22, 2017 at 12:15 PM, gclaybur [via Asciidoctor :: Discussion] <[hidden email]> wrote:
If I create documentation like this:
[source,bash]
----
ls \
-lrt
----
asciidoctor will render the html that an be copied and pasted into a bash shell. It executes without errors. Is there a way to add a callout for line 1 without causing errors when copied and pasted into a bash shell? I have tried this:
[source,bash]
----
ls \ <1>
-lrt
----
<1> this is line 1
The issue it seems is that the callout mechanism requires a space to be added at the end of line 1 of the bash script in order for the <1> to be recognized. The bash backslash character is intended to escape the newline and not the space character. Is there a way to prevent the rendered html to exclude the literal space in line 1, for example?
If you reply to this email, your message will be added to the discussion below: