Commits

Anonymous committed 6ee5f67

Provide rest "class" directive as "cssclass".

  • Participants
  • Parent commits e5cba7b

Comments (0)

Files changed (3)

 
 * Fix behavior of references to functions/methods with an explicit title.
 
-* Support citation nodes in LaTeX writer.M v7
+* Support citation nodes in LaTeX writer.
+
+* Provide the standard "class" directive as "cssclass"; else it is
+  shadowed by the Sphinx-defined directive.
 
 
 Release 0.3 (May 6, 2008)

File doc/markup/desc.rst

    Describes a class.  The signature can include parentheses with parameters
    which will be shown as the constructor arguments.
 
+   Methods and attributes belonging to the class should be placed in this
+   directive's body.  If they are placed outside, the supplied name should
+   contain the class name so that cross-references still work.  Example::
+
+      .. class:: Foo
+         .. method:: quux()
+
+      -- or --
+
+      .. class:: Bar
+
+      .. method:: Bar.quux()
+
+   .. versionadded:: 0.4
+      The standard reST directive ``class`` is now provided by Sphinx under
+      the name ``cssclass``.
+
 .. directive:: .. attribute:: name
 
    Describes an object data attribute.  The description should include

File sphinx/directives/other.py

 tabularcolumns_directive.content = 0
 tabularcolumns_directive.arguments = (1, 0, 1)
 directives.register_directive('tabularcolumns', tabularcolumns_directive)
+
+
+# register the standard rst class directive under a different name
+
+try:
+    # docutils 0.4
+    from docutils.parsers.rst.directives.misc import class_directive
+    directives.register_directive('cssclass', class_directive)
+except ImportError:
+    try:
+        # docutils 0.5
+        from docutils.parsers.rst.directives.misc import Class
+        directives.register_directive('cssclass', Class)
+    except ImportError:
+        # whatever :)
+        pass