Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Simplify the release process

Features that were previously automated (like changelog, contributors,
or pages generation) are now provided by GitHub, so there is no need
to have such a complicated release process.

The current release process is:

$ npm run jshint && npm test && npm version && npm publish
  • Loading branch information...
commit 40673af6bbb58a8792a33b0b269fb42665534255 1 parent 7b8a963
@rafeca authored
Showing with 72 additions and 1,958 deletions.
  1. +0 −3  .jshint
  2. +34 −0 .jshintrc
  3. +0 −5 AUTHORS
  4. +2 −0  Authors.md
  5. +2 −91 History.md
  6. +0 −231 Jakefile
  7. +6 −12 README.md
  8. +0 −341 docs/coverage.html
  9. +0 −186 docs/docco.css
  10. BIN  docs/images/example1.png
  11. BIN  docs/images/example2.png
  12. BIN  docs/images/example3.png
  13. BIN  docs/images/example4.png
  14. BIN  docs/images/example5.png
  15. BIN  docs/images/github-logo.png
  16. BIN  docs/images/gmail-logo.png
  17. BIN  docs/images/linkedin-logo.png
  18. BIN  docs/images/twitter-logo.png
  19. +0 −366 docs/index.html
  20. +0 −1  docs/javascripts/highlight.pack.js
  21. +0 −131 docs/prettyjson.html
  22. +0 −119 docs/stylesheets/main.css
  23. +0 −116 docs/stylesheets/syntax.css
  24. 0  {site → }/images/example1.png
  25. 0  {site → }/images/example2.png
  26. 0  {site → }/images/example3.png
  27. 0  {site → }/images/example4.png
  28. 0  {site → }/images/example5.png
  29. +22 −33 lib/prettyjson.js
  30. +1 −2  lib/utils.js
  31. +5 −7 package.json
  32. BIN  site/images/github-logo.png
  33. BIN  site/images/gmail-logo.png
  34. BIN  site/images/linkedin-logo.png
  35. BIN  site/images/twitter-logo.png
  36. +0 −78 site/index.html
  37. +0 −1  site/javascripts/highlight.pack.js
  38. +0 −119 site/stylesheets/main.css
  39. +0 −116 site/stylesheets/syntax.css
View
3  .jshint
@@ -1,3 +0,0 @@
-{
- "node" : true
-}
View
34 .jshintrc
@@ -0,0 +1,34 @@
+{
+ "node": true,
+ "browser": true,
+ "esnext": true,
+ "bitwise": true,
+ "camelcase": true,
+ "curly": true,
+ "eqeqeq": true,
+ "immed": true,
+ "indent": 2,
+ "latedef": true,
+ "newcap": true,
+ "noarg": true,
+ "quotmark": "single",
+ "regexp": true,
+ "undef": true,
+ "unused": true,
+ "strict": true,
+ "trailing": true,
+ "smarttabs": false,
+ "maxlen": 80,
+ "maxdepth": 2,
+ "predef": [
+ "define",
+ "require",
+ "describe",
+ "it",
+ "xit",
+ "before",
+ "beforeEach",
+ "after",
+ "afterEach"
+ ]
+}
View
5 AUTHORS
@@ -1,5 +0,0 @@
-- Rafael de Oleza <rafeca@gmail.com>
-- Dave Eddy
-- Elias Amaral
-- jiyinyiyong
-- Maciej Małecki
View
2  Authors.md
@@ -0,0 +1,2 @@
+Go to the [https://github.com/rafeca/prettyjson/graphs/contributors](GitHub contributors graph page)
+to see the list of contributors.
View
93 History.md
@@ -1,91 +1,2 @@
-### 0.10.0 — *December 10, 2013*
-
- * Add pretty printing of errors (by @mmalecki)
- * Deprecate Node.js 0.6.x and 0.8.x
-
-### 0.9.0 — *October 4, 2013*
-
- * Checks for hasOwnProperty in function render (by @dlight)
-
-### 0.8.1 — *March 11, 2013*
-
- * Add compatibility for Node.js 0.10.0
- * Update dependencies
-
-### 0.8.0 — *February 23, 2013*
-
- * Fix: ENV vars were not being used correctly
- * Add an option to change the color of the strings
- * Minor codestyle improvements
-
-### 0.7.1 — *October 29, 2012*
-
- * Fix bug in 0.7.0 when input is an array
-
-### 0.7.0 — *October 25, 2012*
-
- * Allow having non-JSON characters at the beginning of the input string (ideal for curl -i)
- * Add a renderString() method to be used by the CLI
- * Change test reporter style to spec
- * Upgrade dependencies to the last versions
-
-### 0.6.0 — *June 29, 2012*
-
- * Update dependencies to support Node.js v0.8
- * Adding ability to use environmental variables
-
-### 0.5.0 — *June 24, 2012*
-
- * Updated dependencies, added support for Node.js up to 0.7.12
- * Minor improvements in README file
- * Add JSHint to the build process
- * Add jake task to execute tests automatically
- * Add test coverage info
-
-### 0.4.0 — *February 24, 2012*
-
- * Now prettyjson uses Mocha test framework instead of jasmine-node
- * Fixed leak in a "key" variable
-
-### 0.3.1 — *February 15, 2012*
-
- * Modified website design
- * Modify webpage link in package.json
-
-### 0.3.0 — *January 24, 2012*
-
- * Added CLI interface
- * Now prettyjson package requires Nodejs 0.6.x
-
-### 0.2.1 — *January 23, 2012*
-
- * Fix: Bug when the JSON has attributes with booleans, integers or null values
-
-### 0.2.0 — *January 22, 2012*
-
- * Now using node-releasetools for the release process
- * Disabled Node.js 0.6 from Travis CI temporally
- * Minor copy in Readme.md
-
-### 0.1.4 — *December 1, 2011*
-
- * Added contributors to the Readme file
-
-### 0.1.3 — *November 17, 2011*
-
- * Fixed the GitHub publishing of tags in the jake task
- * Updated package.json to make it compatible with Node.js 0.6.x
- * Updated travis YAML file to use the new Node.js support on Travis
-
-### 0.1.2 — *November 14, 2011*
-
- * Updated Jakefile with tasks to automate publishing new versions
-
-### 0.1.1 — *October 11, 2011*
-
- * Added changelog jake task to add changelog automatically
- * The library version is retrieved from `package.json` file
-
-### 0.1.0 — *October 10, 2011*
-
- * Initial release
+Go to [GitHub releases page](https://github.com/rafeca/prettyjson/releases) to
+see the history of releases.
View
231 Jakefile
@@ -1,231 +0,0 @@
-var releaseTools = require('releasetools');
-var Step = require('step');
-var exec = require('child_process').exec;
-
-releaseTools.setOptions({
- examplePaths: [
- 'lib/prettyjson.js'
- ],
- siteAssetsPaths: [
- 'site/images',
- 'site/javascripts',
- 'site/stylesheets'
- ]
-});
-
-// Test task
-desc("execute tests");
-task("test", function() {
- var spawn = require('child_process').spawn;
- var child = spawn('npm', ['test']);
-
- console.log('executing the tests...');
-
- child.stderr.on('data', function(stderr) {
- process.stderr.write(stderr);
- });
- child.stdout.on('data', function(stdout) {
- process.stdout.write(stdout);
- });
- child.on('exit', function(code) {
- if (code !== 0) {
- fail(code);
- } else {
- console.log('Done!');
- complete();
- }
- });
-}, true);
-
-
-// Lint task
-desc("execute JSHint checks");
-task("jshint", function() {
- exec('node_modules/jshint/bin/jshint bin/ lib/ --config ".jshint"', function(err, stdout, stderr) {
- if (err) {
- console.log(err);
- fail(err);
- }
- else {
- console.log('Done!');
- complete();
- }
- });
-}, true);
-
-// Auto tests task
-desc("auto execute tests");
-task("watch", function() {
- var spawn = require('child_process').spawn;
- var child = spawn('node_modules/mocha/bin/mocha', ['-w', '-G', '--reporter', 'spec']);
-
- child.stderr.on('data', function(stderr) {
- process.stderr.write(stderr);
- });
- child.stdout.on('data', function(stdout) {
- process.stdout.write(stdout);
- });
- child.on('exit', function(code) {
- if (code !== 0) {
- fail(code);
- } else {
- console.log('Done!');
- complete();
- }
- });
-}, true);
-
-desc("create test coverage file");
-task("test-cov", function() {
- console.log('Creating test coverage file...');
-
- Step(
- function() {
- exec('rm -fr lib-cov', this);
- },
- function(err, stdout, stderr) {
- if (err) throw err;
- exec('node_modules/jscoverage/bin/jscoverage lib lib-cov', this);
- },
- function(err, stdout, stderr) {
- if (err) throw err;
- exec('EXPRESS_COV=1 node_modules/mocha/bin/mocha -R html-cov > docs/coverage.html', this);
- },
- function(err, stdout, stderr) {
- if (err) fail(err);
- else {
- console.log('Done!');
- complete();
- }
- }
- );
-}, true);
-
-// Namespace with all the release related tasks
-namespace('release', function() {
-
- // Build task
- desc('Modify the working copy with all the release information');
- task('build', ['test', 'test-cov', 'jshint'], function(releaseType) {
- Step(
-
- // Update Changelog
- function() {
- console.log('Updating History.md file...');
- releaseTools.updateChangelog(this);
- },
- // Update Contributors
- function(err) {
- if (err) throw err;
- console.log('Updating AUTHORS file...');
- releaseTools.updateAuthorsFile(this);
- },
- // Create Example HTML files
- function(err) {
- if (err) throw err;
- console.log('creating examples documentation...');
- releaseTools.createExamples(this);
- },
- function(err) {
- if (err) fail(err);
- else complete();
- }
- );
- }, true);
-
- // Create site task
- desc('Create the public site');
- task('site', function(releaseType) {
- console.log('Creating the public site page...');
- releaseTools.createSite(function(err) {
- if (err) fail();
- else complete();
- });
- }, true);
-
- // Publish task
- desc('Publish only the static site');
- task('publish-site', ['site'], function() {
- Step(
- // Update gh-pages branch
- function(err) {
- if (err) throw err;
- console.log('Merging changes into gh-pages branch...');
- releaseTools.updatePagesBranch(this);
- },
- // Push to GitHub
- function(err) {
- if (err) throw err;
- console.log('Pushing changes to GitHub...');
- releaseTools.pushToGit(this);
- },
- function(err){
- if (err) fail(err);
- else complete();
- }
- );
- }, true);
-
- // Publish task
- desc('Publish to GitHub and NPM the new version');
- task('publish', ['test'] , function() {
- Step(
- // Check if the `History.md` is modified
- // (to ensure that the `release:build` task has been already executed)
- function() {
- releaseTools.isWorkingCopyClean('History.md', this);
- },
-
- // Commit to Git
- function(err, result) {
- if (err) throw('Error while checking if the git tree is clean: ' + err);
- if (result) throw('You must run jake release:build before publish');
- console.log('Bumping version and creating git tag...');
- releaseTools.commitToGit(this);
- },
-
- // Update gh-pages branch
- function(err) {
- if (err) throw err;
- console.log('Merging changes into gh-pages branch...');
- releaseTools.updatePagesBranch(this);
- },
-
- // Push to GitHub
- function(err) {
- if (err) throw err;
- console.log('Pushing changes to GitHub...');
- releaseTools.pushToGit(this);
- },
-
- // Publish to NPM
- function(err) {
- if (err) throw err;
- console.log('Publishing NPM package...');
- releaseTools.npmPublish(this);
- },
- function(err){
- if (err) fail(err);
- else complete();
- }
- );
- }, true);
-
- // Update package.json task
- desc('Bump version in package.json');
- task('bump', function(releaseType) {
- releaseType = releaseType || 'patch';
- console.log('Bumping version in package.json...');
- releaseTools.updateVersionInPackageJson(releaseType, function(err, oldVersion, newVersion) {
- if (err) {
- return fail('Error while updating version in package.json: ' + err);
- }
- console.log(oldVersion + ' --> ' + newVersion);
- console.log('Done!');
- complete();
- });
- }, true);
-});
-
-desc('Default task is test');
-task('default', ['test'], function(){}, true);
View
18 README.md
@@ -21,7 +21,7 @@ in three different ways:
$ prettyjson package.json
```
-![Example 1](http://rafeca.com/prettyjson/images/example3.png)
+![Example 1](images/example3.png)
**Decode the stdin:** You can also pipe the result of a command (for example an HTTP request) to the CLI to see
the JSON result in a clearer way:
@@ -30,12 +30,12 @@ the JSON result in a clearer way:
$ curl https://api.github.com/users/rafeca | prettyjson
```
-![Example 2](http://rafeca.com/prettyjson/images/example4.png)
+![Example 2](images/example4.png)
**Decode random strings:** if you call the CLI with no arguments, you'll get a prompt where you can past JSON strings
and they'll be automatically displayed in a clearer way:
-![Example 3](http://rafeca.com/prettyjson/images/example5.png)
+![Example 3](images/example5.png)
If you install the package globally (with `npm install -g prettyjson`), the CLI will be installed automatically in your PATH
thanks to npm.
@@ -69,7 +69,7 @@ console.log(prettyjson.render(data));
And will output:
-![Example 4](http://rafeca.com/prettyjson/images/example1.png)
+![Example 4](images/example1.png)
You can also configure the colors of the hash keys and array dashes
(using [colors.js](https://github.com/Marak/colors.js) colors syntax):
@@ -93,18 +93,14 @@ console.log(prettyjson.render(data, {
Will output something like:
-![Example 5](http://rafeca.com/prettyjson/images/example2.png)
-
-## Annotated source
-
-You can check the [annotated source](http://rafeca.com/prettyjson/prettyjson.html) for more information about how it works
+![Example 5](images/example2.png)
## Running Tests
To run the test suite first invoke the following command within the repo, installing the development dependencies:
```bash
-$ npm install --dev
+$ npm install
```
then run the tests:
@@ -118,5 +114,3 @@ On windows, you can run the tests with:
```cmd
C:\git\prettyjson> npm run-script testwin
```
-
-You can check the package's [test coverage](http://rafeca.com/prettyjson/coverage.html) if you are one of those test paranoics
View
341 docs/coverage.html
@@ -1,341 +0,0 @@
-<!DOCTYPE html><html><head><title>Coverage</title><script>
-
-headings = [];
-
-onload = function(){
- headings = document.querySelectorAll('h2');
-};
-
-onscroll = function(e){
- var heading = find(window.scrollY);
- if (!heading) return;
- var links = document.querySelectorAll('#menu a')
- , link;
-
- for (var i = 0, len = links.length; i < len; ++i) {
- link = links[i];
- link.className = link.getAttribute('href') == '#' + heading.id
- ? 'active'
- : '';
- }
-};
-
-function find(y) {
- var i = headings.length
- , heading;
-
- while (i--) {
- heading = headings[i];
- if (y >= heading.offsetTop) {
- return heading;
- }
- }
-}
-</script>
-<style>
-
-body {
- font: 14px/1.6 "Helvetica Neue", Helvetica, Arial, sans-serif;
- margin: 0;
- color: #2C2C2C;
- border-top: 2px solid #ddd;
-}
-
-#coverage {
- padding: 60px;
-}
-
-h1 a {
- color: inherit;
- font-weight: inherit;
-}
-
-h1 a:hover {
- text-decoration: none;
-}
-
-.onload h1 {
- opacity: 1;
-}
-
-h2 {
- width: 80%;
- margin-top: 80px;
- margin-bottom: 0;
- font-weight: 100;
- letter-spacing: 1px;
- border-bottom: 1px solid #eee;
-}
-
-a {
- color: #8A6343;
- font-weight: bold;
- text-decoration: none;
-}
-
-a:hover {
- text-decoration: underline;
-}
-
-ul {
- margin-top: 20px;
- padding: 0 15px;
- width: 100%;
-}
-
-ul li {
- float: left;
- width: 40%;
- margin-top: 5px;
- margin-right: 60px;
- list-style: none;
- border-bottom: 1px solid #eee;
- padding: 5px 0;
- font-size: 12px;
-}
-
-ul::after {
- content: '.';
- height: 0;
- display: block;
- visibility: hidden;
- clear: both;
-}
-
-code {
- font: 12px monaco, monospace;
-}
-
-pre {
- margin: 30px;
- padding: 30px;
- border: 1px solid #eee;
- border-bottom-color: #ddd;
- -webkit-border-radius: 2px;
- -moz-border-radius: 2px;
- -webkit-box-shadow: inset 0 0 10px #eee;
- -moz-box-shadow: inset 0 0 10px #eee;
- overflow-x: auto;
-}
-
-img {
- margin: 30px;
- padding: 1px;
- -webkit-border-radius: 3px;
- -moz-border-radius: 3px;
- -webkit-box-shadow: 0 3px 10px #dedede, 0 1px 5px #888;
- -moz-box-shadow: 0 3px 10px #dedede, 0 1px 5px #888;
- max-width: 100%;
-}
-
-footer {
- background: #eee;
- width: 100%;
- padding: 50px 0;
- text-align: right;
- border-top: 1px solid #ddd;
-}
-
-footer span {
- display: block;
- margin-right: 30px;
- color: #888;
- font-size: 12px;
-}
-
-#menu {
- position: fixed;
- font-size: 12px;
- overflow-y: auto;
- top: 0;
- right: 0;
- margin: 0;
- height: 100%;
- padding: 15px 0;
- text-align: right;
- border-left: 1px solid #eee;
- -moz-box-shadow: 0 0 2px #888
- , inset 5px 0 20px rgba(0,0,0,.5)
- , inset 5px 0 3px rgba(0,0,0,.3);
- -webkit-box-shadow: 0 0 2px #888
- , inset 5px 0 20px rgba(0,0,0,.5)
- , inset 5px 0 3px rgba(0,0,0,.3);
- -webkit-font-smoothing: antialiased;
- background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGYAAABmCAMAAAAOARRQAAABelBMVEUjJSU6OzshIyM5OjoqKy02NjgsLS01NTYjJCUzNTUgISMlJSc0NTUvMDA6PDwlJyg1NjYoKis2NjYrLS02ODkpKyw0NDYrLC04ODovLzA4Ojo0NDUtLy86OjwjIyU4OTosLS82ODgtLS8hIyQvMTEnKCooKSsrKy0qLCwkJSUnKCkrLCwpKiwwMjIxMzMqLC0tLS0pKissLC00NTYwMDIwMTQpKysoKSovMDEtLzA2OTkxMzUrKywvLy8qKyszNTY5OzsqKiw6OjswMDExNDUoKiozNDUvMDIyNDY1Njg2Njk5OTozMzU0NjY4ODkiIyUiIyQ4OTkuMDEmKCowMjQwMTErLS4qKywwMTMhIiMpKiopKy0tLjAkJScxNDQvLzExNDYyNDQmKCk5OTslJig5OjskJSYxMzQrLS8gISIwMTIoKCk1NTUlJSUnJygwMDA4ODgiIiMhISI8PDw6Ojo5OTkpKSojIyQ7OzsyMjIpKSssLCw6Ozw1NjlrfLakAAAg2UlEQVR42jR6i3ea6rYvPgANIAhVXh8WvkQlioUiFlFcBtAmoiRNdzxqu9p0J7vrdK29zuPeex77nnvO/35n1r1ndHRktI0jTOacv/l7lCBK5UqVpOha/YxmWK7BC4TQFKVXrbYsnimqxuuMVlOQ0XltWjUdCwRJ1M+tC1KudOs9q6+da2adUewG0SC0SwELfHtgDds93VEuydEbl3QMWeNoYkR7b/0x1ZRobGI3mLwzAhePqTAwhg6aogjNsGy7/jwQ4rkdqe7CWLxF8k9LfMVFyRS7VJqtkrW8Vt/bkR8FZJao16ipkn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vjkm+nNSiEb7X/3fMjBL5A8PdgG+/FnbexbFFExmEfetXAnisEKy5z44WVPpQZjSy/jzeGn4yDRsFGqhh87QPaDBWhlo37IFbe/C0xynS91d2tP/AJoJS0sVF6iwAAAAAElFTkSuQmCC");
-}
-
-#menu::after {
- display: block;
- content: '';
- padding-top: 80px;
-}
-
-#logo {
- position: fixed;
- bottom: 10px;
- right: 10px;
- background: rgba(255,255,255,.1);
- font-size: 11px;
- display: block;
- width: 20px;
- height: 20px;
- line-height: 20px;
- text-align: center;
- -webkit-border-radius: 20px;
- -moz-border-radius: 20px;
- -webkit-box-shadow: 0 0 3px rgba(0,0,0,.2);
- -moz-box-shadow: 0 0 3px rgba(0,0,0,.2);
- color: inherit;
-}
-
-#menu li a {
- display: block;
- color: white;
- padding: 0 35px 0 25px;
- -webkit-transition: background 300ms;
- -moz-transition: background 300ms;
-}
-
-#menu li {
- position: relative;
- list-style: none;
-}
-
-#menu a:hover,
-#menu a.active {
- text-decoration: none;
- background: rgba(255,255,255,.1);
-}
-
-#menu li:hover .cov {
- opacity: 1;
-}
-
-#menu li .dirname {
- opacity: .60;
- padding-right: 2px;
-}
-
-#menu li .basename {
- opacity: 1;
-}
-
-#menu .cov {
- background: rgba(0,0,0,.4);
- position: absolute;
- top: 0;
- right: 8px;
- font-size: 9px;
- opacity: .6;
- text-align: left;
- width: 17px;
- -webkit-border-radius: 10px;
- -moz-border-radius: 10px;
- padding: 2px 3px;
- text-align: center;
-}
-
-#stats:nth-child(2n) {
- display: inline-block;
- margin-top: 15px;
- border: 1px solid #eee;
- padding: 10px;
- -webkit-box-shadow: inset 0 0 2px #eee;
- -moz-box-shadow: inset 0 0 2px #eee;
- -webkit-border-radius: 5px;
- -moz-border-radius: 5px;
-}
-
-#stats div {
- float: left;
- padding: 0 5px;
-}
-
-#stats::after {
- display: block;
- content: '';
- clear: both;
-}
-
-#stats .sloc::after {
- content: ' SLOC';
- color: #b6b6b6;
-}
-
-#stats .percentage::after {
- content: ' coverage';
- color: #b6b6b6;
-}
-
-#stats .hits,
-#stats .misses {
- display: none;
-}
-
-.high {
- color: #00d4b4;
-}
-.medium {
- color: #e87d0d;
-}
-.low {
- color: #d4081a;
-}
-.terrible {
- color: #d4081a;
- font-weight: bold;
-}
-
-table {
- width: 80%;
- margin-top: 10px;
- border-collapse: collapse;
- border: 1px solid #cbcbcb;
- color: #363636;
- -webkit-border-radius: 3px;
- -moz-border-radius: 3px;
-}
-
-table thead {
- display: none;
-}
-
-table td.line,
-table td.hits {
- width: 20px;
- background: #eaeaea;
- text-align: center;
- font-size: 11px;
- padding: 0 10px;
- color: #949494;
-}
-
-table td.hits {
- width: 10px;
- padding: 2px 5px;
- color: rgba(0,0,0,.2);
- background: #f0f0f0;
-}
-
-tr.miss td.line,
-tr.miss td.hits {
- background: #e6c3c7;
-}
-
-tr.miss td {
- background: #f8d5d8;
-}
-
-td.source {
- padding-left: 15px;
- line-height: 15px;
- white-space: pre;
- font: 12px monaco, monospace;
-}
-
-code .comment { color: #ddd }
-code .init { color: #2F6FAD }
-code .string { color: #5890AD }
-code .keyword { color: #8A6343 }
-code .number { color: #2F6FAD }
-</style></head><body><div id="coverage"><h1 id="overview">Coverage</h1><div id="menu"><li><a href="#overview">overview</a></li><li><span class="cov high">97</span><a href="#lib/prettyjson.js"><span class="dirname">lib/</span><span class="basename">prettyjson.js</span></a></li><li><span class="cov high">100</span><a href="#lib/utils.js"><span class="dirname">lib/</span><span class="basename">utils.js</span></a></li><a id="logo" href="http://visionmedia.github.com/mocha/">m</a></div><div id="stats" class="high"><div class="percentage">97%</div><div class="sloc">82</div><div class="hits">80</div><div class="misses">2</div></div><div id="files"><div class="file"><h2 id="lib/prettyjson.js">lib/prettyjson.js</h2><div id="stats" class="high"><div class="percentage">97%</div><div class="sloc">73</div><div class="hits">71</div><div class="misses">2</div></div><table id="source"><thead><tr><th>Line</th><th>Hits</th><th>Source</th></tr></thead><tbody><tr><td class="line">1</td><td class="hits"></td><td class="source">// Package for formatting JSON data in a coloured</td></tr><tr><td class="line">2</td><td class="hits"></td><td class="source">// YAML-style, perfect for CLI output</td></tr><tr><td class="line">3</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">4</td><td class="hits"></td><td class="source">// ### Export package</td></tr><tr class="hit"> <td class="line">5</td><td class="hits">1</td><td class="source">module.exports = exports;</td></tr><tr><td class="line">6</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">7</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">8</td><td class="hits"></td><td class="source">// ### Module dependencies</td></tr><tr class="hit"> <td class="line">9</td><td class="hits">1</td><td class="source">var colors = require('colors');</td></tr><tr class="hit"> <td class="line">10</td><td class="hits">1</td><td class="source">var Utils = require('./utils');</td></tr><tr class="hit"> <td class="line">11</td><td class="hits">1</td><td class="source">var fs = require('fs');</td></tr><tr><td class="line">12</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">13</td><td class="hits"></td><td class="source">// ### Package version</td></tr><tr class="hit"> <td class="line">14</td><td class="hits">1</td><td class="source">exports.version = JSON.parse(fs.readFileSync(__dirname + '/../package.json', 'utf8')).version;</td></tr><tr><td class="line">15</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">16</td><td class="hits"></td><td class="source">// ### Render function</td></tr><tr><td class="line">17</td><td class="hits"></td><td class="source">// *Parameters:*</td></tr><tr><td class="line">18</td><td class="hits"></td><td class="source">//</td></tr><tr><td class="line">19</td><td class="hits"></td><td class="source">// * **`data`**: Data to render</td></tr><tr><td class="line">20</td><td class="hits"></td><td class="source">// * **`options`**: Hash with different options to configure the parser</td></tr><tr><td class="line">21</td><td class="hits"></td><td class="source">// * **`indentation`**: Base indentation of the parsed output</td></tr><tr><td class="line">22</td><td class="hits"></td><td class="source">//</td></tr><tr><td class="line">23</td><td class="hits"></td><td class="source">// *Example of options hash:*</td></tr><tr><td class="line">24</td><td class="hits"></td><td class="source">//</td></tr><tr><td class="line">25</td><td class="hits"></td><td class="source">// {</td></tr><tr><td class="line">26</td><td class="hits"></td><td class="source">// emptyArrayMsg: '(empty)', // Rendered message on empty strings</td></tr><tr><td class="line">27</td><td class="hits"></td><td class="source">// keysColor: 'blue', // Color for keys in hashes</td></tr><tr><td class="line">28</td><td class="hits"></td><td class="source">// dashColor: 'red', // Color for the dashes in arrays</td></tr><tr><td class="line">29</td><td class="hits"></td><td class="source">// stringColor: 'grey', // Color for strings</td></tr><tr><td class="line">30</td><td class="hits"></td><td class="source">// defaultIndentation: 2 // Indentation on nested objects</td></tr><tr><td class="line">31</td><td class="hits"></td><td class="source">// }</td></tr><tr class="hit"> <td class="line">32</td><td class="hits">1</td><td class="source">exports.render = function render(data, options, indentation) {</td></tr><tr><td class="line">33</td><td class="hits"></td><td class="source"> &quot;use strict&quot;;</td></tr><tr><td class="line">34</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">35</td><td class="hits"></td><td class="source"> // Default value for the indentation param</td></tr><tr class="hit"> <td class="line">36</td><td class="hits">65</td><td class="source"> indentation = indentation || 0;</td></tr><tr><td class="line">37</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">38</td><td class="hits"></td><td class="source"> // Default values for the options</td></tr><tr class="hit"> <td class="line">39</td><td class="hits">65</td><td class="source"> options = options || {};</td></tr><tr class="hit"> <td class="line">40</td><td class="hits">65</td><td class="source"> options.emptyArrayMsg = options.emptyArrayMsg || '(empty array)';</td></tr><tr class="hit"> <td class="line">41</td><td class="hits">65</td><td class="source"> options.keysColor = options.keysColor || &quot;green&quot;;</td></tr><tr class="hit"> <td class="line">42</td><td class="hits">65</td><td class="source"> options.dashColor = options.dashColor || &quot;green&quot;;</td></tr><tr class="hit"> <td class="line">43</td><td class="hits">65</td><td class="source"> options.defaultIndentation = options.defaultIndentation || 2;</td></tr><tr><td class="line">44</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">45</td><td class="hits">65</td><td class="source"> options.stringColor = options.stringColor || null;</td></tr><tr><td class="line">46</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">47</td><td class="hits"></td><td class="source"> // Initialize the output (it's an array of lines)</td></tr><tr class="hit"> <td class="line">48</td><td class="hits">65</td><td class="source"> var output = [];</td></tr><tr><td class="line">49</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">50</td><td class="hits"></td><td class="source"> // Helper function to detect if an object can be serializable directly</td></tr><tr class="hit"> <td class="line">51</td><td class="hits">65</td><td class="source"> var isSerializable = function(input) {</td></tr><tr class="hit"> <td class="line">52</td><td class="hits">94</td><td class="source"> if (typeof input === 'string' || typeof input === 'boolean' ||</td></tr><tr><td class="line">53</td><td class="hits"></td><td class="source"> typeof input === 'number' || input === null) {</td></tr><tr class="hit"> <td class="line">54</td><td class="hits">64</td><td class="source"> return true;</td></tr><tr><td class="line">55</td><td class="hits"></td><td class="source"> }</td></tr><tr class="hit"> <td class="line">56</td><td class="hits">30</td><td class="source"> return false;</td></tr><tr><td class="line">57</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">58</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">59</td><td class="hits">65</td><td class="source"> var addColorToData = function(input) {</td></tr><tr class="hit"> <td class="line">60</td><td class="hits">41</td><td class="source"> if (typeof input === 'string') {</td></tr><tr><td class="line">61</td><td class="hits"></td><td class="source"> // Print strings in regular terminal color</td></tr><tr class="hit"> <td class="line">62</td><td class="hits">37</td><td class="source"> return options.stringColor ? input[options.stringColor] : input;</td></tr><tr><td class="line">63</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">64</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">65</td><td class="hits">4</td><td class="source"> if (input === true) {</td></tr><tr class="hit"> <td class="line">66</td><td class="hits">1</td><td class="source"> return (input+'').green;</td></tr><tr><td class="line">67</td><td class="hits"></td><td class="source"> }</td></tr><tr class="hit"> <td class="line">68</td><td class="hits">3</td><td class="source"> if (input === false) {</td></tr><tr class="hit"> <td class="line">69</td><td class="hits">1</td><td class="source"> return (input+'').red;</td></tr><tr><td class="line">70</td><td class="hits"></td><td class="source"> }</td></tr><tr class="hit"> <td class="line">71</td><td class="hits">2</td><td class="source"> if (input === null) {</td></tr><tr class="hit"> <td class="line">72</td><td class="hits">1</td><td class="source"> return (input+'').grey;</td></tr><tr><td class="line">73</td><td class="hits"></td><td class="source"> }</td></tr><tr class="hit"> <td class="line">74</td><td class="hits">1</td><td class="source"> if (typeof input === 'number') {</td></tr><tr class="hit"> <td class="line">75</td><td class="hits">1</td><td class="source"> return (input+'').blue;</td></tr><tr><td class="line">76</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"> <td class="line">77</td><td class="hits">0</td><td class="source"> return (input+'');</td></tr><tr><td class="line">78</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">79</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">80</td><td class="hits"></td><td class="source"> // Render a string exactly equal</td></tr><tr class="hit"> <td class="line">81</td><td class="hits">65</td><td class="source"> if (isSerializable(data)) {</td></tr><tr class="hit"> <td class="line">82</td><td class="hits">41</td><td class="source"> output.push(Utils.indent(indentation) + addColorToData(data));</td></tr><tr><td class="line">83</td><td class="hits"></td><td class="source"> }</td></tr><tr class="hit"> <td class="line">84</td><td class="hits">24</td><td class="source"> else if (Array.isArray(data)) {</td></tr><tr><td class="line">85</td><td class="hits"></td><td class="source"> // If the array is empty, render the `emptyArrayMsg`</td></tr><tr class="hit"> <td class="line">86</td><td class="hits">9</td><td class="source"> if (data.length === 0) {</td></tr><tr class="hit"> <td class="line">87</td><td class="hits">2</td><td class="source"> output.push(Utils.indent(indentation) + options.emptyArrayMsg);</td></tr><tr><td class="line">88</td><td class="hits"></td><td class="source"> } else {</td></tr><tr class="hit"> <td class="line">89</td><td class="hits">7</td><td class="source"> data.forEach(function(element) {</td></tr><tr><td class="line">90</td><td class="hits"></td><td class="source"> // Prepend the dash at the begining of each array's element line</td></tr><tr class="hit"> <td class="line">91</td><td class="hits">14</td><td class="source"> var line = Utils.indent(indentation) + ('- ')[options.dashColor];</td></tr><tr><td class="line">92</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">93</td><td class="hits"></td><td class="source"> // If the element of the array is a string, render it in the same line</td></tr><tr class="hit"> <td class="line">94</td><td class="hits">14</td><td class="source"> if (typeof element === 'string') {</td></tr><tr class="hit"> <td class="line">95</td><td class="hits">12</td><td class="source"> line += exports.render(element, options);</td></tr><tr class="hit"> <td class="line">96</td><td class="hits">12</td><td class="source"> output.push(line);</td></tr><tr><td class="line">97</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">98</td><td class="hits"></td><td class="source"> // If the element of the array is an array or object, render it in next line</td></tr><tr><td class="line">99</td><td class="hits"></td><td class="source"> } else {</td></tr><tr class="hit"> <td class="line">100</td><td class="hits">2</td><td class="source"> output.push(line);</td></tr><tr class="hit"> <td class="line">101</td><td class="hits">2</td><td class="source"> output.push(</td></tr><tr><td class="line">102</td><td class="hits"></td><td class="source"> exports.render(element, options, indentation + options.defaultIndentation)</td></tr><tr><td class="line">103</td><td class="hits"></td><td class="source"> );</td></tr><tr><td class="line">104</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">105</td><td class="hits"></td><td class="source"> });</td></tr><tr><td class="line">106</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">107</td><td class="hits"></td><td class="source"> }</td></tr><tr class="hit"> <td class="line">108</td><td class="hits">15</td><td class="source"> else if (typeof data === 'object') {</td></tr><tr><td class="line">109</td><td class="hits"></td><td class="source"> // Get the size of the longest index to render all the values on the same column</td></tr><tr class="hit"> <td class="line">110</td><td class="hits">15</td><td class="source"> var maxIndexLength = Utils.getMaxIndexLength(data);</td></tr><tr class="hit"> <td class="line">111</td><td class="hits">15</td><td class="source"> var key;</td></tr><tr><td class="line">112</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">113</td><td class="hits">15</td><td class="source"> for(var i in data) {</td></tr><tr class="hit"> <td class="line">114</td><td class="hits">30</td><td class="source"> if (data.hasOwnProperty(i)) {</td></tr><tr><td class="line">115</td><td class="hits"></td><td class="source"> // Prepend the index at the beginning of the line</td></tr><tr class="hit"> <td class="line">116</td><td class="hits">29</td><td class="source"> key = Utils.indent(indentation) + (i + ': ')[options.keysColor];</td></tr><tr><td class="line">117</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">118</td><td class="hits"></td><td class="source"> // If the value is serializable, render it in the same line</td></tr><tr class="hit"> <td class="line">119</td><td class="hits">29</td><td class="source"> if (isSerializable(data[i])) {</td></tr><tr class="hit"> <td class="line">120</td><td class="hits">23</td><td class="source"> key += exports.render(data[i], options, maxIndexLength - i.length);</td></tr><tr class="hit"> <td class="line">121</td><td class="hits">23</td><td class="source"> output.push(key);</td></tr><tr><td class="line">122</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">123</td><td class="hits"></td><td class="source"> // If the index is an array or object, render it in next line</td></tr><tr><td class="line">124</td><td class="hits"></td><td class="source"> } else {</td></tr><tr class="hit"> <td class="line">125</td><td class="hits">6</td><td class="source"> output.push(key);</td></tr><tr class="hit"> <td class="line">126</td><td class="hits">6</td><td class="source"> output.push(</td></tr><tr><td class="line">127</td><td class="hits"></td><td class="source"> exports.render(data[i], options, indentation + options.defaultIndentation)</td></tr><tr><td class="line">128</td><td class="hits"></td><td class="source"> );</td></tr><tr><td class="line">129</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">130</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">131</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">132</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">133</td><td class="hits"></td><td class="source"> // Return all the lines as a string</td></tr><tr class="hit"> <td class="line">134</td><td class="hits">65</td><td class="source"> return output.join('\n');</td></tr><tr><td class="line">135</td><td class="hits"></td><td class="source">};</td></tr><tr><td class="line">136</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">137</td><td class="hits"></td><td class="source">// ### Render from string function</td></tr><tr><td class="line">138</td><td class="hits"></td><td class="source">// *Parameters:*</td></tr><tr><td class="line">139</td><td class="hits"></td><td class="source">//</td></tr><tr><td class="line">140</td><td class="hits"></td><td class="source">// * **`data`**: Data to render as a string</td></tr><tr><td class="line">141</td><td class="hits"></td><td class="source">// * **`options`**: Hash with different options to configure the parser</td></tr><tr><td class="line">142</td><td class="hits"></td><td class="source">// * **`indentation`**: Base indentation of the parsed output</td></tr><tr><td class="line">143</td><td class="hits"></td><td class="source">//</td></tr><tr><td class="line">144</td><td class="hits"></td><td class="source">// *Example of options hash:*</td></tr><tr><td class="line">145</td><td class="hits"></td><td class="source">//</td></tr><tr><td class="line">146</td><td class="hits"></td><td class="source">// {</td></tr><tr><td class="line">147</td><td class="hits"></td><td class="source">// emptyArrayMsg: '(empty)', // Rendered message on empty strings</td></tr><tr><td class="line">148</td><td class="hits"></td><td class="source">// keysColor: 'blue', // Color for keys in hashes</td></tr><tr><td class="line">149</td><td class="hits"></td><td class="source">// dashColor: 'red', // Color for the dashes in arrays</td></tr><tr><td class="line">150</td><td class="hits"></td><td class="source">// defaultIndentation: 2 // Indentation on nested objects</td></tr><tr><td class="line">151</td><td class="hits"></td><td class="source">// }</td></tr><tr class="hit"> <td class="line">152</td><td class="hits">1</td><td class="source">exports.renderString = function renderString(data, options, indentation) {</td></tr><tr><td class="line">153</td><td class="hits"></td><td class="source"> &quot;use strict&quot;;</td></tr><tr><td class="line">154</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">155</td><td class="hits">7</td><td class="source"> var output = '';</td></tr><tr class="hit"> <td class="line">156</td><td class="hits">7</td><td class="source"> var parsedData;</td></tr><tr><td class="line">157</td><td class="hits"></td><td class="source"> // If the input is not a string or if it's empty, just return an empty string</td></tr><tr class="hit"> <td class="line">158</td><td class="hits">7</td><td class="source"> if (typeof data !== 'string' || data === '') {</td></tr><tr class="hit"> <td class="line">159</td><td class="hits">2</td><td class="source"> return '';</td></tr><tr><td class="line">160</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">161</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">162</td><td class="hits"></td><td class="source"> // Remove non-JSON characters from the beginning string</td></tr><tr class="hit"> <td class="line">163</td><td class="hits">5</td><td class="source"> if (data[0] !== '{' &amp;&amp; data[0] !== '[') {</td></tr><tr class="hit"> <td class="line">164</td><td class="hits">3</td><td class="source"> var beginingOfJson;</td></tr><tr class="hit"> <td class="line">165</td><td class="hits">3</td><td class="source"> if (data.indexOf('{') === -1) {</td></tr><tr class="hit"> <td class="line">166</td><td class="hits">2</td><td class="source"> beginingOfJson = data.indexOf('[');</td></tr><tr class="hit"> <td class="line">167</td><td class="hits">1</td><td class="source"> } else if (data.indexOf('[') === -1) {</td></tr><tr class="hit"> <td class="line">168</td><td class="hits">1</td><td class="source"> beginingOfJson = data.indexOf('{');</td></tr><tr><td class="line">169</td><td class="hits"></td><td class="source"> } else {</td></tr><tr class="miss"> <td class="line">170</td><td class="hits">0</td><td class="source"> beginingOfJson = data.indexOf('{') &lt; data.indexOf('[') ? data.indexOf('{') : data.indexOf('[');</td></tr><tr><td class="line">171</td><td class="hits"></td><td class="source"> }</td></tr><tr class="hit"> <td class="line">172</td><td class="hits">3</td><td class="source"> output += data.substr(0, beginingOfJson) + &quot;\n&quot;;</td></tr><tr class="hit"> <td class="line">173</td><td class="hits">3</td><td class="source"> data = data.substr(beginingOfJson);</td></tr><tr><td class="line">174</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">175</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">176</td><td class="hits">5</td><td class="source"> try {</td></tr><tr class="hit"> <td class="line">177</td><td class="hits">5</td><td class="source"> parsedData = JSON.parse(data);</td></tr><tr><td class="line">178</td><td class="hits"></td><td class="source"> } catch (e) {</td></tr><tr><td class="line">179</td><td class="hits"></td><td class="source"> // Return an error in case of an invalid JSON</td></tr><tr class="hit"> <td class="line">180</td><td class="hits">1</td><td class="source"> return 'Error:'.red + ' Not valid JSON!';</td></tr><tr><td class="line">181</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">182</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">183</td><td class="hits"></td><td class="source"> // Call the real render() method</td></tr><tr class="hit"> <td class="line">184</td><td class="hits">4</td><td class="source"> output += exports.render(parsedData, options);</td></tr><tr class="hit"> <td class="line">185</td><td class="hits">4</td><td class="source"> return output;</td></tr><tr><td class="line">186</td><td class="hits"></td><td class="source">};</td></tr><tr><td class="line">187</td><td class="hits"></td><td class="source"> </td></tr></tbody></table></div><div class="file"><h2 id="lib/utils.js">lib/utils.js</h2><div id="stats" class="high"><div class="percentage">100%</div><div class="sloc">9</div><div class="hits">9</div><div class="misses">0</div></div><table id="source"><thead><tr><th>Line</th><th>Hits</th><th>Source</th></tr></thead><tbody><tr><td class="line">1</td><td class="hits"></td><td class="source">&quot;use strict&quot;;</td></tr><tr><td class="line">2</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">3</td><td class="hits"></td><td class="source">/**</td></tr><tr><td class="line">4</td><td class="hits"></td><td class="source"> * Creates a string with the same length as `numSpaces` parameter</td></tr><tr><td class="line">5</td><td class="hits"></td><td class="source"> **/</td></tr><tr class="hit"> <td class="line">6</td><td class="hits">1</td><td class="source">exports.indent = function indent(numSpaces) {</td></tr><tr class="hit"> <td class="line">7</td><td class="hits">86</td><td class="source"> return new Array(numSpaces+1).join(' ');</td></tr><tr><td class="line">8</td><td class="hits"></td><td class="source">};</td></tr><tr><td class="line">9</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">10</td><td class="hits"></td><td class="source">/**</td></tr><tr><td class="line">11</td><td class="hits"></td><td class="source"> * Gets the string length of the longer index in a hash</td></tr><tr><td class="line">12</td><td class="hits"></td><td class="source"> **/</td></tr><tr class="hit"> <td class="line">13</td><td class="hits">1</td><td class="source">exports.getMaxIndexLength = function(input) {</td></tr><tr class="hit"> <td class="line">14</td><td class="hits">15</td><td class="source"> var maxWidth = 0;</td></tr><tr class="hit"> <td class="line">15</td><td class="hits">15</td><td class="source"> var key;</td></tr><tr><td class="line">16</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"> <td class="line">17</td><td class="hits">15</td><td class="source"> for (key in input) {</td></tr><tr class="hit"> <td class="line">18</td><td class="hits">30</td><td class="source"> if (input.hasOwnProperty(key) &amp;&amp; key.length &gt; maxWidth) {</td></tr><tr class="hit"> <td class="line">19</td><td class="hits">20</td><td class="source"> maxWidth = key.length;</td></tr><tr><td class="line">20</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">21</td><td class="hits"></td><td class="source"> }</td></tr><tr class="hit"> <td class="line">22</td><td class="hits">15</td><td class="source"> return maxWidth;</td></tr><tr><td class="line">23</td><td class="hits"></td><td class="source">};</td></tr><tr><td class="line">24</td><td class="hits"></td><td class="source"> </td></tr></tbody></table></div></div></div></body></html>
View
186 docs/docco.css
@@ -1,186 +0,0 @@
-/*--------------------- Layout and Typography ----------------------------*/
-body {
- font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif;
- font-size: 15px;
- line-height: 22px;
- color: #252519;
- margin: 0; padding: 0;
-}
-a {
- color: #261a3b;
-}
- a:visited {
- color: #261a3b;
- }
-p {
- margin: 0 0 15px 0;
-}
-h1, h2, h3, h4, h5, h6 {
- margin: 0px 0 15px 0;
-}
- h1 {
- margin-top: 40px;
- }
-#container {
- position: relative;
-}
-#background {
- position: fixed;
- top: 0; left: 525px; right: 0; bottom: 0;
- background: #f5f5ff;
- border-left: 1px solid #e5e5ee;
- z-index: -1;
-}
-#jump_to, #jump_page {
- background: white;
- -webkit-box-shadow: 0 0 25px #777; -moz-box-shadow: 0 0 25px #777;
- -webkit-border-bottom-left-radius: 5px; -moz-border-radius-bottomleft: 5px;
- font: 10px Arial;
- text-transform: uppercase;
- cursor: pointer;
- text-align: right;
-}
-#jump_to, #jump_wrapper {
- position: fixed;
- right: 0; top: 0;
- padding: 5px 10px;
-}
- #jump_wrapper {
- padding: 0;
- display: none;
- }
- #jump_to:hover #jump_wrapper {
- display: block;
- }
- #jump_page {
- padding: 5px 0 3px;
- margin: 0 0 25px 25px;
- }
- #jump_page .source {
- display: block;
- padding: 5px 10px;
- text-decoration: none;
- border-top: 1px solid #eee;
- }
- #jump_page .source:hover {
- background: #f5f5ff;
- }
- #jump_page .source:first-child {
- }
-table td {
- border: 0;
- outline: 0;
-}
- td.docs, th.docs {
- max-width: 450px;
- min-width: 450px;
- min-height: 5px;
- padding: 10px 25px 1px 50px;
- overflow-x: hidden;
- vertical-align: top;
- text-align: left;
- }
- .docs pre {
- margin: 15px 0 15px;
- padding-left: 15px;
- }
- .docs p tt, .docs p code {
- background: #f8f8ff;
- border: 1px solid #dedede;
- font-size: 12px;
- padding: 0 0.2em;
- }
- .pilwrap {
- position: relative;
- }
- .pilcrow {
- font: 12px Arial;
- text-decoration: none;
- color: #454545;
- position: absolute;
- top: 3px; left: -20px;
- padding: 1px 2px;
- opacity: 0;
- -webkit-transition: opacity 0.2s linear;
- }
- td.docs:hover .pilcrow {
- opacity: 1;
- }
- td.code, th.code {
- padding: 14px 15px 16px 25px;
- width: 100%;
- vertical-align: top;
- background: #f5f5ff;
- border-left: 1px solid #e5e5ee;
- }
- pre, tt, code {
- font-size: 12px; line-height: 18px;
- font-family: Monaco, Consolas, "Lucida Console", monospace;
- margin: 0; padding: 0;
- }
-
-
-/*---------------------- Syntax Highlighting -----------------------------*/
-td.linenos { background-color: #f0f0f0; padding-right: 10px; }
-span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
-body .hll { background-color: #ffffcc }
-body .c { color: #408080; font-style: italic } /* Comment */
-body .err { border: 1px solid #FF0000 } /* Error */
-body .k { color: #954121 } /* Keyword */
-body .o { color: #666666 } /* Operator */
-body .cm { color: #408080; font-style: italic } /* Comment.Multiline */
-body .cp { color: #BC7A00 } /* Comment.Preproc */
-body .c1 { color: #408080; font-style: italic } /* Comment.Single */
-body .cs { color: #408080; font-style: italic } /* Comment.Special */
-body .gd { color: #A00000 } /* Generic.Deleted */
-body .ge { font-style: italic } /* Generic.Emph */
-body .gr { color: #FF0000 } /* Generic.Error */
-body .gh { color: #000080; font-weight: bold } /* Generic.Heading */
-body .gi { color: #00A000 } /* Generic.Inserted */
-body .go { color: #808080 } /* Generic.Output */
-body .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
-body .gs { font-weight: bold } /* Generic.Strong */
-body .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
-body .gt { color: #0040D0 } /* Generic.Traceback */
-body .kc { color: #954121 } /* Keyword.Constant */
-body .kd { color: #954121; font-weight: bold } /* Keyword.Declaration */
-body .kn { color: #954121; font-weight: bold } /* Keyword.Namespace */
-body .kp { color: #954121 } /* Keyword.Pseudo */
-body .kr { color: #954121; font-weight: bold } /* Keyword.Reserved */
-body .kt { color: #B00040 } /* Keyword.Type */
-body .m { color: #666666 } /* Literal.Number */
-body .s { color: #219161 } /* Literal.String */
-body .na { color: #7D9029 } /* Name.Attribute */
-body .nb { color: #954121 } /* Name.Builtin */
-body .nc { color: #0000FF; font-weight: bold } /* Name.Class */
-body .no { color: #880000 } /* Name.Constant */
-body .nd { color: #AA22FF } /* Name.Decorator */
-body .ni { color: #999999; font-weight: bold } /* Name.Entity */
-body .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
-body .nf { color: #0000FF } /* Name.Function */
-body .nl { color: #A0A000 } /* Name.Label */
-body .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
-body .nt { color: #954121; font-weight: bold } /* Name.Tag */
-body .nv { color: #19469D } /* Name.Variable */
-body .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
-body .w { color: #bbbbbb } /* Text.Whitespace */
-body .mf { color: #666666 } /* Literal.Number.Float */
-body .mh { color: #666666 } /* Literal.Number.Hex */
-body .mi { color: #666666 } /* Literal.Number.Integer */
-body .mo { color: #666666 } /* Literal.Number.Oct */
-body .sb { color: #219161 } /* Literal.String.Backtick */
-body .sc { color: #219161 } /* Literal.String.Char */
-body .sd { color: #219161; font-style: italic } /* Literal.String.Doc */
-body .s2 { color: #219161 } /* Literal.String.Double */
-body .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
-body .sh { color: #219161 } /* Literal.String.Heredoc */
-body .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
-body .sx { color: #954121 } /* Literal.String.Other */
-body .sr { color: #BB6688 } /* Literal.String.Regex */
-body .s1 { color: #219161 } /* Literal.String.Single */
-body .ss { color: #19469D } /* Literal.String.Symbol */
-body .bp { color: #954121 } /* Name.Builtin.Pseudo */
-body .vc { color: #19469D } /* Name.Variable.Class */
-body .vg { color: #19469D } /* Name.Variable.Global */
-body .vi { color: #19469D } /* Name.Variable.Instance */
-body .il { color: #666666 } /* Literal.Number.Integer.Long */
View
BIN  docs/images/example1.png
Deleted file not rendered
View
BIN  docs/images/example2.png
Deleted file not rendered
View
BIN  docs/images/example3.png
Deleted file not rendered
View
BIN  docs/images/example4.png
Deleted file not rendered
View
BIN  docs/images/example5.png
Deleted file not rendered
View
BIN  docs/images/github-logo.png
Deleted file not rendered
View
BIN  docs/images/gmail-logo.png
Deleted file not rendered
View
BIN  docs/images/linkedin-logo.png
Deleted file not rendered
View
BIN  docs/images/twitter-logo.png
Deleted file not rendered
View
366 docs/index.html
@@ -1,366 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>prettyjson - Node.js package for formatting JSON data in a coloured YAML-style, perfect for CLI output</title>
-
- <meta http-equiv="content-type" content="text/html; charset=UTF-8">
- <link rel="stylesheet" media="all" href="docco.css" />
- <link rel="stylesheet" media="all" href="stylesheets/syntax.css" />
- <link rel="stylesheet" media="all" href="stylesheets/main.css" />
-
- <script type="text/javascript" src="javascripts/highlight.pack.js"></script>
-
- <script type="text/javascript">
- var _gaq = _gaq || [];
- _gaq.push(['_setAccount', 'UA-6212472-4']);
- _gaq.push(['_trackPageview']);
-
- (function() {
- var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
- })();
- </script>
- </head>
-
- <body>
-
- <a class="forkme" href="http://github.com/rafeca/prettyjson">
- <img src="https://a248.e.akamai.net/assets.github.com/img/e6bef7a091f5f3138b8cd40bc3e114258dd68ddf/687474703a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f7265645f6161303030302e706e67" alt="Fork me on GitHub">
- </a>
-
- <div id="container">
-
- <h1>prettyjson <a href="http://travis-ci.org/rafeca/prettyjson"><img src="https://secure.travis-ci.org/rafeca/prettyjson.png" alt="Build Status"></a> <a href="http://badge.fury.io/js/prettyjson"><img src="https://badge.fury.io/js/prettyjson.png" alt="NPM version"></a></h1>
-<p>Package for formatting JSON data in a coloured YAML-style, perfect for CLI output.
-
-</p>
-<h2>How to install</h2>
-<p>Just install it via NPM:
-
-</p>
-<pre><code class="lang-bash">$ npm install prettyjson</code></pre>
-<h2>Using it (from the CLI)</h2>
-<p>This package installs a command line interface to render JSON data in a more convenient way. You can use the CLI
-in three different ways:
-
-</p>
-<p><strong>Decode a JSON file:</strong> If you want to see the contents of a JSON file, just pass it as the first argument to the CLI:
-
-</p>
-<pre><code class="lang-bash">$ prettyjson package.json</code></pre>
-<p><img src="http://rafeca.com/prettyjson/images/example3.png" alt="Example 1">
-
-</p>
-<p><strong>Decode the stdin:</strong> You can also pipe the result of a command (for example an HTTP request) to the CLI to see
-the JSON result in a clearer way:
-
-</p>
-<pre><code class="lang-bash">$ curl https://api.github.com/users/rafeca | prettyjson</code></pre>
-<p><img src="http://rafeca.com/prettyjson/images/example4.png" alt="Example 2">
-
-</p>
-<p><strong>Decode random strings:</strong> if you call the CLI with no arguments, you&#39;ll get a prompt where you can past JSON strings
-and they&#39;ll be automatically displayed in a clearer way:
-
-</p>
-<p><img src="http://rafeca.com/prettyjson/images/example5.png" alt="Example 3">
-
-</p>
-<p>If you install the package globally (with <code>npm install -g prettyjson</code>), the CLI will be installed automatically in your PATH
-thanks to npm.
-
-</p>
-<h3>Customizing colors via command line</h3>
-<p>Now it&#39;s possible to customize the colors of the output via environment variables, thanks to @bahamas10:
-
-</p>
-<pre><code class="lang-bash">$ PRETTYJSON_KEYS=red PRETTYJSON_DASH=blue PRETTYJSON_STRING=yellow prettyjson package.json</code></pre>
-<p>The available options are <code>PRETTYJSON_KEYS</code>, <code>PRETTYJSON_DASH</code>, <code>PRETTYJSON_STRING</code> and <code>PRETTYJSON_INDENT</code>.
-
-</p>
-<h2>Using it (from Node.js)</h2>
-<p>It&#39;s pretty easy to use it... you just have to include it in your script and call the <code>render()</code> method:
-
-</p>
-<pre><code class="lang-javascript">var prettyjson = require(&#39;prettyjson&#39;);
-
-var data = {
- username: &#39;rafeca&#39;,
- url: &#39;https://github.com/rafeca&#39;,
- twitter_account: &#39;https://twitter.com/rafeca&#39;,
- projects: [&#39;prettyprint&#39;, &#39;connfu&#39;]
-};
-
-console.log(prettyjson.render(data));</code></pre>
-<p>And will output:
-
-</p>
-<p><img src="http://rafeca.com/prettyjson/images/example1.png" alt="Example 4">
-
-</p>
-<p>You can also configure the colors of the hash keys and array dashes
-(using <a href="https://github.com/Marak/colors.js">colors.js</a> colors syntax):
-
-</p>
-<pre><code class="lang-javascript">var prettyjson = require(&#39;prettyjson&#39;);
-
-var data = {
- username: &#39;rafeca&#39;,
- url: &#39;https://github.com/rafeca&#39;,
- twitter_account: &#39;https://twitter.com/rafeca&#39;,
- projects: [&#39;prettyprint&#39;, &#39;connfu&#39;]
-};
-
-console.log(prettyjson.render(data, {
- keysColor: &#39;rainbow&#39;,
- dashColor: &#39;magenta&#39;,
- stringColor: &#39;white&#39;
-}));</code></pre>
-<p>Will output something like:
-
-</p>
-<p><img src="http://rafeca.com/prettyjson/images/example2.png" alt="Example 5">
-
-</p>
-<h2>Annotated source</h2>
-<p>You can check the <a href="http://rafeca.com/prettyjson/prettyjson.html">annotated source</a> for more information about how it works
-
-</p>
-<h2>Running Tests</h2>
-<p>To run the test suite first invoke the following command within the repo, installing the development dependencies:
-
-</p>
-<pre><code class="lang-bash">$ npm install --dev</code></pre>
-<p>then run the tests:
-
-</p>
-<pre><code class="lang-bash">$ npm test</code></pre>
-<p>You can check the package&#39;s <a href="http://rafeca.com/prettyjson/coverage.html">test coverage</a> if you are one of those test paranoics
-</p>
-
-
- <h2>Change Log</h2>
-
- <h3>0.9.0 — <em>October 4, 2013</em></h3>
-<ul>
-<li>Checks for hasOwnProperty in function render (by @dlight)</li>
-</ul>
-<h3>0.8.1 — <em>March 11, 2013</em></h3>
-<ul>
-<li>Add compatibility for Node.js 0.10.0</li>
-<li>Update dependencies</li>
-</ul>
-<h3>0.8.0 — <em>February 23, 2013</em></h3>
-<ul>
-<li>Fix: ENV vars were not being used correctly</li>
-<li>Add an option to change the color of the strings</li>
-<li>Minor codestyle improvements</li>
-</ul>
-<h3>0.7.1 — <em>October 29, 2012</em></h3>
-<ul>
-<li>Fix bug in 0.7.0 when input is an array</li>
-</ul>
-<h3>0.7.0 — <em>October 25, 2012</em></h3>
-<ul>
-<li>Allow having non-JSON characters at the beginning of the input string (ideal for curl -i)</li>
-<li>Add a renderString() method to be used by the CLI</li>
-<li>Change test reporter style to spec</li>
-<li>Upgrade dependencies to the last versions</li>
-</ul>
-<h3>0.6.0 — <em>June 29, 2012</em></h3>
-<ul>
-<li>Update dependencies to support Node.js v0.8</li>
-<li>Adding ability to use environmental variables</li>
-</ul>
-<h3>0.5.0 — <em>June 24, 2012</em></h3>
-<ul>
-<li>Updated dependencies, added support for Node.js up to 0.7.12</li>
-<li>Minor improvements in README file</li>
-<li>Add JSHint to the build process</li>
-<li>Add jake task to execute tests automatically</li>
-<li>Add test coverage info</li>
-</ul>
-<h3>0.4.0 — <em>February 24, 2012</em></h3>
-<ul>
-<li>Now prettyjson uses Mocha test framework instead of jasmine-node</li>
-<li>Fixed leak in a &quot;key&quot; variable</li>
-</ul>
-<h3>0.3.1 — <em>February 15, 2012</em></h3>
-<ul>
-<li>Modified website design</li>
-<li>Modify webpage link in package.json</li>
-</ul>
-<h3>0.3.0 — <em>January 24, 2012</em></h3>
-<ul>
-<li>Added CLI interface</li>
-<li>Now prettyjson package requires Nodejs 0.6.x</li>
-</ul>
-<h3>0.2.1 — <em>January 23, 2012</em></h3>
-<ul>
-<li>Fix: Bug when the JSON has attributes with booleans, integers or null values</li>
-</ul>
-<h3>0.2.0 — <em>January 22, 2012</em></h3>
-<ul>
-<li>Now using node-releasetools for the release process</li>
-<li>Disabled Node.js 0.6 from Travis CI temporally</li>
-<li>Minor copy in Readme.md</li>
-</ul>
-<h3>0.1.4 — <em>December 1, 2011</em></h3>
-<ul>
-<li>Added contributors to the Readme file</li>
-</ul>
-<h3>0.1.3 — <em>November 17, 2011</em></h3>
-<ul>
-<li>Fixed the GitHub publishing of tags in the jake task</li>
-<li>Updated package.json to make it compatible with Node.js 0.6.x</li>
-<li>Updated travis YAML file to use the new Node.js support on Travis</li>
-</ul>
-<h3>0.1.2 — <em>November 14, 2011</em></h3>
-<ul>
-<li>Updated Jakefile with tasks to automate publishing new versions</li>
-</ul>
-<h3>0.1.1 — <em>October 11, 2011</em></h3>
-<ul>
-<li>Added changelog jake task to add changelog automatically</li>
-<li>The library version is retrieved from <code>package.json</code> file</li>
-</ul>
-<h3>0.1.0 — <em>October 10, 2011</em></h3>
-<ul>
-<li>Initial release</li>
-</ul>
-
-
- <h2>Contributors</h2>
-
- <ul>
-<li>Rafael de Oleza <a href="&#109;&#97;&#x69;&#108;&#x74;&#x6f;&#58;&#x72;&#x61;&#102;&#101;&#99;&#97;&#64;&#x67;&#x6d;&#x61;&#105;&#x6c;&#46;&#x63;&#x6f;&#x6d;">&#x72;&#x61;&#102;&#101;&#99;&#97;&#64;&#x67;&#x6d;&#x61;&#105;&#x6c;&#46;&#x63;&#x6f;&#x6d;</a></li>
-<li>Dave Eddy <a href="&#109;&#97;&#x69;&#108;&#x74;&#x6f;&#58;&#100;&#x61;&#118;&#x65;&#x40;&#x64;&#97;&#x76;&#101;&#x65;&#x64;&#x64;&#x79;&#46;&#99;&#111;&#x6d;">&#100;&#x61;&#118;&#x65;&#x40;&#x64;&#97;&#x76;&#101;&#x65;&#x64;&#x64;&#x79;&#46;&#99;&#111;&#x6d;</a></li>
-<li>Elias Amaral <a href="&#x6d;&#x61;&#105;&#108;&#116;&#111;&#x3a;&#116;&#111;&#x6c;&#107;&#x69;&#101;&#110;&#x64;&#105;&#108;&#105;&#64;&#x67;&#x6d;&#97;&#105;&#x6c;&#46;&#99;&#x6f;&#109;">&#116;&#111;&#x6c;&#107;&#x69;&#101;&#110;&#x64;&#105;&#108;&#105;&#64;&#x67;&#x6d;&#97;&#105;&#x6c;&#46;&#99;&#x6f;&#109;</a></li>
-<li>jiyinyiyong <a href="&#109;&#97;&#x69;&#108;&#116;&#111;&#58;&#106;&#x69;&#121;&#105;&#x6e;&#121;&#105;&#x79;&#x6f;&#110;&#x67;&#64;&#x67;&#109;&#x61;&#105;&#x6c;&#x2e;&#x63;&#111;&#x6d;">&#106;&#x69;&#121;&#105;&#x6e;&#121;&#105;&#x79;&#x6f;&#110;&#x67;&#64;&#x67;&#109;&#x61;&#105;&#x6c;&#x2e;&#x63;&#111;&#x6d;</a></li>
-</ul>
-
-
- <h2>How to contribute</h2>
-
- <p>Good pull requests - patches, improvements, new features - are a fantastic
-help.
-
-</p>
-<p>If you&#39;ve spotted any small, obvious errors and want to help out by patching it,
-that will be much appreciated.
-
-</p>
-<p>If your contribution involves a significant amount of work or substantial
-changes to any part of the project, please open a &quot;contribution enquiry&quot; issue
-first to check that the work is wanted or matches the goals of the project.
-
-</p>
-<p>All pull requests should remain focused in scope and avoid containing unrelated
-commits.
-
-</p>
-<p>Please follow this process; it&#39;s the best way to get your work included in the
-project:
-
-</p>
-<ol>
-<li><p><a href="http://help.github.com/fork-a-repo/">Fork</a> the project.</p>
-</li>
-<li><p>Clone your fork (<code>git clone
-git@github.com:&lt;your-username&gt;/&lt;repo-name&gt;.git</code>).</p>
-</li>
-<li><p>Add an <code>upstream</code> remote (<code>git remote add upstream
-git://github.com/&lt;upsteam-owner&gt;/&lt;repo-name&gt;.git</code>).</p>
-</li>
-<li><p>Get the latest changes from upstream (e.g. <code>git pull upstream
-&lt;dev-branch&gt;</code>).</p>
-</li>
-<li><p>Create a new topic branch to contain your feature, change, or fix (<code>git
-checkout -b &lt;topic-branch-name&gt;</code>).</p>
-</li>
-<li><p>Create the needed tests to ensure that your contribution is not broken in the future.
-If you are creating a small fix or patch to an existing feature, just a simple test
-will do, if it is a brand new feature, make sure to create a new test suite.</p>
-</li>
-<li><p>Make sure that your changes adhere to the current coding conventions used
-throughout the project - indentation, accurate comments, etc.</p>
-</li>
-<li><p>Commit your changes in logical chunks; use git&#39;s <a href="https://help.github.com/articles/interactive-rebase">interactive
-rebase</a> feature to tidy
-up your commits before making them public. Please adhere to these <a href="http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html">git commit
-message guidelines</a>
-or your pull request is unlikely be merged into the main project.</p>
-</li>
-<li><p>Locally merge (or rebase) the upstream branch into your topic branch.</p>
-</li>
-<li><p>Push your topic branch up to your fork (<code>git push origin
-&lt;topic-branch-name&gt;</code>).</p>
-</li>
-<li><p><a href="http://help.github.com/send-pull-requests/">Open a Pull Request</a> with a
-clear title and description.</p>
-</li>
-</ol>
-<p>If you have any other questions about contributing, please feel free to contact
-me.</p>
-
-
- <h2>License</h2>
-
- <p>(The MIT License)
-
-</p>
-<p>Copyright (c) 2011 Rafael de Oleza <a href="&#x6d;&#97;&#105;&#x6c;&#116;&#x6f;&#58;&#114;&#97;&#102;&#x65;&#99;&#x61;&#64;&#103;&#109;&#x61;&#x69;&#x6c;&#46;&#99;&#111;&#109;">&#114;&#97;&#102;&#x65;&#99;&#x61;&#64;&#103;&#109;&#x61;&#x69;&#x6c;&#46;&#99;&#111;&#109;</a>
-
-</p>
-<p>Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-&#39;Software&#39;), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-</p>
-<p>The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-</p>
-<p>THE SOFTWARE IS PROVIDED &#39;AS IS&#39;, WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-</p>
-
-
- </div>
-
- <div id="footer">
- <a href="http://rafeca.com"><span>Rafael de Oleza &mdash; rafeca</span></a>
- <a class="fadedlink" href="https://github.com/rafeca"><img src="images/github-logo.png" alt="@github"></a>
- <a class="fadedlink" href="https://twitter.com/rafeca"><img src="images/twitter-logo.png" alt="@twitter"></a>
- <a class="fadedlink" href="http://linkedin.com/in/rafeca"><img src="images/linkedin-logo.png" alt="@linkedin"></a>
- <a class="fadedlink" href="mailto:rafeca@gmail.com"><img src="images/gmail-logo.png" alt="@gmail"></a>
- </div>
-
- <script type="text/javascript">
- var codes = document.getElementsByTagName('code');
- for (var i=0;i<codes.length;i++) {
- if (codes[i].className.indexOf('lang-') === 0) {
- codes[i].className = codes[i].className.slice('lang-'.length);
- }
-
- switch(codes[i].className) {
- case 'js':
- codes[i].className = 'javascript';
- break;
- }
- }
- hljs.initHighlightingOnLoad();
- </script>
- </body>
-</html>
View
1  docs/javascripts/highlight.pack.js
@@ -1 +0,0 @@
-var hljs=new function(){function m(p){return p.replace(/&/gm,"&amp;").replace(/</gm,"&lt;")}function f(r,q,p){return RegExp(q,"m"+(r.cI?"i":"")+(p?"g":""))}function b(r){for(var p=0;p<r.childNodes.length;p++){var q=r.childNodes[p];if(q.nodeName=="CODE"){return q}if(!(q.nodeType==3&&q.nodeValue.match(/\s+/))){break}}}function h(t,s){var p="";for(var r=0;r<t.childNodes.length;r++){if(t.childNodes[r].nodeType==3){var q=t.childNodes[r].nodeValue;if(s){q=q.replace(/\n/g,"")}p+=q}else{if(t.childNodes[r].nodeName=="BR"){p+="\n"}else{p+=h(t.childNodes[r])}}}if(/MSIE [678]/.test(navigator.userAgent)){p=p.replace(/\r/g,"\n")}return p}function a(s){var r=s.className.split(/\s+/);r=r.concat(s.parentNode.className.split(/\s+/));for(var q=0;q<r.length;q++){var p=r[q].replace(/^language-/,"");if(e[p]||p=="no-highlight"){return p}}}function c(r){var p=[];(function q(t,u){for(var s=0;s<t.childNodes.length;s++){if(t.childNodes[s].nodeType==3){u+=t.childNodes[s].nodeValue.length}else{if(t.childNodes[s].nodeName=="BR"){u+=1}else{if(t.childNodes[s].nodeType==1){p.push({event:"start",offset:u,node:t.childNodes[s]});u=q(t.childNodes[s],u);p.push({event:"stop",offset:u,node:t.childNodes[s]})}}}}return u})(r,0);return p}function k(y,w,x){var q=0;var z="";var s=[];function u(){if(y.length&&w.length){if(y[0].offset!=w[0].offset){return(y[0].offset<w[0].offset)?y:w}else{return w[0].event=="start"?y:w}}else{return y.length?y:w}}function t(D){var A="<"+D.nodeName.toLowerCase();for(var B=0;B<D.attributes.length;B++){var C=D.attributes[B];A+=" "+C.nodeName.toLowerCase();if(C.value!==undefined&&C.value!==false&&C.value!==null){A+='="'+m(C.value)+'"'}}return A+">"}while(y.length||w.length){var v=u().splice(0,1)[0];z+=m(x.substr(q,v.offset-q));q=v.offset;if(v.event=="start"){z+=t(v.node);s.push(v.node)}else{if(v.event=="stop"){var p,r=s.length;do{r--;p=s[r];z+=("</"+p.nodeName.toLowerCase()+">")}while(p!=v.node);s.splice(r,1);while(r<s.length){z+=t(s[r]);r++}}}}return z+m(x.substr(q))}function j(){function q(w,y,u){if(w.compiled){return}var s=[];if(w.k){var r={};function x(D,C){var A=C.split(" ");for(var z=0;z<A.length;z++){var B=A[z].split("|");r[B[0]]=[D,B[1]?Number(B[1]):1];s.push(B[0])}}w.lR=f(y,w.l||hljs.IR,true);if(typeof w.k=="string"){x("keyword",w.k)}else{for(var v in w.k){if(!w.k.hasOwnProperty(v)){continue}x(v,w.k[v])}}w.k=r}if(!u){if(w.bWK){w.b="\\b("+s.join("|")+")\\s"}w.bR=f(y,w.b?w.b:"\\B|\\b");if(!w.e&&!w.eW){w.e="\\B|\\b"}if(w.e){w.eR=f(y,w.e)}}if(w.i){w.iR=f(y,w.i)}if(w.r===undefined){w.r=1}if(!w.c){w.c=[]}w.compiled=true;for(var t=0;t<w.c.length;t++){if(w.c[t]=="self"){w.c[t]=w}q(w.c[t],y,false)}if(w.starts){q(w.starts,y,false)}}for(var p in e){if(!e.hasOwnProperty(p)){continue}q(e[p].dM,e[p],true)}}function d(D,E){if(!j.called){j();j.called=true}function s(r,O){for(var N=0;N<O.c.length;N++){var M=O.c[N].bR.exec(r);if(M&&M.index==0){return O.c[N]}}}function w(M,r){if(p[M].e&&p[M].eR.test(r)){return 1}if(p[M].eW){var N=w(M-1,r);return N?N+1:0}return 0}function x(r,M){return M.i&&M.iR.test(r)}function L(O,P){var N=[];for(var M=0;M<O.c.length;M++){N.push(O.c[M].b)}var r=p.length-1;do{if(p[r].e){N.push(p[r].e)}r--}while(p[r+1].eW);if(O.i){N.push(O.i)}return N.length?f(P,N.join("|"),true):null}function q(N,M){var O=p[p.length-1];if(O.t===undefined){O.t=L(O,F)}var r;if(O.t){O.t.lastIndex=M;r=O.t.exec(N)}return r?[N.substr(M,r.index-M),r[0],false]:[N.substr(M),"",true]}function A(O,r){var M=F.cI?r[0].toLowerCase():r[0];var N=O.k[M];if(N&&N instanceof Array){return N}return false}function G(M,Q){M=m(M);if(!Q.k){return M}var r="";var P=0;Q.lR.lastIndex=0;var N=Q.lR.exec(M);while(N){r+=M.substr(P,N.index-P);var O=A(Q,N);if(O){y+=O[1];r+='<span class="'+O[0]+'">'+N[0]+"</span>"}else{r+=N[0]}P=Q.lR.lastIndex;N=Q.lR.exec(M)}return r+M.substr(P)}function B(M,N){var r;if(N.sL==""){r=g(M)}else{r=d(N.sL,M)}if(N.r>0){y+=r.keyword_count;C+=r.r}return'<span class="'+r.language+'">'+r.value+"</span>"}function K(r,M){if(M.sL&&e[M.sL]||M.sL==""){return B(r,M)}else{return G(r,M)}}function J(N,r){var M=N.cN?'<span class="'+N.cN+'">':"";if(N.rB){z+=M;N.buffer=""}else{if(N.eB){z+=m(r)+M;N.buffer=""}else{z+=M;N.buffer=r}}p.push(N);C+=N.r}function H(O,N,R){var S=p[p.length-1];if(R){z+=K(S.buffer+O,S);return false}var Q=s(N,S);if(Q){z+=K(S.buffer+O,S);J(Q,N);return Q.rB}var M=w(p.length-1,N);if(M){var P=S.cN?"</span>":"";if(S.rE){z+=K(S.buffer+O,S)+P}else{if(S.eE){z+=K(S.buffer+O,S)+P+m(N)}else{z+=K(S.buffer+O+N,S)+P}}while(M>1){P=p[p.length-2].cN?"</span>":"";z+=P;M--;p.length--}var r=p[p.length-1];p.length--;p[p.length-1].buffer="";if(r.starts){J(r.starts,"")}return S.rE}if(x(N,S)){throw"Illegal"}}var F=e[D];var p=[F.dM];var C=0;var y=0;var z="";try{var t,v=0;F.dM.buffer="";do{t=q(E,v);var u=H(t[0],t[1],t[2]);v+=t[0].length;if(!u){v+=t[1].length}}while(!t[2]);return{r:C,keyword_count:y,value:z,language:D}}catch(I){if(I=="Illegal"){return{r:0,keyword_count:0,value:m(E)}}else{throw I}}}function g(t){var p={keyword_count:0,r:0,value:m(t)};var r=p;for(var q in e){if(!e.hasOwnProperty(q)){continue}var s=d(q,t);s.language=q;if(s.keyword_count+s.r>r.keyword_count+r.r){r=s}if(s.keyword_count+s.r>p.keyword_count+p.r){r=p;p=s}}if(r.language){p.second_best=r}return p}function i(r,q,p){if(q){r=r.replace(/^((<[^>]+>|\t)+)/gm,function(t,w,v,u){return w.replace(/\t/g,q)})}if(p){r=r.replace(/\n/g,"<br>")}return r}function n(t,w,r){var x=h(t,r);var v=a(t);var y,s;if(v=="no-highlight"){return}if(v){y=d(v,x)}else{y=g(x);v=y.language}var q=c(t);if(q.length){s=document.createElement("pre");s.innerHTML=y.value;y.value=k(q,c(s),x)}y.value=i(y.value,w,r);var u=t.className;if(!u.match("(\\s|^)(language-)?"+v+"(\\s|$)")){u=u?(u+" "+v):v}if(/MSIE [678]/.test(navigator.userAgent)&&t.tagName=="CODE"&&t.parentNode.tagName=="PRE"){s=t.parentNode;var p=document.createElement("div");p.innerHTML="<pre><code>"+y.value+"</code></pre>";t=p.firstChild.firstChild;p.firstChild.cN=s.cN;s.parentNode.replaceChild(p.firstChild,s)}else{t.innerHTML=y.value}t.className=u;t.result={language:v,kw:y.keyword_count,re:y.r};if(y.second_best){t.second_best={language:y.second_best.language,kw:y.second_best.keyword_count,re:y.second_best.r}}}function o(){if(o.called){return}o.called=true;var r=document.getElementsByTagName("pre");for(var p=0;p<r.length;p++){var q=b(r[p]);if(q){n(q,hljs.tabReplace)}}}function l(){if(window.addEventListener){window.addEventListener("DOMContentLoaded",o,false);window.addEventListener("load",o,false)}else{if(window.attachEvent){window.attachEvent("onload",o)}else{window.onload=o}}}var e={};this.LANGUAGES=e;this.highlight=d;this.highlightAuto=g;this.fixMarkup=i;this.highlightBlock=n;this.initHighlighting=o;this.initHighlightingOnLoad=l;this.IR="[a-zA-Z][a-zA-Z0-9_]*";this.UIR="[a-zA-Z_][a-zA-Z0-9_]*";this.NR="\\b\\d+(\\.\\d+)?";this.CNR="\\b(0[xX][a-fA-F0-9]+|(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)";this.BNR="\\b(0b[01]+)";this.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|\\.|-|-=|/|/=|:|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~";this.BE={b:"\\\\.",r:0};this.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[this.BE],r:0};this.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[this.BE],r:0};this.CLCM={cN:"comment",b:"//",e:"$"};this.CBLCLM={cN:"comment",b:"/\\*",e:"\\*/"};this.HCM={cN:"comment",b:"#",e:"$"};this.NM={cN:"number",b:this.NR,r:0};this.CNM={cN:"number",b:this.CNR,r:0};this.BNM={cN:"number",b:this.BNR,r:0};this.inherit=function(r,s){var p={};for(var q in r){p[q]=r[q]}if(s){for(var q in s){p[q]=s[q]}}return p}}();hljs.LANGUAGES.bash=function(a){var f="true false";var c={cN:"variable",b:"\\$([a-zA-Z0-9_]+)\\b"};var b={cN:"variable",b:"\\$\\{(([^}])|(\\\\}))+\\}",c:[a.CNM]};var g={cN:"string",b:'"',e:'"',i:"\\n",c:[a.BE,c,b],r:0};var d={cN:"string",b:"'",e:"'",c:[{b:"''"}],r:0};var e={cN:"test_condition",b:"",e:"",c:[g,d,c,b,a.CNM],k:{literal:f},r:0};return{dM:{k:{keyword:"if then else fi for break continue while in do done echo exit return set declare",literal:f},c:[{cN:"shebang",b:"(#!\\/bin\\/bash)|(#!\\/bin\\/sh)",r:10},c,b,a.HCM,a.CNM,g,d,a.inherit(e,{b:"\\[ ",e:" \\]",r:0}),a.inherit(e,{b:"\\[\\[ ",e:" \\]\\]"})]}}}(hljs);hljs.LANGUAGES.ini=function(a){return{cI:true,dM:{i:"[^\\s]",c:[{cN:"comment",b:";",e:"$"},{cN:"title",b:"^\\[",e:"\\]"},{cN:"setting",b:"^[a-z0-9_\\[\\]]+[ \\t]*=[ \\t]*",e:"$",c:[{cN:"value",eW:true,k:"on off true false yes no",c:[a.QSM,a.NM]}]}]}}}(hljs);hljs.LANGUAGES.python=function(a){var c=[{cN:"string",b:"(u|b)?r?'''",e:"'''",r:10},{cN:"string",b:'(u|b)?r?"""',e:'"""',r:10},{cN:"string",b:"(u|r|ur)'",e:"'",c:[a.BE],r:10},{cN:"string",b:'(u|r|ur)"',e:'"',c:[a.BE],r:10},{cN:"string",b:"(b|br)'",e:"'",c:[a.BE]},{cN:"string",b:'(b|br)"',e:'"',c:[a.BE]}].concat([a.ASM,a.QSM]);var e={cN:"title",b:a.UIR};var d={cN:"params",b:"\\(",e:"\\)",c:["self",a.CNM].concat(c)};var b={bWK:true,e:":",i:"[${=;\\n]",c:[e,d],r:10};return{dM:{k:{keyword:"and elif is global as in if from raise for except finally print import pass return exec else break not with class assert yield try while continue del or def lambda nonlocal|10",built_in:"None True False Ellipsis NotImplemented"},i:"(</|->|\\?)",c:c.concat([a.HCM,a.inherit(b,{cN:"function",k:"def"}),a.inherit(b,{cN:"class",k:"class"}),a.CNM,{cN:"decorator",b:"@",e:"$"},{b:"\\b(print|exec)\\("}])}}}(hljs);hljs.LANGUAGES.java=function(a){return{dM:{k:"false synchronized int abstract float private char boolean static null if const for true while long throw strictfp finally protected import native final return void enum else break transient new catch instanceof byte super volatile case assert short package default double public try this switch continue throws",c:[{cN:"javadoc",b:"/\\*\\*",e:"\\*/",c:[{cN:"javadoctag",b:"@[A-Za-z]+"}],r:10},a.CLCM,a.CBLCLM,a.ASM,a.QSM,{cN:"class",bWK:true,e:"{",k:"class interface",i:":",c:[{bWK:true,k:"extends implements",r:10},{cN:"title",b:a.UIR}]},a.CNM,{cN:"annotation",b:"@[A-Za-z]+"}]}}}(hljs);hljs.LANGUAGES.cs=function(a){return{dM:{k:"abstract as base bool break byte case catch char checked class const continue decimal default delegate do double else enum event explicit extern false finally fixed float for foreach goto if implicit in int interface internal is lock long namespace new null object operator out override params private protected public readonly ref return sbyte sealed short sizeof stackalloc static string struct switch this throw true try typeof uint ulong unchecked unsafe ushort using virtual volatile void while ascending descending from get group into join let orderby partial select set value var where yield",c:[{cN:"comment",b:"///",e:"$",rB:true,c:[{cN:"xmlDocTag",b:"///|<!--|-->"},{cN:"xmlDocTag",b:"</?",e:">"}]},a.CLCM,a.CBLCLM,{cN:"preprocessor",b:"#",e:"$",k:"if else elif endif define undef warning error line region endregion pragma checksum"},{cN:"string",b:'@"',e:'"',c:[{b:'""'}]},a.ASM,a.QSM,a.CNM]}}}(hljs);hljs.LANGUAGES.xml=function(a){var c="[A-Za-z0-9\\._:-]+";var b={eW:true,c:[{cN:"attribute",b:c,r:0},{b:'="',rB:true,e:'"',c:[{cN:"value",b:'"',eW:true}]},{b:"='",rB:true,e:"'",c:[{cN:"value",b:"'",eW:true}]},{b:"=",c:[{cN:"value",b:"[^\\s/>]+"}]}]};return{cI:true,dM:{c:[{cN:"pi",b:"<\\?",e:"\\?>",r:10},{cN:"doctype",b:"<!DOCTYPE",e:">",r:10,c:[{b:"\\[",e:"\\]"}]},{cN:"comment",b:"<!--",e:"-->",r:10},{cN:"cdata",b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{cN:"tag",b:"<style(?=\\s|>|$)",e:">",k:{title:"style"},c:[b],starts:{e:"</style>",rE:true,sL:"css"}},{cN:"tag",b:"<script(?=\\s|>|$)",e:">",k:{title:"script"},c:[b],starts:{e:"<\/script>",rE:true,sL:"javascript"}},{b:"<%",e:"%>",sL:"vbscript"},{cN:"tag",b:"</?",e:"/?>",c:[{cN:"title",b:"[^ />]+"},b]}]}}}(hljs);hljs.LANGUAGES.http=function(a){return{dM:{i:"\\S",c:[{cN:"status",b:"^HTTP/[0-9\\.]+",e:"$",c:[{cN:"number",b:"\\b\\d{3}\\b"}]},{cN:"request",b:"^[A-Z]+ (.*?) HTTP/[0-9\\.]+$",rB:true,e:"$",c:[{cN:"string",b:" ",e:" ",eB:true,eE:true}]},{cN:"attribute",b:"^\\w",e:": ",eE:true,i:"\\n",starts:{cN:"string",e:"$"}},{b:"\\n\\n",starts:{sL:"",eW:true}}]}}}(hljs);hljs.LANGUAGES.css=function(a){var b={cN:"function",b:a.IR+"\\(",e:"\\)",c:[{eW:true,eE:true,c:[a.NM,a.ASM,a.QSM]}]};return{cI:true,dM:{i:"[=/|']",c:[a.CBLCLM,{cN:"id",b:"\\#[A-Za-z0-9_-]+"},{cN:"class",b:"\\.[A-Za-z0-9_-]+",r:0},{cN:"attr_selector",b:"\\[",e:"\\]",i:"$"},{cN:"pseudo",b:":(:)?[a-zA-Z0-9\\_\\-\\+\\(\\)\\\"\\']+"},{cN:"at_rule",b:"@(font-face|page)",l:"[a-z-]+",k:"font-face page"},{cN:"at_rule",b:"@",e:"[{;]",eE:true,k:"import page media charset",c:[b,a.ASM,a.QSM,a.NM]},{cN:"tag",b:a.IR,r:0},{cN:"rules",b:"{",e:"}",i:"[^\\s]",r:0,c:[a.CBLCLM,{cN:"rule",b:"[^\\s]",rB:true,e:";",eW:true,c:[{cN:"attribute",b:"[A-Z\\_\\.\\-]+",e:":",eE:true,i:"[^\\s]",starts:{cN:"value",eW:true,eE:true,c:[b,a.NM,a.QSM,a.ASM,a.CBLCLM,{cN:"hexcolor",b:"\\#[0-9A-F]+"},{cN:"important",b:"!important"}]}}]}]}]}}}(hljs);hljs.LANGUAGES.javascript=function(a){return{dM:{k:{keyword:"in if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete",literal:"true false null undefined NaN Infinity"},c:[a.ASM,a.QSM,a.CLCM,a.CBLCLM,a.CNM,{b:"("+a.RSR+"|\\b(case|return|throw)\\b)\\s*",k:"return throw case",c:[a.CLCM,a.CBLCLM,{cN:"regexp",b:"/",e:"/[gim]*",c:[{b:"\\\\/"}]}],r:0},{cN:"function",bWK:true,e:"{",k:"function",c:[{cN:"title",b:"[A-Za-z$_][0-9A-Za-z$_]*"},{cN:"params",b:"\\(",e:"\\)",c:[a.CLCM,a.CBLCLM],i:"[\"'\\(]"}],i:"\\[|%"}]}}}(hljs);hljs.LANGUAGES.cpp=function(a){var b={keyword:"false int float while private char catch export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const struct for static_cast|10 union namespace unsigned long throw volatile static protected bool template mutable if public friend do return goto auto void enum else break new extern using true class asm case typeid short reinterpret_cast|10 default double register explicit signed typename try this switch continue wchar_t inline delete alignof char16_t char32_t constexpr decltype noexcept nullptr static_assert thread_local restrict _Bool complex",built_in:"std string cin cout cerr clog stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap array shared_ptr"};return{dM:{k:b,i:"</",c:[a.CLCM,a.CBLCLM,a.QSM,{cN:"string",b:"'\\\\?.",e:"'",i:"."},{cN:"number",b:"\\b(\\d+(\\.\\d*)?|\\.\\d+)(u|U|l|L|ul|UL|f|F)"},a.CNM,{cN:"preprocessor",b:"#",e:"$"},{cN:"stl_container",b:"\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\s*<",e:">",k:b,r:10,c:["self"]}]}}}(hljs);hljs.LANGUAGES.json=function(a){var e={literal:"true false null"};var d=[a.QSM,a.CNM];var c={cN:"value",e:",",eW:true,eE:true,c:d,k:e};var b={b:"{",e:"}",c:[{cN:"attribute",b:'\\s*"',e:'"\\s*:\\s*',eB:true,eE:true,c:[a.BE],i:"\\n",starts:c}],i:"\\S"};var f={b:"\\[",e:"\\]",c:[a.inherit(c,{cN:null})],i:"\\S"};d.splice(d.length,0,b,f);return{dM:{c:d,k:e,i:"\\S"}}}(hljs);hljs.LANGUAGES.perl=function(e){var a="getpwent getservent quotemeta msgrcv scalar kill dbmclose undef lc ma syswrite tr send umask sysopen shmwrite vec qx utime local oct semctl localtime readpipe do return format read sprintf dbmopen pop getpgrp not getpwnam rewinddir qqfileno qw endprotoent wait sethostent bless s|0 opendir continue each sleep endgrent shutdown dump chomp connect getsockname die socketpair close flock exists index shmgetsub for endpwent redo lstat msgctl setpgrp abs exit select print ref gethostbyaddr unshift fcntl syscall goto getnetbyaddr join gmtime symlink semget splice x|0 getpeername recv log setsockopt cos last reverse gethostbyname getgrnam study formline endhostent times chop length gethostent getnetent pack getprotoent getservbyname rand mkdir pos chmod y|0 substr endnetent printf next open msgsnd readdir use unlink getsockopt getpriority rindex wantarray hex system getservbyport endservent int chr untie rmdir prototype tell listen fork shmread ucfirst setprotoent else sysseek link getgrgid shmctl waitpid unpack getnetbyname reset chdir grep split require caller lcfirst until warn while values shift telldir getpwuid my getprotobynumber delete and sort uc defined srand accept package seekdir getprotobyname semop our rename seek if q|0 chroot sysread setpwent no crypt getc chown sqrt write setnetent setpriority foreach tie sin msgget map stat getlogin unless elsif truncate exec keys glob tied closedirioctl socket readlink eval xor readline binmode setservent eof ord bind alarm pipe atan2 getgrent exp time push setgrent gt lt or ne m|0";var d={cN:"subst",b:"[$@]\\{",e:"\\}",k:a,r:10};var b={cN:"variable",b:"\\$\\d"};var i={cN:"variable",b:"[\\$\\%\\@\\*](\\^\\w\\b|#\\w+(\\:\\:\\w+)*|[^\\s\\w{]|{\\w+}|\\w+(\\:\\:\\w*)*)"};var f=[e.BE,d,b,i];var h={b:"->",c:[{b:e.IR},{b:"{",e:"}"}]};var g={cN:"comment",b:"^(__END__|__DATA__)",e:"\\n$",r:5};var c=[b,i,e.HCM,g,{cN:"comment",b:"^\\=\\w",e:"\\=cut",eW:true},h,{cN:"string",b:"q[qwxr]?\\s*\\(",e:"\\)",c:f,r:5},{cN:"string",b:"q[qwxr]?\\s*\\[",e:"\\]",c:f,r:5},{cN:"string",b:"q[qwxr]?\\s*\\{",e:"\\}",c:f,r:5},{cN:"string",b:"q[qwxr]?\\s*\\|",e:"\\|",c:f,r:5},{cN:"string",b:"q[qwxr]?\\s*\\<",e:"\\>",c:f,r:5},{cN:"string",b:"qw\\s+q",e:"q",c:f,r:5},{cN:"string",b:"'",e:"'",c:[e.BE],r:0},{cN:"string",b:'"',e:'"',c:f,r:0},{cN:"string",b:"`",e:"`",c:[e.BE]},{cN:"string",b:"{\\w+}",r:0},{cN:"string",b:"-?\\w+\\s*\\=\\>",r:0},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{b:"("+e.RSR+"|\\b(split|return|print|reverse|grep)\\b)\\s*",k:"split return print reverse grep",r:0,c:[e.HCM,g,{cN:"regexp",b:"(s|tr|y)/(\\\\.|[^/])*/(\\\\.|[^/])*/[a-z]*",r:10},{cN:"regexp",b:"(m|qr)?/",e:"/[a-z]*",c:[e.BE],r:0}]},{cN:"sub",bWK:true,e:"(\\s*\\(.*?\\))?[;{]",k:"sub",r:5},{cN:"operator",b:"-\\w\\b",r:0}];d.c=c;h.c[1].c=c;return{dM:{k:a,c:c}}}(hljs);hljs.LANGUAGES.ruby=function(e){var a="[a-zA-Z_][a-zA-Z0-9_]*(\\!|\\?)?";var k="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?";var g={keyword:"and false then defined module in return redo if BEGIN retry end for true self when next until do begin unless END rescue nil else break undef not super class case require yield alias while ensure elsif or def",keymethods:"__id__ __send__ abort abs all? allocate ancestors any? arity assoc at at_exit autoload autoload? between? binding binmode block_given? call callcc caller capitalize capitalize! casecmp catch ceil center chomp chomp! chop chop! chr class class_eval class_variable_defined? class_variables clear clone close close_read close_write closed? coerce collect collect! compact compact! concat const_defined? const_get const_missing const_set constants count crypt default default_proc delete delete! delete_at delete_if detect display div divmod downcase downcase! downto dump dup each each_byte each_index each_key each_line each_pair each_value each_with_index empty? entries eof eof? eql? equal? eval exec exit exit! extend fail fcntl fetch fileno fill find find_all first flatten flatten! floor flush for_fd foreach fork format freeze frozen? fsync getc gets global_variables grep gsub gsub! has_key? has_value? hash hex id include include? included_modules index indexes indices induced_from inject insert inspect instance_eval instance_method instance_methods instance_of? instance_variable_defined? instance_variable_get instance_variable_set instance_variables integer? intern invert ioctl is_a? isatty iterator? join key? keys kind_of? lambda last length lineno ljust load local_variables loop lstrip lstrip! map map! match max member? merge merge! method method_defined? method_missing methods min module_eval modulo name nesting new next next! nil? nitems nonzero? object_id oct open pack partition pid pipe pop popen pos prec prec_f prec_i print printf private_class_method private_instance_methods private_method_defined? private_methods proc protected_instance_methods protected_method_defined? protected_methods public_class_method public_instance_methods public_method_defined? public_methods push putc puts quo raise rand rassoc read read_nonblock readchar readline readlines readpartial rehash reject reject! remainder reopen replace require respond_to? reverse reverse! reverse_each rewind rindex rjust round rstrip rstrip! scan seek select send set_trace_func shift singleton_method_added singleton_methods size sleep slice slice! sort sort! sort_by split sprintf squeeze squeeze! srand stat step store strip strip! sub sub! succ succ! sum superclass swapcase swapcase! sync syscall sysopen sysread sysseek system syswrite taint tainted? tell test throw times to_a to_ary to_f to_hash to_i to_int to_io to_proc to_s to_str to_sym tr tr! tr_s tr_s! trace_var transpose trap truncate tty? type ungetc uniq uniq! unpack unshift untaint untrace_var upcase upcase! update upto value? values values_at warn write write_nonblock zero? zip"};var c={cN:"yardoctag",b:"@[A-Za-z]+"};var l=[{cN:"comment",b:"#",e:"$",c:[c]},{cN:"comment",b:"^\\=begin",e:"^\\=end",c:[c],r:10},{cN:"comment",b:"^__END__",e:"\\n$"}];var d={cN:"subst",b:"#\\{",e:"}",l:a,k:g};var j=[e.BE,d];var b=[{cN:"string",b:"'",e:"'",c:j,r:0},{cN:"string",b:'"',e:'"',c:j,r:0},{cN:"string",b:"%[qw]?\\(",e:"\\)",c:j},{cN:"string",b:"%[qw]?\\[",e:"\\]",c:j},{cN:"string",b:"%[qw]?{",e:"}",c:j},{cN:"string",b:"%[qw]?<",e:">",c:j,r:10},{cN:"string",b:"%[qw]?/",e:"/",c:j,r:10},{cN:"string",b:"%[qw]?%",e:"%",c:j,r:10},{cN:"string",b:"%[qw]?-",e:"-",c:j,r:10},{cN:"string",b:"%[qw]?\\|",e:"\\|",c:j,r:10}];var i={cN:"function",b:"\\bdef\\s+",e:" |$|;",l:a,k:g,c:[{cN:"title",b:k,l:a,k:g},{cN:"params",b:"\\(",e:"\\)",l:a,k:g}].concat(l)};var h={cN:"identifier",b:a,l:a,k:g,r:0};var f=l.concat(b.concat([{cN:"class",bWK:true,e:"$|;",k:"class module",c:[{cN:"title",b:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?",r:0},{cN:"inheritance",b:"<\\s*",c:[{cN:"parent",b:"("+e.IR+"::)?"+e.IR}]}].concat(l)},i,{cN:"constant",b:"(::)?([A-Z]\\w*(::)?)+",r:0},{cN:"symbol",b:":",c:b.concat([h]),r:0},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{cN:"number",b:"\\?\\w"},{cN:"variable",b:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},h,{b:"("+e.RSR+")\\s*",c:l.concat([{cN:"regexp",b:"/",e:"/[a-z]*",i:"\\n",c:[e.BE]}]),r:0}]));d.c=f;i.c[1].c=f;return{dM:{l:a,k:g,c:f}}}(hljs);hljs.LANGUAGES.sql=function(a){return{cI:true,dM:{i:"[^\\s]",c:[{cN:"operator",b:"(begin|start|commit|rollback|savepoint|lock|alter|create|drop|rename|call|delete|do|handler|insert|load|replace|select|truncate|update|set|show|pragma|grant)\\b",e:";",eW:true,k:{keyword:"all partial global month current_timestamp using go revoke smallint indicator end-exec disconnect zone with character assertion to add current_user usage input local alter match collate real then rollback get read timestamp session_user not integer bit unique day minute desc insert execute like ilike|2 level decimal drop continue isolation found where constraints domain right national some module transaction relative second connect escape close system_user for deferred section cast current sqlstate allocate intersect deallocate numeric public preserve full goto initially asc no key output collation group by union session both last language constraint column of space foreign deferrable prior connection unknown action commit view or first into float year primary cascaded except restrict set references names table outer open select size are rows from prepare distinct leading create only next inner authorization schema corresponding option declare precision immediate else timezone_minute external varying translation true case exception join hour default double scroll value cursor descriptor values dec fetch procedure delete and false int is describe char as at in varchar null trailing any absolute current_time end grant privileges when cross check write current_date pad begin temporary exec time update catalog user sql date on identity timezone_hour natural whenever interval work order cascade diagnostics nchar having left call do handler load replace truncate start lock show pragma",aggregate:"count sum min max avg"},c:[{cN:"string",b:"'",e:"'",c:[a.BE,{b:"''"}],r:0},{cN:"string",b:'"',e:'"',c:[a.BE,{b:'""'}],r:0},{cN:"string",b:"`",e:"`",c:[a.BE]},a.CNM]},a.CBLCLM,{cN:"comment",b:"--",e:"$"}]}}}(hljs);hljs.LANGUAGES.php=function(a){var e={cN:"variable",b:"\\$+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*"};var b=[a.inherit(a.ASM,{i:null}),a.inherit(a.QSM,{i:null}),{cN:"string",b:'b"',e:'"',c:[a.BE]},{cN:"string",b:"b'",e:"'",c:[a.BE]}];var c=[a.CNM,a.BNM];var d={cN:"title",b:a.UIR};return{cI:true,dM:{k:"and include_once list abstract global private echo interface as static endswitch array null if endwhile or const for endforeach self var while isset public protected exit foreach throw elseif include __FILE__ empty require_once do xor return implements parent clone use __CLASS__ __LINE__ else break print eval new catch __METHOD__ case exception php_user_filter default die require __FUNCTION__ enddeclare final try this switch continue endfor endif declare unset true false namespace trait goto instanceof insteadof __DIR__ __NAMESPACE__ __halt_compiler",c:[a.CLCM,a.HCM,{cN:"comment",b:"/\\*",e:"\\*/",c:[{cN:"phpdoc",b:"\\s@[A-Za-z]+"}]},{cN:"comment",eB:true,b:"__halt_compiler.+?;",eW:true},{cN:"string",b:"<<<['\"]?\\w+['\"]?$",e:"^\\w+;",c:[a.BE]},{cN:"preprocessor",b:"<\\?php",r:10},{cN:"preprocessor",b:"\\?>"},e,{cN:"function",bWK:true,e:"{",k:"function",i:"\\$|\\[|%",c:[d,{cN:"params",b:"\\(",e:"\\)",c:["self",e,a.CBLCLM].concat(b).concat(c)}]},{cN:"class",bWK:true,e:"{",k:"class",i:"[:\\(\\$]",c:[{bWK:true,eW:true,k:"extends",c:[d]},d]},{b:"=>"}].concat(b).concat(c)}}}(hljs);hljs.LANGUAGES.diff=function(a){return{cI:true,dM:{c:[{cN:"chunk",b:"^\\@\\@ +\\-\\d+,\\d+ +\\+\\d+,\\d+ +\\@\\@$",r:10},{cN:"chunk",b:"^\\*\\*\\* +\\d+,\\d+ +\\*\\*\\*\\*$",r:10},{cN:"chunk",b:"^\\-\\-\\- +\\d+,\\d+ +\\-\\-\\-\\-$",r:10},{cN:"header",b:"Index: ",e:"$"},{cN:"header",b:"=====",e:"=====$"},{cN:"header",b:"^\\-\\-\\-",e:"$"},{cN:"header",b:"^\\*{3} ",e:"$"},{cN:"header",b:"^\\+\\+\\+",e:"$"},{cN:"header",b:"\\*{5}",e:"\\*{5}$"},{cN:"addition",b:"^\\+",e:"$"},{cN:"deletion",b:"^\\-",e:"$"},{cN:"change",b:"^\\!",e:"$"}]}}}(hljs);
View
131 docs/prettyjson.html
@@ -1,131 +0,0 @@
-<!DOCTYPE html> <html> <head> <title>prettyjson.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> prettyjson.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>Package for formatting JSON data in a coloured
-YAML-style, perfect for CLI output</p> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">&#182;</a> </div> <h3>Export package</h3> </td> <td class="code"> <div class="highlight"><pre><span class="nx">module</span><span class="p">.</span><span class="nx">exports</span> <span class="o">=</span> <span class="nx">exports</span><span class="p">;</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">&#182;</a> </div> <h3>Module dependencies</h3> </td> <td class="code"> <div class="highlight"><pre><span class="kd">var</span> <span class="nx">colors</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;colors&#39;</span><span class="p">);</span>
-<span class="kd">var</span> <span class="nx">Utils</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;./utils&#39;</span><span class="p">);</span>
-<span class="kd">var</span> <span class="nx">fs</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;fs&#39;</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-4">&#182;</a> </div> <h3>Package version</h3> </td> <td class="code"> <div class="highlight"><pre><span class="nx">exports</span><span class="p">.</span><span class="nx">version</span> <span class="o">=</span> <span class="nx">JSON</span><span class="p">.</span><span class="nx">parse</span><span class="p">(</span><span class="nx">fs</span><span class="p">.</span><span class="nx">readFileSync</span><span class="p">(</span><span class="nx">__dirname</span> <span class="o">+</span> <span class="s1">&#39;/../package.json&#39;</span><span class="p">,</span> <span class="s1">&#39;utf8&#39;</span><span class="p">)).</span><span class="nx">version</span><span class="p">;</span></pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-5">&#182;</a> </div> <h3>Render function</h3>
-
-<p><em>Parameters:</em></p>
-
-<ul>
-<li><strong><code>data</code></strong>: Data to render</li>
-<li><strong><code>options</code></strong>: Hash with different options to configure the parser</li>
-<li><strong><code>indentation</code></strong>: Base indentation of the parsed output</li>
-</ul>
-
-<p><em>Example of options hash:</em></p>
-
-<pre><code>{
- emptyArrayMsg: '(empty)', // Rendered message on empty strings
- keysColor: 'blue', // Color for keys in hashes
- dashColor: 'red', // Color for the dashes in arrays
- stringColor: 'grey', // Color for strings
- defaultIndentation: 2 // Indentation on nested objects
-}
-</code></pre> </td> <td class="code"> <div class="highlight"><pre><span class="nx">exports</span><span class="p">.</span><span class="nx">render</span> <span class="o">=</span> <span class="kd">function</span> <span class="nx">render</span><span class="p">(</span><span class="nx">data</span><span class="p">,</span> <span class="nx">options</span><span class="p">,</span> <span class="nx">indentation</span><span class="p">)</span> <span class="p">{</span>
- <span class="s2">&quot;use strict&quot;</span><span class="p">;</span></pre></div> </td> </tr> <tr id="section-6"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-6">&#182;</a> </div> <p>Default value for the indentation param</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">indentation</span> <span class="o">=</span> <span class="nx">indentation</span> <span class="o">||</span> <span class="mi">0</span><span class="p">;</span></pre></div> </td> </tr> <tr id="section-7"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-7">&#182;</a> </div> <p>Default values for the options</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">options</span> <span class="o">=</span> <span class="nx">options</span> <span class="o">||</span> <span class="p">{};</span>
- <span class="nx">options</span><span class="p">.</span><span class="nx">emptyArrayMsg</span> <span class="o">=</span> <span class="nx">options</span><span class="p">.</span><span class="nx">emptyArrayMsg</span> <span class="o">||</span> <span class="s1">&#39;(empty array)&#39;</span><span class="p">;</span>
- <span class="nx">options</span><span class="p">.</span><span class="nx">keysColor</span> <span class="o">=</span> <span class="nx">options</span><span class="p">.</span><span class="nx">keysColor</span> <span class="o">||</span> <span class="s2">&quot;green&quot;</span><span class="p">;</span>
- <span class="nx">options</span><span class="p">.</span><span class="nx">dashColor</span> <span class="o">=</span> <span class="nx">options</span><span class="p">.</span><span class="nx">dashColor</span> <span class="o">||</span> <span class="s2">&quot;green&quot;</span><span class="p">;</span>
- <span class="nx">options</span><span class="p">.</span><span class="nx">defaultIndentation</span> <span class="o">=</span> <span class="nx">options</span><span class="p">.</span><span class="nx">defaultIndentation</span> <span class="o">||</span> <span class="mi">2</span><span class="p">;</span>
-
- <span class="nx">options</span><span class="p">.</span><span class="nx">stringColor</span> <span class="o">=</span> <span class="nx">options</span><span class="p">.</span><span class="nx">stringColor</span> <span class="o">||</span> <span class="kc">null</span><span class="p">;</span></pre></div> </td> </tr> <tr id="section-8"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-8">&#182;</a> </div> <p>Initialize the output (it's an array of lines)</p> </td> <td class="code"> <div class="highlight"><pre> <span class="kd">var</span> <span class="nx">output</span> <span class="o">=</span> <span class="p">[];</span></pre></div> </td> </tr> <tr id="section-9"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-9">&#182;</a> </div> <p>Helper function to detect if an object can be serializable directly</p> </td> <td class="code"> <div class="highlight"><pre> <span class="kd">var</span> <span class="nx">isSerializable</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">input</span><span class="p">)</span> <span class="p">{</span>
- <span class="k">if</span> <span class="p">(</span><span class="k">typeof</span> <span class="nx">input</span> <span class="o">===</span> <span class="s1">&#39;string&#39;</span> <span class="o">||</span> <span class="k">typeof</span> <span class="nx">input</span> <span class="o">===</span> <span class="s1">&#39;boolean&#39;</span> <span class="o">||</span>
- <span class="k">typeof</span> <span class="nx">input</span> <span class="o">===</span> <span class="s1">&#39;number&#39;</span> <span class="o">||</span> <span class="nx">input</span> <span class="o">===</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span>
- <span class="k">return</span> <span class="kc">true</span><span class="p">;</span>
- <span class="p">}</span>
- <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
- <span class="p">};</span>
-
- <span class="kd">var</span> <span class="nx">addColorToData</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">input</span><span class="p">)</span> <span class="p">{</span>
- <span class="k">if</span> <span class="p">(</span><span class="k">typeof</span> <span class="nx">input</span> <span class="o">===</span> <span class="s1">&#39;string&#39;</span><span class="p">)</span> <span class="p">{</span></pre></div> </td> </tr> <tr id="section-10"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-10">&#182;</a> </div> <p>Print strings in regular terminal color</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">return</span> <span class="nx">options</span><span class="p">.</span><span class="nx">stringColor</span> <span class="o">?</span> <span class="nx">input</span><span class="p">[</span><span class="nx">options</span><span class="p">.</span><span class="nx">stringColor</span><span class="p">]</span> <span class="o">:</span> <span class="nx">input</span><span class="p">;</span>
- <span class="p">}</span>
-
- <span class="k">if</span> <span class="p">(</span><span class="nx">input</span> <span class="o">===</span> <span class="kc">true</span><span class="p">)</span> <span class="p">{</span>
- <span class="k">return</span> <span class="p">(</span><span class="nx">input</span><span class="o">+</span><span class="s1">&#39;&#39;</span><span class="p">).</span><span class="nx">green</span><span class="p">;</span>
- <span class="p">}</span>
- <span class="k">if</span> <span class="p">(</span><span class="nx">input</span> <span class="o">===</span> <span class="kc">false</span><span class="p">)</span> <span class="p">{</span>
- <span class="k">return</span> <span class="p">(</span><span class="nx">input</span><span class="o">+</span><span class="s1">&#39;&#39;</span><span class="p">).</span><span class="nx">red</span><span class="p">;</span>
- <span class="p">}</span>
- <span class="k">if</span> <span class="p">(</span><span class="nx">input</span> <span class="o">===</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span>
- <span class="k">return</span> <span class="p">(</span><span class="nx">input</span><span class="o">+</span><span class="s1">&#39;&#39;</span><span class="p">).</span><span class="nx">grey</span><span class="p">;</span>
- <span class="p">}</span>
- <span class="k">if</span> <span class="p">(</span><span class="k">typeof</span> <span class="nx">input</span> <span class="o">===</span> <span class="s1">&#39;number&#39;</span><span class="p">)</span> <span class="p">{</span>
- <span class="k">return</span> <span class="p">(</span><span class="nx">input</span><span class="o">+</span><span class="s1">&#39;&#39;</span><span class="p">).</span><span class="nx">blue</span><span class="p">;</span>
- <span class="p">}</span>
- <span class="k">return</span> <span class="p">(</span><span class="nx">input</span><span class="o">+</span><span class="s1">&#39;&#39;</span><span class="p">);</span>
- <span class="p">};</span></pre></div> </td> </tr> <tr id="section-11"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-11">&#182;</a> </div> <p>Render a string exactly equal</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">if</span> <span class="p">(</span><span class="nx">isSerializable</span><span class="p">(</span><span class="nx">data</span><span class="p">))</span> <span class="p">{</span>
- <span class="nx">output</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="nx">Utils</span><span class="p">.</span><span class="nx">indent</span><span class="p">(</span><span class="nx">indentation</span><span class="p">)</span> <span class="o">+</span> <span class="nx">addColorToData</span><span class="p">(</span><span class="nx">data</span><span class="p">));</span>
- <span class="p">}</span>
- <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nb">Array</span><span class="p">.</span><span class="nx">isArray</span><span class="p">(</span><span class="nx">data</span><span class="p">))</span> <span class="p">{</span></pre></div> </td> </tr> <tr id="section-12"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-12">&#182;</a> </div> <p>If the array is empty, render the <code>emptyArrayMsg</code></p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">if</span> <span class="p">(</span><span class="nx">data</span><span class="p">.</span><span class="nx">length</span> <span class="o">===</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
- <span class="nx">output</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="nx">Utils</span><span class="p">.</span><span class="nx">indent</span><span class="p">(</span><span class="nx">indentation</span><span class="p">)</span> <span class="o">+</span> <span class="nx">options</span><span class="p">.</span><span class="nx">emptyArrayMsg</span><span class="p">);</span>
- <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
- <span class="nx">data</span><span class="p">.</span><span class="nx">forEach</span><span class="p">(</span><span class="kd">function</span><span class="p">(</span><span class="nx">element</span><span class="p">)</span> <span class="p">{</span></pre></div> </td> </tr> <tr id="section-13"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-13">&#182;</a> </div> <p>Prepend the dash at the begining of each array's element line</p> </td> <td class="code"> <div class="highlight"><pre> <span class="kd">var</span> <span class="nx">line</span> <span class="o">=</span> <span class="nx">Utils</span><span class="p">.</span><span class="nx">indent</span><span class="p">(</span><span class="nx">indentation</span><span class="p">)</span> <span class="o">+</span> <span class="p">(</span><span class="s1">&#39;- &#39;</span><span class="p">)[</span><span class="nx">options</span><span class="p">.</span><span class="nx">dashColor</span><span class="p">];</span></pre></div> </td> </tr> <tr id="section-14"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-14">&#182;</a> </div> <p>If the element of the array is a string, render it in the same line</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">if</span> <span class="p">(</span><span class="k">typeof</span> <span class="nx">element</span> <span class="o">===</span> <span class="s1">&#39;string&#39;</span><span class="p">)</span> <span class="p">{</span>
- <span class="nx">line</span> <span class="o">+=</span> <span class="nx">exports</span><span class="p">.</span><span class="nx">render</span><span class="p">(</span><span class="nx">element</span><span class="p">,</span> <span class="nx">options</span><span class="p">);</span>
- <span class="nx">output</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="nx">line</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-15"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-15">&#182;</a> </div> <p>If the element of the array is an array or object, render it in next line</p> </td> <td class="code"> <div class="highlight"><pre> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
- <span class="nx">output</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="nx">line</span><span class="p">);</span>
- <span class="nx">output</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span>
- <span class="nx">exports</span><span class="p">.</span><span class="nx">render</span><span class="p">(</span><span class="nx">element</span><span class="p">,</span> <span class="nx">options</span><span class="p">,</span> <span class="nx">indentation</span> <span class="o">+</span> <span class="nx">options</span><span class="p">.</span><span class="nx">defaultIndentation</span><span class="p">)</span>
- <span class="p">);</span>
- <span class="p">}</span>
- <span class="p">});</span>
- <span class="p">}</span>
- <span class="p">}</span>
- <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="k">typeof</span> <span class="nx">data</span> <span class="o">===</span> <span class="s1">&#39;object&#39;</span><span class="p">)</span> <span class="p">{</span></pre></div> </td> </tr> <tr id="section-16"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-16">&#182;</a> </div> <p>Get the size of the longest index to render all the values on the same column</p> </td> <td class="code"> <div class="highlight"><pre> <span class="kd">var</span> <span class="nx">maxIndexLength</span> <span class="o">=</span> <span class="nx">Utils</span><span class="p">.</span><span class="nx">getMaxIndexLength</span><span class="p">(</span><span class="nx">data</span><span class="p">);</span>
- <span class="kd">var</span> <span class="nx">key</span><span class="p">;</span>
-
- <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="k">in</span> <span class="nx">data</span><span class="p">)</span> <span class="p">{</span>
- <span class="k">if</span> <span class="p">(</span><span class="nx">data</span><span class="p">.</span><span class="nx">hasOwnProperty</span><span class="p">(</span><span class="nx">i</span><span class="p">))</span> <span class="p">{</span></pre></div> </td> </tr> <tr id="section-17"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-17">&#182;</a> </div> <p>Prepend the index at the beginning of the line</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">key</span> <span class="o">=</span> <span class="nx">Utils</span><span class="p">.</span><span class="nx">indent</span><span class="p">(</span><span class="nx">indentation</span><span class="p">)</span> <span class="o">+</span> <span class="p">(</span><span class="nx">i</span> <span class="o">+</span> <span class="s1">&#39;: &#39;</span><span class="p">)[</span><span class="nx">options</span><span class="p">.</span><span class="nx">keysColor</span><span class="p">];</span></pre></div> </td> </tr> <tr id="section-18"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-18">&#182;</a> </div> <p>If the value is serializable, render it in the same line</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">if</span> <span class="p">(</span><span class="nx">isSerializable</span><span class="p">(</span><span class="nx">data</span><span class="p">[</span><span class="nx">i</span><span class="p">]))</span> <span class="p">{</span>
- <span class="nx">key</span> <span class="o">+=</span> <span class="nx">exports</span><span class="p">.</span><span class="nx">render</span><span class="p">(</span><span class="nx">data</span><span class="p">[</span><span class="nx">i</span><span class="p">],</span> <span class="nx">options</span><span class="p">,</span> <span class="nx">maxIndexLength</span> <span class="o">-</span> <span class="nx">i</span><span class="p">.</span><span class="nx">length</span><span class="p">);</span>
- <span class="nx">output</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="nx">key</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-19"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-19">&#182;</a> </div> <p>If the index is an array or object, render it in next line</p> </td> <td class="code"> <div class="highlight"><pre> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
- <span class="nx">output</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="nx">key</span><span class="p">);</span>
- <span class="nx">output</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span>
- <span class="nx">exports</span><span class="p">.</span><span class="nx">render</span><span class="p">(</span><span class="nx">data</span><span class="p">[</span><span class="nx">i</span><span class="p">],</span> <span class="nx">options</span><span class="p">,</span> <span class="nx">indentation</span> <span class="o">+</span> <span class="nx">options</span><span class="p">.</span><span class="nx">defaultIndentation</span><span class="p">)</span>
- <span class="p">);</span>
- <span class="p">}</span>
- <span class="p">}</span>
- <span class="p">}</span>
- <span class="p">}</span></pre></div> </td> </tr> <tr id="section-20"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-20">&#182;</a> </div> <p>Return all the lines as a string</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">return</span> <span class="nx">output</span><span class="p">.</span><span class="nx">join</span><span class="p">(</span><span class="s1">&#39;\n&#39;</span><span class="p">);</span>
-<span class="p">};</span></pre></div> </td> </tr> <tr id="section-21"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-21">&#182;</a> </div> <h3>Render from string function</h3>
-
-<p><em>Parameters:</em></p>
-
-<ul>
-<li><strong><code>data</code></strong>: Data to render as a string</li>
-<li><strong><code>options</code></strong>: Hash with different options to configure the parser</li>
-<li><strong><code>indentation</code></strong>: Base indentation of the parsed output</li>
-</ul>
-
-<p><em>Example of options hash:</em></p>
-
-<pre><code>{
- emptyArrayMsg: '(empty)', // Rendered message on empty strings
- keysColor: 'blue', // Color for keys in hashes
- dashColor: 'red', // Color for the dashes in arrays
- defaultIndentation: 2 // Indentation on nested objects
-}
-</code></pre> </td> <td class="code"> <div class="highlight"><pre><span class="nx">exports</span><span class="p">.</span><span class="nx">renderString</span> <span class="o">=</span> <span class="kd">function</span> <span class="nx">renderString</span><span class="p">(</span><span class="nx">data</span><span class="p">,</span> <span class="nx">options</span><span class="p">,</span> <span class="nx">indentation</span><span class="p">)</span> <span class="p">{</span>
- <span class="s2">&quot;use strict&quot;</span><span class="p">;</span>
-
- <span class="kd">var</span> <span class="nx">output</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="p">;</span>
- <span class="kd">var</span> <span class="nx">parsedData</span><span class="p">;</span></pre></div> </td> </tr> <tr id="section-22"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-22">&#182;</a> </div> <p>If the input is not a string or if it's empty, just return an empty string</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">if</span> <span class="p">(</span><span class="k">typeof</span> <span class="nx">data</span> <span class="o">!==</span> <span class="s1">&#39;string&#39;</span> <span class="o">||</span> <span class="nx">data</span> <span class="o">===</span> <span class="s1">&#39;&#39;</span><span class="p">)</span> <span class="p">{</span>
- <span class="k">return</span> <span class="s1">&#39;&#39;</span><span class="p">;</span>
- <span class="p">}</span></pre></div> </td> </tr> <tr id="section-23"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-23">&#182;</a> </div> <p>Remove non-JSON characters from the beginning string</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">if</span> <span class="p">(</span><span class="nx">data</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">!==</span> <span class="s1">&#39;{&#39;</span> <span class="o">&amp;&amp;</span> <span class="nx">data</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">!==</span> <span class="s1">&#39;[&#39;</span><span class="p">)</span> <span class="p">{</span>
- <span class="kd">var</span> <span class="nx">beginingOfJson</span><span class="p">;</span>
- <span class="k">if</span> <span class="p">(</span><span class="nx">data</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="s1">&#39;{&#39;</span><span class="p">)</span> <span class="o">===</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
- <span class="nx">beginingOfJson</span> <span class="o">=</span> <span class="nx">data</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="s1">&#39;[&#39;</span><span class="p">);</span>
- <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">data</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="s1">&#39;[&#39;</span><span class="p">)</span> <span class="o">===</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
- <span class="nx">beginingOfJson</span> <span class="o">=</span> <span class="nx">data</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="s1">&#39;{&#39;</span><span class="p">);</span>
- <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
- <span class="nx">beginingOfJson</span> <span class="o">=</span> <span class="nx">data</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="s1">&#39;{&#39;</span><span class="p">)</span> <span class="o">&lt;</span> <span class="nx">data</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="s1">&#39;[&#39;</span><span class="p">)</span> <span class="o">?</span> <span class="nx">data</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="s1">&#39;{&#39;</span><span class="p">)</span> <span class="o">:</span> <span class="nx">data</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="s1">&#39;[&#39;</span><span class="p">);</span>
- <span class="p">}</span>
- <span class="nx">output</span> <span class="o">+=</span> <span class="nx">data</span><span class="p">.</span><span class="nx">substr</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="nx">beginingOfJson</span><span class="p">)</span> <span class="o">+</span> <span class="s2">&quot;\n&quot;</span><span class="p">;</span>
- <span class="nx">data</span> <span class="o">=</span> <span class="nx">data</span><span class="p">.</span><span class="nx">substr</span><span class="p">(</span><span class="nx">beginingOfJson</span><span class="p">);</span>
- <span class="p">}</span>
-
- <span class="k">try</span> <span class="p">{</span>
- <span class="nx">parsedData</span> <span class="o">=</span> <span class="nx">JSON</span><span class="p">.</span><span class="nx">parse</span><span class="p">(</span><span class="nx">data</span><span class="p">);</span>
- <span class="p">}</span> <span class="k">catch</span> <span class="p">(</span><span class="nx">e</span><span class="p">)</span> <span class="p">{</span></pre></div> </td> </tr> <tr id="section-24"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-24">&#182;</a> </div> <p>Return an error in case of an invalid JSON</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">return</span> <span class="s1">&#39;Error:&#39;</span><span class="p">.</span><span class="nx">red</span> <span class="o">+</span> <span class="s1">&#39; Not valid JSON!&#39;</span><span class="p">;</span>
- <span class="p">}</span></pre></div> </td> </tr> <tr id="section-25"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-25">&#182;</a> </div> <p>Call the real render() method</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">output</span> <span class="o">+=</span> <span class="nx">exports</span><span class="p">.</span><span class="nx">render</span><span class="p">(</span><span class="nx">parsedData</span><span class="p">,</span> <span class="nx">options</span><span class="p">);</span>
- <span class="k">return</span> <span class="nx">output</span><span class="p">;</span>
-<span class="p">};</span>
-
-</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
View
119 docs/stylesheets/main.css
@@ -1,119 +0,0 @@
-html {
- background-color: #fff;
- color: #252525;
-}
-
-.forkme {
- position: absolute;
- top: 0;
- right: 0;
- z-index: 1;
- -webkit-transition-property: opacity;
- -webkit-transition-duration: 0.2s;
- -webkit-transition-timing-function: ease-out;
- -moz-transition-property: opacity;
- -moz-transition-duration: 0.2s;
- -moz-transition-timing-function: ease-out;
-}
-
-.forkme:hover {
- opacity: 0.7;
-}
-
-/** Build status img **/
-h1 a img {
- padding: 0 0 4px 15px;
-}
-
-#container, #footer {
- width: 800px;
- margin: 0 auto;
-}
-
-.powered {
- border-top: 1px solid #999;
- margin-top: 30px;
-}
-
-.powered span {
- float: left;
- padding: 20px 20px 0 0;
-}
-
-code {
- background-color: #F5F5FF;
- padding: 0 2px;
- border: 1px solid #d0d0ee;
-}
-
-pre code {
- background-color: transparent;
- padding: 0;
- border: none;
-}
-
-pre {
- margin: 25px 0;
- padding: 5px 0 0 15px;
- border-left: 5px solid #d0d0ee;
- color: #444466;
- font-weight: normal;
- font-style: normal;
-}
-
-h1 {
- margin-bottom: 45px;
- font-size: 2.5em;
-}
-
-h2 {
- margin-top: 30px;
- border-bottom: 1px solid #999;
- font-weight: normal;
- font-size: 1.8em;
-}
-
-h3 em {
- font-weight: normal;
- font-size: 14px;
-}
-
-a, a:visited {
- color: #d11e27;
-}
-
-a:hover {
- text-decoration: none;
-}
-
-#footer {
- border-top: 1px solid #999;
- margin-top: 30px;
- padding: 10px 0;
- color: #444;
- line-height: 1.785em;
- font-family: helvetica, arial, clean, sans-serif;
- font-size: 0.875em;
-}
-
-#footer a {
- margin: 0 3px;
- color: #444;
- text-decoration:none;
- opacity: 0.6;
- -webkit-transition-property: opacity, color;
- -webkit-transition-duration: 0.2s;
- -webkit-transition-timing-function: ease-out;
- -moz-transition-property: opacity;
- -moz-transition-duration: 0.2s;
- -moz-transition-timing-function: ease-out;
-}
-
-#footer a:hover {
- opacity: 1;
- color: #000;
-}
-
-#footer span {
- float: right;
-}
View
116 docs/stylesheets/syntax.css
@@ -1,116 +0,0 @@
-/*
-Based on highlight.js github.com style
-(c) Vasily Polovnyov <vast@whiteants.net>
-*/
-pre .comment,
-pre .template_comment,
-pre .diff .header,
-pre .javadoc {
- color: #609090;
- font-style: italic
-}
-
-pre .keyword,
-pre .css .rule .keyword,
-pre .winutils,
-pre .javascript .title,
-pre .lisp .title,
-pre .subst {
- color: #B26818
-}
-
-pre .number,
-pre .hexcolor {
- color: #40a070
-}
-
-pre .string,
-pre .tag .value,
-pre .phpdoc,
-pre .tex .formula {
- color: #D11E27;
-}
-
-pre .title,
-pre .id {
- color: #900;
-}
-
-pre .javascript .title,
-pre .lisp .title,
-pre .subst {
- font-weight: normal
-}
-
-pre .class .title,
-pre .haskell .label,
-pre .tex .command {
- color: #458;
-}
-
-pre .tag,
-pre .tag .title,
-pre .rules .property,
-pre .django .tag .keyword {
- color: #000080;
- font-weight: normal
-}
-
-pre .attribute,
-pre .variable,
-pre .instancevar,
-pre .lisp .body {
- color: #666666;
-}
-
-pre .regexp {
- color: #009926