0

I'm using Jekyll with Kramdown and Coderay.

Is there a way to add the name of the syntax rules used to the output of the code highlighter, when using kramdown? I'd like it to look similar to what ajax-syntax-highlighter outputs. Thus showing the syntax name above the actual code.

Also, being able to add comments to the code snippets would be nice. Just like Octopress does.

Are there any plugins for this, maybe? And no, I do not want to switch to using Octopress instead :)

Michael Krupp
  • 2,042
  • 3
  • 19
  • 36

1 Answers1

0

If you want to highlight code like octopress, use include_code plugin.

The simplest way is to use figure tag.

<figure>
  {% highlight ruby %}
  def print_hi(name)
    puts "Hi, #{name}"
  end
  {% endhighlight %}
  <figcaption>
    <cite>ruby code</cite>
    any additional comment here ...
  </figcaption>

</figure>
David Jacquel
  • 51,670
  • 6
  • 121
  • 147