Redcarpet errors when using Yard or Changing Yards markup provider

* Note, I’m not going to talk about how to make Redcarpet work. Instead I’m going to explain how to get Yard generating documentation again with a redcarpet alternative.

Maybe I’ve just been unlucky but I’ve had a number of run ins with Redcarpet when using Yard over the years. I’ve learned that Yard can use a number of markup-providers besides the Redcarpet gem.

For search purposes, here’s the verbage for my current scuffle with Redcarpet:

[error]: Missing ‘redcarpet’ gem for Markdown formatting. Install it with `gem install redcarpet`

To replace that redcarpet dependency:

1) generate a /.yardopts file if it doesn’t already exist. Any configuration you provide in there will be picked up regardless if you run yard directly or some Rake task calls yard with additional parameters.

2) Append a parameter to change the markup-provider.

--markup-provider <some markup-provider>

Screen Shot 2015-03-05 at 10.39.01 AM

More options for a markup-provider beyond rdiscount are listed at: http://www.rubydoc.info/gems/yard/YARD/Templates/Helpers/MarkupHelper

3) Finally, ensure your Gemfile lists your new markup-provider.

Screen Shot 2015-03-05 at 11.47.04 AM

This entry was posted in Code, Ruby. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *