linked image in reStructuredText

Restructuredtext

Restructuredtext Problem Overview


How can I create a linked image with reStructuredText?

I've found

.. image:: /path/to/image.jpg

for images, and external hyperlinks like

'Python <http://www.python.org/>'_

for links, but I don't know how to combine them or if that is at all possible.

Restructuredtext Solutions


Solution 1 - Restructuredtext

Two ways to do it:

  1. in inline images:

     .. image:: pageflip-200.png
        :target: pageapplet/index.html
    
  2. With a reference, like:

     Click on my |ImageLink|_
     
     .. |ImageLink| image:: /images/link.png
     .. _ImageLink: http://link.url/
    

Solution 2 - Restructuredtext

The following site has a reference for reStructuredText but also Markdown, MediaWiki, asciidoc & org-mode.

http://hyperpolyglot.org/lightweight-markup

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionTBieniekView Question on Stackoverflow
Solution 1 - RestructuredtextnoelbkView Answer on Stackoverflow
Solution 2 - RestructuredtextJavierView Answer on Stackoverflow