dataspice
dataspice copied to clipboard
Discussion: Non-HTML output formats (like Rmd/md)
Had a great question in my dataspice demo at NCEAS today that dovetailed with something we had talked about at the unconf. What if we output to Rmd or md and the scientist could make use of that as they want. The Rmd/md could be converted to HTML still but the intermediate format would be of greater utility to the user.
Also had a suggestion for converting to Word or Google Docs in some form. The comment also pointed out that a lot of scientists (ours include) use Drive as a storage location over GitHub so being able to work with dataspice in a Google Drive workflow would be useful (making HTML output less useful).
Great idea! How would Rmd output format work? I might imagine something like asking the user to add a command like
embed_spice()
to their .Rmd, which would create either stand-alone html or png (think htmlwidgets::saveWidget() or webshot::webshot() for png) into the md output? Not sure how useful that would be. It could work for displaying a concise card format with some metadata (obviously the .png is the polar opposite of a machine-readable version of metadata, but we already have the dataspice.json for that...)
Alternately, maybe you are envisioning something rather more 'raw', i.e. a pure markdown text + links version of the data. One spin on that would be something like cite_spice(), which would give Markdown-formatted text output with the essential bibliographic information (i.e. authors, title, publication date, and link to the overall dataset url or identifier).
Yeah I'm not totally sure. More the latter? The Rmd could be in place of an index.html which could then be rendered into other formats as needed or modified after-the-fact with more R code / figures as desired.
- Multiple simultaneous outputs:
build_site()-> {docs/index.html,docs/index.Rmd - Give the user a
build_site()to build HTML and another function for a nearly equivalent Rmd?
One pain point would be inserting the JSON-LD into the HTML. I'm not sure if it has to be in the <head> tag or not for Google to see it. It's technically possible but I haven't worked out an implementation just yet. Possibly just an Rmd HTML template would be enough.
@amoeba Google's structured data validation tool sees it anywhere in the file, don't think it has to be in the <head>. I like the the Rmd template strategy! Perhaps one could just use the includes option to point to the JSON-LD text, though I guess you'd need to wrap it in a <script type="application/ld+json> thing first...
A light-weight version of the latter could certainly be the citation option like @khondula suggested in #57
See also my approach using rmd partials in codebook.