pyro icon indicating copy to clipboard operation
pyro copied to clipboard

Render code examples automatically with sphinx_gallery

Open eb8680 opened this issue 5 years ago • 5 comments

Currently our non-notebook examples are manually included in the examples webpage via custom .rst files in tutorial/source/. As the number of examples increases, it would be better to follow NumPyro's approach and generate HTML pages automatically with sphinx_gallery. This would make examples easier to find and read, improve the design of the tutorial page, and declutter our tutorial folder on GitHub. Many of the examples also contain extensive docstrings and comments that sphinx_gallery could automatically render in HTML.

More ambitiously, we might even aim to use sphinx_gallery to include tutorials in ReadTheDocs, simplifying our release process and removing the lag between new tutorials being added on GitHub and becoming visible on the examples web page.

eb8680 avatar Oct 14 '20 18:10 eb8680

More ambitiously, we might even aim to use sphinx_gallery to include tutorials in ReadTheDocs, simplifying our release process and removing the lag between new tutorials being added on GitHub and becoming visible on the examples web page.

This is what I wanted for a long time!

fehiepsi avatar Oct 14 '20 21:10 fehiepsi

This worked really well in NumPyro, so hopefully we can just copy the sphinx_gallery boilerplate from there and set up similar redirects to keep links alive.

eb8680 avatar Nov 05 '20 04:11 eb8680

As motivation, I forgot to manually update tutorials during Pyro's 1.5.1 release, so users like @lucapinello experienced errors. Indeed it would be nice to automate this and eliminate possibility of human error.

fritzo avatar Jan 04 '21 17:01 fritzo

Hello! Is this issue available to work on? If so, I would like to claim it! I plan to have a pull request submitted in two weeks.

gioviebell avatar Jul 26 '25 04:07 gioviebell

@gioviebell go ahead! but you may want to describe your plan of action before doing too much work and submitting a PR

martinjankowiak avatar Jul 27 '25 00:07 martinjankowiak