lsegal / yard

YARD is a Ruby Documentation tool. The Y stands for "Yay!"
http://yardoc.org
MIT License
1.94k stars 396 forks source link

[feature request] support kramdown-parser-gfm #1373

Open postmodern opened 3 years ago

postmodern commented 3 years ago

It would be nice if YARD::Templates::Helpers::MarkupHelpers also supported kramdown-parser-gfm which adds GitHub Flavored Markdown support to Kramdown. This could be done by changing MARKUP_PROVIDERS to contain a lambda that Initializes Kramdown::Docuement but checks if defined?(Kramdown::Parser::GFM) and runs Kramdown::Document.new(text, input: 'GFM') instead of the regular Kramdown::Document.new(text). I would be willing to try implementing this, but would require modifying load_markup_provider and not sure how you'd prefer I go about this?

postmodern commented 3 years ago

Er, it looks like custom parser wrapper code is defined as classes in YARD::Templates::Helpers::Markup::. Maybe I'll try writing a wrapper class for calling Kramdown::Document.new.

postmodern commented 3 years ago

I wrote a simple class that inherits from Kramdown::Document and is input: 'GFM' aware, but it seems to break the auto-detection of Kramdown. Will need some guidance about the best way to do this. https://github.com/postmodern/yard/commit/7a91cff36b4eff3d4b5bc9a9c57c840afcebbac1