nikkie-ftnextの日記

イベントレポートや読書メモを発信

登壇報告 | 11月の #guidomeetup にてGuidoさんにSphinx拡張 sphinx-new-tab-link を見ていただきました!嬉しいコメント、天にものぼる心地🙌

はじめに

東海林さん、かっこよかった〜。うぇるこましてきたnikkieです。

すっかり遅くなってしまいましたが、11/30(木)のGuido氏インタラクティブ記念講演会を記事にします。

目次

Guido氏インタラクティブ記念講演会

C&C賞の受賞で来日されたGuido氏(Pythonの生みの親)の記念講演会です。

インタラクティブを冠する通り、Guidoさんに質問したりプレゼンしたりと、Guidoさん 対 コミュニティのPython使いの1:1がいくつもあった感じです。

  • 事前に集めたQ&A
  • 活動を見てもらうプレゼン
  • 当日のライブQ&A

一般社団法人PyCon JP Associationも運営に関わられていて、翌日のpyconjptvで取り上げられています。

アーカイブが、あります!(ありがとうございます!)

私のトークは45:20くらいから。
当日使ったスライドはconnpassに上がっていますし、私のパートだけ抜き出したものはこちらです

英語発表原稿

スピーカーノートを印刷して準備していました。

Hello, everyone.
Please call me nikkie.
Python is a tool that feels very natural to me.

First off, I want to say the most important thing today.
Thank you, Guido-san, for creating Python and answering Rust & type hint questions.

I really enjoy reading Python documentation, as well as the documentation for libraries implemented in Python.


There's something I think about when reading documentation in a browser.
This animation is clicking a link to Wikipedia in Python's Sorting HOW TO.
Wikipedia site is external from Sorting HOW TO, but it opens in the same tab.
To compare it side-by-side, I always used to click with macOS command key pressed.

(2 backup slide)


Many documents, including Python's, are made with a documentation generator called Sphinx.
What I'm introducing here is a Sphinx extension that opens external site links in a new browser tab.
It's called sphinx-new-tab-link.
I wanted it so badly that I ended up making it myself.


With the sphinx-new-tab-link extension,
clicking a link to an external site like PyPI,
will always open it in a NEW tab, even without pressing the command key.

(2 backup slide)


I have a lot of thank-yous to give here.

I found the implementation on StackOverflow.
Many people seems to want to create HTML that opens links in a new tab, but since I couldn't find it on PyPI, I published sphinx-new-tab-link.

I learned how to develop Sphinx extensions at a Python conference, which helped me progress!

Also, recently, thanks to an issue and a pull request, sphinx-new-tab-link now supports dirhtml too.


If you're building HTML with Sphinx and are interested, please try sphinx-new-tab-link.
This is the second most important thing I want to share today.

It's easy to start using.
See left upper side.
Just pip install it and insert it into extensions.

See right side.
In addition to reStructuredText, it also supports combinations of Python files and autodoc, as well as Markdown, so please give it a try.

Even if it's not from Guido-san, I'm always happy to receive feedback.

Thank you!

日本語版

皆さん、こんにちは。
私のことはnikkieと呼んでください。
Pythonは私にとってとても手に馴染むツールです。
まず今日一番言いたいことを言います。
Guidoさん、Pythonを作り出してくれてありがとうございます。
私はPythonだったり、Pythonで実装されたライブラリのドキュメントを読むのがとても好きです。

ドキュメントをブラウザで読んでいて思うことがあります。
このアニメーションは、PythonのSorting HOW TOにあるWikipediaへのリンクをクリックしています。
ドキュメントとは別のサイトのWikipediaですが、同じタブで開きます。
Sorting HOW TOと左右に見比べるために、いつもコマンドキーを押しながらクリックしていました。

Pythonをはじめとする多くのドキュメントは、Sphinxというドキュメンテーションツールで作られているかなと思います。
ここで紹介するのは、外部サイトのリンクをブラウザの別のタブで開くSphinx拡張です。
その名もsphinx-new-tab-linkといいまして、開発者は私です!
喉から手が出るほど欲しかったので、自作して公開しました。

sphinx-new-tab-linkという拡張を有効にした上でビルドしたHTMLの例なんですけれども、
外部サイトに当たるPyPIへのリンクをクリックすると、
これはコマンドキーを押していなくても、常に別のタブで開くようになります。

この場でたくさんありがとうを伝えたいなと思っています。
実装方法はStackOverflowで見つけました。
リンクを別のタブで開くHTMLを作りたい人は多かったようなんですけれども、
PyPIに見つからなかったので、ライブラリ化して公開しています。
PythonカンファレンスでSphinx拡張の開発方法を知ったことで開発が進みました!
そして、先日、Issueとプルリクエストをいただいて、dirhtmlもサポートできるようになりました。

SphinxでHTMLをビルドしている方は、もし興味を持ったら、sphinx-new-tab-linkをお試しください。
簡単に使い出せます。
pip installして、extensionsにinsertするだけです。
そして、reStructuredTextのほかに、Pythonファイルとautodocの組合せだったり、マークダウンもサポートしているので、よければ使ってみてください。
Guidoさんからでなくても、フィードバックは常時大歓迎です。

ありがとうございました。

Guidoさんのコメント、天にものぼるような心地

YouTubeの字幕から拾いました(48:24〜)。

I think that's a great hack
and I agree with you that at so many times there are things not just python sphinx documentation but anything that like there's a link and now you have to sort of after following a few links then you have to navigate back to where you came from
and it's I always wish that it was in another tab so thank you for making this and I'm going to promote this with a python documentation team

最後の一文が嬉しすぎました!
「作ってくれてありがとう。これをPythonドキュメンテーションチームに推進するつもりです」

うおーーー!! やったー!!!!🙌 🙌 🙌

終わりに

11月末日のGuido氏インタラクティブ記念講演会でのプレゼンは、忘れられない経験となりました。
こんなことってあるんですね!

これが現実か信じられなくて、12月はミリシタに打ち込んだりしたのかもしれません。
あこがれの人からですから、軽いパニックだったのかも。しばらく受け止めきれませんでした。
年末で時間もでき、落ち着いても来たので、Pythonドキュメントがどうなっているか覗いたり、プルリク送ってみたりしようと思います

P.S. 発表準備ログ

以下のエントリをGuidoさんに向けてプレゼンした形になります