diff options
author | Jeremy Dorn <jeremy@jeremydorn.com> | 2013-06-12 21:02:49 -0700 |
---|---|---|
committer | Jeremy Dorn <jeremy@jeremydorn.com> | 2013-06-12 21:02:49 -0700 |
commit | 5de859a8baae31455c4f368f6fae0e777d6010ea (patch) | |
tree | 8804907c5e6483121187a011fb69fbd4427ad5b6 | |
parent | 665222b859687c8020a235c5454a490eae526aff (diff) | |
download | sql-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.html | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -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'><?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> |