def setup(app):
    """ Set up the plugin """
    app.add_config_value('sphinx_tabs_nowarn', False, '')
    app.add_config_value('sphinx_tabs_valid_builders', [], '')
    app.add_directive('tabs', TabsDirective)
    app.add_directive('tab', TabDirective)
    app.add_directive('group-tab', GroupTabDirective)
    app.add_directive('code-tab', CodeTabDirective)
    for path in ['sphinx_tabs/' + f for f in FILES]:
        if path.endswith('.css'):
            if 'add_css_file' in dir(app):
                app.add_css_file(path)
            else:
                app.add_stylesheet(path)
        if path.endswith('.js'):
            if 'add_script_file' in dir(app):
                app.add_script_file(path)
            else:
                app.add_javascript(path)
    app.connect('html-page-context', update_context)
    app.connect('build-finished', copy_assets)
def setup ( app ) : app . add_config_value ( 'sphinx_tabs_nowarn' , False , '' ) app . add_config_value ( 'sphinx_tabs_valid_builders' , [ ] , '' ) app . add_directive ( 'tabs' , TabsDirective ) app . add_directive ( 'tab' , TabDirective ) app . add_directive ( 'group-tab' , GroupTabDirective ) app . add_directive ( 'code-tab' , CodeTabDirective ) for path in [ 'sphinx_tabs/' + f for f in FILES ] : if path . endswith ( '.css' ) : if 'add_css_file' in dir ( app ) : app . add_css_file ( path ) else : app . add_stylesheet ( path ) if path . endswith ( '.js' ) : if 'add_script_file' in dir ( app ) : app . add_script_file ( path ) else : app . add_javascript ( path ) app . connect ( 'html-page-context' , update_context ) app . connect ( 'build-finished' , copy_assets )
Set up the plugin