Pre-run cells for intensive computation
See original GitHub issueI am currently adding jupyter-sphinx to the docs for a project where some methods are especially expensive to run (e.g. connecting to a slow cloud service for running a job) or not feasible to run on our CI runners (e.g. not wanting to use private API keys and credits for the cloud service just for CI and docs building), and would prefer being able to just run it once locally and use the output.
I could not see such this feature available from looking around the docs or looking through the scripts in this repo, but if this is already possible that would be great. This is already available in nbsphinx, but I would prefer to see this in jupyter-sphinx for the added benefit of working inline from the .rst files.
Feature requested: insert the output from locally running the contents of the cell into the .rst file and have it display as if the cell had been run, using the same formatting as usual.
Possible implementation: a :dont-run:
directive to skip the execution of the cell and just pass it straight to the cell formatting
Temporary hack idea: the first with the code using :hide-output:
and :raises:
to accept that it will throw an error when there is no API key found, and the second with just print(...)
and :hide-code:
to simulate the output. This would still mean the expensive calls will be made when I am just trying to build the docs locally, which kinda sucks.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (6 by maintainers)
Top GitHub Comments
#141 by @willsimmons1465 should incorporate your use case, sorry for my delay in reviewing, I’ll get to it soon 🤞
Closed via #141