0

the following reST don't work as expected. How can I do it right?

Only the word python_ in this text is linked. What to do if 
I want using other words such as `like it <python_>`_ to jump
to the same link?

.. _python: http://www.python.org

Thanks for any help!

mutetella

Mogsdad
  • 44,709
  • 21
  • 151
  • 275
mutetella
  • 192
  • 1
  • 8

1 Answers1

0

This isn't a really well documented as far as I have been able to read but the OP's method should work. I've tested the following input with rst2html.py (v 0.11) and Sphinx (v 1.2b1) on cygwin. Both generate the correct hyperlinks to the CNN site.

* According to `CNN <http://www.cnn.com/>`_ the economy...
* According to `The Amazing Cable News Network`_ the economy...
* According to the  `Cable News Network <CNN_>`_ the economy...

.. _The Amazing Cable News Network: CNN_
.. CNN: http://www.cnn.com/

The second form was suggested by @Ajay, although it seems odd to me to have to create another alias to get the text you want, but the third form seems to be what the OP was looking for and as far as I can tell it works fine. The third form also works for internal links within the document.

Paul Joireman
  • 2,689
  • 5
  • 25
  • 33