简介:在Sphinx自动模块中不工作 [英] :synopsis: not working in Sphinx automodule

查看:24
本文介绍了简介:在Sphinx自动模块中不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Sphinx,我真的很喜欢它,但它不能提取模块概要。没有错误或任何事情,只是简单的..。没什么。这是我尝试自动创建文档的模块:

# vim: set fileencoding=utf-8 :
"""
.. module:: CONF
   :synopsis: Configuration module, tells where data files are.

.. moduleauthor:: Mr Anderson <mr@matrix.com>
"""

这是REST索引文件中的Sphinx指令:

.. automodule:: CONF
   :synopsis:

我从狮身人面像那里得到了各种各样的其他奇妙的东西,所以它对我来说通常不是坏的。我得到的唯一可疑的东西是:SEVERE: Duplicate ID: "module-CONF"。一些谷歌搜索让我相信这个错误是相当"正常"的?

推荐答案

遵循Bonlenfum的解决方案,下面是一个(甚至更简洁)的示例,它打印模块索引和文档字符串中的模块指令:

"""
.. module:: CONF
  :synopsis: written in module index..................................newlines are
    automatically handled (still, mind the spacing)
  :platform: Windows

.. moduleauthor:: Mr Anderson <mr@matrix.com>

:synopsis: this is written in the docstrings..........................newlines are handled
  automatically handled (mind spacing) or I can force newlines with 

  a newline character.
"""

我添加了"..."添加空格,以使行足够长,使狮身人面像可以自动在换行符上继续。模块作者仅显示在单据字符串中(不显示索引)。

这在Sphinx 1.2和read the docs主题中运行良好

这篇关于简介:在Sphinx自动模块中不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆