on master help sign in
Merge pull request #104 from miikka/faq-syntax-highlighting
1b6dd8aJasper Van der Jeugt
web/tutorials/faq.markdown+12
@@ -31,7 +31,19 @@ recent version of Pandoc (1.9 and onwards). Note that you also need to include
31some CSS in order for this to work! This site, for example, uses the [default
31some CSS in order for this to work! This site, for example, uses the [default
32Pandoc syntax CSS file][syntax-css].
32Pandoc syntax CSS file][syntax-css].
33
33
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+
34[syntax-css]: https://github.com/jaspervdj/hakyll/blob/master/web/css/syntax.css
44[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
35
47
36## When should I rebuild and when should I build?
48## When should I rebuild and when should I build?
37
49