Guide of sphinx-new-tab-link
¶
sphinx-new-tab-link
is a Sphinx extension.このガイドの日本語版はこちらにあります: sphinx-new-tab-link 使い方ガイド
Links¶
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
.
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
.. image:: _static/breakfast.jpg
:target: https://www.flickr.com/photos/pyconjp/48818171768/in/album-72157710870622516/
✅ figure
directive specified :target:
option
.. 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!🙌