-
-
Notifications
You must be signed in to change notification settings - Fork 398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't find redcarpet 3.2 gem #812
Comments
Seems to be an issue with redcarpet 3.2.0, yard works fine with 3.1.2. Will use 3.1 for now. |
Redcarpet seems to fail for yard from time to time, which is unfortunate because it is the first entry in the MARKUP_PROVIDERS hash for markdown (in lib/yard/templates/helpers/markup_helper.rb) MARKUP_PROVIDERS = {
:markdown => [
{:lib => :redcarpet, :const => 'RedcarpetCompat'},
{:lib => :rdiscount, :const => 'RDiscount'},
{:lib => :kramdown, :const => 'Kramdown::Document'},
{:lib => :bluecloth, :const => 'BlueCloth'},
{:lib => :maruku, :const => 'Maruku'},
{:lib => :'rpeg-markdown', :const => 'PEGMarkdown'},
{:lib => :rdoc, :const => 'YARD::Templates::Helpers::Markup::RDocMarkdown'},
], That means if you invoke yard without any markdown provider installed, yard suggests the first entry from above hash/array, which is redcarpet. # Show error message telling user to install first potential provider
name, lib = *[providers.first[:const], providers.first[:lib] || type]
log.error "Missing '#{lib}' gem for #{type.to_s.capitalize} formatting. Install it with `gem install #{lib}`" User then installs redcarpet and is bugged with the error @mscharley showed, which is kind of a deadlock for most users, because they are not informed that there are multiple parsers to choose from. I'd suggest to move the redcarpet entry in the markdown array a few places down, so that the user gets a suggestion for RDiscount or kramdown, which both work fine. |
I opened an issue for this backward incompatible change in upstream vmg/redcarpet#436 (the initial issue comes from vmg/redcarpet#401). A temporary workaround would be to require 'redcarpet/compat' when invoking yard: $ ruby -rredcarpet/compat -S yard ... Not very fun, but it will do. I am considering moving redcarpet down in the priority list or removing it altogether depending on the outcome of the above patch. |
It looks like redcarpet released 3.2.1 which should resolve this issue. |
If I don't specify
-M
at all it seems to be falling back tordoc
even for markdown documentation files (redcarpet
is the only markdown gem I have installed currently).The text was updated successfully, but these errors were encountered: