Class: Middleman::CommonmarkerExtension
- Inherits:
-
Extension
- Object
- Extension
- Middleman::CommonmarkerExtension
- Defined in:
- lib/middleman-commonmarker/extension.rb
Instance Method Summary collapse
-
#after_configuration ⇒ Object
Runs after core’s :markdown_renderer (before_configuration), so this Tilt.prefer overrides the default Kramdown engine.
-
#initialize(app, options_hash = {}, &block) ⇒ CommonmarkerExtension
constructor
A new instance of CommonmarkerExtension.
Constructor Details
#initialize(app, options_hash = {}, &block) ⇒ CommonmarkerExtension
Returns a new instance of CommonmarkerExtension.
12 13 14 15 16 |
# File 'lib/middleman-commonmarker/extension.rb', line 12 def initialize(app, = {}, &block) super require "commonmarker" require "middleman-commonmarker/commonmarker_template" end |
Instance Method Details
#after_configuration ⇒ Object
Runs after core’s :markdown_renderer (before_configuration), so this Tilt.prefer overrides the default Kramdown engine. app.config is still writable here (it is not finalized, since core itself writes cli_options after after_configuration).
22 23 24 25 26 27 28 29 |
# File 'lib/middleman-commonmarker/extension.rb', line 22 def after_configuration unless ..empty? app.config[:markdown] = (app.config[:markdown] || {}).merge(.) end exts = %w[markdown mdown md mkd mkdn] ::Tilt.prefer(::Middleman::Renderers::CommonmarkerTemplate, *exts) end |