parent
bf66d1fc23
commit
3417a33e7a
|
@ -317,16 +317,16 @@ such as using variables.
|
||||||
|
|
||||||
### Code snippet highlighting
|
### Code snippet highlighting
|
||||||
|
|
||||||
Jekyll has built in support for syntax highlighting of [over 100
|
Jekyll has built in support for syntax highlighting of over 60 languages
|
||||||
languages](http://pygments.org/languages/) thanks to
|
thanks to [Rouge](http://rouge.jneen.net). Rouge is the default highlighter
|
||||||
[Pygments](http://pygments.org/). To use Pygments, you must have Python installed
|
in Jekyll 3 and above. To use it in Jekyll 2, set `highlighter` to `rouge`
|
||||||
on your system and set `highlighter` to `pygments` in your site's configuration
|
and ensure the `rouge` gem is installed properly.
|
||||||
file.
|
|
||||||
|
|
||||||
Alternatively, you can use [Rouge](https://github.com/jayferd/rouge) to highlight
|
Alternatively, you can use [Pygments](http://pygments.org) to highlight
|
||||||
your code snippets. It doesn't support as many languages as Pygments, however it
|
your code snippets. To use Pygments, you must have Python installed on your
|
||||||
should suit most use cases. Also, since [Rouge](https://github.com/jayferd/rouge)
|
system, have the `pygments.rb` gem installed and set `highlighter` to
|
||||||
is written in pure Ruby, you don't need Python on your system!
|
`pygments` in your site's configuration file. Pygments supports [over 100
|
||||||
|
languages](http://pygments.org/languages/)
|
||||||
|
|
||||||
To render a code block with syntax highlighting, surround your code as follows:
|
To render a code block with syntax highlighting, surround your code as follows:
|
||||||
|
|
||||||
|
@ -342,9 +342,9 @@ end
|
||||||
|
|
||||||
The argument to the `highlight` tag (`ruby` in the example above) is the
|
The argument to the `highlight` tag (`ruby` in the example above) is the
|
||||||
language identifier. To find the appropriate identifier to use for the language
|
language identifier. To find the appropriate identifier to use for the language
|
||||||
you want to highlight, look for the “short name” on the [Pygments' Lexers
|
you want to highlight, look for the “short name” on the [Rouge
|
||||||
page](http://pygments.org/docs/lexers/) or the [Rouge
|
wiki](https://github.com/jayferd/rouge/wiki/List-of-supported-languages-and-lexers)
|
||||||
wiki](https://github.com/jayferd/rouge/wiki/List-of-supported-languages-and-lexers).
|
or the [Pygments' Lexers page](http://pygments.org/docs/lexers/).
|
||||||
|
|
||||||
#### Line numbers
|
#### Line numbers
|
||||||
|
|
||||||
|
@ -422,4 +422,5 @@ You may also optionally specify the filename in the gist to display:
|
||||||
{% endraw %}
|
{% endraw %}
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
To use the `gist` tag, you'll need to add the [jekyll-gist](https://github.com/jekyll/jekyll-gist) gem to your project.
|
To use the `gist` tag, you'll need to add the
|
||||||
|
[jekyll-gist](https://github.com/jekyll/jekyll-gist) gem to your project.
|
||||||
|
|
Loading…
Reference in New Issue