Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

License

NotificationsYou must be signed in to change notification settings

freddez/html-indent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

html-indent is a html file indenter and checker.

It can be used for a single file, an entire tree, or from stdin (for editorplugin integration).

It supports multi-line tags, and preserves relative indentation in scripts andcomments sections. Except spaces, the document structure is preserved and theonly validation check is for balanced tags.

Command line options

Usage: html-indent [FILE] [options]Options:    -h, --help          print this help menu    -r, --recursive     process all files in directory tree    -e, --extension ext file extension for recursive processing    -n, --dry-run       dry run, don't write files        --numeric       output indentation value    -c, --check         check malformed tags    -l, --lines [start]-[end]                        limit output to selected lines    -p, --print         print html result to stdout

Installation

html-indent is written inRust. For the moment theonly option is to build it from source, soinstall Rustthen type

$ cargo install

Editor integration

There is aVim plugin undertoolsdirectory. Just drop it in~/.vim/indent/ and don't forget to have

filetype plugin indent on

in your.vimrc.

Known alternatives

  • HTML Tidy : Tidy is designed to clean-up htmlcomplete documents and I didn't succeed to indent html fragments with thecommand line version.
  • GNU Emacseditoruniverse environment. The includedhtml-modeandweb-mode, like manyEmacs's majormodes have implementedindent-region function.
  • Atom editor. Unfortunately, the indentation doesn't workwith newlines inside tags.

TODO

  • Better error handling
  • PHP integration
  • Sublime text plugin

[8]ページ先頭

©2009-2025 Movatter.jp