@@ -21,51 +21,124 @@ <h2>Why?</h2>
21
21
22
22
< h2 > How?</ h2 >
23
23
24
- < p > you can see< a href ="https://github.com/marianoguerra/json.human.js/blob/master/js/demo.js "> js/demo.js</ a > in the< a href ="http://github.com/marianoguerra/json.human.js "> repo</ a > for an example, here is a short one</ p >
24
+ < p > You can see< a href ="https://github.com/marianoguerra/json.human.js/blob/master/js/demo.js "> js/demo.js</ a > in the< a href ="http://github.com/marianoguerra/json.human.js "> repo</ a > for an example, here is a short one</ p >
25
25
26
26
< pre >
27
27
var node = JsonHuman.format(input);
28
28
output.appendChild(node);
29
29
</ pre >
30
30
31
31
< h2 > Try it</ h2 >
32
- < p > edit the JSON and click< em > Convert</ em > </ p >
33
-
34
- < h2 > Input: JSON</ h2 >
35
-
36
- < textarea id ="input "> {
37
- "name": "json.human",
38
- "description": "Convert\n JSON to human readable\r 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
- }
32
+ < p > Edit the JSON and click< em > Convert</ em > </ p >
33
+
34
+
35
+
36
+ < table >
37
+ < tr >
38
+ < td > < h2 > Input: JSON</ h2 > </ td >
39
+ < td > < h2 > Input: Options</ h2 > </ td >
40
+ </ tr >
41
+ < tr >
42
+ < td >
43
+ < textarea id ="input "> {
44
+ "name": "json.human",
45
+ "description": "Convert\n JSON to human readable\r HTML",
46
+ "author": "Mariano Guerra< mariano @marianoguerra.org > ",
47
+ "tags": ["DOM", "HTML", "JSON", "Pretty Print"],
48
+ "version": "0.1.0",
49
+ "main": "json.human.js",
50
+ "license" : "MIT",
51
+
52
+ "dependencies": {
53
+ "crel": "1.0.0"
54
+ },
55
+
56
+ "repository": {
57
+ "type": "git",
58
+ "url": "git://github.com/marianoguerra/json.human.js.git"
59
+ },
60
+
61
+ "bugs": {
62
+ "url": "http://github.com/marianoguerra/json.human.js/issues"
63
+ },
64
+
65
+ "contributors": [
66
+ "https://github.com/marianoguerra",
67
+ "https://github.com/anaran",
68
+ "https://github.com/Esya",
69
+ "https://github.com/nickyout",
70
+ "https://github.com/aJanuary",
71
+ "https://github.com/VikramN"
72
+ ],
73
+
74
+ "config": {
75
+ "what?": "this object is just to show some extra stuff",
76
+ "how?": ["add json.human.js", "add json.human.css", "???", "profit!"],
77
+ "customization?": ["customize the css prefix", "change the css file"],
78
+ "integer": 42,
79
+ "float": 12.3,
80
+ "bool": true,
81
+ "bool2": false,
82
+ "emptyString": "",
83
+ "emptyArray": [],
84
+ "emptyObject": {},
85
+ "htmlEntities": "< - trailing < em > &</ em > and some html "
86
+ }
67
87
}
68
- </ textarea >
88
+ </ textarea >
89
+ </ td >
90
+ < td >
91
+ < div style ="padding-left: 5px; padding-top: 10px; ">
92
+ Show Array Indices :< input id ="opt_show_array_index "type ="checkbox "checked > < br />
93
+
94
+ < div style ="margin: 10px 0px; font-weight: bold "> Hyperlinks</ div > < hr >
95
+ < table >
96
+ < tr >
97
+ < td > Enable Hyperlinks</ td >
98
+ < td > < input id ="opt_enable_hyperlinks "type ="checkbox "checked > </ td >
99
+ </ tr >
100
+ < tr >
101
+ < td > Keys</ td >
102
+ < td > < input id ="opt_hyper_keys "type ="text "placeholder ="Ex: url, main "value ="url, contributors "> </ td >
103
+ </ tr >
104
+ < tr >
105
+ < td > Hyperlink Target</ td >
106
+ < td > < input id ="opt_hyper_target "type ="text "placeholder ="Ex: _blank "value ="_blank "> </ td >
107
+ </ tr >
108
+ </ table >
109
+ < div style ="margin: 10px 0px; font-weight: bold "> Boolean Options</ div > < hr >
110
+ < table >
111
+ < tr >
112
+ < td > Show Text ?</ td >
113
+ < td > < input id ="opt_bool_show_text "type ="checkbox "checked > </ td >
114
+ </ tr >
115
+ < tr >
116
+ < td > Label for "true"</ td >
117
+ < td > < input id ="opt_bool_text_true "type ="text "placeholder ="Ex: Yes "value ="Yes "> </ td >
118
+ </ tr >
119
+ < tr >
120
+ < td > Label for "false"</ td >
121
+ < td > < input id ="opt_bool_text_false "type ="text "placeholder ="Ex: No "value ="No "> </ td >
122
+ </ tr >
123
+ < tr >
124
+ < td > Show Image ?</ td >
125
+ < td > < input id ="opt_bool_show_img "type ="checkbox "checked > </ td >
126
+ </ tr >
127
+ < tr >
128
+ < td > Url for "true"</ td >
129
+ < td > < input id ="opt_bool_img_true "type ="text "placeholder ="Ex: css/true.png "value ="css/true.png "> </ td >
130
+ </ tr >
131
+ < tr >
132
+ < td > Url for "false"</ td >
133
+ < td > < input id ="opt_bool_img_false "type ="text "placeholder ="Ex: css/false.png "value ="css/false.png "> </ td >
134
+ </ tr >
135
+ </ table >
136
+ </ div >
137
+ </ td >
138
+ </ tr >
139
+ </ table >
140
+
141
+
69
142
70
143
< div class ="buttons ">
71
144
< button id ="convert "> Convert</ button >
@@ -89,6 +162,9 @@ <h2>Alternatives</h2>
89
162
< li > < a href ="https://github.com/padolsey/prettyPrint.js "> prettyprint.js</ a > </ li >
90
163
</ ul >
91
164
165
+ < br />
166
+ < span > Boolean Icons by -< a href ="https://www.iconfinder.com/iconsets/onebit "> https://www.iconfinder.com/iconsets/onebit</ a > </ span >
167
+
92
168
93
169
< script src ="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.16.0/codemirror.min.js "> </ script >
94
170
< script src ="lib/crel.js "> </ script >