italic text as attribute value

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

italic text as attribute value

RainerB
Hi! Great stuff, Asciidoctor (and Asciidoc)!

I want to use a "variable" (attribute) to hold formatted text, italic in this case. For example:
Ascii doc source "Blah 'bar' blah" yields "Blah /bar/ blah" (italics represented by /.../ here).
The latter is the result that I want.

However, the following asciidoc source yields a result of "Blah 'bar' blah.":

----
:foo: 'bar'

Blah {foo} blah.
----

For some reason, I could not get this to work, neither using asciidoc nor using asciidoctor.
I tried using underscores instead of single quotes, I get "Blah _bar_ blah".
I tried using three instead of individual single quotes, I get "Blah '''bar''' blah".

I searched the net for "asciidoc formatted attribute value", "asciidoc order of evaluation", "asciidoc order of expansion", and more, but found no good hits.
Why doesn't this work?
Can this be made to work?
Can I use something else instead?
Should I open an issue?

Rainer
Reply | Threaded
Open this post in threaded view
|

Re: italic text as attribute value

mojavelinux
Administrator
Please refer to the section "Substitutions in an attribute entry" in the user manual (http://asciidoctor.org/docs/user-manual/#substitutions-in-an-attribute-entry)

Cheers,

-Dan

On Fri, Jan 27, 2017 at 10:25 AM, RainerB [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hi! Great stuff, Asciidoctor (and Asciidoc)!

I want to use a "variable" (attribute) to hold formatted text, italic in this case. For example:
Ascii doc source "Blah 'bar' blah" yields "Blah /bar/ blah" (italics represented by /.../ here).
The latter is the result that I want.

However, the following asciidoc source yields a result of "Blah 'bar' blah.":

----
:foo: 'bar'

Blah {foo} blah.
----

For some reason, I could not get this to work, neither using asciidoc nor using asciidoctor.
I tried using underscores instead of single quotes, I get "Blah _bar_ blah".
I tried using three instead of individual single quotes, I get "Blah '''bar''' blah".

I searched the net for "asciidoc formatted attribute value", "asciidoc order of evaluation", "asciidoc order of expansion", and more, but found no good hits.
Why doesn't this work?
Can this be made to work?
Can I use something else instead?
Should I open an issue?

Rainer



If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/italic-text-as-attribute-value-tp5236.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
Reply | Threaded
Open this post in threaded view
|

Re: italic text as attribute value

DocEvaluator
In reply to this post by RainerB
Had the same problem last week. I did it like this:

//this is the definition:
:attributeXYZ: pass:quotes[follows an _italic_ word]
//this is the usage:
Now {attributeXYZ}.

The rendered text will be:
"Now follows an italic word."