Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ruby markdown interpreter with syntax similar to GitHub Flavored Markdown?

I run a blog using Jekyll, and thought I'd settle with Redcarpet markdown interpreter as it's developed and used by GitHub.

Well, I just happened to come across a bug, went to checkout the issues, and found this.

Maintainer says, "As you probably have noticed (har har har har) I don't have time to maintain Redcarpet anymore. It's not a priority for me (I find Markdown thoroughly boring) and it's not a priority for GitHub, because we no longer use it in production."

So...

  1. Is there a good Ruby markdown interpreter (i.e. actively developed, with sane syntax) that I can use with Jekyll (& pygments)?

  2. Even better, a markdown interpreter with syntax similar to (or at least close to) GitHub Flavored Markdown?

like image 981
its_me Avatar asked Mar 28 '13 16:03

its_me


1 Answers

https://github.com/vmg/redcarpet Redcarpet is very actively developed and was updated about 8 hours ago (at the time of this writing.)

For "flavoring" your Markdown: https://rubygems.org/gems/github-markdown

To convert Markdown to HTML:

GitHub::Markdown.render_gfm("# Header")

To render within Rails:

GitHub::Markdown.render_gfm("# Header").html_safe

Want syntax highlighting? https://github.com/simplabs/highlight https://alphahydrae.com/2013/01/markdown-views-in-rails/

Cheers!

like image 125
RyanScottLewis Avatar answered Sep 28 '22 15:09

RyanScottLewis