Via installation optional dependency
$ pip install package_name[docs]
Via a discover mechanism that looks at all importable modules, checks their __doc_url__
>>> import attending
>>> attending.get_the_docs()
As a runnable package that allows you to start viewing the docs
$ python -m attending
We should add version-dependent docstring?
-
Get the doc URL from PyPI API.
In the top level object has the 'project_urls' key, and we could use the 'Documentation' attribute.
This is typically a link to ReadTheDocs, which would allow us download an html zip file
-
Download said zip file
-
Unzip the file in a cache directory
The optional dependency installation via pip would require some PyPI integration and changes, probably via a PEP.
- 3 things that need to work for someone to use it:
- get the docs
- view the docs
- "management" of docs
- need some tests
- need documentation (what)
- how to
- iterate over modules (find all packages and get the docs for them)
- preferred method for getting docs for package:
__doc_url__- read the docs
pypiproject url for documentation
- constructing a url that is paste-able (browser open would be dope)
- strict: only open docs that you have on your drive
- permissive: shows docs that are not the exact version that you are using.
- support
clean
- airplane
- lockdown network (gov labs)
- expensive/inconsistent access
- privacy conscious individuals.
- easy/trust of docs, the packages describe where to get the docs so you don't succumb to out of date docs online