.. index::
pair: Sphinx; usage
SphinxはreStructredText(reST) 形式で作成された文書を、PDFやHTML、その他のフォーマットへと変換してくれるドキュメンテーションビルダーというツールです。 Pythonのドキュメント生成のために開発されたものなので、プロジェクトのドキュメント作成にはもってこいです。 また、中身もPythonで書かれているので、へびつかいであれば、ある程度カスタマイズすることもできるはずです。
このKumaROOT
もSphinx
を使って生成しています。
プロジェクト自体はGitHubを使ってバージョン管理をしてあり、ウェブ版はRead the Docsで公開しています。
どういったものか気になる方はぜひKumaROOTのGitHubリポジトリをクローンしてみてください。
ドキュメントのはじめかたや、拡張パッケージの設定方法などを整理しました。
---
maxdepth: 1
---
sphinx-install
sphinx-quickstart
sphinx-conf
sphinx-conf-numfig
sphinx-conf-today-fmt
sphinx-extensions
僕がよく使う拡張機能を紹介します。
---
maxdepth: 1
---
sphinx-extensions-myst
sphinx-extensions-opengraph
sphinx-extensions-googleanalytics
sphinx-extensions-copybutton
sphinx-extensions-ablog
sphinx-extensions-datatemplates
sphinx-extensions-napoleon
ドキュメントをマークアップする方法を整理しました。 Sphinxの基本はディレクティブ(directive)とロール(role)です。
:::{hint}
ディレクティブ/ロールは、 HTMLだとブロック要素/インライン要素、 LaTeXだと環境/コマンド、 に相当するイメージで、僕はドキュメントをマークアップしています。
:::
デフォルトの基本はreST(reStructuredText)記法
なのですが、
このドキュメントではMyST記法を前提にコードのサンプルを例示します。
---
maxdepth: 1
---
sphinx-syntax-toctree
sphinx-syntax-comment
sphinx-syntax-hyperlink
sphinx-syntax-code-block
sphinx-syntax-admonition
sphinx-syntax-image
sphinx-syntax-meta
sphinx-syntax-footnote
sphinx-syntax-include
sphinx-syntax-index
---
maxdepth: 1
---
sphinx-html-theme
sphinx-html-title
sphinx-html-logo
sphinx-html-htaccess
sphinx-html-sidebars
sphinx-html-css
% あとでsphinx-designのページを作る % sphinx-html-sd
---
maxdepth: 1
---
sphinx-latex-engine
sphinx-latex-docclass
sphinx-latex-elements
sphinx-latex-documents
sphinx-latex-logo
sphinx-latex-section
sphinx-latex-thesection
---
maxdepth: 1
caption: 設定例
---
sphinx-latex-lualatex
sphinx-latex-uplatex
ドキュメントをビルドする方法を整理しました。
---
maxdepth: 1
---
sphinx-build
sphinx-build-html
sphinx-build-latexpdf
sphinx-build-linkcheck
sphinx-build-gettext
sphinx-autobuild
---
maxdepth: 1
---
sphinx-deploy-gitlab
sphinx-deploy-rtd