0

I'm working a site to generate reports on a lot of data in unpredictable formats. My (current) plan is to organize the content like so:

/content/raw/      # holds raw .csv, .json, .etc, isn't routed

/content/data/     # holds ruby scripts to generate nice formatted
                   # JSON from the appropriate raw data files,
                   # routed to /data/*.json

/content/listings/ # holds ruby scripts to generate JSON which represents
                   # an HTML table or HighChart object and based upon the
                   # formatted data items above, routed to /listings/*.json
                   # (and imported via AJAX to display on appropriate pages)

/content/assets/   # mostly passed through, filtering SASS to CSS, routed to
                   # /assets/*.ext

/content/pages/    # holds Markdown pages filtered to HTML and included in a 
                   # layout, with a special helper to inject graphs/tables
                   # by identifying a listing item, routed to /*index.html

I'm not certain this is the best way to go about it however. In particular, I'm not sure how to work with nanoc so it knows to, say, regenerate a listing which depends on a raw data file which has been replaced with a new version. I also need to know how to write the Rules so that it uses Ruby code from within the item itself (and I'm not sure this is a good practice). Thoughts?

Steven Clontz
  • 945
  • 1
  • 11
  • 20
  • why do you need "to write the Rules so that it uses Ruby code from within the item itself"? as you say it doesn't seem to be good practice. I guess you could put some ruby code in the meta header and call it with `eval` or something linke that. – froderik Apr 26 '14 at 10:11
  • ruby scripts to generate json should probably be put in `lib` and called from `Rules`. are you indicating that the Ruby scripts inthemselves may be dynamic? – froderik Apr 26 '14 at 10:13

0 Answers0