ronin-exploits icon indicating copy to clipboard operation
ronin-exploits copied to clipboard

README: syntax highlight support

Open noraj opened this issue 6 years ago • 3 comments

noraj avatar Oct 02 '19 23:10 noraj

One problem with using GitHub Flavored Markdown on Ronin repositories is YARD which we use for documentation does not yet support using kramdown-parser-gfm to parse GitHub Flavored Markdown, so the README it generates looks corrupted. YARD does however support automatic syntax highlighting of code. Also, I plan on redesigning the syntax for defining exploits and payloads.

postmodern avatar Mar 04 '21 11:03 postmodern

One problem with using GitHub Flavored Markdown on Ronin repositories is YARD which we use for documentation does not yet support using kramdown-parser-gfm to parse GitHub Flavored Markdown, so the README it generates looks corrupted. YARD does however support automatic syntax highlighting of code. Also, I plan on redesigning the syntax for defining exploits and payloads.

On all my gems I use the following for GFM support:

  s.add_development_dependency('github-markup', '~> 3.0') # for GMF support in YARD
  s.add_development_dependency('redcarpet', '~> 3.5') # for GMF support in YARD

And once some will have register commonmarker https://github.com/lsegal/yard/issues/1157, you'll be able to use this

  s.add_development_dependency('commonmarker', '~> 0.21') # for CommonMark support in YARD
  s.add_development_dependency('redcarpet', '~> 3.5') # for CommonMark support in YARD

noraj avatar Mar 04 '21 14:03 noraj

I avoided using redcarpet because it uses C extensions, which aren't supported on JRuby. Where as kramdown is pure-ruby and will work on any ruby implementation. I suppose you could restrict redcarpet to only be used on MRI in the Gemfile:

gem 'redcarpet', platforms: [:mri]
gem 'kramdown', platforms: [:jruby]

I'm also working on a PR to yard which adds support for kramdown-parser-gfm, but it's still a work-in-progress.

postmodern avatar Mar 04 '21 17:03 postmodern

Closing this as the README now has GitHub Flavored Markdown syntax highlighting.

postmodern avatar Jun 11 '23 05:06 postmodern