Socket
Book a DemoInstallSign in
Socket

haml_to_js

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

haml_to_js

bundlerRubygems
Version
0.1.1
Version published
Maintainers
1
Created
Source

haml_to_js

haml_to_js is a ruby library and command line that converts haml to javascript.

Why an other haml to js converter (see similar utilities) ?

  • It is a extension of haml_to_star which purpose is to convert haml into any language
  • This converter is intended for front usage
  • It simplifies debugging (the generated code is readable, a variable hold haml line number so you can know exactly where the problem is)
  • It support features that other don't support (don't hesitate to raise an issue if I am no longer right):
    • if...else statements
    • Declarations such as .first{class: 'second'} will generate <div class="first second"></div>
    • Support for brackets inside parameters (ex: %div{key: 'value with bracket}'})

Installation

gem install haml_to_js

Usage

haml_to_js file or haml_to_js < file

Take a look at integration test cases in order to see what generated code looks like.

The generated code has dependencies; it needs two functions attrs and escape. It is recommended to include haml_to_js.js.

Contributions

This project is hosted on github, so don't hesitate to contribute and raise issues.

License

This project is under MIT License.

Similar utilities

haml-js

client-side-js

ruby-haml-js

FAQs

Package last updated on 27 Dec 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.