Define reusable functions in Haml that can be called with native Haml syntax.
- Native Haml syntax for calling helper functions
- Ability to define helper functions using Haml
- Ability to include user tags from one Haml file in another
The latest version of the gem, 0.10.3
, includes all of the commit to the repository up to this point. The original author, CGamesPlay, no longer uses this project in any production applications and so has no capacity to maintain it. If you are interested in adopting this project, or hiring me to do the modernization, please reach out.
- The current implementation is incompatible with the latest Haml and Rails versions.
- The CircleCI test pipeline is no longer functional due to changes by CircleCI.
Add this line to your application's Gemfile:
gem 'haml_user_tags'
And then execute:
$ bundle
Or install it yourself as:
$ gem install haml_user_tags
The Tutorial will guide you through how to create an use user tags. Briefly:
- define_tag :MyHamlHelper do |attributes, content|
%samp MyHelper called with #{attributes.inspect} and #{content.inspect}
%br
%MyHamlHelper.cls helper defined in Haml directly
Guy Steele's Growing a Language (Video) gives a great demonstration of why user tags in Haml are an essential feature.
- Fork it (https://github.com/CGamesPlay/haml_user_tags/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
rake features
rake release
- Increment
VERSION
andLATEST_STABLE_VERSION
rake site:publish
git push