Open EvanKirshenbaum opened 7 months ago
This issue was referenced by the following commit before migration:
Auto-generated docs are currently in https://pages.github.azc.ext.hp.com/evan-kirshenbaum/thylacine/
I see that you pushed the change to .gitignore
. What was it you had to do to make it so the CSS files got seen, and does that need to be pushed as well?
The change to make the CSS files work is in the doc
branch. It is already there. It has been added in this commit. The change is in the html
directory and can't be merged in the master
.
Here is a reference to fixing the CSS issue https://docs.github.com/en/pages/getting-started-with-github-pages/about-github-pages#static-site-generators
Following the instructions here, I've modified the standard templates for modules and classes to generate member information.
It all seems to work, but it gives me a whole load of errors, all of the form either
D:\dmf-git\thylacine\mpam\src\mpam\device.py:docstring of mpam.device.Pad:1: WARNING: duplicate object description of mpam.device.Pad, other instance in stubs/mpam.device, use :noindex: for one of them
or
D:\dmf-git\thylacine\mpam\doc\stubs\mpam.device.Pad.rst:42: WARNING: autosummary: failed to import Pad.broken.
(always zero or more of the first followed by one of the second). I really have no clue what it's complaining about, but even though I'm typically an "absolutely no warnings allowed" kind of guy, unless I can figure this out rather quickly, I'm going to let these go and merge this into the master branch so that I can get on with the task of actually adding documentation comments.
I also cloned sphinx-build
into tools/build_doc.py
so that the documentation can easily be built from an IDE.
I think the warning are because the environment is dirty from the other builds. Try make clean
first.
I already tried that. It didn't help. I also nuked the files in the stubs
dir (which make clean
doesn't). Didn't help.
Hmm... Once the initial documentation is built, if you actually add a doc comment and rerun, the warnings don't reappear. Maybe we can live with this (at least for a while).
In #81, I've worked my way through adding Sphinx docstrings to mpam.types. It took longer than I expected, but I think I've now figured it out, and it should go faster in the future.
In the process, I've changed the Sphinx theme to "Read the Docs", which I think looks a fair bit nicer for API documentation. To use it, it needs to be installed using pip
:
$ pip install sphinx-rtd-theme
There is a bug(?) in their presentation that prevents line wrapping, but I found a fix here, and it can be found in doc/_static/theme_overrides.css
.
I also played around a bit with the templates themselves, mostly to distinguish between locally-defined and inherited attributes and methods. The revised templates can be found in doc/_templates
.
There are still a few rough spots that need to be worked out, but I think it'll do for now. In particular,
"inherited-members"
to autodoc_default_options
in conf.py
, but if you do that, you get lots of unnecessary hits when searching, since it thinks that the attributes/methods show up in every class.I've merged the Sphinx setup changes and the mpam.types
documentation into master
. I'll now start pushing through with documenting the rest of the system.
sphinx-rtd-theme
should be added to requirements.txt
Who's the audience for requirements.txt
? It's only required for developers who plan on generating documentation. It isn't needed to simply run the code. I haven't looked closely at the spec for that file (wrt pip). Is there any notion of being able to break it into use cases?
Besides, requirements.txt
isn't actually in the master
branch yet. :-)
It is for the developers. For users we should list the requirements in a setup.py
file. See here: https://packaging.python.org/en/latest/discussions/install-requires-vs-requirements/
install_requires is a setuptools setup.py keyword that should be used to specify what a project minimally needs to run correctly.
Whereas install_requires defines the dependencies for a single project, Requirements Files are often used to define the requirements for a complete Python environment.
Migrated from internal repository. Originally created by Rares Vernica on Apr 11, 2022 at 4:56 PM PDT.
The warnings we are seeing might be due to this bug https://github.com/sphinx-doc/sphinx/issues/7817
We probably want to add mpam.exerciser
to index.rst
as well so it gets documented.
_ASF_Thread
seems to be ignored by Sphinx. Probably because it starts with _
If I add :meta public:
to its docstring, it will show up (in full) on the mpam.device page (and in searches), but even then it won't show up on its own page or in the summary tables (including the left-hand ToC column). This is apparently a known Sphinx bug.
@EvanKirshenbaum Can you please add this link https://pages.github.azc.ext.hp.com/evan-kirshenbaum/thylacine/ to the About section of the project in GitHub. This way we can quickly access the docs. Just click on the No description, website, or topics provided. text and paste it there.
Done.
After we moved the repository to DMFSoftware the docs are available here https://pages.github.azc.ext.hp.com/DMFSoftware/thylacine/ I updated the link in the About section of the repository.
Use external library to auto-generate code documentation
Migrated from internal repository. Originally created by Rares Vernica on Mar 24, 2022 at 5:31 PM PDT.