byrdie / sphinx-codeautolink

Automatic links from code examples to reference documentation

Home Page:https://sphinx-codeautolink.rtfd.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sphinx-codeautolink

License: MIT documentation build status

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.

sphinx-codeautolink elsewhere:

Installation

PyPI package Conda-Forge package

sphinx-codeautolink can be installed from the following sources:

$ pip install sphinx-codeautolink
# or, alternatively:
$ conda install -c conda-forge sphinx-codeautolink

To enable sphinx-codeautolink, modify the extension list in conf.py. Note that the extension name uses an underscore rather than a hyphen.

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

That's it! Now your code examples are linked. For ways of concatenating multiple examples and setting default import statements among other things, have a look at the online documentation.

About

Automatic links from code examples to reference documentation

https://sphinx-codeautolink.rtfd.io

License:MIT License


Languages

Language:Python 99.7%Language:CSS 0.3%