First, some history.
First, some history.
TeX (1978)
and he saw that it was good and wrote some books.
Knuth also developed the idea of literate programming (1981) (WEB, TANGLE, WEAVE).
Later, LaTeX was built on TeX, with better separation of formatting and content (1985).
For genius computer scientists, the document preparation problem was solved.
39 years later…
… the World Wide Web and HTML happen …
Markup languages
Literate programming (documents with markup and code)
Other formats
pandoc
Write in the markup format you like, convert to whatever formats you need.
Source code as literature.
Code and description are both given in the same source document.
A particular form of this knits text, code, and output into the final document.
(See also: Roxygen, pydoc as examples of a different type of literate programming. Neither of these types fully match Donald Knuth's initial vision.)
R
knitr
package by Yihui Xie to run code, knit text, code, and output into a markdown document.rmarkdown
package from RStudio automates using knitr
and pandoc
.Python
jupyter notebook
web-based environment.jupyter nbconvert
(uses pandoc
).Rmarkdown
package orchestrates all of this.