Skip to content
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

Annoying links to original on scaled images #4229

Open
txomon opened this issue Nov 9, 2017 · 12 comments
Open

Annoying links to original on scaled images #4229

txomon opened this issue Nov 9, 2017 · 12 comments
Labels

Comments

@txomon
Copy link

@txomon txomon commented Nov 9, 2017

Subject: It's annoying to have all rescaled images linked to original one always

Problem

  • If you rescale anything, even an icon, sphinx will generate a link to it

Procedure to reproduce the problem

Scale an image.

Expected results

Can we just add an option to image to avoid the generation of the link?

Environment info

  • OS: Linux
  • Python version: 3.6
  • Sphinx version: latest
  • html builder

I can make a PR, but just want confirmation that it would be accepted. Although maybe it exists already...

@tk0miya

This comment has been minimized.

Copy link
Member

@tk0miya tk0miya commented Nov 11, 2017

How about html_scaled_image_link?

@txomon

This comment has been minimized.

Copy link
Author

@txomon txomon commented Nov 11, 2017

@tk0miya

This comment has been minimized.

Copy link
Member

@tk0miya tk0miya commented Nov 11, 2017

Ah, I understand. sorry, html_scaled_image_link is not good.
Indeed, such a hyperlink is not needed. Yes, any contribution is always welcome :-)
I think no option is needed. It's reasonable behavior to me.

@tk0miya tk0miya added proposal and removed question labels Nov 11, 2017
@txomon

This comment has been minimized.

Copy link
Author

@txomon txomon commented Nov 11, 2017

@tk0miya

This comment has been minimized.

Copy link
Member

@tk0miya tk0miya commented Nov 12, 2017

AFAIK the thumbnail images are used only if users uses :scale:, :width: or :height: options for images. So it is possible to know the conversion is needed or not. I think a hyperlink is not needed for not converted images even if these options are specified.

@txomon

This comment has been minimized.

Copy link
Author

@txomon txomon commented Nov 12, 2017

Yes, my question is, how do we deactivate the hyperlink generation when those images are specified?

.. image:: something.jpg
   :scale: 50
   :nolink:

my proposal was to add an option, and you seemed to say that no option is needed, so I am asking what solution would you propose.

Sorry if I wasn't clear enough =)

@tk0miya

This comment has been minimized.

Copy link
Member

@tk0miya tk0miya commented Nov 15, 2017

Ah, sorry. I'd misunderstood your request. Okay, you'd like to disable hyperlinks of specific images, right?
I'd like to hear you why do you want to disable specific ones?

I think we have to be careful to add a new option by Sphinx to keep syntax simple. So I'd like to know the reason.

@txomon

This comment has been minimized.

Copy link
Author

@txomon txomon commented Nov 15, 2017

I'd like to hear you why do you want to disable specific ones?

It's part of the problem description when I opened the issue. It doesn't make sense to have a link in an icon.

Another alternative I had thought of was to put some null link or something in the link in the existing :target: option, but couldn't figure it out. I am really open to suggestions

@RGSchuster

This comment has been minimized.

Copy link

@RGSchuster RGSchuster commented Nov 15, 2017

I may be too new to Sphinx, but could you add a feature, say html_icon_image_link that, when set to false, disables the post_process_images function for images below a certain size?

@txomon

This comment has been minimized.

Copy link
Author

@txomon txomon commented Nov 15, 2017

@tony

This comment has been minimized.

Copy link
Contributor

@tony tony commented Feb 21, 2018

I don't think html_scaled_image_link is sufficient because I want to preserve the link behavior by default. I want to opt-out of the link for scaled images.

So I like the :nolink: idea.

tony added a commit to git-pull/website that referenced this issue Feb 21, 2018
This removes href's which are automatically being
added to scaled logos on consulting pages.

See also: sphinx-doc/sphinx#4229
@mgeier

This comment has been minimized.

Copy link
Contributor

@mgeier mgeier commented Nov 2, 2018

👍 for the :nolink: option (or something similar)!

I've used the :width: and :height: option for reST content that is auto-generated by a Sphinx extension, where having a link to the full-sized image doesn't make sense (see spatialaudio/nbsphinx#226 and spatialaudio/nbsphinx#222).

However there may be user-generated reST pages in the same Sphinx project where the link indeed does make sense, so using html_scaled_image_link = False isn't really an option.

tony added a commit to git-pull/website that referenced this issue Sep 10, 2019
This removes href's which are automatically being
added to scaled logos on consulting pages.

See also: sphinx-doc/sphinx#4229
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.