kapso
kapso

Reputation: 11903

Does Ruby/Slim have support for markdown?

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

Upvotes: 4

Views: 2136

Answers (2)

kakubei
kakubei

Reputation: 5400

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

Upvotes: -1

Chris Ledet
Chris Ledet

Reputation: 11628

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!

Upvotes: 11

Related Questions