Coder Social home page Coder Social logo

html2jade's People

Contributors

aichholzer avatar borisjoffe avatar donpark avatar dsc avatar forbeslindesay avatar grawl avatar jumplink avatar mef51 avatar pjeby avatar robbieclarken avatar sandro-pasquali avatar skyatura avatar taku0 avatar z0d14c avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

html2jade's Issues

.jade converted with the html file inside

Hi, I'm on Fedora18
Converting a single file like this (123.html)

<html>
<head></head>
<body>
<h1>HOLA</h1>
</body>
</html>

Generates this output

html
  body /home/geedmo/123.html

Web converter works fine, so there's some conflict with my system, any idea for this behavior?

multiline html attributes should escape the newline with \ to create valid jade.

I have html like this:

    <img src="img/close_button.png" height="16" width="16" alt="Home"
    onclick="
        mwl.switchClass('#search_title', 'show_title_search', 'show_title_main');
        mwl.setGroupTarget('#navigateToggle', '#home', 'show', 'hide');
        mwl.switchClass('#slider', 'show_miniapp', 'show_main');
        mwl.scrollTo('#main');"/>

It produces jade like this

img(src='img/close_button.png', height='16', width='16', alt='Home', onclick='
mwl.switchClass("#search_title", "show_title_search", "show_title_main");
mwl.setGroupTarget("#navigateToggle", "#home", "show", "hide");
mwl.switchClass("#slider", "show_miniapp", "show_main");
mwl.scrollTo("#main");')

This doesn't pass jade parser. html2jade should prefix the line endings with \ within the attritube value, like this:

img(src='img/close_button.png', height='16', width='16', alt='Home', onclick=' \
mwl.switchClass("#search_title", "show_title_search", "show_title_main"); \
mwl.setGroupTarget("#navigateToggle", "#home", "show", "hide"); \
mwl.switchClass("#slider", "show_miniapp", "show_main"); \
mwl.scrollTo("#main");')

Automatically assumes full HTML document

In a templating/partial system, some html documents are included in other documents without being full pages. Auto wrapping each document in html/body seems unnecessary and not doing so facilitates the partial template case.

Example:

<span> hello </span>

=>

html
  body
    span
      | hello

Areas in need of refactoring

  1. CLI options are rather poor in design and in features. In particular, stdout output support is missing.
  2. Overall structure needs rethinking to cleanup accumulated workarounds.
  3. JSDOM dependency. Useful but most of its functionality is unnecessary for simple HTML to Jade conversion.

Errors on startup (apparently during argument logging)

Standard html2jade 0.1.0 either npm install, or from github src :

$ html2jade http://www.mcli.dist.maricopa.edu/tut/tut1.html

node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
TypeError: Converting circular structure to JSON
at Object.stringify (native)
at Command. (/home/nodejs/.node_libraries/.npm/html2jade/0.1.2/package/bin/html2jade:54:51)
at Command. (/home/nodejs/.node_libraries/.npm/commander/0.5.0/package/lib/commander.js:232:8)
at Command.emit (events.js:64:17)
at Command.parseArgs (/home/nodejs/.node_libraries/.npm/commander/0.5.0/package/lib/commander.js:401:12)
at Command.parse (/home/nodejs/.node_libraries/.npm/commander/0.5.0/package/lib/commander.js:349:15)
at Object. (/home/nodejs/.node_libraries/.npm/html2jade/0.1.2/package/bin/html2jade:95:9)
at Module._compile (module.js:402:26)
at Object..js (module.js:408:10)
at Module.load (module.js:334:31)

Seems that the cause is this line:

console.log("default action invoked: " + JSON.stringify(arguments));

Since it's just a debug message, we can try to comment it out.

Then it goes further, but still fails at line 70:

$ ./bin/html2jade http://www.mcli.dist.maricopa.edu/tut/tut1.html
options: {"scalate":false}

node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
TypeError: Object # has no method 'match'
at Object.urlParse as parse
at Command. (/home/nodejs/src/html2jade/bin/html2jade:70:15)
at Command. (/home/nodejs/.node_libraries/.npm/commander/0.5.0/package/lib/commander.js:232:8)
at Command.emit (events.js:64:17)
at Command.parseArgs (/home/nodejs/.node_libraries/.npm/commander/0.5.0/package/lib/commander.js:401:12)
at Command.parse (/home/nodejs/.node_libraries/.npm/commander/0.5.0/package/lib/commander.js:349:15)
at Object. (/home/nodejs/src/html2jade/bin/html2jade:95:9)
at Module._compile (module.js:402:26)
at Object..js (module.js:408:10)
at Module.load (module.js:334:31)

Possibly an incompatibility with the latest commander version?

no output for minimal html file

So trivial to convert by hand that it doesn't much matter, but this outputs nothing / empty string:

<html>
  <head>
    <script type="text/javascript">window.location = "/newsite/";</script>
  </head>
</html>

fix script & style indentations

Jade is rather uptight about indentation of contents of CDATA tags like script and style tags so, unless rules are loosened, script and style tag contents will have to be reformatted during conversion. Support for non-JS script tag will be problematic, however.

html2jade: command not found

Hi,

Sorry - I'm a newbie in Node.js so apologies if I'm missing something trivial here. Yes, I have latest node.js installed on mac, etc.
I wanted to convert a bunch of files from html to jade.
So, I created a directory (I'm using mac so on the desktop), called it "mydir".
Then at the bash prompt, I ran "npm install html2jade" - installed ok.
I copied all my html files in "mydir" directory.

  • Now, at the mydir> prompt (main dir), I tried to do: html2jade index.html
    I get an error that html2jade: command not found
  • I cd over inside to bin directory as: mydir/node_modules/html2jade/bin> html2jade index.html
    I still get the same error as html2jade: command not found. I'm sure I'm missing something here...

Any help, would be great.

Thanks,
Jatin

error when parsing javascript inside of textarea

test case:

<textarea id="text-area">javascript:window.s=document.createElement('script');window.sc=document.getElementsByTagName("body")[0]||document.getElementsByTagName("head")[0];s.src="http://xyz.com/path/app.js";sc.appendChild(s)
</textarea>

Support non UTF-8 encodings

Current implementation expects HTML files to be in UTF-8 encoding. Support non UTF-8 encodings via optional flag and automatic encoding detection.

Equals not getting escaped

The = x below isn't getting escaped and will be evaluated code.

$ cat foo.html 
<html>
  <head>
  </head>
  <body>
    <a>= x</a>
  </body>
</html>
$ html2jade foo.html 
$ cat foo.jade 
html
  head
  body
    a = x

Cannot read property 'tagName' of null

Just installed html2jade, and am getting:

$ echo '<html></html>' > /tmp/foo.html

$ html2jade /tmp/foo.html 

/home/yang/.node/node_modules/html2jade/lib/html2jade.js:233
      tagName = node.tagName.toLowerCase();
                    ^
TypeError: Cannot read property 'tagName' of null
    at Converter.element (/home/yang/.node/node_modules/html2jade/lib/html2jade.js:233:21)
    at Converter.document (/home/yang/.node/node_modules/html2jade/lib/html2jade.js:229:19)
    at /home/yang/.node/node_modules/html2jade/lib/html2jade.js:366:27
    at /home/yang/.node/node_modules/html2jade/lib/html2jade.js:15:20
    at /home/yang/.node/node_modules/html2jade/node_modules/jsdom/lib/jsdom.js:269:7
    at [object Object].<anonymous> (fs.js:86:5)
    at [object Object].emit (events.js:39:17)
    at afterRead (fs.js:843:12)

doesn't properly handle comments

input:

<html>
  <head>
  </head>
  <body>
    <!--tr class="a_b">
      <input name="a_b" type="checkbox" value="true"><span id="a_b">A B</span></input>
    </tr-->
  </body>
</html>

output:

html
  head
  body
    //tr class="a_b">
      <input name="a_b" type="checkbox" value="true"><span id="a_b">A B</span></input>
    </tr

goes back to:

<html><head></head><body><!--tr class="a_b"><input name="a_b" type="checkbox" value="true"><span id="a_b">A B</span></input>    --></tr
</body></html>

allow output file/dir to be specified

currently app.coffee only outputs to process.stdout.

syntax

node app.js -o out/twitter.jade http://twitter.com

should save output to out/twitter.jade file.

implementation

Just needs to instantiate a WriteStream, wraped with html2jade.Output class, then passed to html2jade.convert or html2jade.Converter instance.

handle directory and wildcards as input

node app.js foo

should convert all html files within directory named foo

node app.js bar/*.htm

should convert all .htm files within directory named 'bar'

options

-r should recurse directories

Optional dependency on Contextify is broken

The optional (why optional!?) dependency on Contextify will break the whole program if Contextify fails to install, IE:

┌─[neer@neersighted:pts/6]-[~ | none:none()]-[18:31 | Fri, Jul 20, 2012]----[5861]
└─[±] html2jade http://twitter.com

/usr/local/lib/node_modules/html2jade/node_modules/jsdom/lib/jsdom.js:171
    features   = JSON.parse(JSON.stringify(window.document.implementation._fea
                                                          ^
TypeError: Cannot read property 'implementation' of undefined
    at exports.env.exports.jsdom.env.processHTML (/usr/local/lib/node_modules/html2jade/node_modules/jsdom/lib/jsdom.js:171:59)
    at Request.exports.env.exports.jsdom.env [as _callback] (/usr/local/lib/node_modules/html2jade/node_modules/jsdom/lib/jsdom.js:276:9)
    at Request.init.self.callback (/usr/local/lib/node_modules/html2jade/node_modules/jsdom/node_modules/request/main.js:120:22)
    at Request.EventEmitter.emit (events.js:91:17)
    at Request.<anonymous> (/usr/local/lib/node_modules/html2jade/node_modules/jsdom/node_modules/request/main.js:555:16)
    at Request.EventEmitter.emit (events.js:88:17)
    at IncomingMessage.Request.start.self.req.self.httpModule.request.buffer (/usr/local/lib/node_modules/html2jade/node_modules/jsdom/node_modules/request/main.js:517:14)
    at IncomingMessage.EventEmitter.emit (events.js:115:20)
    at IncomingMessage._emitEnd (http.js:366:10)
    at HTTPParser.parserOnMessageComplete [as onMessageComplete] (http.js:149:23)

Maybe the dependency should be required absolutely?

Dependencies on jade?

Should your package json include a dependency to Jade. I know its obvious but I used local dependenices (npm install .) and choose to install html2jade globally (well local globally)..

Does not work with html5boilerplate

  1. Download a custom html5boilerplate with minified jquery and all the "other" column options checked, and unzip it in a folder
  2. in this folder, in command line, install your project as a global package sudo npm i -g html2jade
  3. html2jade index.html

Results in :

/usr/local/lib/node_modules/html2jade/lib/html2jade.js:333
      data = data.replace(/\s*\[if\s+[^\]]+\]>\s*/, '');
                  ^
TypeError: Cannot call method 'replace' of undefined
    at Converter.conditional (/usr/local/lib/node_modules/html2jade/lib/html2jade.js:333:19)
    at Converter.comment (/usr/local/lib/node_modules/html2jade/lib/html2jade.js:325:21)
    at Converter.<anonymous> (/usr/local/lib/node_modules/html2jade/lib/html2jade.js:309:23)
    at /usr/local/lib/node_modules/html2jade/lib/html2jade.js:3:63
    at Writer.forEachChild (/usr/local/lib/node_modules/html2jade/lib/html2jade.js:103:11)
    at Converter.children (/usr/local/lib/node_modules/html2jade/lib/html2jade.js:301:19)
    at Converter.element (/usr/local/lib/node_modules/html2jade/lib/html2jade.js:296:21)
    at Converter.<anonymous> (/usr/local/lib/node_modules/html2jade/lib/html2jade.js:305:23)
    at /usr/local/lib/node_modules/html2jade/lib/html2jade.js:3:63
    at Writer.forEachChild (/usr/local/lib/node_modules/html2jade/lib/html2jade.js:103:11)

Doesn't like [if lt IE 7] style conditionals.

Hi, I just converted this HTML and it munged the conditionals that set the html tag. This HTML Is from http://www.initializr.com/:

HTML

<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <title></title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width">

        <link rel="stylesheet" href="css/bootstrap.min.css">
        <style>
            body {
                padding-top: 50px;
                padding-bottom: 20px;
            }
        </style>
        <link rel="stylesheet" href="css/bootstrap-theme.min.css">
        <link rel="stylesheet" href="css/main.css">

        <script src="js/vendor/modernizr-2.6.2-respond-1.1.0.min.js"></script>
    </head>
    <body>
        <!--[if lt IE 7]>
            <p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p>
        <![endif]-->
    <div class="navbar navbar-inverse navbar-fixed-top">
</div>
</body>

Result (notice the missing conditionals)

!!! 5
html.no-js
//
    <![endif]
  head
    meta(charset='utf-8')
    meta(http-equiv='X-UA-Compatible', content='IE=edge,chrome=1')
    title
    meta(name='description', content='')
    meta(name='viewport', content='width=device-width')
    link(rel='stylesheet', href='css/bootstrap.min.css')
    style
      body {
      padding-top: 50px;
      padding-bottom: 20px;
      }
    link(rel='stylesheet', href='css/bootstrap-theme.min.css')
    link(rel='stylesheet', href='css/main.css')
    script(src='js/vendor/modernizr-2.6.2-respond-1.1.0.min.js')
  body
    //if lt IE 7
      p.chromeframe
        | You are using an
        strong outdated
        | browser. Please
        a(href='http://browsehappy.com/') upgrade your browser
        | or
        a(href='http://www.google.com/chromeframe/?redirect=true') activate Google Chrome Frame
        | to improve your experience.
    .navbar.navbar-inverse.navbar-fixed-top

Error: Unknown encoding

Any idea why I would be getting an "[Error: Unknown encoding]" message?

I'm trying to convers some old html email to jade with "XHTML 1.0 Strict" Doctype (which I deleted to see if that was the problem but still got the same error).

Getting an empty file

Hi there,

First of all, thank you for what appears to be an outstanding converter based on what I've heard! Maybe I'm doing something incorrectly, I can see the output in my shell as jade syntax, but the file it generates is empty. Have you encountered this issue previously?

Thank you,
dBanx

mac OSX directory paths

Just a note:

I discovered that if any directory on the path has a blank space (allowed on Mac OSX, example: ~/foo bar/blee), the output of html2jade goes into never never land. The file is created, but it is of zero length. Remove the whitespace from the directory path, and no problem.

Remove jsdom dependency

Hi,

I think the dependency on jsdom is unnecessary. For the purpose of just converting from html to jade, I do believe using the dom produced by htmlparser should be sufficient.

There are a lot of problem surrounding jsdom. Mainly because jsdom has a hard dependency on contextify...which is a binary library that isn't pure js. Contextify has build issue in a lot of environments and some environment (like cloud9 ide) does not allow binary libraries to run on their platform.

Error: jsdom.env requires a 'html' argument

Hi Don,

I am getting following error:

$ html2jade index.html

node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: jsdom.env requires a 'html' argument
at /home//.node_libraries/.npm/jsdom/0.2.14/package/lib/jsdom.js:356:13
at Array.forEach (native)
at Function.processArguments (/home//.node_libraries/.npm/jsdom/0.2.14/package/lib/jsdom.js:353:12)
at Object.env (/home//.node_libraries/.npm/jsdom/0.2.14/package/lib/jsdom.js:143:29)
at Parser.parse (/home//.node_libraries/.npm/html2jade/0.1.17/package/lib/html2jade.js:17:27)
at Converter.conditional (/home//.node_libraries/.npm/html2jade/0.1.17/package/lib/html2jade.js:349:21)
at Converter.comment (/home//.node_libraries/.npm/html2jade/0.1.17/package/lib/html2jade.js:327:21)
at /home//.node_libraries/.npm/html2jade/0.1.17/package/lib/html2jade.js:310:24
at Writer.forEachChild (/home//.node_libraries/.npm/html2jade/0.1.17/package/lib/html2jade.js:102:11)
at Converter.children (/home//.node_libraries/.npm/html2jade/0.1.17/package/lib/html2jade.js:298:19)

html2jade -V
0.1.16

$ npm ls
npm WARN express 2.5.2 Unmet dependency in
npm WARN jade >= 0.0.1 Unmet dependency in
[email protected]
âââ [email protected] extraneous
âââ UNMET DEPENDENCY express 2.5.2
ââ⬠[email protected] extraneous
â âââ [email protected]
â ââ⬠[email protected]
â ââ⬠[email protected]
â â âââ [email protected]
â âââ [email protected]
â âââ [email protected]
â âââ [email protected]
âââ UNMET DEPENDENCY jade >= 0.0.1
âââ [email protected] extraneous
âââ [email protected] extraneous
ââ⬠[email protected] extraneous
ââ⬠[email protected]
â âââ [email protected]
ââ⬠[email protected]
âââ [email protected]

Appreciate help.
Thank you.

internal instance of Parser for conditional

Conditional comment block is currently parsed using a fresh instance of Parser to parse HTML in the comment block.

It should either reuse or use equivalent instance as Parser provided in by caller.

unit test

need unit test against test html files.

should verify round-trip from html to jade and back.

The option 'donotencode' dose not work when using html2jade.convertHtml()

Hi, donpark!

Firstly, I am grateful for your project :)

Secondly, I got a problem and need help.
I installed the html2jade package with npm install, and required it in my code. When I tried to convert html using html2jade.convertHtml() with an option {donotencode: true}, I got a wrong result.

My code:

var html2jade = require('html2jade');
html2jade.convertHtml('${2:value="${3}"}', {donotencode: true}, function (err, jade) {
  console.log(jade);
});

The result:

html
  body &dollar;&lcub;2&colon;value&equals;&quot;&dollar;&lcub;3&rcub;&quot;&rcub;

And what I actually expected:

html
  body ${2:value="${3}"}

Any help, would be great.

Thanks,
Thinrey

escaped characters are wrongly translated into html. e.g. &lt; becomes > while it shouldn't be

This piece of html

<p>Note the lack of the <code>&lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;</code>, which disables the zooming aspect of sites in mobile devices. In addition, we reset our container's width and are basically good to go.</p>

<p>&copy; Company 2013</p>

Becomes, by using http://html2jade.aaron-powell.com

    p
    | Note the lack of the
      code <meta name="viewport" content="width=device-width, initial-scale=1.0">
      | , which disables the zooming aspect of sites in mobile devices. In addition, we reset our container's width and are basically good to go.
    p © Company 2013

it should be

    p
    | Note the lack of the
      code **&lt;**meta name="viewport" content="width=device-width, initial-scale=1.0"**&gt;**
      | , which disables the zooming aspect of sites in mobile devices. In addition, we reset our container's width and are basically good to go.
    p **&copy;** Company 2013

Scalate support

Hi, html2jade has been quite helpful. Would you consider throwing in a few optional tweaks to make everything work much more nicely with Scalate?

  • Scalate Jade doesn't support commas inside attribute parens. It would be nice to be able to switch that off.
  • Client-side Javascript should be put in :javascript
  • CSS should be put in :css

Thanks!

npm install -g html2jade failing

gyp WARN EACCES user "M" does not have permission to access the dev dir "/Users/M/.node-gyp/0.10.22"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/var/folders/50/jhs_jbzs7mxfx_3vq4pzkncr0000gn/T/.node-gyp"
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

gyp: Error 1 running xcodebuild
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/Cellar/node/0.10.22/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:467:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Darwin 13.0.0
gyp ERR! command "node" "/usr/local/Cellar/node/0.10.22/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/html2jade/node_modules/jsdom/node_modules/contextify
gyp ERR! node -v v0.10.22
gyp ERR! node-gyp -v v0.11.0
gyp ERR! not ok 
npm http 200 http://registry.npmjs.eu/tough-cookie
npm http 200 http://registry.npmjs.eu/domhandler/-/domhandler-2.1.0.tgz
npm http 200 http://registry.npmjs.eu/cssom/-/cssom-0.3.0.tgz
npm http 200 http://registry.npmjs.eu/readable-stream
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the contextify package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls contextify
npm ERR! There is likely additional logging output above.

npm ERR! System Darwin 13.0.0
npm ERR! command "/usr/local/Cellar/node/0.10.22/bin/node" "/usr/local/bin/npm" "install" "-g" "html2jade"
npm ERR! cwd /Users/M/Ruby/Angular-Fun
npm ERR! node -v v0.10.22
npm ERR! npm -v 1.3.14
npm ERR! code ELIFECYCLE

i got a error “ERR! Error: spawn ENOMEM” while npm install

[root@guang384 ~]# npm install html2jade -g
npm http GET https://registry.npmjs.org/html2jade
npm http 304 https://registry.npmjs.org/html2jade
npm http GET https://registry.npmjs.org/commander
npm http GET https://registry.npmjs.org/jsdom
npm http 304 https://registry.npmjs.org/commander
npm http 304 https://registry.npmjs.org/jsdom
npm http GET https://registry.npmjs.org/htmlparser
npm http GET https://registry.npmjs.org/cssom
npm http GET https://registry.npmjs.org/request
npm http GET https://registry.npmjs.org/contextify
npm http 304 https://registry.npmjs.org/htmlparser
npm http 304 https://registry.npmjs.org/request
npm http 304 https://registry.npmjs.org/cssom
npm http 304 https://registry.npmjs.org/contextify
npm http GET https://registry.npmjs.org/bindings
npm http 304 https://registry.npmjs.org/bindings

[email protected] install /usr/local/lib/node_modules/html2jade/node_modules/jsdom/node_modules/contextify
node-gyp rebuild

info it worked if it ends with ok
info downloading: http://nodejs.org/dist/v0.6.17/node-v0.6.17.tar.gz
ERR! UNCAUGHT EXCEPTION:
ERR! Error: spawn ENOMEM
at errnoException (child_process.js:483:11)
at ChildProcess.spawn (child_process.js:446:11)
at Object.spawn (child_process.js:342:9)
at Gyp.spawn (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/node-gyp.js:124:26)
at runGypAddon (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:216:18)
at Object.oncomplete (/usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:94:5)
ERR! This is a bug in node-gyp. Please open an Issue:
ERR! https://github.com/TooTallNate/node-gyp/issues
ERR! not ok
npm WARN optional dependency failed, continuing [email protected]
/usr/local/bin/html2jade -> /usr/local/lib/node_modules/html2jade/bin/html2jade
[email protected] /usr/local/lib/node_modules/html2jade
├── [email protected]
└── [email protected] ([email protected], [email protected], [email protected])

throws when encountering conditional (msie) comments

test.html:

<html>
  <head>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
    <!--[if IE]>
      <script src="vendor/CFInstall.min.js"></script>
      <script src="javascripts/hello-msie.js"></script>
    <![endif]-->
    <meta http-equiv="content-type" content="text/html; charset=us-ascii" />
  </head>
  <body>
  <script>
//<![CDATA[
//]]>
  </script>
    Hello World.
    blah
    blah



    blah
  </body>
</html>

run

html2jade test.html > test.jade

In Memory Map?

Is there a way to just take a string or buffer of html and convert to jade on the fly? I would love to have a WYSIWYG editor on the client side pass the html but then convert it to jade or even better a client script to convert it in the browser. In the browser might be easier as you could use the DOM :)

Not compatible with node 0.8.x

npm http GET https://registry.npmjs.org/html2jade
npm http 200 https://registry.npmjs.org/html2jade
npm http GET https://registry.npmjs.org/html2jade/-/html2jade-0.1.18.tgz
npm http 200 https://registry.npmjs.org/html2jade/-/html2jade-0.1.18.tgz
npm http GET https://registry.npmjs.org/jsdom
npm http GET https://registry.npmjs.org/commander
npm http 200 https://registry.npmjs.org/commander
npm http 200 https://registry.npmjs.org/jsdom
npm ERR! error rolling back [email protected] Error: ENOTEMPTY, rmdir '/usr/local/lib/node_modules/html2jade'

npm ERR! Unsupported
npm ERR! Not compatible with your version of node/npm: [email protected]
npm ERR! Required: {"node":">= 0.4.x < 0.8.0"}
npm ERR! Actual: {"npm":"1.1.21","node":"0.8.1"}
npm ERR!
npm ERR! System Darwin 11.4.0
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "html2jade" "-g"
npm ERR! cwd /Users/zdwalter/Downloads/node-v0.8.1
npm ERR! node -v v0.8.1
npm ERR! npm -v 1.1.21
npm ERR! code ENOTSUP
npm ERR! message Unsupported
npm ERR! errno {}
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/zdwalter/Downloads/node-v0.8.1/npm-debug.log
npm not ok

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.