Question

I cant get markdown to work with Slim (Rails 3.1 app), I get this error:

Unknown line indicator
   :markdown

I have the following gems in my Gemfile:

gem 'bluecloth'
gem 'rdiscount'
gem 'slim'

This is how my template looks like:

:markdown
  #hello
Was it helpful?

Solution

Yes. Slim supports Markdown. You need to put markdown: before you use markdown code in your templates.

Example:

markdown:
  #Header
    Hello from #{"Markdown!"}
    Second Line!

OTHER TIPS

You might be able to use Markdown syntax with a single gem: redcarpet. Nothing against the other gems, but after a couple of years dealing with Rails I really believe less is more, especially when it comes to adding gems to your projects, it can get out of hand very quickly.

This page lists the requirements for Markdown support in Slim:

slim-template

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top