4 ms·
Jupyter notebooks seem to be the modern form for literate programming. People are writing entire books in the literate style: http://nbviewer.jupyter.org/gith
by jpfr 8y ago
Jupyter notebooks seem to be the modern form for literate programming.
People are writing entire books in the literate style:
http://nbviewer.jupyter.org/github/rlabbe/Kalman-and-Bayesian-Filters-in-Python/blob/master/table_of_contents.ipynb http://nbviewer.jupyter.org/github/rlabbe/Kalman-and-Bayesia...
The style is similar to literate classics like "Structure and Interpretation of Computer Programs" and "Structure and Interpretation of Classical Mechanics".
The only downside is version control. Jupyter uses a custom file format. It is difficult to work with colleagues on the same notebook, since we cannot use the usual code-versioning tools (git/diff/etc.) to manually merge together concurrent changes.
Anybody knows a good solution for this?
- make3 8y ago> Jupyter uses a custom file format For those curious, the ipynb files are json files, and the code is stored in an array of cells, as string entries
- sasvari 8y agoYou can use a filter in your gitconfig to strip away the outputs, and thus make it play nicer with git [0]. gitconfig: [filter "nbstrip_full"] clean = "jq --indent 1 \ '(.cells[] | select(has(\"outputs\")) | .outputs) = [] \ | (.cells[] | select(has(\"execution_count\")) | .execution_count) = null \ | .metadata = {\"language_info\": {\"name\": \"python\", \"pygments_lexer\": \"ipython3\"}} \ | .cells[].metadata = {} \ '" smudge = cat required = true gitattributes: *.ipynb filter=nbstrip_full [0] http://timstaley.co.uk/posts/making-git-and-jupyter-notebooks-play-nice/ http://timstaley.co.uk/posts/making-git-and-jupyter-notebook...
- avodonosov 8y agoREADME files on higher level (modules, subsystems), comments on the level of individual files.
- cup-of-tea 8y ago> Anybody knows a good solution for this? It's right here where you're commenting: org-mode.
- yug_blop 8y agoorg-babel: https://orgmode.org/worg/org-contrib/babel/ https://orgmode.org/worg/org-contrib/babel/