QuantEcon / sphinxcontrib-jupyter

A Sphinx Extension for Generating Jupyter Notebooks
BSD 3-Clause "New" or "Revised" License
76 stars 23 forks source link

Make sure TOML files are copied by Jupinx #228

Closed arnavs closed 5 years ago

arnavs commented 5 years ago

The key is to make sure that whenever we are recreating the folder structure of notebooks, that we bring along the TOML files (if any) and not just the RST/IPYNB.

mmcky commented 5 years ago

@AakashGfude can we add an option that will bring files based on a pattern over to the build directory. Perhaps we could add

jupyter_execute_dependencies = {
    'lecture_name' : [<files>],
}

@arnavs this might be a fairly general way to approach this. As TOML files are directory dependent do you think this approach would be ok -- perhaps nominate the first lecture in each directory to copy the toml file?

Otherwise we could add:

jupyter_execute_lang_support = {
    'julia'   :  [".toml"],
}

to copy any support infrastructure across to the execution directory.

arnavs commented 5 years ago

Off the top of my head, I think the second approach is more robust... otherwise we'd have to keep track not to rename/delete the designated notebook for each directory, nominate one for new directories we create, etc.

arnavs commented 5 years ago

@mmcky @AakashGfude OK, in the TOML refactor branch of the lecture source I added the files to the main subdirectory where they’re needed.

So that is good to go for your testing.

mmcky commented 5 years ago

thanks @arnavs -- @AakashGfude let's brainstorm this when we met up this morning.

mmcky commented 5 years ago

We have decided to implement a general approach for file dependencies that can be file or directory level static objects.

jupyter_dependencies = {
    <dir> : ['file1', 'file2'],
    {<dir>}/<file.rst> : ['file1']
}

then this will be parsed and files copied.