A Ruby gem that normalizes and beautifies HTML, including embedded Ruby code, ideal for Rails templates.
HTML Beautifier is a Ruby gem that normalizes and beautifies HTML files, including those with embedded Ruby (ERB) code. It solves the problem of messy, inconsistently formatted HTML in Rails templates by applying consistent indentation, removing trailing spaces, and handling Ruby block structures. The tool ensures HTML files are clean and readable, whether used via command line or integrated into Ruby code.
Ruby on Rails developers working with ERB templates who need to maintain clean, consistently formatted HTML files. It's also useful for developers using embedded Ruby in other contexts who want automated HTML beautification.
Developers choose HTML Beautifier because it specifically understands embedded Ruby syntax, unlike generic HTML formatters, making it ideal for Rails projects. It's lightweight, easy to use via command line or as a library, and provides customizable indentation options.
A normaliser/beautifier for HTML that also understands embedded Ruby. Ideal for tidying up Rails templates.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
It correctly indents and outdents Ruby blocks like if and do, and handles elsif clauses, making it uniquely effective for Rails ERB templates as highlighted in the README.
Allows specifying indentation with spaces or tabs via the indent parameter, providing flexibility for different coding styles.
Removes trailing spaces and collapses multiple whitespace, ensuring consistently clean HTML output without unnecessary clutter.
Can format files in-place or via standard input from the terminal, making it easy to automate in scripts or pre-commit hooks.
Requires Ruby installation and is designed for Ruby projects, limiting its use in polyglot environments or teams not using Ruby.
Lacks support for configuration files to store formatting preferences, relying on manual command-line arguments or code parameters for each use.
Focuses on indentation and whitespace; it doesn't offer advanced features like HTML minification, attribute sorting, or syntax error checking.