Every software developer defines and uses variables. If variables are so powerful, why do WYSIWYG word processors lack the ability to quickly and easily insert variable definitions?[4] In the screenshot, the left-hand side provides an editable variable definition hierarchy, the middle pane provides a Markdown editor, and the right-hand side provides a real-time HTML preview of the content with variables interpolated and substituted.
After variables, programming language integration--such as R[5]--comes naturally. Consider the following syntax (that could be hidden through a UI):
`r#csv2md('data.csv',totals=TRUE)`
The function imports data from an external data source and converts it to Markdown. The HTML version can be styled, or piped through pandoc to create beautiful PDF output[6]. In the screenshot, the left-hand side shows the csv2md command (totals are calculated automatically for numeric columns), the middle pane shows an HTML preview (real-time), and the right-hand side shows a PDF produced from the same source document using pandoc and ConTeXt.The CSV file could also be a JSON request over HTTP, or database query, meaning that the document is always up-to-date with the most recent data: a living document. This could be accomplished without having to change the source document, as well:
`r#import(v$data$source,totals=TRUE)`
Here, v$data$source is a variable that defines a data source. In this case, the value might be 'data.csv', but could be 'protocol://host/app/api/json'. The variables themselves could be sourced from a YAML file, JSON data stream, or remote database.This is what I've been working towards for the last several months.[7] There's more that this editor can do, but it's still in early beta stages, should anyone care to try it.
[1]: https://github.com/jgm/pandoc/issues/168
[2]: http://pandoc.org/
[3]: http://wiki.contextgarden.net/
[4]: https://raw.githubusercontent.com/DaveJarvis/scrivenvar/mast...
[5]: https://github.com/bedatadriven/renjin/