Guide of sphinx-new-tab-link¶

sphinx-new-tab-link is a Sphinx extension.
It builds HTML from source which enables your browser to open external links in new tabs ✨
I'll show you how to use it in this document (oh my gosh, this document is dogfooding too! 🐶)

このガイドの日本語版はこちらにあります: sphinx-new-tab-link 使い方ガイド

Links¶

  • PyPI https://pypi.org/project/sphinx-new-tab-link/

  • GitHub Repository

Installation¶

You can install sphinx-new-tab-link from PyPI.

$ pip install sphinx-new-tab-link

How to use¶

Enable this extension in your Sphinx project's conf.py.

conf.py¶
extensions = [
    "sphinx_new_tab_link",
]

That's it!

External links in HTML will be opened in a new tab of the browser.

Supported notations¶

It supports various notations of a external link possible in reST.

✅Line with URL only

https://github.com/ftnext/sphinx-new-tab-link

✅URL written inline (See PyPI at 'Links' section)

✅Define an external hyperlink target and refer it: Published guide

.. _Published guide: https://ftnext.github.io/sphinx-new-tab-link/guide.html

Define an external hyperlink target and refer it: `Published guide`_

✅Anonymous hyperlink notation: published guide (anonymous notation)

.. __: https://ftnext.github.io/sphinx-new-tab-link/guide.html

Anonymous hyperlink notation: `published guide (anonymous notation)`__

✅Embedded URL with double underscore: GitHub Repository (without target definition)

`GitHub Repository (without target definition) <https://github.com/ftnext/sphinx-new-tab-link>`__

✅Refer again to the target defined by the embedded URL with single underscore (See GitHub Repository at 'Links' section): GitHub Repository

`GitHub Repository <https://github.com/ftnext/sphinx-new-tab-link>`_

Can refer `GitHub Repository`_ again.

✅ image directive specified :target: option

_images/breakfast.jpg
.. image:: _static/breakfast.jpg
    :target: https://www.flickr.com/photos/pyconjp/48818171768/in/album-72157710870622516/

✅ figure directive specified :target: option

_images/pyconjp2019.jpg
.. figure:: _static/pyconjp2019.jpg
    :target: https://www.flickr.com/photos/pyconjp/48743997848/in/album-72157710870622516/

注釈

note: Also supports sphinx.ext.autodoc!

For HTML built from a docstring containing a URL, your browser open the URL in a new tab. The API documentation of sphinx-new-tab-link is an example of that! 🐶

Enjoy documentation!🙌

sphinx-new-tab-link documentation

ナビゲーション

For library users:

  • sphinx-new-tab-link 使い方ガイド
  • Guide of sphinx-new-tab-link
    • Links
    • Installation
    • How to use
    • Supported notations
  • Markdown example / Markdownの例

For developers:

  • API

Related Topics

  • Documentation overview
    • Previous: sphinx-new-tab-link 使い方ガイド
    • Next: Markdown example / Markdownの例
©2022, nikkie. | Powered by Sphinx 8.1.3 & Alabaster 1.0.0 | Page source