chiark / gitweb /
m.code: add a bunch of advanced .. include:: features.
authorVladimír Vondruš <mosra@centrum.cz>
Thu, 14 May 2020 10:50:44 +0000 (12:50 +0200)
committerVladimír Vondruš <mosra@centrum.cz>
Thu, 14 May 2020 12:14:44 +0000 (14:14 +0200)
commit1708a7598fdea3caf780f0da1a44e79178525193
tree0ae16543d3ca0d18cfe398e9b782e529176b9142
parent31dd0b86fe93eddbfcfd58fe076aff8a815517a7
m.code: add a bunch of advanced .. include:: features.

It was already useful, but this makes it even more. What's done:

-  :start-on: so it's possible to pin on something in the code without
   having to add a comment marker everywhere
-  :end-before: that can be empty, and thus simply stop at the end of
   the block
-  :strip-prefix: for removing excessive indentation as well as adding
   an ability to interpret code comments as reST.

All combined together, one can now embed Sphinx Gallery files (which can
be converted to ipynb files too) *and* still have a total flexibility
over what's done on the content formatting and layouting side, ignoring
boring portions of the source file etc etc.
doc/plugins/math-and-code-selfcontained.py [new file with mode: 0644]
doc/plugins/math-and-code.rst
plugins/m/code.py
plugins/m/test/code/file.py [new file with mode: 0644]
plugins/m/test/code/page.html
plugins/m/test/code/page.rst