sphinx-codeautolink

Automatic links from code examples to reference documentation.

35 个版本 Python >=3.10
安装
pip install sphinx-codeautolink
poetry add sphinx-codeautolink
pipenv install sphinx-codeautolink
conda install sphinx-codeautolink
描述

sphinx-codeautolink

|pyversions| |downloads| |license| |readthedocs|

sphinx-codeautolink makes code examples clickable by inserting links from individual code elements to the corresponding reference documentation. We aim for a minimal setup assuming your examples are already valid Python.

For a live demo, see our online documentation on Read The Docs <https://sphinx-codeautolink.rtfd.org>_.

Installation

sphinx-codeautolink can be installed from the following sources:

.. code:: sh

$ pip install sphinx-codeautolink
$ conda install -c conda-forge sphinx-codeautolink

Note that the library is in early development, so version pinning is advised. To enable sphinx-codeautolink, modify the extension list in conf.py. Note that the extension name uses an underscore rather than a hyphen.

.. code:: python

extensions = [ ..., "sphinx_codeautolink", ]

That's it! Now your code examples are linked. For ways of concatenating examples, setting default import statements, or customising link style among other things, see the online documentation <https://sphinx-codeautolink.rtfd.org>_.

.. |pyversions| image:: https://img.shields.io/pypi/pyversions/sphinx-codeautolink :alt: Python versions

.. |downloads| image:: https://img.shields.io/pypi/dm/sphinx-codeautolink :alt: Monthly downloads

.. |license| image:: https://img.shields.io/badge/License-MIT-blue.svg :target: https://choosealicense.com/licenses/mit :alt: License: MIT

.. |readthedocs| image:: https://rtfd.org/projects/sphinx-codeautolink/badge/?version=stable :target: https://sphinx-codeautolink.rtfd.org/en/stable/ :alt: Documentation

版本列表
0.18.1 2026-04-30
0.18.0 2026-04-25
0.17.5 2025-07-09
0.17.4 2025-03-07
0.17.3 2025-03-06
0.17.2 2025-03-02
0.17.1 2025-02-24
0.17.0 2025-02-18
0.16.2 2025-01-16
0.16.1 2025-01-15
0.16.0 2025-01-11
0.15.2 2024-06-03
0.15.1 2024-04-17
0.15.0 2023-04-19
0.14.1 2023-01-30
0.14.0 2023-01-28
0.13.2 2023-01-26
0.13.1 2023-01-15
0.13.0 2023-01-08
0.12.1 2022-11-05
0.12.0 2022-09-14
0.11.0 2022-06-08
0.10.0 2022-01-25
0.9.0 2022-01-13
0.8.0 2021-12-16
0.7.0 2021-11-28
0.6.0 2021-11-21
0.5.1 2021-11-20
0.5.0 2021-11-07
0.4.0 2021-10-08
0.3.0 2021-10-05
0.2.1 2021-10-01
0.2.0 2021-10-01
0.1.1 2021-09-22
0.1.0 2021-09-22