繁体   English   中英

为什么 sphinx 无法识别文档字符串的某些部分

[英]Why sphinx does not recognize some part of docstring

我想用 sphinx 来记录一个 django 项目。 使用sphinx.ext.autodoc时一切正常。 但是我遇到了以下问题。 无法识别ParametersReturns下的文档字符串。 请提供任何帮助!

class CampaignNamingTool(models.Model):
    """
    The goal of Campaign Naming Tool is to help account mangers 
    to respect campaigns nomenclature and thus avoid bugs or
    missing campaigns. Because campaigns are case sensitives in
    the workflow process. So every bad named or misnamed campaign
    are ignored and it won't be displayed in the users insertions orders.
    Plase use this formular to create your first campaign.
    
    Parameters:
    ----------
    user                          : owner or in charge of the campaign.
    year, month                   : year and month when launching campaign online.
    advertiser                    : advertiser of the campaign.
    name                          : name of the campaign.
    device                        : device the campaign must be served (Desktop, Mobile, tablette).
    type_of_format                : format that campaign must be served (IAB, Video, Habillage, etc)
    kpi                           : KPI of the campaign (CPM, CPC, CPV, CPA, etc)

    Returns:
    -------
    An Insertion Order object with the concatenation of all these parameters
    """

您的文档字符串看起来像是 numpy 和 Google 风格的混合体,这行不通 - 选择一个。 确保启用拿破仑扩展。

在这里找到扩展的样式和配置: https ://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html

过时但更易读的文档在这里: https ://sphinxcontrib-napoleon.readthedocs.io/en/latest/

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM