def setup(app): app.connect("autodoc-process-docstring", cut_lines( pre=1, post=11, what=["module"] )) app.connect("autodoc-process-docstring", cut_lines( pre=1, what=["module","class","method","function","attribute","data","exception"] ))
def setup(app): from sphinx.ext.autodoc import cut_lines app.connect('autodoc-process-docstring', cut_lines(4, what=['module'])) app.add_object_type('directive', 'dir', 'pair: %s; directive', parse_directive) app.add_object_type('role', 'role', 'pair: %s; role', parse_role) app.add_object_type('confval', 'confval', 'pair: %s; configuration value') app.add_object_type('event', 'event', 'pair: %s; event', parse_event)
def setup(app): # add custom css app.add_css_file("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']))
def setup(app): from sphinx.ext.autodoc import cut_lines from sphinx.util.docfields import GroupedField app.connect('autodoc-process-docstring', cut_lines(4, what=['module'])) app.connect('source-read', linkify_issues_in_changelog) app.add_object_type('confval', 'confval', objname='configuration value', indextemplate='pair: %s; configuration value') app.add_object_type('setuptools-confval', 'setuptools-confval', objname='setuptools configuration value', indextemplate='pair: %s; setuptools configuration value') fdesc = GroupedField('parameter', label='Parameters', names=['param'], can_collapse=True) app.add_object_type('event', 'event', 'pair: %s; event', parse_event, doc_field_types=[fdesc]) # Load jQuery and patches to make readthedocs-doc-embed.js available (refs: #10574) app.add_js_file('https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js', priority=100) app.add_js_file('https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.13.1/underscore-min.js', # NoQA priority=100) app.add_js_file('_sphinx_javascript_frameworks_compat.js', priority=105) # workaround for RTD from sphinx.util import logging logger = logging.getLogger(__name__) app.info = lambda *args, **kwargs: logger.info(*args, **kwargs) app.warn = lambda *args, **kwargs: logger.warning(*args, **kwargs) app.debug = lambda *args, **kwargs: logger.debug(*args, **kwargs)
def setup(app): from sphinx.ext.autodoc import cut_lines app.connect(b'autodoc-process-docstring', cut_lines(4, what=['module'])) app.add_object_type( b'confval', 'confval', objname='configuration value', indextemplate='pair: %s; configuration value')
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)
def setup(app): from sphinx.ext.autodoc import cut_lines app.connect('autodoc-process-docstring', cut_lines(4, what=['module'])) app.add_description_unit('directive', 'dir', 'pair: %s; directive', parse_directive) app.add_description_unit('role', 'role', 'pair: %s; role', parse_role) app.add_description_unit('confval', 'confval', 'pair: %s; configuration value') app.add_description_unit('event', 'event', 'pair: %s; event', parse_event)
def setup(app): # add custom stylesheet app.add_stylesheet("css/customize.css") from sphinx.ext.autodoc import cut_lines # skip the copyright lines in every module docstring (last two lines of docstring) app.connect('autodoc-process-docstring', cut_lines(pre=0, post=2, what=['module']))
def setup(app): from sphinx.ext.autodoc import cut_lines from sphinx.util.docfields import GroupedField app.connect('autodoc-process-docstring', cut_lines(4, what=['module'])) app.add_object_type('confval', 'confval', objname='configuration value', indextemplate='pair: %s; configuration value') app.add_object_type( 'setuptools-confval', 'setuptools-confval', objname='setuptools configuration value', indextemplate='pair: %s; setuptools configuration value') fdesc = GroupedField('parameter', label='Parameters', names=['param'], can_collapse=True) app.add_object_type('event', 'event', 'pair: %s; event', parse_event, doc_field_types=[fdesc]) # workaround for RTD from sphinx.util import logging logger = logging.getLogger(__name__) app.info = lambda *args, **kwargs: logger.info(*args, **kwargs) app.warn = lambda *args, **kwargs: logger.warning(*args, **kwargs) app.debug = lambda *args, **kwargs: logger.debug(*args, **kwargs)
def setup(app): from sphinx.ext.autodoc import cut_lines app.connect('autodoc-process-docstring', cut_lines(4, what=['module'])) app.add_description_unit('confval', 'confval', objname='configuration value', indextemplate='pair: %s; configuration value') app.add_description_unit('event', 'event', 'pair: %s; event', parse_event)
def setup(app): from sphinx.ext.autodoc import cut_lines app.connect(b'autodoc-process-docstring', cut_lines(4, what=['module'])) app.add_object_type(b'confval', 'confval', objname='configuration value', indextemplate='pair: %s; configuration value')
def test_cut_lines(app): app.connect('autodoc-process-docstring', cut_lines(2, 2, ['function'])) actual = do_autodoc(app, 'function', 'target.process_docstring.func') assert list(actual) == [ '', '.. py:function:: func()', ' :module: target.process_docstring', '', ' second line', ' ' ]
def setup(app): from sphinx.ext.autodoc import between, cut_lines global autodoc_lang if 'autodoc_lang' in app.config.overrides: autodoc_lang = app.config.overrides['autodoc_lang'] app.connect('autodoc-process-docstring', between('\.\.\s\[(/|)' + autodoc_lang + '\].*', ['function'])) app.connect('autodoc-process-docstring', cut_lines(1, what=['function']))
def setup(app): from sphinx.ext.autodoc import between, cut_lines global autodoc_lang if "autodoc_lang" in app.config.overrides: autodoc_lang = app.config.overrides["autodoc_lang"] app.connect("autodoc-process-docstring", between("\.\.\s\[(/|)" + autodoc_lang + "\].*", ["function"])) app.connect("autodoc-process-docstring", cut_lines(1, what=["function"]))
def setup(app): from sphinx.ext.autodoc import cut_lines app.connect("autodoc-process-docstring", cut_lines(4, what=["module"])) app.add_description_unit("directive", "dir", "pair: %s; directive", parse_directive) app.add_description_unit("role", "role", "pair: %s; role", parse_role) app.add_description_unit("confval", "confval", "pair: %s; configuration value") app.add_description_unit("event", "event", "pair: %s; event", parse_event)
def setup(app, **options): """ Overriding Public method :param app: The Sphinx App instance :param options: Extra options """ app.connect('autodoc-process-docstring', fix_docstring) app.connect('autodoc-process-docstring', cut_lines(25, what=['module']))
def test_docstring_processing(): def process(objtype, name, obj): inst = AutoDirective._registry[objtype](directive, name) inst.object = obj inst.fullname = name return list(inst.process_doc(inst.get_doc())) class E: def __init__(self): """Init docstring""" # docstring processing by event handler assert process('class', 'bar', E) == ['Init docstring', '', '42', ''] lid = app.connect('autodoc-process-docstring', cut_lines(1, 1, ['function'])) def f(): """ first line second line third line """ assert process('function', 'f', f) == ['second line', ''] app.disconnect(lid) lid = app.connect('autodoc-process-docstring', between('---', ['function'])) def g(): """ first line --- second line --- third line """ assert process('function', 'g', g) == ['second line', ''] app.disconnect(lid) lid = app.connect('autodoc-process-docstring', between('---', ['function'], exclude=True)) def h(): """ first line --- second line --- third line """ assert process('function', 'h', h) == ['first line', 'third line', ''] app.disconnect(lid)
def setup(app): from sphinx.ext.autodoc import cut_lines app.connect("autodoc-process-docstring", cut_lines(4, what=["module"])) app.add_object_type( "confval", "confval", objname="configuration value", indextemplate="pair: %s; configuration value", )
def setup(app): from sphinx.ext.autodoc import cut_lines from sphinx.util.docfields import GroupedField app.connect("autodoc-process-docstring", cut_lines(4, what=["module"])) app.add_object_type( "confval", "confval", objname="configuration value", indextemplate="pair: %s; configuration value" ) fdesc = GroupedField("parameter", label="Parameters", names=["param"], can_collapse=True) app.add_object_type("event", "event", "pair: %s; event", parse_event, doc_field_types=[fdesc])
def setup(app): from sphinx.ext.autodoc import cut_lines from sphinx.util.docfields import GroupedField app.connect('autodoc-process-docstring', cut_lines(4, what=['module'])) app.add_object_type('confval', 'confval', objname='configuration value', indextemplate='pair: %s; configuration value') fdesc = GroupedField('parameter', label='Parameters', names=['param'], can_collapse=True) app.add_object_type('event', 'event', 'pair: %s; event', parse_event, doc_field_types=[fdesc])
def test_docstring_processing(): def process(objtype, name, obj): inst = AutoDirective._registry[objtype](directive, name) inst.object = obj inst.fullname = name return list(inst.process_doc(inst.get_doc())) class E: def __init__(self): """Init docstring""" # docstring processing by event handler assert process("class", "bar", E) == ["Init docstring", "", "42", ""] lid = app.connect("autodoc-process-docstring", cut_lines(1, 1, ["function"])) def f(): """ first line second line third line """ assert process("function", "f", f) == ["second line", ""] app.disconnect(lid) lid = app.connect("autodoc-process-docstring", between("---", ["function"])) def g(): """ first line --- second line --- third line """ assert process("function", "g", g) == ["second line", ""] app.disconnect(lid) lid = app.connect("autodoc-process-docstring", between("---", ["function"], exclude=True)) def h(): """ first line --- second line --- third line """ assert process("function", "h", h) == ["first line", "third line", ""] app.disconnect(lid)
def setup(app): from sphinx.ext.autodoc import cut_lines from sphinx.util.docfields import GroupedField app.connect('autodoc-process-docstring', cut_lines(4, what=['module'])) app.add_object_type('confval', 'confval', objname='configuration value', indextemplate='pair: %s; configuration value') fdesc = GroupedField('parameter', label='Parameters', names=['param'], can_collapse=True) app.add_object_type('event', 'event', 'pair: %s; event', parse_event, doc_field_types=[fdesc]) # workaround for RTD from sphinx.util import logging logger = logging.getLogger(__name__) app.info = lambda *args, **kwargs: logger.info(*args, **kwargs) app.warn = lambda *args, **kwargs: logger.warning(*args, **kwargs) app.debug = lambda *args, **kwargs: logger.debug(*args, **kwargs)
def setup(app): from sphinx.ext.autodoc import cut_lines app.srcdir = basedir app.confdir = app.srcdir app.connect("autodoc-process-docstring", cut_lines(4, what=["module"])) app.add_object_type( "confval", "confval", objname="configuration value", indextemplate="pair: %s; configuration value", ) # workaround for RTD from sphinx.util import logging logger = logging.getLogger(__name__) app.info = lambda *args, **kwargs: logger.info(*args, **kwargs) app.warn = lambda *args, **kwargs: logger.warning(*args, **kwargs) app.debug = lambda *args, **kwargs: logger.debug(*args, **kwargs)
def setup(app): from sphinx.ext.autodoc import cut_lines from sphinx.util.docfields import GroupedField app.connect("autodoc-process-docstring", cut_lines(4, what=["module"])) app.add_object_type( "confval", "confval", objname="configuration value", indextemplate="pair: %s; configuration value", ) fdesc = GroupedField("parameter", label="Parameters", names=["param"], can_collapse=True) app.add_object_type("event", "event", "pair: %s; event", parse_event, doc_field_types=[fdesc])
def test_docstring_processing_functions(): lid = app.connect('autodoc-process-docstring', cut_lines(1, 1, ['function'])) def f(): """ first line second line third line """ assert list(gen.get_doc('function', 'f', f)) == ['second line', ''] app.disconnect(lid) lid = app.connect('autodoc-process-docstring', between('---', ['function'])) def f(): """ first line --- second line --- third line """ assert list(gen.get_doc('function', 'f', f)) == ['second line', ''] app.disconnect(lid)
def setup(app): from sphinx.ext.autodoc import cut_lines app.connect("autodoc-process-docstring", cut_lines(4, 2, what=["module"]))
def setup(app): from sphinx.ext.autodoc import cut_lines app.connect("autodoc-skip-member", autodoc_skip_member) app.connect('autodoc-process-docstring', cut_lines(2, what=['module'])) app.add_stylesheet("custom.css")
def setup(app): #remove first line of module docstrings - it's module title from sphinx.ext.autodoc import cut_lines app.connect('autodoc-process-docstring', cut_lines(1, what=['module']))
def setup(app): app.add_css_file('theme_overrides.css') # remove first line description docstrings in documentation app.connect('autodoc-process-docstring', cut_lines(1))
def setup(app): from sphinx.ext.autodoc import cut_lines app.connect("autodoc-skip-member", autodoc_skip_member) app.connect("autodoc-process-docstring", cut_lines(2, what=["module"]))
def setup(app): 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"]))
def setup(app): from sphinx.ext.autodoc import cut_lines app.connect("doctree-resolved", list_toctree) app.connect('autodoc-process-docstring', cut_lines(2, what=['module']))
def setup(app): app.connect('autodoc-process-docstring', cut_lines(2, what=['module']))
def setup(app): from sphinx.ext.autodoc import cut_lines # This cuts off the standard disclaimer from all module doc strings. app.connect('autodoc-process-docstring', cut_lines(0, post=4, what=['module']))
def setup(app): from sphinx.ext.autodoc import cut_lines app.connect('autodoc-process-docstring', cut_lines(2, what=['module']))
def setup(app): from sphinx.ext.autodoc import cut_lines app.connect("autodoc-process-docstring", cut_lines(2, what=["module"])) app.add_directive("udevversion", UDevVersion)
def setup(app): from sphinx.ext.autodoc import cut_lines # skip the copyright lines in every module docstring (last two lines of docstring) app.connect('autodoc-process-docstring', cut_lines(pre=0, post=2, what=['module']))
def setup(app): app.connect('autodoc-process-docstring', cut_lines(2, what=['module'])) app.connect('autodoc-skip-member', skip_abc)
def setup(app): app.connect("autodoc-process-docstring", cut_lines(2, what=["module"]))
def setup(app): from sphinx.ext.autodoc import cut_lines app.connect('autodoc-process-docstring', cut_lines(3, 3, what=['module'])) app.add_description_unit('confval', 'confval', 'pair: %s; configuration value')
def setup(app): app.connect('missing-reference', missing_reference) app.connect('autodoc-process-docstring', cut_lines(2, what=['module']))
def setup(app): from sphinx.ext.autodoc import cut_lines app.connect(b'autodoc-process-docstring', cut_lines(2, what=['module'])) app.add_directive('udevversion', UDevVersion)
def setup(app): from sphinx.ext.autodoc import cut_lines app.connect('autodoc-process-docstring', cut_lines(1, what=['function']))
def setup(app): from sphinx.ext.autodoc import cut_lines app.connect('autodoc-process-docstring', cut_lines(17, what=['module']))
def setup(app): from sphinx.ext.autodoc import cut_lines # skip the copyright lines in every module docstring app.connect("autodoc-process-docstring", cut_lines(pre=17, what=["module"]))
def setup(app): app.connect('autodoc-process-docstring', cut_lines(30, 30, what=['module']))