This construct:
Here you have |optparse.OptionParser|_.
.. |optparse.OptionParser| replace:: ``optparse.OptionParser`` documentation
.. _optparse.OptionParser: http://docs.python.org/library/optparse.html
produces this HTML (some linebreaks added):
Here you have
optparse.OptionParser documentation.
I realize that this is not exactly what you asked for, but maybe it's close enough. See also http://docutils.sourceforge.net/FAQ.html#is-nested-inline-markup-possible.