Like regular programming, but with inverted comments, basically. Any text is a comment, except for specially marked lines or blocks, which are executable code. Comments by default = more comments = more documentation.
Literate Programming
-
Jupyter
Is a Literate Programming tool, mostly for Python but theoretically supports any language. Execution of code is implemented via Jupyter kernels. Code, comments and code section outputs are stored in so-called notebooks.