Enhanced mkdocstrings python handler
Project description
mkdocstrings-python-xref
Python handler for mkdocstrings supporting relative cross-references.
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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file mkdocstrings_python_xref-1.6.0-py3-none-any.whl
.
File metadata
- Download URL: mkdocstrings_python_xref-1.6.0-py3-none-any.whl
- Upload date:
- Size: 19.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c315b4aeb093c9652f6555cb8ce6e2046948f9ed7479bbf0093d674bcf17e80 |
|
MD5 | ac09d79a9a8e5e3cfaa38f9276575b3f |
|
BLAKE2b-256 | e77f1b77a8399ac34647f492aed7569464462fcd69846d4cd4f83c2dd86dd9dd |