Attributes substitution on formatted text

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

Attributes substitution on formatted text

Daiane
I've been using the user defined variables a lot along my text, but suddenly I realized I cannot format a substitution.

For example, I have a variable (or attribute)

:tfile: target-file-used.txt


And I want to make the result of the substitution formatted in monospaced (or bold)

so I have tried:

Then copy the result in the file `~/user/{tfile}` to make something.

But I got the literal {tfile}  as the output, it's monospaced, but I want the content of variable instead.

I assume it's because substitution is disabled by default, like in http://mrhaki.blogspot.com/2014/05/awesome-asciidoc-substitute-attribute.html (and many other references like that) but I found no way to [subs="attributes"] in a in-line formatting.

How could I do that?

Thanks in advance for any hint.
Reply | Threaded
Open this post in threaded view
|

Re: Attributes substitution on formatted text

Andrew Carver
Reply | Threaded
Open this post in threaded view
|

Re: Attributes substitution on formatted text

Daiane
Thanks a lot Andrew!

I had tried the "pass" stuff. I must admit I don't understand what that means at all.  Anyway, you pointing me that link make me create a separate file to test it again (to paste the test here) and I realized the problem was not on the formatting, but on my variable.

In the example I copied here it was simple lines, but on my project it is a set of files including each other and one of them is the file with all the variables. The one variable I want to format was wrong. Thanks a lot again!

Only for future reference:

When I test

= Title of mine

:tfile: target-file-used.txt


Then copy the result in the file `~/user/{tfile}` to make something.

Then copy the result in the file pass[`~/user/{tfile}`] to make something.

Then copy the result in the file pass:q[`~/user/{tfile}`] to make something.

The end.


I get (italic here is monospaced in html or pdf output file)


Title of mine

Then copy the result in the file ~/user/target-file-used.txt to make something.

Then copy the result in the file pass[~/user/target-file-used.txt] to make something.

Then copy the result in the file ~/user/{tfile} to make something.

The end
.

Thanks again, and I apologize for my mistake
Reply | Threaded
Open this post in threaded view
|

Re: Attributes substitution on formatted text

mojavelinux
Administrator
The following should work:

= Title of mine
:tfile: target-file-used.txt

Then copy the result in the file `~/user/{tfile}` to make something.

You should see:

Then copy the result in the file ~/user/target-file-used.txt to make something.

The attribute reference would only be escaped if it was enclosed in an inline passthrough.

Then copy the result in the file `+~/user/{tfile}+` to make something.

The other possibility is that you have compat-mode enabled, perhaps via the API or CLI.

Cheers,

-Dan

On Wed, Jun 13, 2018 at 5:45 PM Daiane [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Thanks a lot Andrew!

I had tried the "pass" stuff. I must admit I don't understand what that means at all.  Anyway, you pointing me that link make me create a separate file to test it again (to paste the test here) and I realized the problem was not on the formatting, but on my variable.

In the example I copied here it was simple lines, but on my project it is a set of files including each other and one of them is the file with all the variables. The one variable I want to format was wrong. Thanks a lot again!

Only for future reference:

When I test

= Title of mine

:tfile: target-file-used.txt


Then copy the result in the file `~/user/{tfile}` to make something.

Then copy the result in the file pass[`~/user/{tfile}`] to make something.

Then copy the result in the file pass:q[`~/user/{tfile}`] to make something.

The end.


I get (italic here is monospaced in html or pdf output file)


Title of mine

Then copy the result in the file ~/user/target-file-used.txt to make something.

Then copy the result in the file pass[~/user/target-file-used.txt] to make something.

Then copy the result in the file ~/user/{tfile} to make something.

The end
.

Thanks again, and I apologize for my mistake


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Attributes-substitution-on-formatted-text-tp6372p6375.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