diff options
author | Georg Brandl <georg@python.org> | 2010-10-06 10:11:56 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2010-10-06 10:11:56 (GMT) |
commit | 60203b41b03d03361754d264543d5fbe6259eb25 (patch) | |
tree | 005d0d6be6437244ae360ebc0d65fa7b149a8093 /Doc/documenting | |
parent | 64a41edb039afee683d69bd6f72e3709ff11bd93 (diff) | |
download | cpython-60203b41b03d03361754d264543d5fbe6259eb25.zip cpython-60203b41b03d03361754d264543d5fbe6259eb25.tar.gz cpython-60203b41b03d03361754d264543d5fbe6259eb25.tar.bz2 |
Migrate to Sphinx 1.0 C language constructs.
Diffstat (limited to 'Doc/documenting')
-rw-r--r-- | Doc/documenting/markup.rst | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/Doc/documenting/markup.rst b/Doc/documenting/markup.rst index b4421cb..33653a8 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: |