-
This is a numbered list.
-
I'm going to include a fenced code block as part of this bullet:
Code More Code
-
We can put fenced code blocks inside nested bullets, too.
-
Like this:
printf("Hello, World!");
-
The key is to indent your fenced block by (4 * bullet_indent_level) spaces.
-
Also need to put a separating newline above and below the fenced block.
-
- This is a bullet.
- This is the end of the first bullet list, with a fenced code block following:
Code
More Code
- This is the start of a new bullet list. Hey, where is my fenced code? ``` Code More Code
4. Maybe we can do it with indenting?
Code
More Code
5. Did that work? No, so we will try with separation:
Code
More Code
6. Now I will try more indenting, to match the bullet margin, plus 4:
Code
More Code
7. Well that was disappointing. How about we indent and use backticks together?
```
Code
More Code
```
8. No such luck.
---
* Oh look, it's some [Apache config](http://pygments.org/docs/lexers/#lexers-for-non-source-code-file-types):
```apache
<Directory /foo/bar>
Order allow,deny
Deny from all
</Directory>
```
* Wasn't that fun?
Thank you for writing this it has helped me. Hopefully you don't mind, but I'd like to make some suggestions:
The key is to indent your fenced block by (4 * bullet_indent_level) spaces.
, you should also say this applies to the code within the fenced block. In other words, every line of code in the code block need that same (4 * bullet_indent_level) space prefix.This is not a suggestion but it might be interesting to some: technically, you only need (3 * bullet_indent_level) spaces. This is true for any thing you want to include in your bullet point that is written on a different line.