2012-12-29 103 views
11

我是狮身人面像的新手。我尝试了这个教程,但是我没有在内容中生成链接。我得到狮身人面像无法获得TOCTREE显示链接

C:\Users\mhaikalm\sphinxtest\source\index.rst:11: WARNING: toctree contains refe 
rence to document 'intro' that doesn't have a title: no link will be generated 
C:\Users\mhaikalm\sphinxtest\source\index.rst:11: WARNING: toctree contains refe 
rence to document 'zuhdi' that doesn't have a title: no link will be generated 
writing additional files... (0 module code pages) genindex search 
copying static files... done 
dumping search index... done 
dumping object inventory... done 
build succeeded, 3 warnings. 

Build finished. The HTML pages are in build/html. 

的错误我已经在相同目录下创建zuhdi.rstintro.rstindex.rst。我怎样才能把文件的标题?

为了您的信息,我的index.rst包含这些行:

Contents: 

.. toctree:: 
    :maxdepth: 2 

    intro 
    zuhdi 

执行文件必须存在我把在toctree的联系? intro.rstzuhdi.rst只是一个空文件。

回答

16

由于您没有intro.rst中的标题,您将收到此错误。
为了解决这个问题,请给intro.rst添加一个标题。假设你想你的标题是My Title,那么标题可以通过将以下两行的intro.rst第一行补充说:

My Title 
********* 

请注意,您必须有足够的*字符完全强调你的标题,否则你将获得约畸形的标题另一个错误或者其强调

希望这有助于

+0

很抱歉的延迟审批 –

+0

@HaikalNashuha:哈哈!很高兴我能够提供帮助 – inspectorG4dget