|
|
| |
|
|
| indent [options] [input-files] indent [options] [single-input-file] [-o output-file] |
|
|
| perltidy [ options ] file1 file2 file3 ... (output goes to file1.tdy,file2.tdy,file3.tdy,...) perltidy [ options ] file1 -o outfile perltidy [ options ] file1 -st >outfile perltidy [ options ] outfile |
|
| astyle比indent好在有很多成套的的风格定义:ansi java linux...不必记住复杂的缩进具体选项。 |
astyle [options] < Original > Beautified astyle [options] Foo.cpp Bar.cpp [...] astyle --style=ansi *.cpp 我尝试过用它来格式化PHP程序也很有效(当然是不合HTML代码混在一起的纯PHP代码)。 |
|
|
| 并参考相应安装文档 |
|
| pydent: 代码缩进工具 pystat: 代码统计工具 |
Run "python setup.py build" Run "python setup.py install" |
|
| 但JSP不适合ASP PHP JSP等嵌入式脚本的代码美化
|
tidy file1 file2 ... 注意:对于含有中文的页面要使用 -raw选项
tidy.exe -raw -imuq -wrap 132 -f %f.err %f
选项说明: -raw: 不修改中文字符 (output values above 127 without conversion to entities) -i indend 缺省HTML按2个空格缩进 -m 覆盖原文件 -u 强制所有HTML标记大写(这个可以不加) -wrap 页面代码宽度大于132行强制换行 -f %f.err 将错误输出到"相应文件名.err"文件中 HTMLTIDY支持XML的格式美化: tidy -xml -imq web.xml tidy -xml -imq build.xml |