Shailen,
You can continue to use backticks, though a more lightweight approach is to
plus symbols. The reason I say "more lightweight" is because the backticks
actually take the text out of the document when substitutions are
performed, then restores it afterwards. By doing so, nothing
is interpreted inside of the backticks. The plus symbols simply get wrapped
inplace. There are cases when you undesired substitutions when using the
plus symbols...but it's not too common.
My recommendation is to use backticks when you find you need them,
otherwise the plus signs.
Examples:
+foo.bar()+
`foo.bar()`
For some strange reason, the html5 backend in AsciiDoc is configured to
wrap literal text in <span class="monospaced"></span> instead
of <code></code>.
This can be easily changed by including an override configuration file in
the same directory as the source file. If your source file is named
document.asciidoc, then create document.conf and populate it with:
ifdef::basebackend-html[]
[tags]
# +code+
monospaced=<code{1? class="{1}"}>|</code>
[literal-inlinemacro]
# `code`
<code>{passtext}</code>
endif::basebackend-html[]
(The xhtml backend uses <code> tags, so you can consult it as a reference:
%asciidoc_install%/xhtml11.conf)
Consult the user guide for other ways to customize the output.
-Dan
On Mon, Mar 11, 2013 at 6:06 PM, Shailen Tuli <[email protected]>wrote:
> I'm switching over from markdown to asciidoc and have a question. In my
> markdown file, I use backticks to indicate code font (`foo.bar()`). When
> this is converted to html, the text gets placed inside code blocks
> (<code>foo.bar()</code>).
>
> How should I format a text fragment in asciidoc if I want it to appear
> within code blocks when the document is converted to html? Many thanks.
>
> - Shailen Tuli
>
> --
> You received this message because you are subscribed to the Google Groups
> "asciidoc" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/asciidoc?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
--
Dan Allen
Principal Software Engineer, Red Hat | Author of Seam in Action
Registered Linux User #231597
http://google.com/profiles/dan.j.allen
http://mojavelinux.com
http://mojavelinux.com/seaminaction
--
You received this message because you are subscribed to the Google Groups
"asciidoc" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/asciidoc?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.