Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eagletmt/haml_parser
Parser of Haml template language
https://github.com/eagletmt/haml_parser
Last synced: about 2 months ago
JSON representation
Parser of Haml template language
- Host: GitHub
- URL: https://github.com/eagletmt/haml_parser
- Owner: eagletmt
- License: mit
- Created: 2015-09-12T07:25:08.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-07-02T04:50:50.000Z (over 8 years ago)
- Last Synced: 2024-04-25T07:01:30.030Z (8 months ago)
- Language: Ruby
- Size: 57.6 KB
- Stars: 12
- Watchers: 4
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# HamlParser
[![Gem Version](https://badge.fury.io/rb/haml_parser.svg)](http://badge.fury.io/rb/haml_parser)
[![Build Status](https://travis-ci.org/eagletmt/haml_parser.svg?branch=master)](https://travis-ci.org/eagletmt/haml_parser)
[![Coverage Status](https://coveralls.io/repos/eagletmt/haml_parser/badge.svg?branch=master&service=github)](https://coveralls.io/github/eagletmt/haml_parser?branch=master)
[![Code Climate](https://codeclimate.com/github/eagletmt/haml_parser/badges/gpa.svg)](https://codeclimate.com/github/eagletmt/haml_parser)Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/haml_parser`. To experiment with that code, run `bin/console` for an interactive prompt.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'haml_parser'
```And then execute:
$ bundle
Or install it yourself as:
$ gem install haml_parser
## Usage
```ruby
parser = HamlParser::Parser.new(filename: 'input.haml')
ast = parser.call(File.read('input.haml'))
```Simple CLI interface is also available.
```
% cat input.haml
%p hello world
% haml_parser input.haml
#,
self_closing=false,
nuke_inner_whitespace=false,
nuke_outer_whitespace=false,
object_ref=nil,
filename="input.haml",
lineno=1>]>
```## Development
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake false` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/eagletmt/haml_parser.
## License
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).