Skip to content

scrapy/sphinx-scrapy

Repository files navigation

sphinx-scrapy

PyPI version Supported Python versions

Sphinx extension for documentation in the Scrapy ecosystem.

Features

Setup

  1. Configure in pyproject.toml the Python version for documentation builds, e.g.:

    [tool.sphinx-scrapy]
    python-version = "3.14"

    It must be supported by Read the Docs.

  2. Add to docs/requirements.txt:

    sphinx-scrapy==0.7.2
    
  3. 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_baseurl option for sitemap generation is generated automatically based on the project name (pyproject.toml or conf.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 in conf.py.

  4. Add to docs/.gitignore:

    /_build/
    
  5. Add to .pre-commit-config.yaml:

    repos:
    - repo: https://github.com/scrapy/sphinx-scrapy
        rev: 0.8.2
        hooks:
        - id: sphinx-scrapy
  6. Add to tox.ini:

    [tox]
    requires =
        sphinx-scrapy[tox]==0.8.2
    envlist = …,docs

    Note

    docs in envlist is required.

You can now build the docs with:

tox -e docs

Sphinx extensions

The following Sphinx extensions are automatically enabled when you enable sphinx_scrapy:

Intersphinx packages

scrapy_intersphinx_enable supports the following packages:

Release notes

See the release notes for a list of releases and their changes.

About

Sphinx extension for documentation in the Scrapy ecosystem

Resources

License

Stars

Watchers

Forks

Contributors

Languages