Question

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?

Was it helpful?

Solution

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

OTHER TIPS

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 (...);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top