0

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 (foo.bar()).

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?

Shailen Tuli
  • 13,815
  • 5
  • 40
  • 51

2 Answers2

2

Late and short answer:

You can use backticks just like in Markdown.

From the AsciiDoc User manual:

Monospaced text

Word phrases +enclosed in plus characters+ are rendered in a monospaced font. Word phrases `enclosed in backtick characters` (grave accents) are also rendered in a monospaced font but in this case the enclosed text is rendered literally and is not subject to further expansion

Sonson123
  • 10,879
  • 12
  • 54
  • 72
  • 1
    Note that from asciidoctor (not asciidoc!) 1.5 onwards, the syntax changed slightly (http://asciidoctor.org/news/2014/08/12/asciidoctor-1-5-0-released/). The content of backticks now *is* subject to further expansion. The plus signs no longer yield monospaced font, they just prevent expansion. To get both, you need to nest plus signs in backticks. – Rainer Blome Jan 27 '17 at 15:35
0

As you can see here, you can use `foo.bar()` the same way in asciidoc.

Here's an example of that:

    * Utilizar as funções `fgetc` ou `getc` para ler carácteres (...);
Eduardo Santana
  • 5,780
  • 3
  • 19
  • 21