|
| 1 | +<!doctype html> |
| 2 | +<html> |
| 3 | +<head> |
| 4 | +<metacharset='utf-8'> |
| 5 | +<title>json.human.js - Json Formatting for Human Beings</title> |
| 6 | +<linkrel="stylesheet"media="all"href="css/demo.css"/> |
| 7 | +<linkrel="stylesheet"media="all"href="css/json.human.css"/> |
| 8 | +<linkrel="stylesheet"media="all"href="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.16.0/codemirror.css"/> |
| 9 | +</head> |
| 10 | + |
| 11 | +<body> |
| 12 | +<h1>json.human.js: Json Formatting for Human Beings</h1> |
| 13 | + |
| 14 | +<pclass="project-description">Provide JSON and get a DOM node with |
| 15 | + a human representation of that JSON.</p> |
| 16 | + |
| 17 | + |
| 18 | +<h2>Why?</h2> |
| 19 | + |
| 20 | +<p>At<ahref="http://event-fabric.com">Event Fabric</a> we need to display JSON to people from all technical levels without being too technical but also without losing information about the underlying JSON object.</p> |
| 21 | + |
| 22 | +<h2>How?</h2> |
| 23 | + |
| 24 | +<p>you can see<ahref="https://github.com/marianoguerra/json.human.js/blob/master/js/demo.js">js/demo.js</a> in the<ahref="http://github.com/marianoguerra/json.human.js">repo</a> for an example, here is a short one</p> |
| 25 | + |
| 26 | +<pre> |
| 27 | + var node = JsonHuman.format(input); |
| 28 | + output.appendChild(node); |
| 29 | +</pre> |
| 30 | + |
| 31 | +<h2>Try it</h2> |
| 32 | +<p>edit the JSON and click<em>Convert</em></p> |
| 33 | + |
| 34 | +<h2>Input: JSON</h2> |
| 35 | + |
| 36 | +<textareaid="input">{ |
| 37 | + "name": "json.human", |
| 38 | + "description": "Convert JSON to human readable HTML", |
| 39 | + "author": "Mariano Guerra<mariano@marianoguerra.org>", |
| 40 | + "tags": ["DOM", "HTML", "JSON", "Pretty Print"], |
| 41 | + "version": "0.1.0", |
| 42 | + "main": "json.human.js", |
| 43 | + "license" : "MIT", |
| 44 | + "dependencies": { |
| 45 | + "crel": "1.0.0" |
| 46 | + }, |
| 47 | + "repository": { |
| 48 | + "type": "git", |
| 49 | + "url": "git://github.com/marianoguerra/json.human.js.git" |
| 50 | + }, |
| 51 | + "bugs": { |
| 52 | + "url": "http://github.com/marianoguerra/json.human.js/issues" |
| 53 | + }, |
| 54 | + "contributors": [], |
| 55 | + "config": { |
| 56 | + "what?": "this object is just to show some extra stuff", |
| 57 | + "how?": ["add json.human.js", "add json.human.css", "???", "profit!"], |
| 58 | + "customization?": ["customize the css prefix", "change the css file"], |
| 59 | + "integer": 42, |
| 60 | + "float": 12.3, |
| 61 | + "bool": true, |
| 62 | + "emptyString": "", |
| 63 | + "emptyArray": [], |
| 64 | + "emptyObject": {}, |
| 65 | + "htmlEntities": "<-trailing<em> &</em> and some html " |
| 66 | + } |
| 67 | +} |
| 68 | +</textarea> |
| 69 | + |
| 70 | +<divclass="buttons"> |
| 71 | +<buttonid="convert">Convert</button> |
| 72 | +</div> |
| 73 | + |
| 74 | +<h2>Output: HTML</h2> |
| 75 | + |
| 76 | +<divid="output"> |
| 77 | +</div> |
| 78 | + |
| 79 | +<h2>Raw HTML</h2> |
| 80 | +<textareaid="output-raw"style="width: 100%; height: 20em;"> |
| 81 | +</textarea> |
| 82 | + |
| 83 | +<h2>License?</h2> |
| 84 | + |
| 85 | +<p><ahref="http://opensource.org/licenses/MIT">MIT</a></p> |
| 86 | + |
| 87 | +<h2>Alternatives</h2> |
| 88 | +<ul> |
| 89 | +<li><ahref="https://github.com/padolsey/prettyPrint.js">prettyprint.js</a></li> |
| 90 | +</ul> |
| 91 | + |
| 92 | + |
| 93 | +<scriptsrc="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.16.0/codemirror.min.js"></script> |
| 94 | +<scriptsrc="lib/crel.js"></script> |
| 95 | +<scriptsrc="src/json.human.js"></script> |
| 96 | +<scriptsrc="js/demo.no.requirejs.js"></script> |
| 97 | +</body> |
| 98 | +</html> |