PHP, ASP.JAVA, JAVA code formatting tool arrangement_PHP tutorial

WBOY
Release: 2016-07-21 15:37:25
Original
1129 people have browsed it

PHP code formatting tool http://www.waterproof.fr/products/phpCodeBeautifier/
I recently modified a code that has no indentation at all. Use this to format it.
Equivalent to the previous indent of c
By the way, write other languages ​​​​
c, c++ c# ==> indent Astyle
java ==> astyle Jalopy Jacobe ImportScrbber
php ==> ; phpCodeBeautifier
perl ==> perlTidy
python ==> Pydent
asp ==> VBSBeaut

TR> TABLE> http://www.bkjia.com/PHPjc/321957.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/321957.htmlTechArticlePHP code formatting tool http://www.waterproof.fr/products/phpCodeBeautifier/ Recently modified a code, There is no indentation at all, you can use this to format it. Equivalent to before...
Tool name Applicable languages Introduction Installation/Usage
indent c indent is synonymous with code beautification tools indent is a standard tool that comes with gcc,
工具名称 适用语言 简介 安装/使用
indent c indent就是代码美化工具的代名词 indent是gcc附带的一个标准工具,
indent [options] [input-files]
indent [options] [single-input-file] [-o output-file]
perltidy perl perltidy本身也是用perl写的 下载后: perl Makefile.PL;make;make install
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 c c++ java (php) 一个速度很快的C/C++/Java源代码美化工具。
astyle比indent好在有很多成套的的风格定义:ansi java linux...不必记住复杂的缩进具体选项。
下载源代码解包后,make, 生成astyle可执行文件
astyle [options] < Original > Beautified
astyle [options] Foo.cpp Bar.cpp [...]
astyle --style=ansi *.cpp
我尝试过用它来格式化PHP程序也很有效(当然是不合HTML代码混在一起的纯PHP代码)。
jalopy java 功能强大的JAVA代码格式化工具,除了标准界面外,命令行工具,还可作为ANT JBUILDER ECLIPSE JDEVELOPER等工具的插件使用,并提供API 从http://prdownloads.sourceforge.net/jalopy/下载
并参考相应安装文档
pydent python pythius包含了2个工具:
pydent: 代码缩进工具
pystat: 代码统计工具
下载源代码解包后:
Run "python setup.py build"
Run "python setup.py install"
htmltidy html/xml HTML代码的纠错工具,可以帮助你的HTML代码更好的符合W3C规范,现在被称作tidy,因为它不仅只使用于HTML,也现在也适用于XHTML XML的格式化。

但JSP不适合ASP PHP JSP等嵌入式脚本的代码美化

 

下载源代码后 make 生成tidy可执行文件:
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
indent [options] [input-files]indent [options] [single-input-file] [-o output-file ]
perltidy perl perltidy itself is also written in perl After downloading: perl Makefile.PL;make;make install

perltidy [ options ] file1 file2 file3 ...

(output goes to file1.tdy, file2.tdy, file3 .tdy, ...)perltidy [ options ] file1 -st >outfileperltidy [ options ] outfile
astyle c c++ java (php) A fast C/C++/Java source code beautification tool. Astyle is better than indent in that it has many complete sets of style definitions: ansi java linux... There is no need to remember complex indentation specific options. After downloading the source code and unpacking it, make, generate astyle executable fileastyle [options] < Original > Beautifiedastyle [options] Foo.cpp Bar.cpp [ ...]astyle --style=ansi *.cppI have tried using it to format PHP programs and it works well (of course it is pure PHP code that is not mixed with HTML code).
jalopy java A powerful JAVA code formatting tool. In addition to the standard interface, the command line tool can also be used as a plug-in for ANT JBUILDER ECLIPSE JDEVELOPER and other tools, and provides API Download from http://prdownloads.sourceforge.net/jalopy/and refer to the corresponding installation documentation
pydent python pythius includes 2 tools: pydent: code indentation toolpystat: code statistics tool After downloading and unpacking the source code:Run "python setup.py build"Run "python setup.py install"
htmltidy html/xml HTML code debugging tool can help your HTML code better comply with W3C specifications. It is now called tidy because it is not only used for HTML, but also for XHTML XML. formatting. But JSP is not suitable for code beautification of embedded scripts such as ASP PHP JSP
After downloading the source code, make generates the tidy executable file: tidy file1 file2...Note: Use the -raw option for pages containing Chinese
tidy.exe -raw -imuq -wrap 132 -f %f.err %f
option description: -raw: Do not modify Chinese characters (output values ​​above 127 without conversion to entities) -i indend Default HTML is indented by 2 spaces -m Overwrite the original file-u forces all HTML tags to be capitalized (this can be omitted) -wrap forces a newline if the page code width is greater than 132 lines -f %f.err outputs the error to the "corresponding file name.err" file HTMLTIDY supports XML format beautification: tidy -xml -imq web.xmltidy -xml -imq build.xml
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template