Skip to main content

mkdocstrings-python-xref

Python handler for mkdocstrings supporting relative cross-references.

pypi version conda version documentation
PyPI - Python Version GitHub
CI GitHub issues

mkdocstrings is an awesome plugin for MkDocs that can generate Markdown API documentation from comments in code. The standard python handler allows you to create cross-reference links using the syntax [<title>][<path>] where the path must either be the fully qualified name of the referent or is empty, in which case the path is taken from the title. This works well when the names are short, but can be burdensome in larger codebases with deeply nested package structures.

This package extends mkdocstrings-python to support a relative cross-reference syntax, that allows you to write doc-strings with cross-references like:

class MyClass:
    def this_method(self):
        """
        See [other_method][..] from [MyClass][(c)]
        """

rather than:

class MyClass:
    def this_method(self):
        """
        See [other_method][mypkg.mymod.MyClass.other_method] 
        from [MyClass][mypkg.mymod.Myclass]
        """

Another benefit of this extension is that it will report source locations for bad references so that errors are easier to find and fix. For example:

$ mkdocs build
INFO    -  Cleaning site directory
INFO    -  Building documentation to directory: /home/jdoe/my-project/site
WARNING -  mkdocstrings_handlers: file:///home/jdoe/my-project/src/myproj/bar.py:16:
           Cannot load reference 'myproj.bar.bad'

For further details, please see the Documentation

Metadata

Release files for mkdocstrings-python-xref 2.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mkdocstrings-python-xref 2.1.1
File Size Uploaded
mkdocstrings_python_xref-2.1.1.tar.gz 17.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mkdocstrings-python-xref 2.1.1
File Interpreter ABI Platform
mkdocstrings_python_xref-2.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 35.9 kB

Release files / mkdocstrings_python_xref-2.1.1.tar.gz

Download URL mkdocstrings_python_xref-2.1.1.tar.gz
Size 17.9 kB
Tags Source
SHA-256 checksum
How to use checksums
649c2d35dbd766ee8f57706bc2af4b2f1f0090862821e83e58224aa9cad3e589
BLAKE2b-256 checksum
How to use checksums
2ce010cf8e825376622ff584af4274cabfe3781f6b531200220a2280d2d4b071
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / mkdocstrings_python_xref-2.1.1-py3-none-any.whl

Download URL mkdocstrings_python_xref-2.1.1-py3-none-any.whl
Size 18.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a5f4d36cba7ff83e639293d41d76b98554d9ebbe093af6f415b20af0511b9bc4
BLAKE2b-256 checksum
How to use checksums
b7377263b08d95cae74c5d301d65620619cc2e641c2e4f487597d659dd568c98
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release history Release notifications | RSS feed

This release

2.1.1 This release

2 release files

2.1.0

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.16.3

2 release files

1.16.2

2 release files

1.16.1

2 release files

1.16

1 release file

1.14.1

1 release file

1.14.0

1 release file

1.6.2

1 release file

1.6.1

1 release file

1.6.0.1

1 release file

1.6.0

1 release file

1.5.3

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page