Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Repository files navigation

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()">Beautifybutton>

<script>
function beautify() {
var code = $(".textarea1").val();
var new_code = MyCodeBeautifier.prettyPrint(code);
document.querySelector(".textarea2").value = new_code;
}
script>
body>
html>

Packages

Contributors