Skip to content

Code Beautifier

Original Repos:

Overview

Code Beautifier is a javascript library to beautify PHP code, but it also works in other languages.

Check out a live example by opening index.html.


Usage

<html><head><scriptsrc="js/MyCodeBeautifier.js"></script></head><body><textareaclass="textarea1" rows=20style="width:100%;"></textarea><textareaclass="textarea2" rows=20style="width:100%;"></textarea><buttononClick="beautify()">Beautify</button><script>functionbeautify(){varcode=$(".textarea1").val();varnew_code=MyCodeBeautifier.prettyPrint(code);document.querySelector(".textarea2").value=new_code;}</script></body></html>

Releases

Packages

Contributors

Languages