Chilipp / sphinx-nbexamples

⛔️ Deprecated: Create an examples gallery with sphinx from Jupyter Notebooks
MIT License
15 stars 11 forks source link

Thunbernail figure missing when gallery_dirs is not None #18

Closed lhoupert closed 3 years ago

lhoupert commented 3 years ago

Hi @Chilipp , Thank you very much for the great work you did!

I encountered a bug when I set up gallery_dirs to a not None value.

My example_gallery_config variable is below:

example_gallery_config = {
     'examples_dirs': '../notebooks/',   # path to your example scripts
     'gallery_dirs': 'source/notebooks/',  # path to where to save gallery generated output
     'pattern': '0.+.ipynb',
     'dont_preprocess': True,
     'toctree_depth':2,
}

When I run make html, I got these warning:

1233]± make html                                                                                                                             ✹ ✚ ✭ 17:15:29
Running Sphinx v3.5.1
/home/lhoupert/miniconda3/envs/th_routing/lib/python3.9/site-packages/sphinx_nbexamples/__init__.py:1165: RemovedInSphinx40Warning: The app.add_stylesheet() is deprecated. Please use app.add_css_file() instead.
  app.add_stylesheet('example_gallery_styles.css')
loading pickled environment... done
[NbConvertApp] WARNING | Config option `kernel_spec_manager_class` not recognized by `NbConvertApp`.
Scaling ./images/01_network.png to thumbnail ./images/thumb/gallery_._01_generate_network.ipynb_thumb.png
[NbConvertApp] WARNING | Config option `kernel_spec_manager_class` not recognized by `NbConvertApp`.
Scaling ./images/02_best_route.png to thumbnail ./images/thumb/gallery_._02_compute_best_route.ipynb_thumb.png
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 10 source files that are out of date
updating environment: 0 added, 1 changed, 0 removed
reading sources... [100%] notebooks/index                                                                                                                     
/media/lhoupert/home_w10/Work/Dev/Python/th_routing/docs/source/notebooks/index.rst:25: WARNING: image file not readable: source/notebooks/images/thumb/gallery_source_notebooks_01_generate_network.ipynb_thumb.png
/media/lhoupert/home_w10/Work/Dev/Python/th_routing/docs/source/notebooks/index.rst:40: WARNING: image file not readable: source/notebooks/images/thumb/gallery_source_notebooks_02_compute_best_route.ipynb_thumb.png
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] th_routing_readme                                                                                                                    
generating indices... genindex py-modindex done
highlighting module code... [100%] th_routing.tools                                                                                                           
writing additional pages... search done
copying images... [100%] notebooks/images/01_generate_network_1.png                                                                                           
copying downloadable files... [100%] notebooks/02_compute_best_route.ipynb                                                                                    
copying static files... done
copying extra files... done
dumping search index in English (code: en)... done
dumping object inventory... done
build succeeded, 2 warnings.

I got particularly these two warnings:

/media/lhoupert/home_w10/Work/Dev/Python/th_routing/docs/source/notebooks/index.rst:25: WARNING: image file not readable: source/notebooks/images/thumb/gallery_source_notebooks_01_generate_network.ipynb_thumb.png
/media/lhoupert/home_w10/Work/Dev/Python/th_routing/docs/source/notebooks/index.rst:40: WARNING: image file not readable: source/notebooks/images/thumb/gallery_source_notebooks_02_compute_best_route.ipynb_thumb.png

It seems that the programme seems to be searching the images in docs/source/notebooks/source/notebooks/images/thumb instead of docs/source/notebooks/images/thumb. Then the results is that the thumbnail figures are not available.

I found a quick fix by copying my directory images/thumb into a folder docs/_build/html/notebook/source/notebooks/images/thumb

If you tell me where the I can fix the code that generate the figure path in the index.rst, I am happy to do a PR

Thanks,

loïc

lhoupert commented 3 years ago

Any idea @Chilipp ?

Chilipp commented 3 years ago

Hey @lhoupert! my apologies for the delay! Unfortunately I do not have resources at the moment to work on sphinx-nbexamples and I'd like to deprecate it anyway (https://github.com/Chilipp/sphinx-nbexamples/issues/17#issuecomment-782036624).

My honest apologies for these troubles. I recommend you to move to nbsphinx. Or do you think it makes sense to transfer the sphinx-nbexamples to a public space, such as sphinx-contrib?

lhoupert commented 3 years ago

Hi @Chilipp , thank you for your answer! Sorry I didn't realise you were stopping the way. I will move to nbsphinx.

It could be a good idea to transfer sphinx-nbexample to sphinx-contrib!