Every repository with this icon (
Every repository with this icon (
tree dc50f9e7bc85cb3a7a2d55d3fc1ecaa1d0f8b002
parent 5f9138f2ffe3b4766cb518e4a5bc13eae9dc78b6
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Fri Jun 27 11:54:30 -0700 2008 | |
| |
README.markdown | Sat Feb 07 16:36:44 -0800 2009 | |
| |
Rakefile | Fri Jun 27 11:54:30 -0700 2008 | |
| |
dependency.yml | Mon Nov 24 10:09:32 -0800 2008 | |
| |
lib/ | Fri Oct 03 12:40:56 -0700 2008 | |
| |
markdown.html | Sat Aug 30 12:50:52 -0700 2008 | |
| |
markdown_filter_extension.rb | Sun Aug 31 10:08:37 -0700 2008 | |
| |
spec/ | Fri Jun 27 18:10:25 -0700 2008 |
note: if you're using Radiant 0.7.0 or newer all you need to do is install the RDiscount gem and you'll get the better parser without needing to install this extension. users of the 0.6.x series may still find this extension helpful.
Requirements
You need to have the rdiscount gem (version 1.2.6+) installed.
gem install rdiscount
Demonstration
More important than the speed gain in RDiscount is the level of conversion accuracy, for example compare the very last test, my un-official and admittedly narrow "bold two digit number test". Nowhere in that span of numbers should you see an actual *. If you're never doing any Markdown that confuses BlueCloth and just care about rendering big spans of Markdown you'll have to install it for yourself and see how much faster it really is. One thing is definite, it is faster; which becomes more apparent the larger the span of Markdown you have to convert. Just to give you some idea, I consistently see results of 4 seconds (BlueCloth) vs. 1 second (RDiscount) to render the entire demo page.
Installation
You can either git clone from github or download and unpack a taball into a vendor/extensions/markdown_filter directory, then restart your server. There are no rake tasks to run.
If you don't see the (RDiscount) label at the end of the extension description in the Extensions tab you're most likely running 0.6.7 or lower. In those versions of Radiant, the default extensions are loaded before custom ones with the same name; you'll need to make a trivial change to the initializer.rb file in radiant/lib/radiant.
# change line 24 from
paths = [RADIANT_ROOT + '/vendor/extensions', RAILS_ROOT + '/vendor/extensions'].uniq
# to
paths = [RAILS_ROOT + '/vendor/extensions', RADIANT_ROOT + '/vendor/extensions'].uniq
You'll need to restart your server again, but after that you should see the (RDiscount) label in the Extensions tab.
Everything else
I needed an implementation of Markdown that followed the full syntax, and did so consistently. For example, in BlueCloth **1%** yields the HTML <em>*1%*</em> however, in RDiscount it correctly yields <strong>1%</strong>. Eventually you get tired of explaining to clients that even though they typed it in exactly right the content management system you provided them doesn't understand it, and instead they need to type out the actual HTML.
RDiscount brings Discount Markdown's C implementation of SmartyPants built in so there is no need to rely on RubyPants which like BlueCloth is dead slow compared to a C implementation. Installing it will automatically override the built-in (BlueCloth) Markdown so you don't need to change the filter on your pages. You can tell the extension is properly installed when you see (RDiscount) at the end of the extension description in the Extensions tab of the admin interface.
Known Differences
Refer to the Inconsistencies and Enhancements pages (and feel free to add any you find)







