Code/Function/Library to intent/format/prettify JavaScript/QtScript code for readablity within the application?
Greetings,
in one of my applications I provide a simple code editor based on a QTextEdit
widget and the QSyntaxHighlighter
. I was wondering if there is function, library or generally a way to allow the user to have his/her code re-formatted and indented within the application?
Websites like this allow you to re-format and intent JavaScript/QtScript/ECMAScript code easily, but it would be nice to h开发者_StackOverflow社区ave a "Format Code" button right next to the code editor.
You could try to experiment with astyle or indent. Although these programs are mostly made to format C/C++, they might give acceptable results with javascript.
精彩评论