Skip to main content

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

Project description

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.

The reST

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

is converted into

External link: <a class="reference external" href="https://example.com/" rel="noopener 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

Roles

External link with icon (Experimental)

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

Enjoy documentation!🙌

Project details


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.6.1.tar.gz (6.0 kB view hashes)

Uploaded Source

Built Distribution

sphinx_new_tab_link-0.6.1-py3-none-any.whl (5.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page