Skip to content

Releases: stephannv/blueprint

v0.4.0 - SVG support

25 Apr 20:57
7efdac6
Compare
Choose a tag to compare
v0.4.0 - SVG support Pre-release
Pre-release

Full details: https://blueprint.gunbolt.org/changelogs/v0.4.0/

What's Changed

Full Changelog: v0.3.0...v0.4.0

v0.3.0

18 Apr 23:06
729a9d7
Compare
Choose a tag to compare
v0.3.0 Pre-release
Pre-release

Full details: https://blueprint.gunbolt.org/changelogs/v0.3.0/

What's Changed

  • feat: Add experimental Blueprint::HTML.builder by @stephannv in #39

Full Changelog: v0.2.0...v0.3.0

v0.2.0

07 Apr 13:02
Compare
Choose a tag to compare
v0.2.0 Pre-release
Pre-release

Highlights

Conditional rendering

It's possible to override #render? method to control blueprint render.

class Example
  include Blueprint::HTML
  
  private def blueprint
    h1 { "Example" }
  end
  
  private def render?
    false
  end  
end

example = Example.new
example.to_html # => ""

Array attributes

Arrays passed as attribute values will be flattened and joined with " ".

class Example
  include Blueprint::HTML
  
  private def blueprint
    h1(class: ["a", "b", ["c", "d"]) { "Example" }
  end
end

example = Example.new
example.to_html # => "<h1 class="a b c d">Example</h1>"

Enveloping

By overriding the #envelope(&) method, you can create a wrapper around blueprint content. This is useful when defining layouts for pages

class Layout
  include Blueprint::HTML
  
  private def blueprint(&)
    html do
      body do
        yield
      end
    end
  end
end

class BasePage
  include Blueprint::HTML
  
  private def envelope(&)
    render(Layout.new) { yield }
  end
end

class Example < BasePage  
  def blueprint
    h1 { "Example" }
  end
end

example = Example.new
example.to_html # => "<html><body><h1>Hello</h1></body></html>"

Log

Full Changelog: v0.1.0...v0.2.0

v0.1.0 - First alpha release

27 Mar 13:46
Compare
Choose a tag to compare
Pre-release

This is a alpha version. I believe this shard is ready to be tested on side projects since it has the core features implemented (eg. can build full pages, can compose page with components, escapes content and attributes values).