From 1e9040f305ad428057cda11bef972ae4eca801ae Mon Sep 17 00:00:00 2001 From: Tom Preston-Werner Date: Sat, 13 Dec 2008 18:15:11 -0800 Subject: [PATCH] add code highlighting docs to readme --- README.textile | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/README.textile b/README.textile index 4dc02bf6..dec03cd2 100644 --- a/README.textile +++ b/README.textile @@ -60,6 +60,35 @@ And if you don't want to be in the proto site root to run Jekyll: The autobuild feature can be used on any of the invocations. +h2. Filters, Tags, and Blocks + +h3. Code Highlighting + +Jekyll has built in support for syntax highlighting of over "100 +languages":http://pygments.org/languages/ via "Pygments":http://pygments.org/. +In order to take advantage of this you'll need to have Pygments installed (and +the pygmentize binary must be in your path). + +To denote a code block that should be highlighted: + +
+{% highlight ruby %}
+def foo
+  puts 'foo'
+end
+{% endhighlight %}
+
+ +The argument to highlight is the language identifier. To find the +appropriate identifier to use for your favorite language, look for the "short +name" on the "Lexers":http://pygments.org/docs/lexers/ page. + +In order for the highlighting to show up, you'll need to include a +highlighting stylesheet. For an example stylesheet you can look at +"syntax.css":http://github.com/mojombo/tpw/tree/master/css/syntax.css. These +are the same styles as used by GitHub and you are free to use them for your +own site. + h2. Contribute If you'd like to hack on Jekyll, grab the source from GitHub. To get