Implementation:Scikit learn Scikit learn SphinxConf
| Knowledge Sources | |
|---|---|
| Domains | Documentation, Build Tools |
| Last Updated | 2026-02-08 15:00 GMT |
Overview
Concrete tool for configuring the Sphinx documentation build system provided by scikit-learn.
Description
This is the Sphinx configuration file (conf.py) for the scikit-learn documentation. It configures all Sphinx extensions including autodoc, autosummary, numpydoc, sphinx-gallery, intersphinx, and custom extensions for code linking. The file sets up theme configuration, gallery examples, HTML output options, LaTeX settings, and custom link resolvers for GitHub source code integration.
Usage
Use this configuration when building the scikit-learn documentation locally, modifying documentation build behavior, adding new Sphinx extensions, or customizing the HTML theme and output settings.
Code Reference
Source Location
- Repository: scikit-learn
- File: doc/conf.py
Signature
# Sphinx configuration file
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"numpydoc",
"sphinx.ext.linkcode",
# ... additional extensions
]
# Key configuration variables
project = 'scikit-learn'
html_theme = 'scikit-learn' # custom theme
Import
# This file is executed by Sphinx, not imported directly
import sphinx_gallery
from github_link import make_linkcode_resolve
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| Source code | Python files | Yes | scikit-learn source code for autodoc extraction |
| RST files | text files | Yes | ReStructuredText documentation source files |
| Examples | Python scripts | Yes | Gallery example scripts for sphinx-gallery |
Outputs
| Name | Type | Description |
|---|---|---|
| HTML documentation | HTML files | Rendered HTML documentation website |
| LaTeX documentation | LaTeX files | Rendered LaTeX/PDF documentation |
| API reference pages | HTML files | Auto-generated API reference from docstrings |
Usage Examples
Basic Usage
# Build the documentation from the doc/ directory:
# make html
# Or using sphinx-build directly:
# sphinx-build -b html . _build/html