summaryrefslogtreecommitdiff
path: root/Doc/documenting
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-10-06 10:11:56 +0000
committerGeorg Brandl <georg@python.org>2010-10-06 10:11:56 +0000
commitc3afd3975eebf1ed52c8c32752e1002b644e2489 (patch)
treee1a6933c7fd4f472af4e9460b0a8f1be8f9284d3 /Doc/documenting
parente593f9d6630dca449f3567d68bc1fa39e4724e76 (diff)
downloadcpython-c3afd3975eebf1ed52c8c32752e1002b644e2489.tar.gz
Migrate to Sphinx 1.0 C language constructs.
Diffstat (limited to 'Doc/documenting')
-rw-r--r--Doc/documenting/markup.rst30
1 files changed, 17 insertions, 13 deletions
diff --git a/Doc/documenting/markup.rst b/Doc/documenting/markup.rst
index b4421cb23b..33653a80b1 100644
--- a/Doc/documenting/markup.rst
+++ b/Doc/documenting/markup.rst
@@ -107,11 +107,11 @@ index entries more informative.
The directives are:
-.. describe:: cfunction
+.. describe:: c:function
Describes a C function. The signature should be given as in C, e.g.::
- .. cfunction:: PyObject* PyType_GenericAlloc(PyTypeObject *type, Py_ssize_t nitems)
+ .. c:function:: PyObject* PyType_GenericAlloc(PyTypeObject *type, Py_ssize_t nitems)
This is also used to describe function-like preprocessor macros. The names
of the arguments should be given so they may be used in the description.
@@ -119,29 +119,29 @@ The directives are:
Note that you don't have to backslash-escape asterisks in the signature,
as it is not parsed by the reST inliner.
-.. describe:: cmember
+.. describe:: c:member
Describes a C struct member. Example signature::
- .. cmember:: PyObject* PyTypeObject.tp_bases
+ .. c:member:: PyObject* PyTypeObject.tp_bases
The text of the description should include the range of values allowed, how
the value should be interpreted, and whether the value can be changed.
References to structure members in text should use the ``member`` role.
-.. describe:: cmacro
+.. describe:: c:macro
Describes a "simple" C macro. Simple macros are macros which are used
for code expansion, but which do not take arguments so cannot be described as
functions. This is not to be used for simple constant definitions. Examples
- of its use in the Python documentation include :cmacro:`PyObject_HEAD` and
- :cmacro:`Py_BEGIN_ALLOW_THREADS`.
+ of its use in the Python documentation include :c:macro:`PyObject_HEAD` and
+ :c:macro:`Py_BEGIN_ALLOW_THREADS`.
-.. describe:: ctype
+.. describe:: c:type
Describes a C type. The signature should just be the type name.
-.. describe:: cvar
+.. describe:: c:var
Describes a global C variable. The signature should include the type, such
as::
@@ -403,22 +403,26 @@ the currently documented class.
The following roles create cross-references to C-language constructs if they
are defined in the API documentation:
-.. describe:: cdata
+.. describe:: c:data
The name of a C-language variable.
-.. describe:: cfunc
+.. describe:: c:func
The name of a C-language function. Should include trailing parentheses.
-.. describe:: cmacro
+.. describe:: c:macro
The name of a "simple" C macro, as defined above.
-.. describe:: ctype
+.. describe:: c:type
The name of a C-language type.
+.. describe:: c:member
+
+ The name of a C type member, as defined above.
+
The following role does possibly create a cross-reference, but does not refer
to objects: