Skip to main content

Better python object resolution in Sphinx

Project description

sphinx-resolve-py-references

A sphinx extension that fixes or warns about missing references to Python objects

The extension is useful because it's often annoying to write out the full path to an object in your docs which you know is imported in the current module. This is also true for neighboring modules which would be easier referenced with a relative name.

This extension resolves these issues by allowing you to reference functions or classes which are imported in the current module as if they had been defined there and creates a backlink to their true location.

from some_package import MyClass

def my_function():
    '''Uses :class:`MyClass`'''
    # The above reference would normally fail because `MyClass`
    # is not defined in this module. However this extension
    # automatically resolves the reference

This is done by analyzing the AST to find import statements and trace them back to the place where the target was defined. This is more robust than looking at the __module__ and __name__ attributes of classes and functions because not all documentable objects have these properties (e.g. global variables).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sphinx_resolve_py_references-0.1.0.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

sphinx_resolve_py_references-0.1.0-py2.py3-none-any.whl (6.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file sphinx_resolve_py_references-0.1.0.tar.gz.

File metadata

  • Download URL: sphinx_resolve_py_references-0.1.0.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.0

File hashes

Hashes for sphinx_resolve_py_references-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0f87c06b29ec128964aee2e40d170d1d3c0e5f4955b2618a89ca724f42385372
MD5 064836160d368a77e8c2414aa5661b96
BLAKE2b-256 d4cfce91f269bb8964304c9d667f65730bf0746f5846725bb6f895db2ea4d832

See more details on using hashes here.

File details

Details for the file sphinx_resolve_py_references-0.1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: sphinx_resolve_py_references-0.1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.0

File hashes

Hashes for sphinx_resolve_py_references-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ccf44a6b62d75c3a568285f4e1815734088c1a7cab7bbb7935bb22fbf0d78bc2
MD5 477fbaa56cc89ada6005d280c1e10fcb
BLAKE2b-256 032688a46aa237eddb95467bff2139ddc04487df53c2740a8b75fb9c70c2977e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page