当前位置: 首页>>代码示例>>Python>>正文


Python autodoc.cut_lines方法代码示例

本文整理汇总了Python中sphinx.ext.autodoc.cut_lines方法的典型用法代码示例。如果您正苦于以下问题:Python autodoc.cut_lines方法的具体用法?Python autodoc.cut_lines怎么用?Python autodoc.cut_lines使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sphinx.ext.autodoc的用法示例。


在下文中一共展示了autodoc.cut_lines方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setup

# 需要导入模块: from sphinx.ext import autodoc [as 别名]
# 或者: from sphinx.ext.autodoc import cut_lines [as 别名]
def setup(app):
    # add custom css
    app.add_stylesheet("css/customize.css")
    from sphinx.ext.autodoc import cut_lines
    # skip the copyright line in every module docstring (last line of docstring)
    app.connect('autodoc-process-docstring', cut_lines(pre=0, post=1, what=['module'])) 
开发者ID:irmen,项目名称:Pyro5,代码行数:8,代码来源:conf.py

示例2: setup

# 需要导入模块: from sphinx.ext import autodoc [as 别名]
# 或者: from sphinx.ext.autodoc import cut_lines [as 别名]
def setup(app):
    app.connect('autodoc-process-docstring', cut_lines(2, what=['module'])) 
开发者ID:rizar,项目名称:attention-lvcsr,代码行数:4,代码来源:conf.py

示例3: setup

# 需要导入模块: from sphinx.ext import autodoc [as 别名]
# 或者: from sphinx.ext.autodoc import cut_lines [as 别名]
def setup(app):
    app.connect('autodoc-process-docstring', cut_lines(2, what=['module']))
    app.connect('autodoc-skip-member', skip_abc) 
开发者ID:rizar,项目名称:attention-lvcsr,代码行数:5,代码来源:conf.py

示例4: setup

# 需要导入模块: from sphinx.ext import autodoc [as 别名]
# 或者: from sphinx.ext.autodoc import cut_lines [as 别名]
def setup(app):
    # Avoid print the copyright intro in each module documentation
    from sphinx.ext.autodoc import cut_lines
    app.connect('autodoc-process-docstring', cut_lines(15, what=['module']))

    # Generate the meos documentation files
    app.connect('builder-inited', Autogenerate_MEoS) 
开发者ID:jjgomera,项目名称:pychemqt,代码行数:9,代码来源:conf.py

示例5: cut_lines

# 需要导入模块: from sphinx.ext import autodoc [as 别名]
# 或者: from sphinx.ext.autodoc import cut_lines [as 别名]
def cut_lines(pre, post=0, what=None):
    """
    Return a listener that removes the first *pre* and last *post*
    lines of every docstring.  If *what* is a sequence of strings,
    only docstrings of a type in *what* will be processed.

    Use like this (e.g. in the ``setup()`` function of :file:`conf.py`)::

       from sphinx.ext.autodoc import cut_lines
       app.connect('autodoc-process-docstring', cut_lines(4, what=['module']))

    This can (and should) be used in place of :confval:`automodule_skip_lines`.
    """
    def process(app, what_, name, obj, options, lines):
        if what and what_ not in what:
            return
        del lines[:pre]
        if post:
            # remove one trailing blank line.
            if lines and not lines[-1]:
                lines.pop(-1)
            del lines[-post:]
        # make sure there is a blank line at the end
        if lines and lines[-1]:
            lines.append('')
    return process 
开发者ID:cihologramas,项目名称:pyoptools,代码行数:28,代码来源:sage_autodoc.py

示例6: setup

# 需要导入模块: from sphinx.ext import autodoc [as 别名]
# 或者: from sphinx.ext.autodoc import cut_lines [as 别名]
def setup(app):
    app.connect('autodoc-process-docstring', cut_lines(3, 3, what=['module'])) 
开发者ID:banama,项目名称:Werkzeug-docs-cn,代码行数:4,代码来源:werkzeugext.py


注:本文中的sphinx.ext.autodoc.cut_lines方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。