gma / nesta

File Based CMS and Static Site Generator
http://nestacms.com
MIT License
902 stars 121 forks source link

using Redcarpet instead of Maruku #65

Closed fajrif closed 13 years ago

fajrif commented 13 years ago

it will be nice to use markdown parser with Redcarpet

gma commented 13 years ago

On 31 Aug 2011, at 18:02, fajrif wrote:

it will be nice to use markdown parser with Redcarpet

What is it about Redcarpet that makes you want to use it? I like it too, I'm just curious as to why you'd like to use it.

fajrif commented 13 years ago

Hi Graham! I found maruku monkeypatching the String class to define to_html method. sometimes it conflict with other gems such as ActiveAdmin that also monkeypatching the Object class. I'am integrating nesta with Rails 3 and using ActiveAdmin for administration page. it works fine if using Redcarpet for markdown. btw is up to you! I really like your framework to create static page / blog. Awesome!

gma commented 13 years ago

Ah, okay. Monkey patching the standard library is a fairly horrific thing to do. Say no more. Consider Maruku's card to be marked…

On 2 Sep 2011, at 12:04, fajrif wrote:

Hi Graham! I found maruku monkeypatching the String class to define to_html method. sometimes it conflict with other gems such as ActiveAdmin that also monkeypatching the Object class. I'am integrating nesta with Rails 3 and using ActiveAdmin for administration page. it works fine if using Redcarpet for markdown. btw is up to you! I really like your framework to create static page / blog. Awesome!

Reply to this email directly or view it on GitHub: https://github.com/gma/nesta/pull/65#issuecomment-1978102

pengwynn commented 13 years ago

+1 This is the first thing I do in each new app.rb.

adamstac commented 13 years ago

+1 as well :)

gma commented 13 years ago

See the referenced commit.

By default it'll use redcarpet, but you can stick with Maruku by adding the maruku gem to your Gemfile and adding this to your app.rb file:

Tilt.prefer Tilt::MarukuTemplate

The same goes for the other Markdown processors supported by Tilt (BlueCloth, RDiscount and Kramdown).

gma commented 13 years ago

If you feel strongly about redcarpet, see @etc's comment on the commit (https://github.com/gma/nesta/commit/5e0f2af33f6ccb2886cb67c8d6bc18385773ef83). In short, Haml's :markdown filter can't use redcarpet yet.

I'm going for RDiscount as the default in 0.9.11 and you'll be able to configure tilt to use redcarpet instead by adding it to your Gemfile. This seems cleaner than having Nesta depend on two different Markdown libs, and having different libs used under different circumstances.

etc commented 13 years ago

Sounds good to me. Is the plan to switch to Redcarpet once this pull request is merged into HAML? (I imagine the security of Redcarpet would make it more natural as a default).

gma commented 13 years ago

I've not thought it through to be honest but I'd be happy to look at it again if/when redcarpet support gets merged.