pydata_sphinx_theme.short_link#
A custom Transform object to shorten github and gitlab links.
Classes#
Shorten link when they are coming from github or gitlab and add an extra class to the tag for further styling. |
Functions#
|
Triage node.traverse (docutils <0.18.1) vs node.findall. |
Module Contents#
- class pydata_sphinx_theme.short_link.ShortenLinkTransform(document, startnode=None)[source]#
Bases:
sphinx.transforms.post_transforms.SphinxPostTransform
Shorten link when they are coming from github or gitlab and add an extra class to the tag for further styling.
- Before:
<a class="reference external" href="https://github.com/2i2c-org/infrastructure/issues/1329"> https://github.com/2i2c-org/infrastructure/issues/1329 </a>
- After:
<a class="reference external github" href="https://github.com/2i2c-org/infrastructure/issues/1329"> 2i2c-org/infrastructure#1329 </a>
- pydata_sphinx_theme.short_link.traverse_or_findall(node, condition, **kwargs)[source]#
Triage node.traverse (docutils <0.18.1) vs node.findall.
TODO: This check can be removed when the minimum supported docutils version for numpydoc is docutils>=0.18.1.
- Parameters:
node (docutils.nodes.Node)
condition (str)
- Return type:
Iterator[docutils.nodes.Node]