contentful_rails
contentful_rails copied to clipboard
Subclassing MarkdownRenderer
so, I was following your README on subclassing the markdown renderer, and I realized that in your markdown_helper.rb parse_markdown method you always instantiate the
renderer = ContentfulRails::MarkdownRenderer.new(renderer_opts)
So, how do you typically force your engine to use your new and improved subclassed markdown renderer?
@dezmathio we have re-defined parse_markdown in a new helper in the project to to this.
I see, we thought of doing that as well. Do you think that it would be worthwhile making a configuration attribute such as .markdown_renderer
where we could override it if we were using a subclassed one, else it would always use the default one? That way we could cut down on code duplication & have a somewhat cleaner solution. Thoughts? cc @pmoore
I'll leave @dlitvakb to decide, @dezmathio - he maintains now.
Hey @dezmathio,
Looks like something we can improve on,
I'll look onto it as soon as I have a free slot on my schedule.
I'll propose taking a look again to refining this gem during next week's planning.
I'll try to get you an update by this time next week.
Cheers
Hey @dezmathio,
Sorry response took a bit longer, I've been travelling quite a bit (right now at RubyConf US).
My first priority now is to address all Rails Integration related issues, including this one, so I'll be tackling this issue in the next few days and have a PR ready for merge as soon as possible.
Cheers