最初に
以下の環境で実施
環境 | 詳細 |
---|---|
OS | windows11 |
言語 | python |
sphinx | v5.1.1 |
Pythonでの自作モジュールのdocを以下で作成
_dirは絶対パスを入れている
sphinx-apidoc -f -o source_dir module_dir
sphinx-build source_dir build_dir
エラー
記事タイトルのエラーが発生。
WARNING Inline interpreted text or phrase reference start-string without end-string.
原因
原因は下記の記事を参照して推定した。
恐らく、rst記載の方法として、「``」で囲むべき文字列が適切でないと思われる。
apidocで自動生成しているので、rst自体は解読できないので確定できなかった。
# Example1
[NG] Exit code of a process is stored in the ``RetValue variable.
[OK] Exit code of a process is stored in the ``RetValue`` variable.
# Example2
[NG] Python ``list``s use square bracket syntax.
[OK] Python ``list``\s use square bracket syntax.
解決
ソースコード内の以下の記載が原因と思われたので修正した。
# NG
param = str
# OK
param = ''