{"library":"sphinxcontrib-apidoc","title":"Sphinx Contrib Apidoc","type":"library","description":"sphinxcontrib-apidoc is a Sphinx extension designed to automate the process of running `sphinx-apidoc` on each build, thereby generating API documentation from Python packages. It streamlines the integration of API documentation into Sphinx projects. The current version is 0.6.0. This project is in maintenance mode, as Sphinx 8.2.0 and newer include a built-in extension offering similar functionality, and new users are encouraged to use the native Sphinx extension instead. [1, 9]","language":"python","status":"maintenance","last_verified":"Thu Apr 16","install":{"commands":["pip install sphinxcontrib-apidoc"],"cli":null},"imports":["extensions = ['sphinxcontrib.apidoc']"],"auth":{"required":false,"env_vars":[]},"links":{"homepage":null,"github":"https://github.com/sphinx-contrib/apidoc","docs":null,"changelog":null,"pypi":"https://pypi.org/project/sphinxcontrib-apidoc/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null},"quickstart":{"code":"import os\nimport sys\n\nsys.path.insert(0, os.path.abspath('.'))\n\n# conf.py in your Sphinx documentation source directory\n\nproject = 'MyProject'\ncopyright = '2023, MyAuthor'\nextensions = [\n    'sphinx.ext.autodoc',\n    'sphinx.ext.napoleon',\n    'sphinxcontrib.apidoc'\n]\n\n# --- sphinxcontrib-apidoc specific configuration ---\n# Path to the Python package to document (relative to conf.py)\napidoc_module_dir = '../../my_python_package'\n# Output directory for generated API docs (relative to conf.py)\napidoc_output_dir = 'api_reference'\n# Exclude 'tests' directory from API generation\napidoc_excluded_paths = ['tests']\n# Put documentation for each module on its own page\napidoc_separate_modules = True\n# Filename for a table of contents file (defaults to 'modules')\napidoc_toc_file = 'index'\n# End of sphinxcontrib-apidoc specific configuration ---\n\nhtml_theme = 'alabaster'","lang":"python","description":"To quickly integrate `sphinxcontrib-apidoc`, first ensure it's installed. Then, edit your Sphinx `conf.py` file to add `'sphinxcontrib.apidoc'` to your `extensions` list. Crucially, configure `apidoc_module_dir` to point to the root of your Python package, relative to `conf.py`. You should also specify `apidoc_output_dir` for where the generated reStructuredText files will reside, and optionally, `apidoc_excluded_paths` to skip unwanted modules or directories. Finally, include the generated TOC file (e.g., 'api_reference/index') in your main documentation's `toctree`. [9]","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}