How to use the autodocsumm.__init__.AutoSummDirective function in autodocsumm

To help you get started, we’ve selected a few autodocsumm examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Chilipp / autodocsumm / autodocsumm / __init__.py View on Github external
else:
        registry = get_documenters(app)
    for cls in [AutoSummClassDocumenter, AutoSummModuleDocumenter,
                CallableAttributeDocumenter, NoDataDataDocumenter,
                NoDataAttributeDocumenter]:
        if not issubclass(registry.get(cls.objtype), cls):
            if sphinx_version >= [2, 2]:
                app.add_autodocumenter(cls, override=True)
            elif sphinx_version >= [0, 6]:
                app.add_autodocumenter(cls)
            else:
                app.add_documenter(cls)

    # directives
    if sphinx_version >= [1, 8]:
        app.add_directive('automodule', AutoSummDirective, override=True)
        app.add_directive('autoclass', AutoSummDirective, override=True)
    else:
        app.add_directive('automodule', AutoSummDirective)
        app.add_directive('autoclass', AutoSummDirective)

    # group event
    app.add_event('autodocsumm-grouper')

    # config value
    app.add_config_value('autodata_content', 'class', True)
    app.add_config_value('document_data', True, True)
    app.add_config_value('not_document_data', [], True)
    return {'version': sphinx.__display_version__, 'parallel_read_safe': True}