简体   繁体   中英

Why sphinx does not recognize some part of docstring

I would like to use sphinx for documenting a django project. All is fine when using sphinx.ext.autodoc . But I come accross some throuble with the following. The docstring under Parameters and Returns are not recognized. Any help please !

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
    """

Your docstring looks like a mixture of numpy and Google style, this won't work - choose one. Make sure you enable napoleon extension.

Find both styles and config for extension here: https://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html

Outdated but more readable documentation is here: https://sphinxcontrib-napoleon.readthedocs.io/en/latest/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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