Skip to main content
`Ctrl`+`K`

# pydata_sphinx_theme.short_link

A custom Transform object to shorten github and gitlab links.

## Classes

`ShortenLinkTransform` | Shorten link when they are coming from github or gitlab and add an extra class to

## Module Contents

class pydata_sphinx_theme.short_link.ShortenLinkTransform(document, startnode=None)

  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>

  parse_url(uri)

    Parse the content of the url with respect to the selected platform.

    Parameters:

      uri (urllib.parse.ParseResult) – the link to the platform content

    Returns:

      the reformated url title

    Return type:

      str

  run(**kwargs)

    Run the Transform object.

  default_priority = 400

    Numerical priority of this transform, 0 through 999 (override).

  formats = ('html',)
  platform = None
  supported_platform: ClassVar[dict[str, str]]