docs: def _knit(fin, fout,
                opts_knit='progress=FALSE, verbose=FALSE',
                opts_chunk='eval=FALSE'):
          """Use knitr to convert r markdown (or anything knitr supports)
          to markdown.
  
          fin / fout - strings, input / output filenames.
          opts_knit - string, options to pass to knit
          opts_shunk - string, chunk options
  
          options are passed verbatim to knitr:knit running in Rscript.
          """
          script = ('sink("/dev/null");'
                    'library(knitr);'
                    'opts_knit$set({opts_knit});'
                    'opts_chunk$set({opts_chunk});'
                    'knit("{input}", output="{output}")')
  
          rcmd = ('Rscript', '-e',
                  script.format(input=fin, output=fout,
                                opts_knit=opts_knit, opts_chunk=opts_chunk)
                  )
  
          p = subprocess.Popen(rcmd,
                               stdout=subprocess.PIPE,
                               stderr=subprocess.PIPE)
          stdout, stderr = p.communicate()