Bold italic in ReStructuredText

In sphinx this is possible through custom roles: You make a style in css, and make a role pointing to that style. Here's an full working example of underlined text: sphinx-dev thread.

Edit:

Here's a good example: ReST strikethrough

Edit 2:

That sphinx-dev link is not available any more, so here's the gist, it very similar to the strikethrough link above:

CSS:

span.underlined {
  text-decoration: underline;
}

Register role in RST:

.. role:: underlined
   :class: underlined

to use it later as

:underlined:`test`

All this can be in a single RST document:

.. raw:: html

   <style type="text/css">
     span.underlined {
       text-decoration: underline;
     }
   </style>

.. role:: underlined
   :class: underlined

:underlined:`test`

Test it with::

rst2html5.py test01.rst test01.html

Although Markdown supports nesting bold and italic, reStructuredText does not (this is one of the rare cases where Markdown is more powerful, as there is no way to represent bold italics in reStructuredText).

https://gist.github.com/1855764


Recipe for HTML output.

my.rst:

.. role:: red
  :class: red

.. role:: bolditalic
  :class: bolditalic

:red:`WARNING` :bolditalic:`Don't be stupid!`

my.css:

.red { color: red; }
.bolditalic {
  font-weight: bold;
  font-style: italic;
}

Build by:

rst2html --strip-comments --halt warning --stylesheet=my.css my.rst my.html