github.com/stephannv/blueprint

A lib for writing reusable and testable views templates (HTML, SVG, Forms) in plain Crystal. Inspired by Phlex.

84 stars
1 dependent
License: MIT

Nothing has been indexed for 0.3.0 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.

Installation

# Add this to your shard.yml
dependencies:
  blueprint:
    github: stephannv/blueprint
    version: ~> 0.3.0

Then run:

shards install

shard.yml

No shard.yml has been indexed for 0.3.0. You can read it on the repository.

Dependencies

Unknown: the shard.yml for this version has not been read yet.

README

This README is the one indexed from the repository at its latest ref, not from the tag for this version.

<p align="center">
  <a href="https://stephannv.github.io/blueprint-docs/" target="_blank">
    <picture>
      <img
        alt="Blueprint logo"
        src="https://raw.githubusercontent.com/stephannv/blueprint/HEAD/.github/blueprint-logo.svg"
        width="200"
        height="200"
        style="max-width: 100%;"
      >
    </picture>
  </a>
</p>

<p align="center">
  A lib for writing reusable and testable views templates (HTML, SVG, Forms) in plain Crystal.
</p>

<p align="center">
  <a href="https://github.com/stephannv/blueprint/actions/workflows/ci.yml"><img src="https://github.com/stephannv/blueprint/actions/workflows/ci.yml/badge.svg" alt="Tests"></a>
  <a href="https://github.com/stephannv/blueprint/actions/workflows/weekly.yml"><img src="https://github.com/stephannv/blueprint/actions/workflows/weekly.yml/badge.svg" alt="Weekly CI"></a>
  <img src="https://img.shields.io/badge/0-dependencies-blue" alt="Zero dependencies">
</p>

------

Example:
```crystal
class Alert
  include Blueprint::HTML

  private def blueprint
    div class: "alert alert-success" do
      h4(class: "alert-heading") { "Well done!" }
      p { "Hello Word" }
    end
  end
end

Alert.new.to_s
```

Output:
```html
<div class="alert alert-success">
  <h4 class="alert-heading">Well done!</h4>
  <p>Hello World</p>
</div>
```

## Documentation

For full documentation, visit <https://stephannv.github.io/blueprint-docs/>.

## Contributing

1. Fork it (<https://github.com/stephannv/blueprint/fork>)
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request