Skip to main content
Ctrl+K

PyData Theme

  • 用户指南
  • 贡献者指南
  • 示例
  • 变更日志
    • API
    • PyData Website
    • NumFocus
    • Donate to NumFocus
  • X
  • GitHub
  • PyPI
  • PyData
  • 用户指南
  • 贡献者指南
  • 示例
  • 变更日志
  • API
  • PyData Website
  • NumFocus
  • Donate to NumFocus
  • X
  • GitHub
  • PyPI
  • PyData

Section Navigation

  • pydata_sphinx_theme
    • pydata_sphinx_theme.edit_this_page
    • pydata_sphinx_theme.logo
    • pydata_sphinx_theme.pygments
    • pydata_sphinx_theme.short_link
    • pydata_sphinx_theme.toctree
    • pydata_sphinx_theme.translator
    • pydata_sphinx_theme.utils
  • API Reference
  • pydata_sphinx_theme
  • pydata_sphinx_theme.short_link

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.

参数:

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

返回:

the reformated url title

返回类型:

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]][源代码]#

上一页

pydata_sphinx_theme.pygments

下一页

pydata_sphinx_theme.toctree

On this page
  • Classes
  • Module Contents
    • ShortenLinkTransform
      • ShortenLinkTransform.parse_url()
      • ShortenLinkTransform.run()
      • ShortenLinkTransform.default_priority
      • ShortenLinkTransform.formats
      • ShortenLinkTransform.platform
      • ShortenLinkTransform.supported_platform
在 GitHub 上编辑
显示源代码

© Copyright 2019, PyData Community.

由 Sphinx 8.1.3创建。

Built with the PyData Sphinx Theme 0.16.1.