Skip to content

iamchrismiller/JSONFormatter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JSON -> HTML Formatter

================

A JSON to HTML formatter for use with AMD/Non-AMD

Convert basic JSON datatypes (number, string, boolean, null, object, array) into an HTML fragments.

Code Extracted and modified to be a more reusable following the (Universal Module Definition) pattern.

Based On Firefox/Chrome Extension's :

Usage

new JSONFormatter(options).toHtml(json);

Supported options - number - string - boolean - object - array

Example options override

   var formatterOptions = {
          'string' : function(key,val) {
            if (key === 'id') return '<a class="link" data-request="'+val+'">'+val+'</a>';
            return false;
          }
        };

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt.

Release History

  • 0.1.1 Updated Build Dependencies
  • 0.1.0 Initial release

License

MIT/BSD

Author

Chris Miller

About

JSON -> HTML Formatter

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published