Class: Frontman::SlimRenderer
- Defined in:
- lib/frontman/renderers/slim_renderer.rb
Instance Method Summary collapse
- #compile(layout) ⇒ Object
-
#initialize ⇒ SlimRenderer
constructor
A new instance of SlimRenderer.
- #render_content(compiled, content, scope, _data) ⇒ Object
Methods inherited from Renderer
Constructor Details
#initialize ⇒ SlimRenderer
Returns a new instance of SlimRenderer.
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/frontman/renderers/slim_renderer.rb', line 9 def initialize Slim::Engine.( pretty: true, buffer: :@_slim_buffer, sort_attrs: false, disable_escape: true ) super end |
Instance Method Details
#compile(layout) ⇒ Object
20 21 22 23 24 |
# File 'lib/frontman/renderers/slim_renderer.rb', line 20 def compile(layout) Slim::Template.new(nil) do layout end end |
#render_content(compiled, content, scope, _data) ⇒ Object
26 27 28 |
# File 'lib/frontman/renderers/slim_renderer.rb', line 26 def render_content(compiled, content, scope, _data) compiled.render(scope) { content } end |