Online code beautifier and formatter [closed]

心不动则不痛 提交于 2019-11-26 11:43:03

问题


What are the best online code beautifier and formatter out there? I\'m not asking for highlighters. Any language will do.


回答1:


CSS: code beautifier

HTML: HTML Tidy, CleanUp HTML or the general purpose Pretty Diff

Javascript: http://jsbeautifier.org/

PHP: http://beta.phpformatter.com/

SQL: http://dpriver.com/pp/sqlformat.htm

XML: http://chris.photobooks.com/xml/default.htm

Colour all: http://quickhighlighter.com/




回答2:


For PHP, Java, C++, C, Perl, JavaScript, CSS you can try:

http://www.prettyprinter.de/index.php




回答3:


You can use Perl::Tidy for Perl.




回答4:


JsonLint is good for validating and formatting JSON.




回答5:


What language?? There are different tools for almost every imaginable programming language, since they all have different syntactic rules and conventions.

Good ol' indent is a nice, customizable, command-line utility to format C and C++ programs.




回答6:


It depends of the language, and of the architecture you are using.

For example, in a php platform, you can format almost language with GeSHi

As bluish comments, GeSHi is a generic syntax highlighter, with no beautification feature. It is more used on the server side, and combine it with a beautification tool can be tricky, as illustrated with this GeSHi drupal ticket.




回答7:


I've used Quick Highlighter a lot. Works great for a huge list of languages.




回答8:


Use gist.github.com. There is a multi-language support(java, c, c++, c#, vb, haskell, ruby, javascript, lua, HTML, SQL, Tcl, Perl, JSON, groovy...)

Here is a sample "Generate LiquiBase changeLogs using Groovy"



来源:https://stackoverflow.com/questions/206441/online-code-beautifier-and-formatter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!