diff --git a/docs/sphinx_pyodide/sphinx_pyodide/jsdoc.py b/docs/sphinx_pyodide/sphinx_pyodide/jsdoc.py index 643f1170b..de064e35a 100644 --- a/docs/sphinx_pyodide/sphinx_pyodide/jsdoc.py +++ b/docs/sphinx_pyodide/sphinx_pyodide/jsdoc.py @@ -130,8 +130,7 @@ def get_jsdoc_summary_directive(app): result = [] for group in ["global", "attribute", "function"]: result.append(self.format_heading(group.title() + "s:")) - group_objects = app._sphinxjs_analyzer.js_docs[group] - table_items = self.get_summary_table(group_objects) + table_items = self.get_summary_table(group) table_markup = self.format_table(table_items) result.extend(table_markup) return result @@ -182,7 +181,8 @@ def get_jsdoc_summary_directive(app): argument of format_table. """ pkgname = "globalThis." if group == "global" else "pyodide." - return [self.get_summary_row(pkgname, obj) for obj in group] + group_objects = app._sphinxjs_analyzer.js_docs[group] + return [self.get_summary_row(pkgname, obj) for obj in group_objects] # This following method is copied almost verbatim from autosummary # (where it is called get_table). diff --git a/docs/sphinx_pyodide/tests/test_directives.py b/docs/sphinx_pyodide/tests/test_directives.py index 998ee7574..2aae58e6d 100644 --- a/docs/sphinx_pyodide/tests/test_directives.py +++ b/docs/sphinx_pyodide/tests/test_directives.py @@ -117,9 +117,9 @@ def test_extract_summary(): def test_summary(): - globals = jsdoc_summary.get_summary_table(pyodide_analyzer.js_docs["global"]) - attributes = jsdoc_summary.get_summary_table(pyodide_analyzer.js_docs["attribute"]) - functions = jsdoc_summary.get_summary_table(pyodide_analyzer.js_docs["function"]) + globals = jsdoc_summary.get_summary_table("global") + attributes = jsdoc_summary.get_summary_table("attribute") + functions = jsdoc_summary.get_summary_table("function") set(globals) == { ( "languagePluginLoader",