Sphinx setup: use autosummary to automatically generate module and class pages. #286
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
List of Changes
numpydocextension to sphinx. Now all our docstrings written in numpy style will not generate warnings.numpydocautomatically includes theautosummaryextension.autosummary_generate = Truehas been added todocs/source/conf.py. This will makeautosummarygenerate files whenever needed. Accordingly, the filesdocs/source/config.rst,docs/source/mobject.rst,docs/source/geometry.rstare no longer needed (a similar --and better-- version is generated byautosummary).-- the autogenerated files are put in
docs/source/_autogenerated/. This folder should be kept outside of version control.Motivation
The previous setup required to manually create a stub page for each module, each including just boilerplate code. With the new setup, the
autosummaryextension does that on its own.Explanation for Changes
The
autosummaryextension seeks out anyautosummarydirectives in each document and generates new files as needed. The new files are put insource/_autosummary. The name of this folder may be changed later.Testing Status
All tests pass locally.
Further Comments
I realized that the
numpydocextension was not installed/included in our sphinx setup. Once I added it, numpydoc included autosummary, and I realized we could use it to streamline our setup. Once this PR is merged, I'll go back to what I was actually trying to do with numpydoc...Acknowledgement