Obey prefer_full_module setting when finding backreferences#1364
Obey prefer_full_module setting when finding backreferences#1364larsoner merged 2 commits intosphinx-gallery:masterfrom
Conversation
|
Would be great to have a test that would have caught this. @QuLogic WDYT about adding an Axes3D to one of the |
This fixes several cases of missing backreferences in Matplotlib's `mpl_toolkits` namespace, which need the full module name for referencing into Sphinx.
|
But for back references, it would have to be something in the documented module, so from |
|
I think any module listed in |
ee5bba4 to
cf5e6d1
Compare
|
I added a |
| # instance | ||
| dummy_class_inst = re.search( | ||
| r'sphinx_gallery.backreferences.html#sphinx[_,-]gallery[.,-]backreferences[.,-][D,d]ummy[C,c]lass" title="sphinx_gallery.backreferences.DummyClass" class="sphx-glr-backref-module-sphinx_gallery-backreferences sphx-glr-backref-type-py-class sphx-glr-backref-instance"><span class="n">dc</span>', # noqa: E501 | ||
| r'sphinx_gallery._dummy.html#sphinx[_-]gallery[.-]_dummy[.-][Dd]ummy[Cc]lass" title="sphinx_gallery._dummy.DummyClass" class="sphx-glr-backref-module-sphinx_gallery-_dummy sphx-glr-backref-type-py-class sphx-glr-backref-instance"><span class="n">dc</span>', # noqa: E501 |
There was a problem hiding this comment.
I also fixed the regex here, as #617 seems to be saying that _ or . may be - instead, but these seem to be also allowing , which seems unlikely.
These failed before the previous commit.
cf5e6d1 to
7743497
Compare
|
Yikes I thought that would be simpler, thanks for working through it @QuLogic ! |
|
Stupid question, could we have also tested this by adding |
… to version 0.17.1 v0.17.1 ------- **Fixed bugs:** - FIX: Fix stability of stored compiled regex `#1369 <https://github.com/sphinx-gallery/sphinx-gallery/pull/1369>`__ (`larsoner <https://github.com/larsoner>`__) - ENH: Improve \_sanitize_rst `#1366 <https://github.com/sphinx-gallery/sphinx-gallery/pull/1366>`__ (`timhoffm <https://github.com/timhoffm>`__) - Obey prefer_full_module setting when finding backreferences `#1364 <https://github.com/sphinx-gallery/sphinx-gallery/pull/1364>`__ (`QuLogic <https://github.com/QuLogic>`__) - Fix linking to class attributes with prefer_full_module `#1363 <https://github.com/sphinx-gallery/sphinx-gallery/pull/1363>`__ (`QuLogic <https://github.com/QuLogic>`__) - Improve minigallery directive path input resolution `#1360 <https://github.com/sphinx-gallery/sphinx-gallery/pull/1360>`__ (`lucyleeow <https://github.com/lucyleeow>`__) - FIX Allow str path minigallery entries when backreferences off `#1355 <https://github.com/sphinx-gallery/sphinx-gallery/pull/1355>`__ (`lucyleeow <https://github.com/lucyleeow>`__) - FIX generate zipfiles when index passed by user `#1353 <https://github.com/sphinx-gallery/sphinx-gallery/pull/1353>`__ (`lucyleeow <https://github.com/lucyleeow>`__) **Documentation** (NEWS truncated at 15 lines)
This fixes several cases of missing backreferences in Matplotlib's
mpl_toolkitsnamespace, which need the full module name for referencing into Sphinx.For example,

Axes3D.plotonly has one back reference:but with this change we have all these:
