A useful thing came out from this discussion with @Kaspar.
We currently hide all import statements in the API nbs. But we should only hide what’s not to be seen, but more precisely we shouldn’t hide the important imports.
So you can see in the modified version of https://docs.fast.ai/utils.ipython.html#utils.ipython
while it still hides the show_doc
-related imports it shows the important import:
from fastai.utils.ipython import *
Unless there are objections, I think all API nbs should do that.
Any takers to do it for all nbs?
@ashaw, can we please also modify the doc skeleton generator to create two code cells for imports, one hidden as it is now and another not hidden with just the one line import for that module? as I have done it with https://docs.fast.ai/utils.ipython.html#utils.ipython
update: Discussed this more with the devs, and the agreement is that unless the doc has examples at the top, e.g. https://docs.fast.ai/vision.html, then we want to have the page start with:
“To import the foo
module, use:” from foo import *
So here is the model to replicate: https://docs.fast.ai/utils.ipython.html#utils.ipython