Re: Using attributes in the "class" directive

David Goodger <[email protected]>
Newsgroups gmane.text.docutils.user
Message-ID <CABiJP=LRM33hYguWrJNUBZcbhagOkOknEPwhL0_PNsRf4sqGcw@mail.gmail.com>
On Thu, Dec 21, 2017 at 7:41 AM,
<[email protected]> wrote:
> According to the spec, the "class" attribute accepts class names and also
> attribute values as directive arguments [1].
>
> [1] http://docutils.sourceforge.net/docs/ref/rst/directives.html#class

You misunderstand the spec. The class names *become* the "classes"
attribute of its contents or the immediately-following element.

> The examples for the "class" attribute only include class names but not
> attribute values.

This reST::

    .. class:: special

    This is a "special" paragraph.

becomes this doctree fragment (XML)::

    <paragraph classes="special">This is a "special" paragraph.</paragraph>

> Is it really possible to assign attributes to a class name
> by using the "class" directive?

No, that doesn't make sense.

David Goodger
<http://python.net/~goodger>

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.