Live data from Hacker News

Json.human.js: Json Formatting for Human Beings

marianoguerra.github.io

1–10 of 71 posts

Re: Json.human.js: Json Formatting for Human Beings

#3
This is great! And nicely written--it would be very easy to modify this to format things differently. Eventually, it would be cool to have the conversion go both ways. That way it could be incorporated in a CMS (arbitrary structured content being passed around as JSON but displayed and edited in HTML).

Re: Json.human.js: Json Formatting for Human Beings

#4

This is great! And nicely written--it would be very easy to modify this to format things differently. Eventually, it would be cool to have the conversion go both ways. That way it could be incorporated in a CMS (arbitrary structured content being passed around as JSON but displayed and edited in HTML).

since css classes tell you what's inside you can recover it completely, also I was thinking on using HTML5's data- to store the data there too.

the next next step would be to provide in place edition with validation :)

Re: Json.human.js: Json Formatting for Human Beings

#5
I can understand the usefulness of things like Krumo[1] for PHP but I am struggling to understand the use-case for this. With a language like PHP you don't have direct manipulation abilities (without debugging using an extension) so it makes sense that you need to format the data before you send it to the client but with JS you have the ability to inspect the JS directly. Also I think JSON (with spaces/indentions/linebreaks) is extremely readable (Especially with things like PrettyPrint[2] installed).

Where do you see this being used?

[1] http://krumo.sourceforge.net/

[2] https://chrome.google.com/webstore/detail/prettyprint/nipdlg...

Re: Json.human.js: Json Formatting for Human Beings

#7

author here: let me know if you have any questions

Great work! Would be nice to add an option to convert json key names to human-friendly names(passed as a separate key value array). So a key like full_name can appear as "Your Name:" to the end user.

Re: Json.human.js: Json Formatting for Human Beings

#8

I can understand the usefulness of things like Krumo[1] for PHP but I am struggling to understand the use-case for this. With a language like PHP you don't have direct manipulation abilities (without debugging using an extension) so it makes sense that you need to format the data before you send it to the client but with JS you have the ability to inspect the JS directly. Also I think JSON (with spaces/indentions/lin…

I made it because my app (http://event-fabric.com/) receives arbitrary JSON and one of the options you have is to inspect what is going through the steps, so I need the ability to format arbitrary and possibly nested JSON in a pretty way but without hidding the JSON structure because the app is to actually inspect and manipulate that JSON.

until now I was using a pretty printer but the result was too "technical" for non programmers to see (at least that's my opinion).

Post reply on HN