Open FilBot3 opened 4 years ago
Anyone? Bueller?
I guess this isn't going to get any looks.
git clone git@github.com:microsoft/azure-devops-python-api.git
Then change directories into the project.
python -m pip install sphinx
sphinx-quickstart \
--sep \
--project "azure-devops" \
--author "Microsoft" \
--release "2023" \
--language "en" \
--ext-autodoc \
--makefile \
./docs
This will put the config and other files into the docs/
folder.
Open docs/conf.py
. Add the following lines towards the top.
import os
import sys
sys.path.insert(0, os.path.abspath('../../azure-devops/azure'))
[!Warning] Path inserts I'm still working on what to do with this. So far it's not working as I remember.
Open docs/conf.py
and add the following lines to extensions.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.napoleon' # Needs to be installed.
]
sphinx-apidoc --force --output-dir source ../azure-devops/azure
If you're using split directories, then instead of .
, you would put the output into source
.
Add the sections with ++
.
.. azure-devops documentation master file, created by
sphinx-quickstart on Mon May 1 13:42:46 2023.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to azure-devops's documentation!
========================================
++ .. automodule:: azure.devops
++ :members:
++ :undoc-members:
++ :show-inheritance:
.. toctree::
:maxdepth: 2
:caption: Contents:
++ modules
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
The only piece that is truly desired is the modules
directive on the same indentation as toctree
.
You need to do the [[#Build API Docs in rST]] first, then you can perform this step.
make html
Now the HTML documentation should be available in build/html/index.html
.
Is there a way to use Sphinx to build documentation that would list the Function/Methods, their parameters, and expected returns? Using
pydoc
doesn't seem to format the docstrings properly.Also, if it were made using something like this:
it might be easier to decipher.