Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
*Note that versions roughly correspond to the version of mkdocstrings-python that they
are compatible with.*

## 2.0.1

* Fix extended template configuration (#56)

## 2.0.0

* Depends on mkdocstrings-python >=2.0 and mkdocstrings >=1.0
Expand Down
8 changes: 8 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ fully qualified or is empty, in which case it is taken from the title.
If you work with long package and class names or with namespace packages, this can result in a lot
of extra typing and harder to read doc-strings.


!!! note "Difference with mkdocstrings-python"

[mkdoctrings-python release 1.19](https://github.com/mkdocstrings/python/releases/tag/1.19.0)
introduced support for relative (and also scoped) cross-references, but does not
support the full range of relative syntax supported by this handler. Specifically,
the standard handler only supports the leading `.` syntax described here.

If you enable the `relative_crossrefs` option in the `python_xref` handler options
in your mkdocs.yml file ([see configuration](config.md) for an example), then the handler
will support more compact relative syntax:
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ markdown_extensions:
- admonition
- pymdownx.snippets:
check_paths: true
- pymdownx.details
- pymdownx.superfences
- pymdownx.tabbed:
alternate_style: true
Expand Down
2 changes: 1 addition & 1 deletion pixi.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/mkdocstrings_handlers/python_xref/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.0
2.0.1
7 changes: 7 additions & 0 deletions src/mkdocstrings_handlers/python_xref/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,17 @@ def render(self, data: CollectorItem, options: PythonOptions, locale: str | None

def get_templates_dir(self, handler: Optional[str] = None) -> Path:
"""See [render][.barf]"""
# use same templates as standard python handler
if handler == self.name:
handler = 'python'
return super().get_templates_dir(handler)

def get_extended_templates_dirs(self, handler: str) -> list[Path]:
# use same templates as standard python handler
if handler == self.name:
handler = 'python'
return super().get_extended_templates_dirs(handler)

def _check_ref(self, ref : str, exclude: list[str | re.Pattern] = []) -> bool:
"""Check for existence of reference"""
for ex in exclude:
Expand Down
Loading