Sphinx extension for documentation in the Scrapy ecosystem.
Provides a
docstox environment.Generates a Read the Docs configuration.
Enables commonly-used Sphinx extensions.
Configures sphinx.ext.intersphinx for Python and Scrapy, and streamlines configuration for additional packages.
Allows you to easily link to Scrapy settings, request metadata keys, signals and commands:
:setting:`BOT_NAME` :setting:`LOG_LEVEL <scrapy:LOG_LEVEL>` :reqmeta:`download_slot` :signal:`spider_opened` :command:`crawl`
Configure in
pyproject.tomlthe Python version for documentation builds, e.g.:[tool.sphinx-scrapy] python-version = "3.14"
It must be supported by Read the Docs.
Add to
docs/requirements.txt:sphinx-scrapy==0.7.2
Add to
docs/conf.py:extensions = [ "sphinx_scrapy", ]
To automatically configure sphinx.ext.intersphinx for installed supported packages, set:
scrapy_intersphinx_enable_installed = True
You can also enable or disable the automatic sphinx.ext.intersphinx configuration of packages manually:
scrapy_intersphinx_enable = [ "parsel", "w3lib", ] scrapy_intersphinx_disable = [ "scrapy", ]
The
html_baseurloption for sitemap generation is generated automatically based on the project name (pyproject.tomlorconf.py) and known documentation URLs (the same used for easy intersphinx configuration) with a fallback to https://<project>.readthedocs.io/en/latest/. You can alternatively define the setting yourself inconf.py.Add to
docs/.gitignore:/_build/
Add to
.pre-commit-config.yaml:repos: - repo: https://github.com/scrapy/sphinx-scrapy rev: 0.8.2 hooks: - id: sphinx-scrapy
Add to
tox.ini:[tox] requires = sphinx-scrapy[tox]==0.8.2 envlist = …,docs
Note
docsinenvlistis required.
You can now build the docs with:
tox -e docsThe following Sphinx extensions are automatically enabled when you enable
sphinx_scrapy:
scrapy_intersphinx_enable supports the following packages:
See the release notes for a list of releases and their changes.