python-sphinx - 我在 Read the Docs 上构建项目时遇到问题
问题描述
使用 sphinx-quickstart 创建了 sphinx 项目。运行“make html”并且没有产生错误。将所有代码推送到 GitHub。我尝试在 Read the Docs 上导入和构建项目,但出现以下错误。使用 Mac 时我没有任何问题——它在 Read the Docs 上构建和呈现代码。这次我使用的是 Windows 10。
Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/thirddocs/envs/latest/lib/python3.7/site-packages/sphinx/cmd/build.py", line 304, in build_main
app.build(args.force_all, filenames)
File "/home/docs/checkouts/readthedocs.org/user_builds/thirddocs/envs/latest/lib/python3.7/site-packages/sphinx/application.py", line 341, in build
self.builder.build_update()
File "/home/docs/checkouts/readthedocs.org/user_builds/thirddocs/envs/latest/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 347, in build_update
len(to_build))
File "/home/docs/checkouts/readthedocs.org/user_builds/thirddocs/envs/latest/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 360, in build
updated_docnames = set(self.read())
File "/home/docs/checkouts/readthedocs.org/user_builds/thirddocs/envs/latest/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 472, in read
self.env.doc2path(self.config.master_doc))
sphinx.errors.SphinxError: master file /home/docs/checkouts/readthedocs.org/user_builds/thirddocs/checkouts/latest/contents.rst not found
Sphinx error:
master file /home/docs/checkouts/readthedocs.org/user_builds/thirddocs/checkouts/latest/contents.rst not found
解决方案
它只需将 master_doc = 'index' 添加到 conf.py 文件中即可。
推荐阅读
- python - 为什么 virtualenv(版本 20)比 python3 -m venv 快得多
- websphere - 如何将配置 websphere 同步到其他站点 DR?
- cygwin - 如何让cygwin更快?
- vbscript - 如何使用用户输入 VBScript 编辑 .ini 文件中的字符串
- emacs - 使全局次要模式缓冲区本地
- reactjs - 当 ReactJS 中已经有 proptypes 时,如何将函数从父级传递给子级
- mysql - 无法使用 mysql 和 nodejs 将动态行插入表中
- arrays - 如何从没有随机的数组中选择一个数据
- docker - 在 Docker 中运行 Wildfly 时,类加载器 getResource 失败
- html - 如果单元格包含 HTML,MDBDataTable 无法对列进行排序