class Lookbook::RenderedScenarioEntity
@api public
See the [ScenarioEntity](./scenario_entity) docs for other available methods.
method that returns the rendered HTML output.
Extends ScenarioEntity with an ‘output`
Represents a rendered preview scenario.
def beautified_output
-
(String)
- Rendered output
def beautified_output @_beautified_output ||= CodeBeautifier.call(output) end
def has_custom_template?
def has_custom_template? !template.in?(system_templates) && !custom_source? && !view? end
def initialize(scenario, output, params)
- Api: - private
def initialize(scenario, output, params) @scenario = scenario @params = params @output = output end
def render_args
def render_args @_render_args ||= preview.render_args(scenario.name, params: params) end
def source
- Api: - private
def source has_custom_template? ? template_source(template) : scenario.source end
def source_lang
- Api: - private
def source_lang has_custom_template? ? template_lang(template) : scenario.source_lang end
def system_templates
def system_templates ["view_components/preview", Lookbook.config.preview_template] end
def template
def template render_args[:template] end
def view?
def view? render_args[:type] == :view end