Skip to content

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

License

Unknown and 3 other licenses found

Licenses found

Unknown
LICENSE.md
Apache-2.0
LICENSE_APACHE_2.md
BSD-3-Clause
LICENSE_BSD_3C.md
LGPL-3.0
LICENSE_GNU_LGPL_3.md
Notifications You must be signed in to change notification settings

a19836/code-beautifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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>
	<script src="js/MyCodeBeautifier.js"></script>
</head>
<body>
	<textarea class="textarea1" rows=20 style="width:100%;"></textarea>
	<textarea class="textarea2" rows=20 style="width:100%;"></textarea>
	<button onClick="beautify()">Beautify</button>
	
	<script>
		function beautify() {
			var code = $(".textarea1").val();
			var new_code = MyCodeBeautifier.prettyPrint(code);
			document.querySelector(".textarea2").value = new_code;
		}
	</script>
</body>
</html>