sphinxcontrib-jupyter
sphinxcontrib-jupyter copied to clipboard
FEAT: Support for generalised directory structures
It would be nice to have support for generalised directory structures so projects can be fully configurable. Currently the extension requires _static
to be included in the source directory and is copied to the target directory by default.
We should change this so the _static
folder can be located anywhere and assets are pulled in as required. When visit_image
is parsed then we can copy the individual file to the build folder and update the link in the resulting notebook.
While making this change we could arrange the files in the build folder by type?:
images
and figures
-> { BUILDDIR }/_images
downloads
-> { BUILDDIR }/_downloads
otherwise we can preserve the same folder structure
this is more in line with the latest HTML
writer and only static
assets that are used would be copied to support the built page. For reference the html
writer adopts a flat _images
directory for image files to support the site and ignores any other path specifications. If two files have the same name -- a second file is added with a number appended to the filename and that file is referenced in the html
. so a resulting structure in html
case is:
build/_images/file.png #_static/file.png
build/_images/file1.png #source/_static/file.png
the above example is contained in the attached test repo (below)