Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leveraging examples in package documentation #6

Open
rstoneback opened this issue Jan 12, 2022 · 3 comments
Open

Leveraging examples in package documentation #6

rstoneback opened this issue Jan 12, 2022 · 3 comments

Comments

@rstoneback
Copy link
Contributor

rstoneback commented Jan 12, 2022

It would be great if users could directly run our examples in the documentation, or, if we could auto-ish build jupyter notebooks from our .rst files.

I currently am building an example in pysatMadrigal, but also here. In the future, if one changes, the other won't automatically. Examples are good, but low technical debt is also good.

  • We could make our existing doc examples jupyter notebooks within the docs. https://jupyter-sphinx.readthedocs.io/en/latest/
    We'd have to change all the instances of .. code:: in the .rst files to .. jupyter-execute:: The potential downside is I think RTD would then actually have to run all of our code to build the docs, which may involve downloading data.

  • Found a package that claims to couple with Sphinx to produce Jupyter notebooks. https://github.com/QuantEcon/sphinxcontrib-jupyter The code is in a code block but with a leading ```python so it fails when run. So close here but not quite right.

  • There are potentially options for converting existing docs to .ipynb. jupytext offers such a service, however, it doesn't support .rst but rather .myst . I ran jupytext on my DMSP example and it was a no go. It ran, but the .. code:: section wasn't treated as code. Everything gets loaded up into a big text type cell. There may be workarounds, like, auto translate .rst to .md first?

@rstoneback
Copy link
Contributor Author

Friendly ping @aburrell since this could involve a couple pulls I've requested review on.

@aburrell
Copy link
Member

Uggg, I might not be the person to ping on this 😝 I think we should not change our docs.

I know there's a place for these executable tutorials, but I always found them hard to use and never wanted to "just run things", since there was no guarantee it would work the same for me locally or be relevant for my slightly different situation. My view is that these are best reserved for published examples, since you want them to always be the same.

@rstoneback
Copy link
Contributor Author

Good to know. I was really hoping we could have our docs and make them tutorials too.
Doesn't look like the packages are quite there yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants