Sphinx将整个模块索引添加到生成的PDF中

时间:2018-04-20 02:29:56

标签: python pdf python-sphinx read-the-docs autodoc

我使用Sphinx autodoc创建Python文档,然后将其托管在ReadTheDocs here上。由ReadTheDocs生成的PDF仅包含我的索引页面的TOC,您可以看到here

我希望PDF还包含每个模块/函数的整个模块索引和文档:http://sensormotion.readthedocs.io/en/develop/source/sensormotion.html

基本上我希望我的索引TOC和完整模块页面都合并到同一个PDF

我需要在conf.py中更改哪些设置才能实现此目的?

目前我只有默认的latex_documents选项:

latex_documents = [
    (master_doc, 'index.tex', project + ' Documentation',
     author, 'howto'),
]

我尝试在列表中添加另一个元组以获取实际的模块/函数引用,但似乎没有任何内容附加到PDF:

latex_documents = [
    (master_doc, 'index.tex', project + ' Documentation',
     author, 'howto'),
    ('sensormotion', 'sensormotion.tex', project + ' Documentation',
     author, 'howto'),
]

1 个答案:

答案 0 :(得分:0)

您没有从docs/source引用index.rst下的第一个文件。我想也许HTML构建器会搜索docs下的所有第一个文件,而LaTeX构建器会渲染你在latex_documents下明确列出的文件(它为这个列表中的每个条目创建一个输出PDF)。