Example repository for setting up a pip installable project
https://my_package.readthedocs.io/en/latest/ Read this to understand how to set up the automated documentation
To install run the following line in your environment
pip install git+https://github.com/MikeSmithLabTeam/my_package
To update run the following line in your environment
pip install --upgrade git+https://github.com/MikeSmithLabTeam/my_package
-
Install sphinx
pip install sphinx
-
Change to the docs directory
cd docs
-
Run sphinx-quickstart
sphinx-quickstart
-
Edit the conf.py file
Add the following lines to the top of the file
import os import sys sys.path.insert(0, os.path.abspath('../my_package'))
Add the following lines to the extensions list
'sphinx.ext.autodoc', 'sphinx.ext.coverage', 'sphinx.ext.napoleon', 'sphinx.ext.viewcode',
Add the following lines to the end of the file
# -- Extension configuration ------------------------------------------------- autodoc_mock_imports = ['numpy', 'pandas', 'matplotlib', 'scipy', 'sklearn', 'seaborn', 'statsmodels', 'tensorflow', 'torch', 'keras', 'xgboost', 'lightgbm', 'catboost']
-
Run sphinx-apidoc
sphinx-apidoc -f -o source/ ../my_package
-
Build the docs
make html
-
Open the docs
open _build/html/index.html