showcase icon indicating copy to clipboard operation
showcase copied to clipboard

Some assorted Phlex support sketches

Open kaspth opened this issue 1 year ago • 1 comments

"showcase/previews/#{path.id}".classify
"Showcase::Previews::Box".constantize.render_in(@view_context)

# Require Zeitwerk naming conventions so `constantize` works.
# showcase/previews/box.rb
class Showcase::Previews::Box < Showcase::Phlex::Preview
  def template
    description do
      
    end

    sample "Basic" do
      
    end
  end
end

showcase.sample "Basic" do
  render Phlex::View
end

class Showcase::Phlex::Preview < Phlex::HTML
  attr_reader :showcase

  def initialize(showcase)
    @showcase = showcase
  end

  def template
    yield
  end
end

preview = Showcase::Preview.new
Showcase::Phlex::Preview.new(self).render_in(@view_context)

Showcase.phlex do
  
end

kaspth avatar Feb 20 '23 04:02 kaspth