Skip to content

MAINT Update backreferences docs and add tests#1154

Merged
lucyleeow merged 10 commits intosphinx-gallery:masterfrom
lucyleeow:doc_backref
Aug 2, 2023
Merged

MAINT Update backreferences docs and add tests#1154
lucyleeow merged 10 commits intosphinx-gallery:masterfrom
lucyleeow:doc_backref

Conversation

@lucyleeow
Copy link
Copy Markdown
Contributor

@lucyleeow lucyleeow commented Jul 30, 2023

Fixes some nitpicks in backreferences docs.

Edit:

This PR now does the following:

  • Minor wording updates in backreferences/linking docs
  • Update docstring SphinxDocLinkResolver.resolve
  • Change prefer_full_module to set instead of list, like other similar configs (e.g., exclude_implicit_doc)
  • Use the full module (instead of short module) name when matching prefer_full_module - gives you finer control and brings it in line with what exclude_implicit_doc does.
  • Update and add a test to better test _get_short_module_name

'prefer_full_module':[
# a list of regex command of your module where the full module
# name should be used for sphinx_gallery instead of the shortend
'yourmodule.*+\d{4}',
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was not sure exactly what this regex was intended to do, regex101 gave:

image

Have amended to just mod.submod as simple example.

@lucyleeow lucyleeow marked this pull request as draft July 30, 2023 10:56
@lucyleeow lucyleeow changed the title DOC Fix typos/clarify backrefences docs MAINT Update backreferences docs and add tests Jul 31, 2023
Copy link
Copy Markdown
Contributor

@larsoner larsoner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to merge when green

@lucyleeow
Copy link
Copy Markdown
Contributor Author

lucyleeow commented Aug 1, 2023

Thanks @larsoner, I had forgotten to push (so changes I mentioned were not up yet). If you're interested, would be good to get your eye over test_get_short_module_name - it was difficult to work out how best to test this.

For posterity, the context here is that while I looked into our backreferences code during investigation of: napari/docs#214 and thought we could better test it.

@lucyleeow lucyleeow marked this pull request as ready for review August 1, 2023 09:42
@larsoner
Copy link
Copy Markdown
Contributor

larsoner commented Aug 1, 2023

The backreferences code is always a bit of a nightmare. I usually rely on the tests being good enough to catch any breakages. We do check that some matplotlib things resolve in examples so hopefully it's good enough :(

Copy link
Copy Markdown
Contributor

@larsoner larsoner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to mark for merge-when-green if you're happy @lucyleeow !

@lucyleeow lucyleeow merged commit c81ad78 into sphinx-gallery:master Aug 2, 2023
@lucyleeow lucyleeow deleted the doc_backref branch August 2, 2023 01:22
clrpackages referenced this pull request in clearlinux-pkgs/pypi-sphinx_gallery Aug 22, 2023
… to version 0.14.0

v0.14.0
-------

**Implemented enhancements:**

-  MAINT Update backreferences docs and add tests `#1154 <https://github.com/sphinx-gallery/sphinx-gallery/pull/1154>`__ (`lucyleeow <https://github.com/lucyleeow>`__)
-  Remove extra spaces in reported running time `#1147 <https://github.com/sphinx-gallery/sphinx-gallery/pull/1147>`__ (`stefanv <https://github.com/stefanv>`__)

**Fixed bugs:**

-  MAINT: Fix for Sphinx 7.2 `#1176 <https://github.com/sphinx-gallery/sphinx-gallery/pull/1176>`__ (`larsoner <https://github.com/larsoner>`__)
-  updated mpl gui warning catcher to new error message `#1160 <https://github.com/sphinx-gallery/sphinx-gallery/pull/1160>`__ (`story645 <https://github.com/story645>`__)
-  Ensure consistent encoding for md5sum generation `#1159 <https://github.com/sphinx-gallery/sphinx-gallery/pull/1159>`__ (`sdhiscocks <https://github.com/sdhiscocks>`__)
-  Maint: Fix ``app.builder.outdir`` as Sphinx now using pathlib `#1155 <https://github.com/sphinx-gallery/sphinx-gallery/pull/1155>`__ (`lucyleeow <https://github.com/lucyleeow>`__)
-  Make \_LoggingTee compatible with TextIO `#1151 <https://github.com/sphinx-gallery/sphinx-gallery/pull/1151>`__ (`o-laurent <https://github.com/o-laurent>`__)

(NEWS truncated at 15 lines)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants