8000 ENH: Improve _sanitize_rst by timhoffm · Pull Request #1366 · sphinx-gallery/sphinx-gallery · GitHub
[go: up one dir, main page]

Skip to content

ENH: Improve _sanitize_rst #1366

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 3, 2024
Merged

Conversation

timhoffm
Copy link
Contributor
@timhoffm timhoffm commented Aug 2, 2024

When using the sphinx config default_role = 'obj', one can leave out the prefixes :meth: and similar and directly reference code objects using backticks. In there, one can use the sphinx prefix modifiers . and ~.

Examples from Matplotlib where these show up:

image image

This PR enhances _sanitize_rst to remove the prefix modifiers:

  • .MyClass --> MyClass
  • ~.MyClass.close --> close

When using the sphinx config `default_role = 'obj'`, one can leave out the
prefixes :meth: and similar and directly reference code objects using
backticks. In there, one can use the sphinx prefix modifiers `.` and `~`.

This PR enhances `_sanitize_rst` to remove the prefix modifiers:

- `.MyClass` --> MyClass
- `~.MyClass.close` --> close
@lucyleeow lucyleeow added the bug label Aug 3, 2024
@larsoner larsoner merged commit 36a9ee9 into sphinx-gallery:master Aug 3, 2024
18 of 19 checks passed
@larsoner
Copy link
Contributor
larsoner commented Aug 3, 2024

Thanks @timhoffm !

@timhoffm timhoffm deleted the clean-rst branch August 3, 2024 17:46
clrpackages referenced this pull request in clearlinux-pkgs/pypi-sphinx_gallery Aug 9, 2024
… to version 0.17.1

v0.17.1
-------

**Fixed bugs:**

-  FIX: Fix stability of 
721D
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0