-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit c9539a3
Showing
30 changed files
with
4,242 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Sphinx build info version 1 | ||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: 380363073118297f37d362aa538c0c4b | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
API | ||
=== | ||
|
||
.. automodule:: sphinx_new_tab_link | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
.. _english_guide: | ||
|
||
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! 🐶) | ||
*このガイドの日本語版はこちらにあります:* :ref:`japanese_guide` | ||
|
||
Links | ||
-------------------- | ||
|
||
* PyPI https://pypi.org/project/sphinx-new-tab-link/ | ||
* `GitHub Repository <https://github.com/ftnext/sphinx-new-tab-link>`_ | ||
|
||
Installation | ||
-------------------- | ||
|
||
You can install ``sphinx-new-tab-link`` from PyPI. | ||
|
||
.. code-block:: shell | ||
$ pip install sphinx-new-tab-link | ||
How to use | ||
-------------------- | ||
|
||
Enable this extension in your Sphinx project's :file:`conf.py`. | ||
|
||
.. code-block:: python | ||
:caption: 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) | ||
|
||
.. _Published guide: https://ftnext.github.io/sphinx-new-tab-link/guide.html | ||
|
||
✅Define an external hyperlink target and refer it: `Published guide`_ | ||
|
||
.. code-block:: rest | ||
.. _Published guide: https://ftnext.github.io/sphinx-new-tab-link/guide.html | ||
Define an external hyperlink target and refer it: `Published guide`_ | ||
.. __: https://ftnext.github.io/sphinx-new-tab-link/guide.html | ||
|
||
✅Anonymous hyperlink notation: `published guide (anonymous notation)`__ | ||
|
||
.. code-block:: rest | ||
.. __: 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) <https://github.com/ftnext/sphinx-new-tab-link>`__ | ||
|
||
.. code-block:: rst | ||
`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`_ | ||
|
||
.. code-block:: rst | ||
`GitHub Repository <https://github.com/ftnext/sphinx-new-tab-link>`_ | ||
Can refer `GitHub Repository`_ again. | ||
.. note:: note: Also supports `sphinx.ext.autodoc <https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html>`__! | ||
|
||
For HTML built from a docstring containing a URL, your browser open the URL in a new tab. | ||
The :doc:`api` documentation of ``sphinx-new-tab-link`` is an example of that! 🐶 | ||
|
||
Enjoy documentation!🙌 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
.. _japanese_guide: | ||
|
||
``sphinx-new-tab-link`` 使い方ガイド | ||
============================================================= | ||
|
||
| ``sphinx-new-tab-link`` はSphinx拡張です。 | ||
| ソースからビルドしたHTMLで、 **外部リンクをブラウザの新しいタブで開く** ように自動で設定します✨ | ||
| このドキュメントで使い方を示します(なんと、このドキュメントはドッグフーディングにもなっているんですよ!🐶) | ||
*Here is English version of this guide:* :ref:`english_guide` | ||
|
||
リンク集 | ||
-------------------- | ||
|
||
* PyPI https://pypi.org/project/sphinx-new-tab-link/ | ||
* `GitHub Repository <https://github.com/ftnext/sphinx-new-tab-link>`_ | ||
|
||
インストール | ||
-------------------- | ||
|
||
``sphinx-new-tab-link`` はPyPIからインストールできます。 | ||
|
||
.. code-block:: shell | ||
$ pip install sphinx-new-tab-link | ||
使い方 | ||
-------------------- | ||
|
||
あなたのSphinxプロジェクトの :file:`conf.py` でこの拡張を有効にしてください。 | ||
|
||
.. code-block:: python | ||
:caption: conf.py | ||
extensions = [ | ||
"sphinx_new_tab_link", | ||
] | ||
これだけです! | ||
|
||
HTML中の外部リンクが、ブラウザの新しいタブで開かれるようになります。 | ||
|
||
対応している記法 | ||
-------------------- | ||
|
||
reSTで可能なさまざまな記法による外部リンクをサポートしています。 | ||
|
||
✅直接URLだけを書いた行 | ||
|
||
https://github.com/ftnext/sphinx-new-tab-link | ||
|
||
✅インラインで書いたURL(「リンク集」の *PyPI* 参照) | ||
|
||
.. _公開版ガイド: https://ftnext.github.io/sphinx-new-tab-link/guide.html | ||
|
||
✅外部ハイパーリンクターゲットを定義し、それを参照: `公開版ガイド`_ | ||
|
||
.. code-block:: rest | ||
.. _公開版ガイド: https://ftnext.github.io/sphinx-new-tab-link/guide.html | ||
外部ハイパーリンクターゲットを定義し、それを参照: `公開版ガイド`_ | ||
.. __: https://ftnext.github.io/sphinx-new-tab-link/guide.html | ||
|
||
✅匿名ハイパーリンク記法: `公開版ガイド(匿名記法)`__ | ||
|
||
.. code-block:: rest | ||
.. __: https://ftnext.github.io/sphinx-new-tab-link/guide.html | ||
匿名ハイパーリンク記法: `公開版ガイド(匿名記法)`__ | ||
✅アンダースコア2つの埋め込みURL: `GitHub Repository(ターゲット定義なし) <https://github.com/ftnext/sphinx-new-tab-link>`__ | ||
|
||
.. code-block:: rst | ||
`GitHub Repository(ターゲット定義なし) <https://github.com/ftnext/sphinx-new-tab-link>`__ | ||
✅アンダースコア1つの埋め込みURLによって定義したターゲット(リンク集の *GitHub Repository*)を再度参照: `GitHub Repository`_ | ||
|
||
.. code-block:: rst | ||
`GitHub Repository <https://github.com/ftnext/sphinx-new-tab-link>`_ | ||
再度 `GitHub Repository`_ を参照できる | ||
.. note:: `sphinx.ext.autodoc <https://www.sphinx-doc.org/ja/master/usage/extensions/autodoc.html>`__ にも対応しています! | ||
|
||
URLを含んだdocstringからビルドしたHTMLでも、URLはブラウザの新しいタブで開きます。 | ||
``sphinx-new-tab-link`` の :doc:`api` のドキュメントは、その例になっているんですよ!🐶 | ||
|
||
Enjoy documentation!🙌 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
.. sphinx-new-tab-link documentation documentation master file, created by | ||
sphinx-quickstart on Wed Nov 16 23:12:14 2022. | ||
You can adapt this file completely to your liking, but it should at least | ||
contain the root `toctree` directive. | ||
Welcome to sphinx-new-tab-link documentation's documentation! | ||
============================================================= | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:caption: For library users: | ||
|
||
guide.rst | ||
guide.en.rst | ||
markdown-example | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
:caption: For developers: | ||
|
||
api.rst | ||
|
||
Indices and tables | ||
================== | ||
|
||
* :ref:`genindex` | ||
* :ref:`modindex` | ||
* :ref:`search` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Markdown example / Markdownの例 | ||
|
||
*Here is an example of how `sphinx-new-tab-link` works with HTML built from a Markdown file.* | ||
*MarkdownファイルからビルドされたHTMLでも`sphinx-new-tab-link`が機能する例です。* | ||
|
||
```{note} reST version: [reST example](guide.en.rst) / [reSTの例](guide.rst) | ||
``` | ||
|
||
## Links / リンク集 | ||
|
||
* PyPI <https://pypi.org/project/sphinx-new-tab-link/> | ||
* [GitHub Repository](https://github.com/ftnext/sphinx-new-tab-link) | ||
|
||
## Installation / インストール | ||
|
||
```shell | ||
$ pip install sphinx-new-tab-link myst-parser | ||
``` | ||
|
||
## How to use / 使い方 | ||
|
||
`conf.py` | ||
|
||
```python | ||
extensions = [ | ||
"myst_parser", | ||
"sphinx_new_tab_link", | ||
] | ||
``` | ||
|
||
## Supported notations / 対応している記法 | ||
|
||
It supports various notations of a external link possible in MyST. | ||
MySTで可能なさまざまな記法による外部リンクをサポートしています。 | ||
|
||
ref: <https://myst-parser.readthedocs.io/en/latest/syntax/syntax.html#default-destination-resolution> | ||
|
||
✅Autolinks | ||
|
||
See *PyPI* at ['Links / リンク集' section](#links--リンク集) | ||
|
||
```md | ||
<https://pypi.org/project/sphinx-new-tab-link/> | ||
``` | ||
|
||
✅Inline links (to external target) | ||
|
||
See *GitHub Repository* at ['Links / リンク集' section](#links--リンク集) | ||
|
||
```md | ||
[GitHub Repository](https://github.com/ftnext/sphinx-new-tab-link) | ||
``` | ||
|
||
✅Reference links (to external target) | ||
|
||
[公開版ガイド(ja)][guide-ja] | ||
|
||
[guide-ja]: https://ftnext.github.io/sphinx-new-tab-link/guide.html | ||
|
||
```md | ||
[公開版ガイド(ja)][guide-ja] | ||
|
||
[guide-ja]: https://ftnext.github.io/sphinx-new-tab-link/guide.html | ||
``` | ||
|
||
Enjoy documentation!🙌 |
Oops, something went wrong.