Currently, the solution is to call Pandoc after every dyndoc to convert from .html to .md (see mock code). The downside is that it requires that every user installs Pandoc and points it is in Stata, which is not a trivial task for all our collaborators.
Code:
* Copy the example files from the official dyndoc documentation to my path global mypath "C:/Users/JohnDoe/Desktop/dyndoctest" foreach file in dyndoc_ex.txt header.txt stmarkdown.css { copy "http://www.stata-press.com/data/r15/markdown/`file'" "${mypath}/`file'", replace } * Generates the same html output as found in http://www.stata-press.com/data/r15/markdown/dyndoc_ex.html cd "${mypath}" dyndoc dyndoc_ex.txt, saving(dyndoc_output.html) replace * What I have been doing is to convert this html into md using pandoc * but the user must have installed pandoc.exe in his computer for this to work local whereispandoc "C:/Users/JohnDoe/Pandoc/pandoc" local pandoc_cmd "`whereispandoc' ${mypath}/dyndoc_output.html -f html -t markdown -s -o ${mypath}/dyndoc_output.md" shell `pandoc_cmd'
Thanks for any advice!
0 Response to Stata markdown: can dyndoc create md files instead of html?
Post a Comment