Skip to content

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

License

Notifications You must be signed in to change notification settings

masal/htmlbeautifier

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HTML Beautifier

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

Usage

htmlbeautifier file1 [file2 ...]

or

htmlbeautifier < input > output

What it does

  • Normalises hard tabs to spaces
  • Removes trailing spaces
  • Indents after opening HTML elements
  • Outdents before closing elements
  • Collapses multiple whitespace
  • Indents after block-opening embedded Ruby (if, do etc.)
  • Outdents before closing Ruby blocks
  • Outdents elsif and then indents again
  • Indents the left-hand margin of JavaScript and CSS blocks to match the indentation level of the code

About

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

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Ruby 100.0%