Fenced code snippets

I’m coming from some basic Markdown editors and include a lot of code snippets in my writing.

When I create a code snippet, I usually fenced it in with ``` (3 backticks). This doesn’t seem to compile to a snippet in html. I also tried indenting several times.

Am I missing something?

re: daringfireball.net/projects/mark … ax#precode

One thing I noticed is that I don’t think I had multimarkdown installed (at least the one referenced in the guide) and the option to compile to MMD was in the drop down options.

Also, now that I have MMD installed, I can use the multimarkdown command line tool to parse a .md file with the ``` (3 backticks) fenced and it generates the expected HTML with

 and .

However, doing it from within Scrivener does not. It’s almost like it believes those backticks to be valid characters in my paragraphs and puts them in a normal

tag.

I read that MMD2 is installed by default with Scrivener, so I guess that explains why it was there before I installed the newer version. I installed the “support files” for the new version as suggested by the guide, but still can’t use the backticks.

The mmd (and md) syntax for in-line code is to use one pair of back-tick quotes:

gives:

<p><code>code in here</code></p>

For a code block, indent each line by one tab or four spaces:

gives:

<pre><code>code block by indent </code></pre>

I’d not come across the multiple back-tick quotes before, but I see there are options for doubling them to include a back-tick quote within a code block, although that doesn’t seem to suggest a triple.

Scrivener comes with its own MMD4 installation, but if you have your own installation it will be used instead of the built-in one.

How does that dovetail with the Format -> Formatting -> Preserve formatting (something like that…) option, which was suggested elsewhere?

(See also: https://forum.literatureandlatte.com/t/tab-entire-paragraph/24928/1)