[Doc-SIG] Re: [Docutils-develop] master plan for interpreted text?

David Goodger goodger@python.org
Tue, 04 Feb 2003 00:26:24 -0500


Benja Fallenstein wrote:
> I'm thinking that following HTML's model may make sense: in addition to
> *emphasis* and **strong**, have `italics`:i: and `bold`:b:. So if there
> is no semantic class matching what you need, you just use one of these two.

I'm reluctant to enable explicit italic & bold roles.  Even in HTML, their
use is discouraged (although not deprecated... yet).

> Another option would be being able to declare your own interpreted text
> roles and assigning them a class: Then, the writers would handle all of
> these in the same way, and the decision on how to render them would be a
> stylesheet issue. E.g., ::
> 
>     .. role:: foreign f
> 
>     This is the `de facto`:f: standard.
> 
> And in a CSS stylesheet::
> 
>     .foreign { font-style: italic }

That might be OK for HTML, but wouldn't apply to other formats.  And how
would it be represented in the intermediate data structure (the doctree)?
As ``<phrase class="foreign">``?  That's the equivalent of ``<interpreted
role="foreign">``, which was dropped in favour of concrete elements (e.g.,
``<foreign>``).

It might be feasible to declare a new role which is a modification of an
existing role with a "class" attribute.  Something like::

    .. role:: foreign f
       :base: emphasis
       :class: foreign

This would result in ``<emphasis class="foreign">`` when used.  It would
need a good use case though.  And it would still be problematic for non-HTML
output.

-- David Goodger    http://starship.python.net/~goodger

Programmer/sysadmin for hire: http://starship.python.net/~goodger/cv