【发布时间】:2021-12-19 05:02:06
【问题描述】:
我正在尝试将我已完成的代码文档放在 readthedocs 上,但所有页面都变成了空白。我已经尝试了一整天,我已经观看/阅读了数十篇教程,但没有任何效果。当我在本地进行时,它会正常构建。
目录是这样组织的:
/root:/docs、module1.py、module2.py、module3.py、.readthedocs.yml
根/文档:/_build、/_static、/_templates、conf.py、index.rst、make.bat、Makefile、requirements.txt、module1.rst、module2.rst、module3.rst
我会在下面留下 .readthedocs.yml、conf.py 和 requirements.txt 的代码,让你看看我有没有做错什么。我厌倦了这么多尝试让这件事工作,请帮助我
#readthedocs.yml
version: 2
sphinx:
configuration: docs/conf.py
formats: all
python:
version: 3.8
install:
- requirements: docs/requirements.txt
#conf.py
import sphinx_rtd_theme
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
project = 'MolOpt'
copyright = '2021, estevaopbs'
author = 'estevaopbs'
extensions = [
'sphinx.ext.autodoc'
]
templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
html_theme = 'sphinx_rtd_theme'
html_static_path = ['_static']
#requirements.txt
sphinx_rtd_theme==1.0.0
【问题讨论】:
-
检查 RTD 上的构建日志。会有一个错误,很可能表明它无法导入你的包,因为它没有安装。见docs.readthedocs.io/en/stable/guides/…
-
存储库已被删除,我知道它现在住在这里github.com/estevaopbs/MolOpt
标签: python python-sphinx restructuredtext read-the-docs