我正在使用Python-Sphinx进行一个更大的文档项目。我刚刚开始并设法克服了第一个障碍,并创建了一个面向各个子项目的文件夹结构,为整个项目做出了贡献:
.../source/
conf.py
index.rst (braket file for everything)
/OverViewDocumentation/
overview.rst
/Subprojects/
/sub1/
index.rst
sub1Docu.rst
/sub2/
indexfile.rst
sub2Docu.rst
我希望看到的是,这种结构可以通过一个单一的html结构访问,但是叶文档变成了单独的LaTeX/PDF文档。
这能实现吗?
我的 conf.py 如下所示:
latex_documents = [
(master_doc,
'TexDoc1.tex',
'Title1',
'author1',
'Custom docclass'),
('abolute\path\to\other\indexfile.rst',
'TexDoc2.tex',
'Title2',
'author2',
'Custom docclass'),
]
但我总是收到错误消息:
WARNING: "latex_documents" config value references unknown document <pathto>indexfile
请注意,无论我使用绝对路径还是相对路径,都会出现错误。
感谢 mzjn 的提示,我找到了解决方案。
错误出在文件 conf.py 中。工作文件如下所示:
latex_documents = [
(master_doc,
'TexDoc1.tex',
'Title1',
'author1',
'Custom docclass'),
('relative/path/to/other/indexfile',
'TexDoc2.tex',
'Title2',
'author2',
'Custom docclass'),
]
在上面的文件中,我遇到了以下问题
- 使用反斜杠而不是斜杠(我正在开发窗口系统(
- 使用绝对路径
- 对索引文件使用显式文件扩展名