jupyterlite-sphinx icon indicating copy to clipboard operation
jupyterlite-sphinx copied to clipboard

Allow adding contents from outside the Sphinx source directory

Open agriyakhetarpal opened this issue 7 months ago • 0 comments

Description

This PR allows the jupyterlite_contents configuration option to pick up contents from app.srcdir, i.e., to add notebooks outside docs/ or docs/source/. For example, it can be used to include a directory from outside the docs, say, in an examples/ folder that's in the repository's root folder (a pattern that's often the convention in the structure of a Python package) or any other path on their machine.

Support for including paths inside the srcdir and for glob patterns is retained.

Therefore, users may now specify the following in conf.py

jupyterlite_contents = [
  "./custom_contents/",
  "../my_example_dir/**",
  "../my_other_example_dir/**",
  "/Users/username/absolute/path/to/notebook.ipynb",
]

and so on, or absolute paths on their machine if they wish to.


Closes #261 This also came up in statsmodels/statsmodels#9536

agriyakhetarpal avatar Apr 11 '25 11:04 agriyakhetarpal