Hey Rich,
On 5/9/2012 3:50 PM, Rich Morin wrote:
> I'm wondering about the current status and near-term prospects for
> making YARD output machine-friendly. For example, YARD pages could
> include RDFa markup or a YARD server could emit JSON, on request.
>
Good question. JSON data has actually been brought up a few times for
search, as well as for building custom templates (we could theoretically
completely scrap our template API and have customizations be done via
JS). Theoretically, we could just do something like Ember.js and have
docs be a one-page app that just build off of a js file with all of the
object data in it. Doing this would actually cut YARD's runtime by
significant amounts, since generating HTML is the most expensive part of
the process right now.
There are performance issues with that though, so we never really went
that far into it. There are also some issues regarding how browsers deal
with "cross-domain" requests on local file:// URLs.
The hybrid solution seems like the best fit, having JSON output only in
the YARD server. This might be a better fit for a plugin right now
though, given that it's not really on our current priority list-- that
might change in a few releases. Figuring out exactly how to split up the
data would be the biggest concern, as serving it all at once would
probably bog down a JSON client. I suppose the best fit would be to list
content per namespace. Again, these decisions are easier if they are
left out of core, so if you can come up with a plugin, that would be
probably be useful.
rubydoc.info could certainly install it.
Loren