diff --git a/sphinx_apipages/__init__.py b/sphinx_apipages/__init__.py index 40230f4..5f3e459 100644 --- a/sphinx_apipages/__init__.py +++ b/sphinx_apipages/__init__.py @@ -40,11 +40,6 @@ def setup(app: sphinx.application.Sphinx): # https://github.com/sphinx-doc/sphinx/issues/6316 app.config.toc_object_entries = False - # Make apipages_hidden_methods visible in templates - app.config.autosummary_context = { - "hidden_methods": app.config.apipages_hidden_methods, - } - # Connect events app.connect("config-inited", config_inited) @@ -71,6 +66,11 @@ def config_inited(app: sphinx.application.Sphinx, config): else: app.config.templates_path = templates_path + # Make apipages_hidden_methods visible in templates + app.config.autosummary_context = { + "hidden_methods": app.config.apipages_hidden_methods, + } + # Copy API (sub-)module RST files to dst folder if os.path.exists(src_dir): audeer.mkdir(dst_dir)