Read the Docsしたい(.readthedocs.yml

# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the version of Python and other tools you might need
build:
    os: "ubuntu-22.04"
    tools:
        python: "3.9"
        # You can also specify other tool versions:
        # nodejs: "16"
        # rust: "1.55"
        # golang: "1.17"

# Build documentation in the docs/ directory with Sphinx
sphinx:
    builder: html
    configuration: docs/source/conf.py

# Optionally build your docs in additional formats such as PDF
formats:
    - pdf

# Optionally set the version of Python and requirements required to build your docs
python:
    install:
        - requirements: requirements.txt

Read the DocsはSphinxドキュメントを公開するためのホスティングサービスです。 このKumaROOTもRTDを使って公開しています。

素のSphinxであれば、そのままRTDでビルドできますが、パッケージを追加している場合は、ビルド時の設定が必要です。 ビルド時の設定は.readthedocs.yml(もしくは.readthedocs.yaml)でカスタマイズできます。

それぞれの設定項目については公式ドキュメント(Configuration File V2)を参照してください。

注釈

2023-09-25以降はこの設定ファイルが必須となりました。 詳しくは公式ブログを参照してください。

Poetryしたい

1$ poetry export -f requirements.txt --output requirements.txt

KumaROOTではpoetryを使ってパッケージを管理していますが、RTDではpoetry installができません。 そのため、poetry exportrequirements.txtを作成しています。 poetryに限らずpip以外のパッケージ管理ツールを使っている場合には、この方法がいいのかもしれません。