executablebooks / sphinx-tomyst

A sphinx translator for producing myst syntax files
MIT License
5 stars 2 forks source link

Issue with including code files via `literalinclude` #92

Closed mmcky closed 4 years ago

mmcky commented 4 years ago

There is an issue with translation of literalinclude to myst

.. literalinclude:: /_static/lecture_specific/optgrowth_fast/ogm.py

includes the contents of the file in the myst output.

This helps with not requiring to copy over assets when translating to myst but isn't a particularly friendly approach to translation.

We could:

mmcky commented 4 years ago

The _static folder is currently copied to bring across figures -- so if we assume there are no externally referenced files (which I think is reasonable assumption for now) then we should

include literalinclude direct in the myst rather than include the content this won't work for execution. See issue https://github.com/executablebooks/MyST-NB/issues/274

mmcky commented 4 years ago

Perhaps the best solution will be as suggested in https://github.com/executablebooks/MyST-NB/issues/274 and translate literalinclude items to code-cell that is read in from a file.

Updated Decision:

I think sphinx-tomyst should actually be updated to add literalinclude directive and a file reference (as that is a true represnetation of the rst) and any adaptation required to bring in executability to the jupyter-book workflow is an update to the source markup

mmcky commented 4 years ago

fixed by PR #93