Live data from Hacker News

Json.human.js: Json Formatting for Human Beings

marianoguerra.github.io

51–60 of 71 posts

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

#51
post #48

I dump my JSON as YAML. Even if you are not using YAML for saving data (and I don't -- in Python at least PyYAML is orders of magnitudes slower than the built-in JSON), it is nicer to read.

YAML was my first thought as well. Why not a library that converts back and forth and displayed the YAML in a pre tag or textarea? Then you could edit the YAML and after converting back still have valid JSON.

YAML is a superset of JSON, but as long as the YAML used to convert to JSON started as JSON, there shouldn't be a problem.

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

#53
post #12

I use this almost daily, lets you easily format/compact and edit JSON through a GUI: http://jsoneditoronline.org/ Easy to use, and makes working with complex JSON a snap. The source is also available: https://github.com/josdejong/jsoneditor/

I think a tree view make for more sense for navigating JSON. The table view of the parser is very confusing for any JSON with lots of nesting.

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

#54

You know, it's funny but I find the pretty-printed JSON easier to read than the formatted HTML.

Yes, but non-technical project members may not. This is pretty useful to pretty-print this information so it's readable in design docs, etc (it doesn't replace the json raw data, just explains it a bit better)

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

#55
post #52

I'm using Jason.app[1] on OS X which does this wonderfully (as desktop app). [1] https://github.com/tbrannam/Jason

Agreed, Jason.app is really handy for browsing, validating, prettifying, and minifying JSON. I think the outline view is even less friendly for a non-technical person though, listing every value as a name/data-type/value row.

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

#56
post #12

I use this almost daily, lets you easily format/compact and edit JSON through a GUI: http://jsoneditoronline.org/ Easy to use, and makes working with complex JSON a snap. The source is also available: https://github.com/josdejong/jsoneditor/

I think a tree view make for more sense for navigating JSON. The table view of the parser is very confusing for any JSON with lots of nesting.

If you add an assignment at the beginning, you can do this in your browser console :)

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

#57
post #48

I dump my JSON as YAML. Even if you are not using YAML for saving data (and I don't -- in Python at least PyYAML is orders of magnitudes slower than the built-in JSON), it is nicer to read.

I use YAML for configs, as an option for API endpoints, and sometimes for debugging. Anything else that's computer-to-computer is JSON.

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

#58

This would be a fantastic option for the admin interface's of JSON document stores like CouchBase, ElasticSearch or RethinkDB. JSON is easy to read, but can get hard to visually parse when the payload is large.

I built something like this, but with the added functionality of admin-style inputs, much like what you seem to be looking for.

It's working (not done yet), but I've got an update on my local that I need to iron a bit before I commit.

Oh, and the name sucks.

https://github.com/dclowd9901/lscenery

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

#59
I did something similar a few years ago with the HTML5 JSON Report Format: https://github.com/ServiceStack/ServiceStack/wiki/HTML5Repor...

It's been baked into http://www.servicestack.net web service fx and lets you see a human readable view of every web service response when called from a browser (i.e. Accept:text/html).

It's also has dynamically sortable table rows and is also completely static/stand-alone. It's just a static template that wraps an embedded JSON response and converting it to HTML on the fly and injecting it the page (all client-side / use view-source).

Here's a live preview of it in action: http://servicestack.net/ServiceStack.Northwind/customers/ALF...

And the JSON service it's wrapping: http://servicestack.net/ServiceStack.Northwind/customers/ALF...

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

#60
post #48

I dump my JSON as YAML. Even if you are not using YAML for saving data (and I don't -- in Python at least PyYAML is orders of magnitudes slower than the built-in JSON), it is nicer to read.

I use YAML for configs, as an option for API endpoints, and sometimes for debugging. Anything else that's computer-to-computer is JSON.

I still like INI for configs. It's extremely simple and hard to mess up, and I think it's more readable than JSON.
Post reply on HN