Skip to main content

sphinx-new-tab-link

testing workflow PyPI version Python Versions

Open external links in new tabs of the browser in Sphinx HTML documents

Overview

If you enable sphinx_new_tab_link, external links of built HTML are opened in new tabs of your browser.

Images that link to external pages become slightly brighter when hovered or focused, making it easier to recognize that they are clickable.

The reST

External link: `Example <https://example.com/>`_

is converted into

External link: <a class="reference external" href="https://example.com/" rel="noreferrer" target="_blank">Example</a>

Usage

First, create your Sphinx documentation.

Then edit conf.py to use this extension.

extensions = [
    "sphinx_new_tab_link",
]

Configuration

new_tab_link_show_external_link_icon

  • Type: bool
  • Default: False

If you want to show external links with icons, set this to True in your conf.py.

new_tab_link_show_external_link_icon = True

new_tab_link_enable_referrer

  • Type: bool
  • Default: False

If you want external links without rel="noreferrer", set this to True in your conf.py.

new_tab_link_enable_referrer = True

Roles

External link with icon (Experimental)

External link: :icon-link:`Example <https://example.com/>`

Enjoy documentation!🙌

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sphinx_new_tab_link-0.8.2.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sphinx_new_tab_link-0.8.2-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

Release history Release notifications | RSS feed

This release

0.8.2 This release

2 files

0.8.1

2 files

0.8.0

2 files

0.7.0

2 files

0.6.1

2 files

0.6.0

2 files

0.5.3

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.4.0

2 files

0.3.1

2 files

0.3.0

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page