From c37b66f1afc4d1801f832602b589025d32df0b39 Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Sun, 25 Apr 2021 11:12:32 +0100 Subject: [PATCH] simplify --- docs/requirements.txt | 2 +- docs/source/conf.py | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index 6fda04707ea..778c2880bb8 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,5 +1,5 @@ sphinx==2.4.4 -sphinx-gallery +sphinx-gallery>=0.9.0 matplotlib numpy -e git+git://github.com/pytorch/pytorch_sphinx_theme.git#egg=pytorch_sphinx_theme diff --git a/docs/source/conf.py b/docs/source/conf.py index b0079a00668..639c877fc9f 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -281,15 +281,6 @@ def inject_minigalleries(app, what, name, obj, options, lines): https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html """ - conf_file_path = Path(__file__).parent.absolute() - backrefs_path = conf_file_path / sphinx_gallery_conf['backreferences_dir'] / (name + '.examples') - if not (os.path.isfile(backrefs_path) and os.path.getsize(backrefs_path) > 0): - # We avoid showing the (empty) minigallery if there's nothing to show, i.e. if the object - # isn't used in any example. - # FIXME: this check can be removed once https://github.com/sphinx-gallery/sphinx-gallery/pull/813 - # is merged and the new sphinx-gallery version (> 0.8.x) is released. - return - if what in ("class", "function"): lines.append(f".. minigallery:: {name}") lines.append(f" :add-heading: Examples using ``{name.split('.')[-1]}``:")