Metadata-Version: 2.4
Name: sphinx-new-tab-link
Version: 0.8.2
Summary: Open external links in new tabs of the browser in Sphinx HTML documents
Author-email: nikkie <takuyafjp+develop@gmail.com>
License: MIT License
Project-URL: Homepage, https://github.com/ftnext/sphinx-new-tab-link
Project-URL: Guide, https://ftnext.github.io/sphinx-new-tab-link/guide.en.html
Project-URL: Bug Tracker, https://github.com/ftnext/sphinx-new-tab-link/issues
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: MIT License
Classifier: Intended Audience :: Developers
Classifier: Framework :: Sphinx
Classifier: Framework :: Sphinx :: Extension
Classifier: Topic :: Documentation
Classifier: Topic :: Documentation :: Sphinx
Classifier: Topic :: Internet :: WWW/HTTP :: Site Management
Classifier: Topic :: Software Development :: Documentation
Classifier: Topic :: Text Processing :: Markup :: HTML
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: Sphinx>=7.3
Requires-Dist: sphinxcontrib-extdevhelper-kasane
Provides-Extra: testing
Requires-Dist: pytest; extra == "testing"
Requires-Dist: pytest-randomly; extra == "testing"
Requires-Dist: defusedxml; extra == "testing"
Requires-Dist: beautifulsoup4; extra == "testing"
Provides-Extra: typecheck
Requires-Dist: mypy; extra == "typecheck"
Requires-Dist: types-docutils; extra == "typecheck"
Requires-Dist: types-beautifulsoup4; extra == "typecheck"
Provides-Extra: lint
Requires-Dist: flake8; extra == "lint"
Requires-Dist: black; extra == "lint"
Requires-Dist: isort; extra == "lint"
Requires-Dist: autoflake; extra == "lint"
Requires-Dist: pyupgrade; extra == "lint"
Provides-Extra: dev
Requires-Dist: taskipy; extra == "dev"
Dynamic: license-file

# sphinx-new-tab-link
![testing workflow](https://github.com/ftnext/sphinx-new-tab-link/actions/workflows/testing.yml/badge.svg)
[![PyPI version](https://badge.fury.io/py/sphinx-new-tab-link.svg)](https://badge.fury.io/py/sphinx-new-tab-link)
[![Python Versions](https://img.shields.io/pypi/pyversions/sphinx-new-tab-link.svg)](https://pypi.org/project/sphinx-new-tab-link/)

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

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

is converted into

```html
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.

```python
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`.

```python
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`.

```python
new_tab_link_enable_referrer = True
```

## Roles

### External link with icon (Experimental)

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

Enjoy documentation!🙌
