A Jekyll plugin that enables Pygments syntax highlighting for kramdown-parsed fenced code blocks, and adds typographic styling hooks using Typogruby.
gem 'jekyll-pypedown'
to your site's Gemfile_config.yml
:markdown: Pypedown
gems:
- jekyll-pypedown
By default, Jekyll only uses Pygments to highlight code contained within Liquid {% highlight %}
tags. This plugin adapts Kramdown so that it uses Pygments for fenced code blocks too, meaning you can use more Markdown and less Liquid. For example:
~~~ ruby
print "Hello World"
~~~
If you prefer, setting input: GFM
in Pypedown's config will enable Github flavored code fencing:
``` ruby
print "Hello World"
```
Inline code spans can also be highlighted:
Or inline code like this: `\section{foo}`{:.language-latex}
Content is filtered through Typogruby by Arjan van der Gaag. This adds classes to HTML documents, which can be styled with CSS to make your text look better. For example:
"Typogruby makes HTML look smarter & better, don't you think?"
is turned into:
<span class="dquo">“</span>Typogruby makes
<span class="caps">HTML</span> look smarter
<span class="amp">&</span> better,
don’t you think?”
Pypedown accepts a number of kramdown configuaration options, as well as a few specific to Pypedown. Here are the accepted values alongside their defaults:
pypedown:
auto_ids: # true
auto_id_prefix: # nil
default_lang: # nil
entity_output: # :as_char
footnote_nr: # 1
smart_quotes: # lsquo,rsquo,ldquo,rdquo
toc_levels: # 1..6
typogruby: # true
indent: # 4
input: # nil
Based on an initial idea by Matthias Vogelgesang, and the following plugins: