skillfed

sphinx-codeautolink

Automatic links from code examples to reference documentation.

sphinx-codeautolink v0.19.0 84.2K downloads/30d#14,015 on PyPI72
License unclear Active released

What it is and what it does

sphinx-codeautolink is a Sphinx extension that automatically converts code elements in documentation examples into clickable links pointing to their reference documentation. It works by parsing valid Python code in your examples and inserting hyperlinks to the corresponding API docs for each function, class, or module mentioned.

The extension requires minimal setup—just add it to your Sphinx conf.py extensions list—and assumes your code examples are already valid Python. It depends on sphinx and beautifulsoup4 to parse and modify the rendered HTML. The project is in active development (Beta status) and supports Python 3.10 through 3.14, with recent releases and steady maintenance.

Use it for:

  • Automatically link function and class names in code examples to their API reference documentation
  • Make library usage examples in Sphinx docs interactive and navigable without manual link markup
  • Reduce documentation maintenance by eliminating hand-written cross-reference links in code blocks
  • Improve reader experience by enabling one-click navigation from example code to detailed API docs

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

sphinx-codeautolink automatically converts code examples in Sphinx documentation into clickable links that point to the corresponding reference documentation for each code element.

Yes, if you maintain Sphinx documentation with code examples and want readers to navigate easily to API references. Low install friction, active maintenance, and no known vulnerabilities make it a safe choice. The Beta status and recommendation to pin versions suggest treating it as a stable but still-evolving tool rather than a mature library.

Install

sphinx-codeautolink on PyPI

pip

pip install sphinx-codeautolink

uv

uv add sphinx-codeautolink

poetry

poetry add sphinx-codeautolink

Installing sphinx-codeautolink

Before you install

Low install friction; depends only on sphinx and beautifulsoup4. Actively maintained with a recent release (16 days old) and steady repository activity. Early development status (Beta) suggests version pinning is recommended.

Quickstart

pip install sphinx-codeautolink

# In conf.py:
extensions = [
    "sphinx_codeautolink",
]

Requires Python 3.10 or later; sphinx and beautifulsoup4 must be installed.

Verify before relying

  • Whether the package handles all Python syntax constructs or only a subset of common patterns
  • Performance impact on large documentation builds with many code examples
  • Compatibility with Sphinx themes other than the default

Package facts

License not declared (unclear)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 2 — sphinx, beautifulsoup4
Maintenance actively maintained — 16 days since the last release
Last repo commit
First released
Downloads 84,218/month — #14,015 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: sphinx_codeautolink-0.19.0-py3-none-any.whl

Keywords: sphinx, extension, code, link

Development Status :: 4 - BetaFramework :: SphinxFramework :: Sphinx :: ExtensionProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: DocumentationTopic :: Documentation :: SphinxTopic :: Software Development :: Documentation

Tags

sphinx code example linkingautomatic documentation cross-referencesclickable code snippets sphinxsphinx extension code linkingdocumentation code element referencessphinx code to docs linkinginteractive code examples sphinx
sphinx-extensiondocumentation-tooling

More Documentation packages