rougier / from-python-to-numpy

An open-access book on numpy vectorization techniques, Nicolas P. Rougier, 2017
http://www.labri.fr/perso/nrougier/from-python-to-numpy
Other
2.05k stars 340 forks source link

Maybe use ReST include directives #23

Closed deeplook closed 7 years ago

deeplook commented 7 years ago

... if there's no policy of having everything in the ReST files. If not, includes would minimise the risk of code files and doc files being out of sync. And the ReST include directive has many options to pick only what you want, if you don't want to shoe the entire file. In the simplest case an include looks like this:

.. include:: code/anatomy.py
    :code: python

See http://docutils.sourceforge.net/docs/ref/rst/directives.html#including-an-external-document-fragment

rougier commented 7 years ago

I agree this is problematic, but it would need more work to split source code properly and get rid of copyright headers, some comments, etc.