From 8a83439acce4b0aaa02528256f38de0f8a7a7e6d Mon Sep 17 00:00:00 2001 From: Hagen Wierstorf Date: Wed, 10 Jan 2024 12:09:12 +0100 Subject: [PATCH] Fix setting of hidden_methods template variable (#6) --- sphinx_apipages/__init__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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)