Slimmy
Usage
Create slimmy instance.
Slimmy = require 'slimmy'slimmy =
You then can convert file.
slimmyconvertFile'~/my_rails_app/app/views/layouts/application.html.haml'
Or the whole directory (recursively).
slimmyconvertDir'~/my_rails_app/app/views/'
Or just a string.
filePath = '~/my_rails_app/app/views/layouts/application.html.haml'hamlString = require'fs'readFileSyncfilePathtoString slimmyconvertStringhamlStringthen # then we can access compiler's buffer consolelogcompilerbuffer
Development
Prepare development environment: install haml, install node packages.
gem install hamlnpm install -g gulpnpm install -g coffeegulpnpm install
Run tests in development mode.
coffeegulp mocha:dev
Code!