Sphinx extension for linking to VTK class documentation.
Project description
sphinx-vtk-xref is a Sphinx extension for linking directly to VTK’s documentation using the :vtk: reference role.
Installation
Add sphinx-vtk-xref as a project dependency or install it with:
pip install sphinx-vtk-xrefAdd sphinx_vtk_xref as an extension in your conf.py file used by Sphinx. The exact setup depends on whether your documentation is written in reStructuredText or Markdown.
reStructuredText
extensions = [
...,
'sphinx_vtk_xref',
]
Markdown (MyST)
Markdown support requires MyST-Parser, which dispatches Sphinx roles like :vtk: using its own {vtk} syntax.
pip install myst-parser
extensions = [
...,
'sphinx_vtk_xref',
'myst_parser',
]
source_suffix = {
'.md': 'markdown',
}
Usage
Add links to VTK class documentation with the :vtk: role. For example, write :vtk:`vtkImageData` in docstrings to link directly to the vtkImageData documentation. This will render as vtkImageData.
If using MyST, use {vtk}`vtkImageData` instead.
Link directly to class members such as methods or enums. For example, write :vtk:`vtkImageData.GetSpacing` to link directly to the GetSpacing method. This will render as vtkImageData.GetSpacing.
If using MyST, use {vtk}`vtkImageData.GetSpacing` instead.
Use ~ to shorten the title for the link and only show the class member after the period. For example, :vtk:`~vtkImageData.GetSpacing` will render as GetSpacing.
If using MyST, use {vtk}`~vtkImageData.GetSpacing` instead.
Provide a custom title for the reference. For example, :vtk:`Get Image Spacing <vtkImageData.GetSpacing>` will render as Get Image Spacing
If using MyST, use {vtk}`Get Image Spacing <vtkImageData.GetSpacing>` instead.
Configuration
The following options can be set in conf.py:
- sphinx_vtk_xref_nitpicky
Bool, default True. Set to False to disable :vtk: link checking. This is independent of Sphinx’s own nitpicky option, so you can turn off :vtk: link validation without affecting how the rest of your project handles missing references. When disabled, the :vtk: role skips the HTTP request used to validate class and member references (and to resolve member anchors) and instead links directly to the (unvalidated) class documentation page.
sphinx_vtk_xref_nitpicky = False- sphinx_vtk_xref_ignored_status_codes
Collection of HTTP status codes, default {429, 500, 502, 503, 504}. These codes typically indicate a transient server-side issue (rate limiting or upstream unavailability) rather than a genuinely-invalid class reference, so they are logged as info messages and do not fail the build, even with Sphinx’s -W flag. The role falls back to the (unvalidated) class URL in this case.
sphinx_vtk_xref_ignored_status_codes = {404}
Notes
The URLs linking to the VTK documentation are checked to ensure they are valid references. A warning is emitted if the reference is invalid, but the role will still try to point to a valid URL where possible. Combine this with Sphinx’s own -W flag to fail the build on invalid links.
The role does not currently support linking to nested members. For example, linking to an enum member with :vtk:`vtkCommand.EventIds` works, but linking to a specific enum value with :vtk:`vtkCommand.EventIds.PickEvent` does not.
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 sphinx_vtk_xref-0.2.1.tar.gz.
File metadata
- Download URL: sphinx_vtk_xref-0.2.1.tar.gz
- Upload date:
- Size: 14.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f7fe4fb40a360d6af161c80d9917fc19335d6545a6c7ffa16599f69e224735e
|
|
| MD5 |
969d77d49ea0888d8ff49269d930172f
|
|
| BLAKE2b-256 |
6de77d8075b0e1c4c21ade72fb083cca68b629febeaf4b5daddb28ba52c6a38f
|
Provenance
The following attestation bundles were made for sphinx_vtk_xref-0.2.1.tar.gz:
Publisher:
test-and-release.yml on pyvista/sphinx-vtk-xref
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sphinx_vtk_xref-0.2.1.tar.gz -
Subject digest:
2f7fe4fb40a360d6af161c80d9917fc19335d6545a6c7ffa16599f69e224735e - Sigstore transparency entry: 2275588690
- Sigstore integration time:
-
Permalink:
pyvista/sphinx-vtk-xref@c6c9516ac76b507c6c0abe4d8abcceac71a70c32 -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/pyvista
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
test-and-release.yml@c6c9516ac76b507c6c0abe4d8abcceac71a70c32 -
Trigger Event:
push
-
Statement type:
File details
Details for the file sphinx_vtk_xref-0.2.1-py3-none-any.whl.
File metadata
- Download URL: sphinx_vtk_xref-0.2.1-py3-none-any.whl
- Upload date:
- Size: 6.5 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 |
c1cd09bde3a9ab0ba704b39a2a0e16a6d5bbe0a59043a6fa135d128cd42a77ba
|
|
| MD5 |
5a5a5b1416a2e272e83deea5c7172a08
|
|
| BLAKE2b-256 |
ab48382581cbd93916e343d4d268f7176f76e80cfed49c86a08a3eada026abfe
|
Provenance
The following attestation bundles were made for sphinx_vtk_xref-0.2.1-py3-none-any.whl:
Publisher:
test-and-release.yml on pyvista/sphinx-vtk-xref
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sphinx_vtk_xref-0.2.1-py3-none-any.whl -
Subject digest:
c1cd09bde3a9ab0ba704b39a2a0e16a6d5bbe0a59043a6fa135d128cd42a77ba - Sigstore transparency entry: 2275588780
- Sigstore integration time:
-
Permalink:
pyvista/sphinx-vtk-xref@c6c9516ac76b507c6c0abe4d8abcceac71a70c32 -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/pyvista
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
test-and-release.yml@c6c9516ac76b507c6c0abe4d8abcceac71a70c32 -
Trigger Event:
push
-
Statement type: