PHP Code formatting tool http://www.waterproof.fr/products/phpCodeBeautifier/
Recently modified a code, which is completely without indentation, with this can be formatted.
Equivalent to the indent of the previous C
By the way, write about other languages.
C, C + + C # ==> indent Astyle
Java ==> astyle jalopy jacobe importscrbber
PHP ==> Phpcodebeautifier
Perl ==> Perltidy
Python ==> pydent
ASP ==> Vbsbeaut
Tool Name |
Applicable language |
Brief introduction |
Install/Use |
Indent |
C |
Indent is synonymous with code beautification tools |
Indent is a standard tool that comes with GCC, indent [options] [Input-files] indent [options] [Single-input-file] [-O output-file] |
Perltidy |
Perl |
Perltidy itself is written in Perl. |
After download: 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] <infile >outfile |
Astyle |
C C + + java (PHP) |
A fast C/c++/java source code landscaping tool. Astyle is better than indent to have many sets of style definitions: ANSI Java Linux ... You don't have to remember complex indentation options. |
After downloading the source code unpack, make, generate the Astyle executable file Astyle [Options] < Original > beautified Astyle [Options] Foo.cpp Bar.cpp [...] Astyle--style=ansi *.cpp I've tried to use it to format a PHP program and it works (of course, it's pure PHP code mixed with HTML code). |
Jalopy |
Java |
Powerful Java Code formatting tool, in addition to the standard interface, command-line tools can also be used as plug-ins for tools such as Ant JBuilder ECLIPSE JDeveloper, and provide API |
Download from http://prdownloads.sourceforge.net/jalopy/ and refer to the appropriate installation documentation |
Pydent |
Python |
The Pythius contains 2 tools: Pydent: Code indent Tool Pystat: Code Statistics tool |
After downloading the source code unpack: Run "Python setup.py Build" Run "python setup.py Install" |
htmltidy |
html/xml |
html code Error-correcting tools. can help your HTML code better conform to the tidy, which is now called the "the", because it is not only used in HTML, but also now applies to the formatting of XHTML XML. But JSP is not suitable for code beautification of embedded scripts such as ASP PHP JSP |
Tidy file1 file2 ... Note: For pages containing Chinese, use the-raw option
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 2 spaces
-M overwrite the original file
-u Force all HTML tags to uppercase (This can not be added)
-wrap page code width greater than 132 lines Force wrap
-F%f.err to output errors to the appropriate file name. err file
Htmltidy supports XML formatting:
tidy-xml-imq web.xml
tidy-xml-imq build.xml
|