ytbryan / emd

📝 Embeddable markdown with Syntax Highlighting in Rails 5+ products
MIT License
26 stars 8 forks source link

Minor refactor renderer #7

Open fwolfst opened 5 years ago

fwolfst commented 5 years ago

Extract options and renderer initialization.

This allows users to easier override just the redcarpet options (#5 ) and possible future implementations of using other renderers (#6).

This is a minor refactor to improve readability and extendability (e.g. for a TOCRenderer), inspired by original source https://stackoverflow.com/a/33778564/1680728 who quotes https://gist.github.com/davidjrice/3014948 .

fwolfst commented 5 years ago

If this would to be merged, the README needs modification (now in order to override the redcarpet options, the initializer will look different (better).