Guard::MtHaml
This is a Guard wrapper for MtHaml to compile Haml to PHP, Twig or static HTML.
Installation
Add to your Gemfile
:
gem "guard-mthaml"
Require in your Guardfile
:
require "guard/mthaml"
Or, add the default Guard::MtHaml template to your Guardfile
by running:
$ guard init mthaml
Usage
Requires that php
be executable via command line.
###
# Sample Guardfile block for Guard::MtHaml
#
# :input ("views/src") set input directory with haml files
# :output ("views") set output directory for compiled files
# :environment ("php") haml environment
# :extension (nil) output file extension, uses environment if nil
# :notifications (true) toggle guard notifications
# :compress_output (false) compress compiled haml files
# :static_files (false) compile haml to static html
# :run_at_start (true) compile files when guard starts
###
guard :mthaml, :input => "views/src", :output => "views"
Filters
Currently, only support for Markdown and CoffeeScript is available. I will eventually support Sass (pull requests are welcome). MtHaml doesn't have a way of disabling the runtime variables inside of filters when attempting to use interpolation (#{$var}
); this is a known issue that needs to be addressed within MtHaml before it can be included into this plugin.
Authors
License
Graphite is available under the MIT license.