project-open-data / simple-catalog-generator

An experiment to make a jekyll-powered catalog generator
https://project-open-data.cio.gov/simple-catalog-generator/data.json
11 stars 7 forks source link

figure out how to create tiered json files #2

Open gbinal opened 10 years ago

gbinal commented 10 years ago

This is the hard part.

With the v1.1 schema, even the simplest of agency data listings will have multiple dimensions (see diagram and example file).

Questions:

The latter question is the major element of this issue.

gbinal commented 10 years ago

I think this is possible because of how the xml, csv, and html variants of the original model take the original json file and pull it into another structure. There's a slightly more complex version in play with the individual_apis.xxx files here.

gbinal commented 10 years ago

This can wait until I address #1, but then I'll need some help probably.

gbinal commented 10 years ago

Some answers might be found here - http://jekyllrb.com/docs/datafiles/

parkr commented 10 years ago

If you can provide an example of input and desired output, I might be able to come up with the proper piping or modify Jekyll to accommodate this use-case.

konklone commented 10 years ago

You may simply have to avoid jsonify entirely and build a custom JSON file using a template, as you would an HTML representation. It's uglier, and you'll need to use filters to accommodate for encoding issues on every field (e.g. always escaping fields that might contain quotation marks), but it sounds possible.