on master help sign in
Merge pull request #104 from miikka/faq-syntax-highlighting

Add a syntax highlighting example to FAQ

commit1b6dd8a37369a63669f3b6cc76c856f94fb65fd1 authorJasper Van der Jeugt <jaspervdj@gmail.com> dateSat 2 Feb 2013, 12:53 (14 years ago) parent33d7f959aaadd8
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