使用sphinx-quickstart创建了sphinx项目。跑了“使HTML”,没有错误产生。将所有代码推送到GitHub。我尝试在“阅读文档”上导入和构建项目,但出现以下错误。使用Mac时,我没有问题,它可以在“阅读文档”上生成并呈现代码。这次我使用的是Windows 10。
回溯(最近通话最近): 在build_main的第304行中输入文件“ /home/docs/checkouts/readthedocs.org/user_builds/thirddocs/envs/latest/lib/python3.7/site-packages/sphinx/cmd/build.py” app.build(args.force_all,文件名) 生成文件“ /home/docs/checkouts/readthedocs.org/user_builds/thirddocs/envs/latest/lib/python3.7/site-packages/sphinx/application.py”,第341行 self.builder.build_update() 文件“ /home/docs/checkouts/readthedocs.org/user_builds/thirddocs/envs/latest/lib/python3.7/site-packages/sphinx/builders/init.py”,行347,在build_update中 len(to_build)) 文件“ /home/docs/checkouts/readthedocs.org/user_builds/thirddocs/envs/latest/lib/python3.7/site-packages/sphinx/builders/init.py”,第360行,在建立 Updated_docnames = set(self.read()) 文件“ /home/docs/checkouts/readthedocs.org/user_builds/thirddocs/envs/latest/lib/python3.7/site-packages/sphinx/builders/init.py”,第472行,在读 self.env.doc2path(self.config.master_doc)) sphinx.errors.SphinxError:主文件/home/docs/checkouts/readthedocs.org/user_builds/thirddocs/checkouts/latest/contents.rst未找到
Sphinx错误: 找不到主文件/home/docs/checkouts/readthedocs.org/user_builds/thirddocs/checkouts/latest/contents.rst
答案 0 :(得分:1)
通过在conf.py文件中添加master_doc ='index'来工作。