summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2013-02-02 12:53:28 -0800
committerJasper Van der Jeugt <jaspervdj@gmail.com>2013-02-02 12:53:28 -0800
commit1b6dd8a37369a63669f3b6cc76c856f94fb65fd1 (patch)
treef8dd4d2b2f741a42bd93d1c6bd7642ab5211521c
parent33d7f95090ea866eba10e3f9ae3d0717f3beee52 (diff)
parent9aaadd8696dc3db355834df666a1eb52feaf14ab (diff)
downloadhakyll-1b6dd8a37369a63669f3b6cc76c856f94fb65fd1.tar.gz
Merge pull request #104 from miikka/faq-syntax-highlighting
Add a syntax highlighting example to FAQ
-rw-r--r--web/tutorials/faq.markdown12
1 files changed, 12 insertions, 0 deletions
diff --git a/web/tutorials/faq.markdown b/web/tutorials/faq.markdown
index c0bbd3f..ad6dbd8 100644
--- a/web/tutorials/faq.markdown
+++ b/web/tutorials/faq.markdown
@@ -31,7 +31,19 @@ recent version of Pandoc (1.9 and onwards). Note that you also need to include
some CSS in order for this to work! This site, for example, uses the [default
Pandoc syntax CSS file][syntax-css].
+To highlight a code block, you need to use Pandoc's fenced code block syntax to
+set the block's language. For example, here's how you highlight Haskell code:
+
+ ``` haskell
+ fac n = foldr (*) 1 [1..n]
+ ```
+
+For details, see Pandoc's user guide on [fenced code
+blocks][pandoc-code-blocks] and [inline code][pandoc-inline-code].
+
[syntax-css]: https://github.com/jaspervdj/hakyll/blob/master/web/css/syntax.css
+[pandoc-code-blocks]: http://johnmacfarlane.net/pandoc/README.html#fenced-code-blocks
+[pandoc-inline-code]: http://johnmacfarlane.net/pandoc/README.html#verbatim
## When should I rebuild and when should I build?