Open external links in new tabs of the browser in Sphinx HTML documents
MIT License
Open external links in new tabs of the browser in Sphinx HTML documents
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>
First, create your Sphinx documentation.
Then edit conf.py
to use this extension.
extensions = [
"sphinx_new_tab_link",
]
new_tab_link_show_external_link_icon
bool
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
External link: :icon-link:`Example <https://example.com/>`
Enjoy documentation!🙌