Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Converts html to coffeekup

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 bin
Octocat-spinner-32 lib
Octocat-spinner-32 src
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.md
Octocat-spinner-32 package.json
README.md

htmlkup

Installation

$ npm install -g htmlkup

Command line usage:

Pipe it in, it pipes it out.

$ echo '<html></html>' | htmlkup
html()
$ echo '<html>
  <head>
    <link type="text/css" href="/css/my.css" />
    <script type="text/javascript" src="/js/my.js"></script>
    <title>Title</title>
  </head>
  <body>
    <div>Text</div>
    <div>
      <a href="/">somewhere</a><br/>
    </div>
  </body>
</html>' | htmlkup
html ->
  head ->
    link type: "text/css", href: "/css/my.css"
    script type: "text/javascript", src: "/js/my.js"
    title "Title"
  body ->
    div "Text"
    div ->
      a href: "/", "somewhere"
      br()
$ htmlkup < your.html > your.coffee

Module usage:

hmtlkup exports just one function. Pass in html, it returns coffeescript

htmlkup = require 'htmlkup'

html = '<p>Hi!</p>'
coffeekup = htmlkup(html)
p "Hi!"

Online usage:

html2coffeekup by Jacob Friis Saxberg

You can paste in your HTML and it'll output coffeescript.

http://html2coffeekup.herokuapp.com/

haml-html-coffeecup-javascript-coffeescript-converter by Mike Smullin

Converts HAML into HTML, HTML into coffescript (coffeekup), and bi-directional conversion of coffeescript and javascript.

http://mikesmullin.github.com/haml-html-coffeecup-javascript-coffeescript-converter/

Tests

$ vows
Something went wrong with that request. Please try again.