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

Create a clickable link for images with image and figure directives #1695

Open
brian-rose opened this issue Dec 9, 2024 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@brian-rose
Copy link

Proposal

Images, particularly logo and thumbnail images, are often clickable links on web pages. Currently this is possible in myst using plain markdown, e.g. [![]()](). But then we don't have access to the configuration options offered by the {image} directive.

So my proposal is basically to add this functionality, perhaps with a new :url: argument to the image directive.

Additional notes

The specific use case I'm thinking of here is for logos, which naturally want to link back to landing pages for whatever the logo is representing. The native logo images are often large, high-res image files and we want to scale them down for display, e.g. using the :width: option.

The need to scale down an image is one of the main reasons I reach for the {image} directive over the native Markdown image.

@brian-rose brian-rose added the enhancement New feature or request label Dec 9, 2024
@choldgraf choldgraf changed the title Images as links Create a clickable link for images with the image directive Dec 9, 2024
@choldgraf choldgraf changed the title Create a clickable link for images with the image directive Create a clickable link for images with image and figure directives Dec 9, 2024
@choldgraf
Copy link
Collaborator

choldgraf commented Dec 9, 2024

Agreed this would be useful - as a reference, the way that Jupyter Book currently handles this is with a :target: parameter:

```{image} foo.png
:target: https://google.com OR `myst-ref`
```

Ref to myst-parser image docs, which inherit this from Sphinx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants