python - 狮身人面像 index.rst 里面的目录
问题描述
Sphinx 构建的主文档的路径可以在conf.py
. 但是,此目录路径反映在生成的 HTML 中,例如在 Read The Docs 中显示为缺失的索引。我想使用这种替代路径来干净地构建我的项目 - 在顶层进行配置和内部文档src
,但让构建基本上摆脱它。
所以这就是我以前的:
docs
conf.py
index.rst
things
doc1.rst
doc2.rst
这可行,但是当将大量文件添加到顶层时,Sphinx 的 makefile 等会变得混乱。我想改用这个:
docs
conf.py
src
index.rst
things
doc1.rst
doc2.rst
哪个构建,但index.html
在build/html/src
而不是build/html
. master_doc
令我惊讶的是,除了inconf.py
控制主文件的位置和名称这一事实之外,没有关于此的任何信息。我怎样才能让我的文档被构建到build/html
?
解决方案
有一个选项用于指定配置文件的位置:-c
.
# conf.py
master_doc = 'index'
# structure
docs
conf.py
src
index.rst
...
然后运行sphinx-build -b html -c . src build/html
。但是,此解决方案确实需要控制 build 命令,而 Read The Docs 中没有该命令。并且似乎-c
在 Sphinx 自己的 makefile 中也不起作用(使用-M
而不是-b
)。
推荐阅读
- fortran - 关于 MPI_SEND 和 MPI_RECV 命令的问题
- java - 无法插入到 mysql 中的枚举类型
- linux - net.DialTCP 在 Linux 上产生“连接被拒绝”错误,但在 Windows 上没有
- json - 如果我使用 JSON Schema 的 if-else 条件,是否有办法针对 JSON 中存在的任何附加键引发错误?
- google-cloud-platform - 有没有办法一次清除多个表?
- javascript - javascript API导入和导出问题
- javascript - Upsert 实现委托更新但不委托添加
- java - Java,字符串只接受字母和“if”语句
- mysql - 在 CentOS 6.9 上安装 MySQL 5.1
- spring-integration - spring-cloud-stream 应用程序正在寻找不存在的 org.springframework.integration.endpoint.Pausable