Are attributes allowed with tag:: comments?

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

Are attributes allowed with tag:: comments?

oddhack
Is it legal and supported to say something like

// tag::tagname[myattrib='foo bar']

? The user manual just uses [] in all the examples I can see, but it would be very convenient for our purposes to be able to define block attribute-like variables to associate with the tagged block (even though/if such variables would not be visible to asciidoctor itself, though it's a bonus if they *are* visible).

Alternatively, what are the restrictions on what other content can be present on a tag:: line? It would be basically as good for our needs to be able to say

// tag::tagname[] // myattrib='foo bar'

or similar.

Jon
Reply | Threaded
Open this post in threaded view
|

Re: Are attributes allowed with tag:: comments?

mojavelinux
Administrator
Jon,

Attributes are not supported in include tags. Asciidoctor tries to limit as much as possible what it searches for to minimize matching something it shouldn't in this case.

However, Asciidoctor is only looking at the end of the line for the tag. So you can and anything you want in front of the tag. In other words:

// myattrib='foo bar' tag::tagname[]

Cheers,

-Dan

On Wed, Oct 18, 2017 at 3:38 PM oddhack [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Is it legal and supported to say something like

// tag::tagname[myattrib='foo bar']

? The user manual just uses [] in all the examples I can see, but it would be very convenient for our purposes to be able to define block attribute-like variables to associate with the tagged block (even though/if such variables would not be visible to asciidoctor itself, though it's a bonus if they *are* visible).

Alternatively, what are the restrictions on what other content can be present on a tag:: line? It would be basically as good for our needs to be able to say

// tag::tagname[] // myattrib='foo bar'

or similar.

Jon



If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Are-attributes-allowed-with-tag-comments-tp5997.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