greedy backreferences
See original GitHub issueI’m puzzled by two points related to backreferences, which have been introduced by version 0.5 of sphinx-gallery:
- it seems that intersphinx links are generated not only for functions or class constructors, but also for instances of objects of modules selected for backreferences. For example in https://sphinx-gallery.github.io/stable/auto_examples/plot_3_capture_repr.html#sphx-glr-auto-examples-plot-3-capture-repr-py integer variables have links to the Python doc, or in https://sphinx-gallery.github.io/stable/auto_examples/plot_0_sin.html#sphx-glr-auto-examples-plot-0-sin-py numpy arrays also have links. Is this done on purpose? With this behaviour example pages become very busy with links (see for example https://scikit-image.org/docs/dev/auto_examples/color_exposure/plot_rgb_to_hsv.html#sphx-glr-auto-examples-color-exposure-plot-rgb-to-hsv-py)
- modules listed in the
intersphinx_mapping
variable ofconf.py
seem to generate backreferences even if they are not listed in SG’sreference_url
dict. This was not the case with version 0.4.
I tried to track down when the change appeared, maybe it’s https://github.com/sphinx-gallery/sphinx-gallery/commit/3acd37b716bc5684da0f4f4d7054e2ca0f3d66d8#diff-33215ef937b7c3d86fe0a23425c585e4 but I’m not sure. Happy to dig more if needed but I’d like to know first whether this is a desired behaviour or not.
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (12 by maintainers)
Top Results From Across the Web
greedy backreference in python's reguar expression?
You can use 4 capture groups, where group infix is only for capturing a single char to be repeated. (?P<prefix>.{0,3}?)(?P<repeat>(?
Read more >Regular Expression Backreferences and the Non-Greedy ...
The backreference (the "\1" at the end of the regex) behaves exactly the same as when in a replacement string: it represents the...
Read more >Possessive Quantifiers - Regex Tutorial
A greedy quantifier first tries to repeat the token as many times as possible, and gradually gives up matches as the engine backtracks...
Read more >Greedy and Lazy Quantifiers - W3docs
In this chapter, we will see how the search works with greedy and lazy quantifiers. Imagine you have a text and need to...
Read more >Python regex backreferences
The backreferences allow you to reference capturing groups within a regular expression. The following shows the syntax of a backreference: \N.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If the style / busy appearance / aesthetics is the only real problem, we could think about giving the references CSS class names based on their module names like sg-backref-python and sg-backref-sklearn (plus each gets a global sg-backref) based on which package they’re from. Then you can blacklist/whitelist HTML styles of the links as you wish.
I can take a stab at implementing the CSS classes in the next couple of days