3
3
=============================
4
4
:Author: David Goodger
5
5
:Contact: goodger@python.org
6
:Revision: $Revision: 4228 $
7
:Date: $Date: 2005-12-23 00:46:04 +0100 (Fri, 23 Dec 2005) $
6
:Revision: $Revision: 5015 $
7
:Date: $Date: 2007-03-12 21:25:40 +0100 (Mon, 12 Mär 2007) $
8
8
:Copyright: This document has been placed in the public domain.
126
126
This is a generic, titled admonition. The title may be anything the
129
The author-supplied title is also used as a "class" attribute value
129
The author-supplied title is also used as a "classes" attribute value
130
130
after being converted into a valid identifier form (down-cased;
131
131
non-alphanumeric characters converted to single hyphens; "admonition-"
132
132
prefixed). For example, this admonition::
317
317
+---------------------------+
319
319
``figclass`` : text
320
Set a "class" attribute value on the figure element. See the
320
Set a "classes" attribute value on the figure element. See the
321
321
class_ directive below.
323
323
``align`` : "left", "center", or "right"
656
656
The "container" directive surrounds its contents (arbitrary body
657
657
elements) with a generic block-level "container" element. Combined
658
with the optional "class_" attribute argument(s), this is an extension
659
mechanism for users & applications. For example::
658
with the optional "classes_" attribute argument(s), this is an
659
extension mechanism for users & applications. For example::
661
661
.. container:: custom
775
775
The following options are recognized:
778
Set a "class" attribute value on the table element. See the
778
Set a "classes" attribute value on the table element. See the
779
779
class_ directive below.
781
781
``widths`` : integer [, integer...]
1372
1372
The following options are recognized:
1374
``start-after`` : text to find in the external data file
1375
Only the content after the first occurrence of the specified text
1378
``end-before`` : text to find in the external data file
1379
Only the content before the first occurrence of the specified text
1380
(but after any ``after`` text) will be included.
1374
1382
``literal`` : flag (empty)
1375
1383
The entire included text is inserted into the document as a single
1376
1384
literal block (useful for program listings).
1466
1476
:Directive Content: Optional. If present, it is interpreted as body
1469
The "class" directive sets the "class" attribute value on its content
1479
The "class" directive sets the "classes" attribute value on its content
1470
1480
or on the first immediately following non-comment element [#]_. For
1471
details of the "class" attribute, see `its entry`__ in `The Docutils
1481
details of the "classes" attribute, see `its entry`__ in `The Docutils
1472
1482
Document Tree`_. The directive argument consists of one or more
1473
1483
space-separated class names, which are converted to lowercase and all
1474
1484
non-alphanumeric characters are converted to hyphens. (For the
1475
1485
rationale, see below.)
1477
__ ../doctree.html#class
1487
__ ../doctree.html#classes
1498
1508
The text above is parsed and transformed into this doctree fragment::
1500
<paragraph class="special">
1510
<paragraph classes="special">
1501
1511
This is a "special" paragraph.
1502
<section class="exceptional remarkable">
1512
<section classes="exceptional remarkable">
1504
1514
An Exceptional Section
1506
1516
This is an ordinary paragraph.
1507
<paragraph class="multiple">
1517
<paragraph classes="multiple">
1508
1518
First paragraph.
1509
<paragraph class="multiple">
1519
<paragraph classes="multiple">
1510
1520
Second paragraph.
1512
.. [#] To set a "class" attribute value on a block quote, the "class"
1513
directive must be followed by an empty comment::
1522
.. [#] To set a "classes" attribute value on a block quote, the
1523
"class" directive must be followed by an empty comment::
1515
1525
.. class:: highlights
1518
1528
Block quote text.
1520
The directive doesn't allow content, therefore an empty comment is
1521
required to terminate the directive. Without the empty comment,
1522
the block quote text would be interpreted as the "class"
1523
directive's content, and the parser would complain.
1530
An empty comment is required to terminate the directive to allow
1531
the indented text to be parsed as a block quote. Without the empty
1532
comment, the indented text would be interpreted as the "class"
1533
directive's content, and the classes would be applied to each
1534
element (paragraphi, in this case) individually, instead of to the
1535
block quote as a whole.
1525
.. topic:: Rationale for Class Attribute Value Conversion
1537
.. topic:: Rationale for "classes" Attribute Value Conversion
1527
1539
Docutils identifiers are converted to conform to the regular
1528
1540
expression ``[a-z](-?[a-z0-9]+)*``. For CSS compatibility,
1529
identifiers (the "class" and "id" attributes) should have no
1541
identifiers (the "classes" and "id" attributes) should have no
1530
1542
underscores, colons, or periods. Hyphens may be used.
1532
1544
- The `HTML 4.01 spec`_ defines identifiers based on SGML tokens:
1550
1562
The CSS1 "nmchar" rule does not include underscores ("_"), colons
1551
(":"), or periods ("."), therefore "class" and "id" attributes
1563
(":"), or periods ("."), therefore "classes" and "id" attributes
1552
1564
should not contain these characters. They should be replaced with
1553
1565
hyphens ("-"). Combined with HTML's requirements (the first
1554
1566
character must be a letter; no "unicode", "latin1", or "escape"
1601
1613
The parsed result is as follows::
1604
<emphasis class="custom">
1616
<emphasis classes="custom">
1607
1619
If no base role is explicitly specified, a generic custom role is
1608
1620
automatically used. Subsequent interpreted text will produce an
1609
"inline" element with a "class" attribute, as in the first example
1621
"inline" element with a "classes" attribute, as in the first example
1612
With most roles, the ":class:" option can be used to set a "class"
1624
With most roles, the ":class:" option can be used to set a "classes"
1613
1625
attribute that is different from the role name. For example::
1615
1627
.. role:: custom
1631
1643
``class`` : text
1632
Set a "class" attribute value on the element produced (``inline``,
1633
or element associated with a base class) when the custom
1634
interpreted text role is used. If no directive options are
1644
Set the "classes" attribute value on the element produced
1645
(``inline``, or element associated with a base class) when the
1646
custom interpreted text role is used. If no directive options are
1635
1647
specified, a "class" option with the directive argument (role
1636
1648
name) as the value is implied. See the class_ directive above.