In my spare time I've been developing a Java-based (don't hate me) WYSIWYM tool that integrates R, Markdown, and a fair bit more. For example, Scrivenvar can also transform XML into Markdown via XSLT, then use an R engine to perform computations that are substituted back into the Markdown document prior to generating an HTML preview from the final text. (For the OOP enthusiasts, it uses the Chain-of-Command design pattern.)
I wrote Scrivenvar because I wanted the ability to use interpolated variables while writing, so as to create documents free from duplicated content (e.g., character names, locations, and timeline calculations in a novel). (My favourite part of the book's R code is integration of a GIS API to compute driving distance based on the lat/long coordinates of two places in the novel, falling back to the Haversine formula if the website is unavailable; the number is then converted to English text using a Chicago Manual of Style function call. Effectively, if I change the lat/long of either location, the value of the book is updated without having to remember where in the text that that particular number was referenced.)
Once a YAML document is loaded, inserting a variable is quick: type a few letters from a value followed by Control+Space to insert the corresponding variable name. This is handy if for deeply nested variable hierarchies.
I wrote Scrivenvar because I wanted the ability to use interpolated variables while writing, so as to create documents free from duplicated content (e.g., character names, locations, and timeline calculations in a novel). (My favourite part of the book's R code is integration of a GIS API to compute driving distance based on the lat/long coordinates of two places in the novel, falling back to the Haversine formula if the website is unavailable; the number is then converted to English text using a Chicago Manual of Style function call. Effectively, if I change the lat/long of either location, the value of the book is updated without having to remember where in the text that that particular number was referenced.)
Once a YAML document is loaded, inserting a variable is quick: type a few letters from a value followed by Control+Space to insert the corresponding variable name. This is handy if for deeply nested variable hierarchies.
The software is open-source and very much beta:
https://github.com/DaveJarvis/scrivenvar
Ping me on GitHub if you like the concept and have comments or questions.