簡體   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