PHP, ASP. JAVA, and JAVA code formatting tools

Source: Internet
Author: User
Tags tidy

PHP code formatting tool http://www.waterproof.fr/products/phpCodeBeautifier/
I recently modified a code with no indentation in it. I can use this to format it.
It is equivalent to the indent of the previous c
By the way
C, c ++ c #=> indent Astyle
Java ==> astyle Jalopy jacbe ImportScrbber
Php ==> phpCodeBeautifier
Perl ==> perlTidy
Python ==> Pydent
Asp ==> VBSBeaut

Tool Name Applicable Language Introduction Installation/Use
Indent C Indent is synonymous with code beautification tools Indent is a standard tool attached to gcc,
Indent [options] [input-files]
Indent [options] [single-input-file] [-o output-file]
Perltidy Perl Perltidy is also written in perl. Download: perl Makefile. PL; 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 ++ java (php) A very fast C/C ++/Java source code beautification tool.
Astyle has many complete set of style definitions better than indent: ansi java linux... you don't have to remember the complex indentation specific options.
Download the source code, decompress the package, make, and generate the astyle executable file.
Astyle [options] <Original> Beautified
Astyle [options] Foo. cpp Bar. cpp [...]
Astyle -- style = ansi *. cpp
I tried to use it to format the PHP program, which is also very effective (of course, it is not a pure PHP code mixed with HTML code ).
Jalopy Java 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 APIs Download from http://prdownloads.sourceforge.net/jalopy/
See the relevant installation documents.
Pydent Python Pythius contains two tools:
Pydent: Code indent Tool
Pystat: Code statistics Tool
After the source code is downloaded and unwrapped:
Run "python setup. py build"
Run "python setup. py install"
Htmltidy Html/xml The error correction tool for HTML code 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.

However, JSP is not suitable for the code beautification of embedded scripts such as asp php jsp.

 

After the source code is downloaded, make generates the tidy executable file:
Tidy file1 file2...
Note: For pages containing Chinese characters, use the-raw option tidy.exe-raw-imuq-wrap 132-f % f. err % f to describe the options:
-Raw: do not modify Chinese characters (output values above 127 without conversion to entities)
-I indend: by default, HTML is Indented by two spaces.
-M overwrites the original file
-U forces all HTML tags to be capitalized (this can be left blank)
-Wrap Page code with a width greater than 132 lines force line feed
-F % f. err: output the error to the "corresponding file name. err" file.
HTMLTIDY supports XML format beautification:
Tidy-xml-imq web. xml
Tidy-xml-imq build. xml

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.