A normaliser/beautifier for HTML that also understands embedded Ruby. Ideal for tidying up Rails tem...
The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:
A normaliser/beautifier for HTML that also understands embedded Ruby. Ideal for tidying up Rails templates.
To update files in-place:
$ htmlbeautifier file1 [file2 ...]
or to operate on standard input and output:
$ htmlbeautifier < input > output
beautiful = HtmlBeautifier.beautify(messy)
You can also specify how to indent (the default is two spaces):
beautiful = HtmlBeautifier.beautify(messy, indent: "\t")
This is a Ruby gem. To install the command-line tool (you may need
$ gem install htmlbeautifier
To use the gem with Bundler, add to your