A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/threedaymonk/htmlbeautifier below:

threedaymonk/htmlbeautifier: A normaliser/beautifier for HTML that also understands embedded Ruby. Ideal for tidying up Rails templates.

A normaliser/beautifier for HTML that also understands embedded Ruby. Ideal for tidying up Rails templates.

To update files in-place:

$ htmlbeautifier file1.html.erb [file2.html.erb ...]

or to operate on standard input and output:

$ htmlbeautifier < untidy.html.erb > formatted.html.erb
require 'htmlbeautifier'

beautiful = HtmlBeautifier.beautify(untify_html_string)

You can also specify how to indent (the default is two spaces):

beautiful = HtmlBeautifier.beautify(untidy_html_string, indent: "\t")

This is a Ruby gem. To install the command-line tool (you may need sudo):

$ gem install htmlbeautifier

To use the gem with Bundler, add to your Gemfile:

  1. Follow these guidelines when writing commit messages (briefly, the first line should begin with a capital letter, use the imperative mood, be no more than 50 characters, and not end with a period).
  2. Include tests.

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4