on master help sign in
Add a syntax highlighting example to FAQ
commit9aaadd8696dc3db355834df666a1eb52feaf14ab authorMiikka Koskinen <miikka.koskinen@iki.fi> dateSat 2 Feb 2013, 22:13 (14 years ago) parent33d7f95
1 file changed+12
web/tutorials/faq.markdown+12
web/tutorials/faq.markdown+12
@@ -31,7 +31,19 @@ recent version of Pandoc (1.9 and onwards). Note that you also need to include
3131some CSS in order for this to work! This site, for example, uses the [default
3232Pandoc syntax CSS file][syntax-css].
3333
34+To highlight a code block, you need to use Pandoc's fenced code block syntax to
35+set the block's language. For example, here's how you highlight Haskell code:
36+
37+ ``` haskell
38+ fac n = foldr (*) 1 [1..n]
39+ ```
40+
41+For details, see Pandoc's user guide on [fenced code
42+blocks][pandoc-code-blocks] and [inline code][pandoc-inline-code].
43+
3444[syntax-css]: https://github.com/jaspervdj/hakyll/blob/master/web/css/syntax.css
45+[pandoc-code-blocks]: http://johnmacfarlane.net/pandoc/README.html#fenced-code-blocks
46+[pandoc-inline-code]: http://johnmacfarlane.net/pandoc/README.html#verbatim
3547
3648## When should I rebuild and when should I build?
3749