linked image in reStructuredText

TBieniek picture TBieniek · Dec 30, 2012 · Viewed 10.7k times · Source

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.

Answer

noelbk picture noelbk · Jan 17, 2013

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/