Skip to content

Commit

Permalink
[release] Publish on GitHub Pages
Browse files Browse the repository at this point in the history
  • Loading branch information
ftnext committed Sep 8, 2024
0 parents commit ef57776
Show file tree
Hide file tree
Showing 35 changed files with 4,300 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .buildinfo
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: 049766881c169166b5df1c66e46630bb
tags: 645f666f9bcd5a90fca523b33c5a78b7
Empty file added .nojekyll
Empty file.
Binary file added _images/breakfast.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/pyconjp2019.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions _sources/api.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
API
===

.. automodule:: sphinx_new_tab_link
:members:
113 changes: 113 additions & 0 deletions _sources/guide.en.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
.. _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.
✅ ``image`` directive specified ``:target:`` option

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

.. code-block:: rst
.. 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/

.. code-block:: rst
.. figure:: _static/pyconjp2019.jpg
:target: https://www.flickr.com/photos/pyconjp/48743997848/in/album-72157710870622516/
.. 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!🙌
113 changes: 113 additions & 0 deletions _sources/guide.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
.. _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`_ を参照できる
✅ ``:target:`` オプションを指定した ``image`` ディレクティブ

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

.. code-block:: rst
.. image:: _static/breakfast.jpg
:target: https://www.flickr.com/photos/pyconjp/48818171768/in/album-72157710870622516/
✅ ``:target:`` オプションを指定した ``figure`` ディレクティブ

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

.. code-block:: rst
.. figure:: _static/pyconjp2019.jpg
:target: https://www.flickr.com/photos/pyconjp/48743997848/in/album-72157710870622516/
.. 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!🙌
28 changes: 28 additions & 0 deletions _sources/index.rst.txt
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`
66 changes: 66 additions & 0 deletions _sources/markdown-example.md.txt
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!🙌
Loading

0 comments on commit ef57776

Please sign in to comment.