Closed benjamincharity closed 13 years ago
Basically default rdiscount mrkdown renderer have some options but I don't remember which ones you need to pass in order to achieve your goal. I propose you to switch to redcarpet instead.This is really easy...
Just add following line into your Gemfile:
gem "redcarpet"
And pass some cool options to the toto config:
toto = Toto::Server.new do
# ...
set :markdown, [:gh_blockcode, :strikethrough, :fenced_code, :no_intraemphasis]
# ...
end
This will make your markdown really simialr to github's
Adding that line into my config causes this error:
!! Unexpected error while processing request: undefined method `gh_blockcode=' for #<RDiscount:0x007ff442549cf8>
Also, does redcarpet replace rdiscount? Or simply add to it?
The options I have provided are valid to redcarpet only.
When you'll add redcarpet gem into your Gemfile it will "substitute" rdiscount, so just add thta gem line and run bundle
Hmm that's what I did. Still throwing the error.
can you show your config.ru file?
Sure thing: https://github.com/benjamincharity/Toto-Site/blob/master/config.ru
Note: the markdown line is commented in my current file as it was causing the app error.
replace second line Bundler.setup
with Bundler.require
Still have the same error.
!! Unexpected error while processing request: undefined method `gh_blockcode=' for #<RDiscount:0x007f9cbbb1e450>
Sorry I was a little bit unclear.
You need to put redcarpet above toto gem. And of course above rdiscount gem.
Also, if you use Bundler.require
- there's no ned for manual require.
See gist: https://gist.github.com/1327302
That fixed it! Thanks.
np :))
Not really a toto issue, but I was thinking that one of you might have dealt with this.
I'm not sure if this something simple I'm missing, but when I put a block of code in markdown it left aligns all of the lines. This makes it a bit hard to read. Is this an option, or formatting issue?