summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Dorn <jeremy@jeremydorn.com>2013-06-12 21:02:49 -0700
committerJeremy Dorn <jeremy@jeremydorn.com>2013-06-12 21:02:49 -0700
commit5de859a8baae31455c4f368f6fae0e777d6010ea (patch)
tree8804907c5e6483121187a011fb69fbd4427ad5b6
parent665222b859687c8020a235c5454a490eae526aff (diff)
downloadsql-formatter-origin/gh-pages.zip
sql-formatter-origin/gh-pages.tar.gz
sql-formatter-origin/gh-pages.tar.bz2
Added documentation for compress method.origin/gh-pages
Fixed bug with unreadable pre contents before prettyprint js loads.
-rw-r--r--index.html25
1 files changed, 25 insertions, 0 deletions
diff --git a/index.html b/index.html
index ecc1568..3d82030 100644
--- a/index.html
+++ b/index.html
@@ -16,6 +16,9 @@
padding-top: 20px;
padding-bottom: 40px;
}
+ pre {
+ color: white;
+ }
</style>
<link href="css/bootstrap-responsive.min.css" rel="stylesheet">
@@ -149,6 +152,28 @@ echo SqlFormatter::highlight($sql);</pre>
<hr>
+ <section>
+ <h3>Compress SQL Query</h3>
+
+ <p>The compress method compresses whitespace and removes comments.</p>
+
+ <pre class='prettyprint lang-php'>&lt;?php
+$sql = "-- This is a comment
+SELECT
+/* This is another comment
+On more than one line */
+Id #This is one final comment
+as temp, DateCreated as Created FROM MyTable;";
+
+echo SqlFormatter::compress($sql);</pre>
+
+ <pre style="color: black; background-color: white;">
+SELECT Id as temp, DateCreated as Created FROM MyTable;</pre>
+
+ </section>
+
+ <hr>
+
<section>
<h3>Remove SQL Comments</h3>