/html-normalize

Beautifier for html( embedding js and css ) use js-beautify and PyTidyLib

Primary LanguagePython

html-normalize

Beautifier for html( embedding js and css ) use js-beautify and PyTidyLib

Why? can't Beautifier html files by js-beautify(python).

Introduction

To clean html files.

  1. clean comments in html files.
  2. use PyTidyLib to clean html structures.
  3. extract javascript from html files, and then use js-beautify to beautifier it.
  4. output the file.

Install

jsbeautify

pip install jsbeautifier

PyTidyLib

pip install pytidylib

for windows copy the libtidy.dll to python27/Scripts

Bugs

Issuing me if there are any questions.

Ref

js-beautify: https://github.com/beautify-web/js-beautify PyTidyLib: http://pythonhosted.org/pytidylib/#function-reference