Using monospaced text within smart quotes

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

Using monospaced text within smart quotes

awilkinson
I'd like to be able to wrap smart quotes are some text that contains some text that should be monospaced. The HTML that I'm aiming for is:

&#8220;<code>endpoints</code> + <code>.</code> + <code>name</code>&#8221;

I've tried using this syntax:

"``endpoints` + `.` + `name``"

But the resulting HTML is:

&#8220;`endpoints` + <code>.</code> + <code>name</code>&#8221;

The backticks around endpoints haven't been replaced with <code> and </code>. Is there something that I can do so that the backticks around endpoints are interpreted as I'd like?
Reply | Threaded
Open this post in threaded view
|

Re: Using monospaced text within smart quotes

awilkinson
I neglected to mention that my workaround thus far has been to manually enter the smart quotes in the document:

‟`endpoints` + `.` + `name`”

However, it's awkward to type and inconsistent with the rest of the document. I'd prefer an Asciidoctor syntax solution if there is one.
Reply | Threaded
Open this post in threaded view
|

Re: Using monospaced text within smart quotes

mojavelinux
Administrator
Using Asciidoctor 1.5.0, this can be accomplished using:

"```endpoints`` + `.` + ``name```"

The "` and `" are the double smart quotes enclosure. For example, "`content goes here`".

The words "endpoints" and "name" need to be surrounded by double backticks, which are the unconstrained monospaced formatting. The dot in the middle can still use the constrainted monospaced formatting.

Hope that helps!

Cheers,

-Dan

On Tue, Oct 28, 2014 at 4:48 AM, awilkinson [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I neglected to mention that my workaround thus far has been to manually enter the smart quotes in the document:

‟`endpoints` + `.` + `name``”

However, it's awkward to type and inconsistent with the rest of the document. I'd prefer an Asciidoctor syntax solution if there is one.


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Using-monospaced-text-within-smart-quotes-tp2380p2381.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Reply | Threaded
Open this post in threaded view
|

Re: Using monospaced text within smart quotes

awilkinson
Thanks, Dan. Can you recommend somewhere to learn about constrained and unconstrained formatting? A search of the user manual for "constrained" didn't find anything.
Reply | Threaded
Open this post in threaded view
|

Re: Using monospaced text within smart quotes

mojavelinux
Administrator
Andy,

The constrained / unconstrained is absent from the user manual at the moment. That needs to be corrected because you are absolutely correct to point out that it is not clear. This is a topic that is covered in the original AsciiDoc (Python) User Guide that didn't get properly carried over. We are tracking this improvement as https://github.com/asciidoctor/asciidoctor.org/issues/64.

Here's what you need to know.

Constrained formatting marks (called "quotes" in AsciiDoc terminology) are single characters that are placed around a word. The "around" is defined by the fact that word characters do not appear outside the marks. You use this form when the word stands alone, as in:

 That is *strong* stuff!

Or when the word is adjacent to punctuation, like a period.

 This stuff sure is *strong*!

Unconstrained formatting marks are double characters that are placed within a word. The "within" is defined by the fact that a word character appears directly outside one of the marks. For example:

 She spells it with an "h", as in Sara**h**.

There are cases when it seems like it would be okay to use constrained, but unconstrained is required. This happens because of the way the Asciidoctor parser (and the AsciiDoc Python parser) currently works. Substitutions may be applied before getting to the formatting marks, in which case the characters adjacent to those marks may not be what you see in the original source. A good example is the case you gave:

 "```endpoints```"

What's happening is that the parser is too conservative and you have to double up the marks to convince it that you want the formatting to apply. We intend to fix these types of irregularities by implementing a more robust inline parser...but that's just how it is today.

The general strategy is to use the constrained form, when in doubt. If it doesn't take, double up the marks. That's how I do it. You'll get to know the edge cases pretty quickly...which would could probably document in the user manual until the situation improves.

Cheers,

-Dan

On Wed, Oct 29, 2014 at 2:37 AM, awilkinson [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Thanks, Dan. Can you recommend somewhere to learn about constrained and unconstrained formatting? A search of the user manual for "constrained" didn't find anything.


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Using-monospaced-text-within-smart-quotes-tp2380p2397.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Reply | Threaded
Open this post in threaded view
|

Re: Using monospaced text within smart quotes

awilkinson
Thanks again, Dan. That's very helpful.