Extended mkdocstrings-python handler with better cross-references support
Project description
mkdocstrings-python-betterrefs
Python handler for mkdocstrings with improved handling for cross-references, including relative ones.
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.
mkdocstrings-python does already have support for cross-references, however, it is currently only available in the insiders edition, which is limited to their sponsors. Additionally, this implementation is fairly limited in comparison to what this project offers.
[!TIP] For more information on the mkdocstrings-python official support of relative cross-references, check out the feature request proposing them: here, and the docs detailing the configuration option: here.
It is expected that relative cross-references will make it into the open-source version once a funding goal of $2,000 is reached. You can see the current progress towards this goal here.
This package extends mkdocstrings-python to support an improved cross-reference syntax, that allows you to write doc-strings with relative 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]
"""
Relative references are especially useful for larger codebases with deeply nested package structure, where writing out the absolute paths each time gets very burdensome.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mkdocstrings_python_betterrefs-1.0.2.tar.gz.
File metadata
- Download URL: mkdocstrings_python_betterrefs-1.0.2.tar.gz
- Upload date:
- Size: 83.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98f678de0953eb2ab381c10acb304672dc0ed33945ef04d6b76a72eaa9d6afae
|
|
| MD5 |
d516916a143db9990c23fa369cbb8802
|
|
| BLAKE2b-256 |
b37e5cb5643da3959944f59f5da49455754fea9de527178a796910450696c129
|
Provenance
The following attestation bundles were made for mkdocstrings_python_betterrefs-1.0.2.tar.gz:
Publisher:
publish.yml on ItsDrike/mkdocstrings-python-betterrefs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mkdocstrings_python_betterrefs-1.0.2.tar.gz -
Subject digest:
98f678de0953eb2ab381c10acb304672dc0ed33945ef04d6b76a72eaa9d6afae - Sigstore transparency entry: 173202561
- Sigstore integration time:
-
Permalink:
ItsDrike/mkdocstrings-python-betterrefs@f04575c1c6c24c6b9f07bcbe911d94e322431db5 -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/ItsDrike
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f04575c1c6c24c6b9f07bcbe911d94e322431db5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mkdocstrings_python_betterrefs-1.0.2-py3-none-any.whl.
File metadata
- Download URL: mkdocstrings_python_betterrefs-1.0.2-py3-none-any.whl
- Upload date:
- Size: 15.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a8dd38cf83f01a717966a9edbad26605ac5528d8411d839caaead1c7ea1998a
|
|
| MD5 |
b628b7d14424f05266c137ac6103a683
|
|
| BLAKE2b-256 |
79eb7c7a21058b6dfb75a9dff10c1d59ad2083a4229b05ea95e48ec6f58c2fa3
|
Provenance
The following attestation bundles were made for mkdocstrings_python_betterrefs-1.0.2-py3-none-any.whl:
Publisher:
publish.yml on ItsDrike/mkdocstrings-python-betterrefs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mkdocstrings_python_betterrefs-1.0.2-py3-none-any.whl -
Subject digest:
5a8dd38cf83f01a717966a9edbad26605ac5528d8411d839caaead1c7ea1998a - Sigstore transparency entry: 173202562
- Sigstore integration time:
-
Permalink:
ItsDrike/mkdocstrings-python-betterrefs@f04575c1c6c24c6b9f07bcbe911d94e322431db5 -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/ItsDrike
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f04575c1c6c24c6b9f07bcbe911d94e322431db5 -
Trigger Event:
push
-
Statement type: