Mike Samuel,
It is a great idea and I thought you might be interested in an implementation of literate programming for the statistical programming language “R”.
Have you heard of R Markdown? R Markdown is markdown with code blocks for the statistical programming language “R” and other programming languages.
The RStudio IDE allows users to create R Markdown (.rmd) which is markdown that is pre-processed by the R knitR package to Pandoc compatible markdown (.md) where it can be output to HTML, PDF or Microsoft Word.
I would like VS Code to do the same thing more generally for all VS Code supported languages
and added some information to an issue here: (I was learning as I posted, so the later posts are more informed).