donpark / html2jade

Converts HTML to Jade template. Not perfect but useful enough for non-daily conversions.
MIT License
1.18k stars 157 forks source link

Remove jsdom dependency #30

Closed ming-codes closed 10 years ago

ming-codes commented 12 years ago

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.

donpark commented 12 years ago

Interesting suggestion. I used jsdom instead of using htmlparser directly because I wanted to cover javascript generated document as well. Perhaps a good compromise is to use static HTML conversion as default and make dynamic document conversion an option.

donpark commented 12 years ago

I just realized that removing jsdom dependency from html2jade will require adding a htmlparser-specific layer to simulate DOM API which is required to continue supporting convertDocument method.

Given that amount of change is not trivial, I'm going to defer this issue until later. Of course, you are welcome to fork and hack as always if you can't wait. :-)

donpark commented 10 years ago

version 0.7 replaces jsdom with jsdom-little which apparently don't have problematic contextify dependency. while not exactly matching this issue, it's a move in the right direction.

@lightblade Please close this issue if you feel your needs are met. Leave it as is otherwise. Thx.

ming-codes commented 10 years ago

Sure. Thanks for getting that out.