1 ====================================
2 Docutils_ for python documentation
3 ====================================
5 :Contact: grubert@users.sourceforge.net
8 :Copyright: This document has been placed in the public domain.
10 This tried, at a time when texinfo was used, to explore the posibilities to use
11 docutils as format for python library documentation as specified in
12 `Documenting Python`_ .
14 This version is based on a script from Greg Ward, hacked by Thomas Heller.
18 * `Edward Loper's sandbox
19 <http://docutils.sf.net/sandbox/edloper/docpy/>`__. The example
20 "asyncore.rst" file was originally adapted by Steve Holden and Bill
23 * `Dave Kuhlman's sandbox
24 <http://docutils.sf.net/sandbox/dkuhlman/>`__ and `his homepage
25 <http://www.rexx.com/~dkuhlman/rstpythonlatex_intro.html>`__.
31 Maybe make title "ctypes --- A foreign function library for Python"
37 :Summary: A foreign function library for Python.
38 :Module Type: standard
39 :Author: Thomas Heller <theller@python.net>
40 :Synopsis: A foreign function library for Python.
44 Module and Summary are mandatory.
51 - For python documentation are typeset using ``\tableiii`` or
54 a. Only tables with two to five columns are supported.
55 b. longtables should only be used for longer tables.
56 c. Neither multicolumn nor multirow seam to be possible.
57 d. All contents are left aligned.
58 e. Which options for colfont are there: textrm, exception .
60 - An unpatched latex2html might be unable to handle ``longtable`` options.
61 Maybe remove the ``[c]`` and put the longtable into a center environment.
63 * Document ``markup.py`` and ``missing.py``.
65 * Inline markup: email, note, pep, rfc, strong, ulink, url, warning
66 might be already possible others require manual markup ?
69 * see also environment.
71 * standard definition lists for or something else ?::
78 * if a definition has no classifier and starts with ``class`` use classdesc ?
80 * funcdesc arguments with default values should be marked as optional.
87 This is done by *informational units* (see `Documenting Python`_).
90 sizeof(type_or_object)
92 Returns the size in bytes of a ctypes type or instance memory
93 buffer. Does the same as the C sizeof() function.
97 \begin{funcdesc}{sizeof}{type_or_object}
98 Returns the size in bytes of a ctypes type or instance memory
99 buffer. Does the same as the C sizeof() function.
102 this is done with definition lists with classifiers.
103 Plain definition lists are only supported by transaltion to
104 ``datadescni``, this might result in too much white space. ::
106 sizeof(type_or_object) : funcdesc
107 Returns the size in bytes of a ctypes type or instance memory
108 buffer. Does the same as the C sizeof() function.
110 Note: the classifier must be preceeded by ``" : "`` (blank colon blank) and no
111 blank line before the descriptional text.
113 And the definition, e.g. ``sizeof(...)`` is processed as text only,
114 any markup like bold or literal is lost.
116 Environments (sorted by parameters)::
118 \begin{datadesc} {name}
119 \begin{datadescni} {name}
120 \begin{excdesc} {name}
121 \begin{classdesc*} {name}
122 \begin{csimplemacrodesc} {name}
124 \begin{ctypedesc} [tag]{name}
125 \begin{memberdesc} [type name]{name}
126 \begin{memberdescni} [type name]{name}
128 \begin{cvardesc} {type}{name}
129 \begin{funcdesc} {name}{parameters}
130 \begin{funcdescni} {name}{parameters}
131 \begin{classdesc} {name}{constructor parameters}
132 \begin{excclassdesc} {name}{constructor parameters}
134 \begin{methoddesc} [type name]{name}{parameters}
135 \begin{methoddescni} [type name]{name}{parameters}
137 \begin{cmemberdesc} {container}{type}{name}
138 \begin{cfuncdesc} {type}{name}{args}
140 The ``ni``-variants do not create index entries.
142 ``classdesc*`` describes a class without describing the constructor.
144 More beautiful would be to add some translation from rst-classifier
145 to docpy markup. The desc can be skipped, "ni" should be written as
146 "noindex" and the ``*`` variant should be detected as it has no
149 SerialAvail : function noindex
152 This requires some thought interrest and feedback.
159 - 2006-06-07: rename mkpydoc.py to rst2docpy.py and
160 remove informational units via topics.
161 - 2006-06-03: add cmemberdesc.
162 - 2006-06-02: support more informational units (cmemberdesc missing)
163 - 2006-05-25: notice environment.
166 - parameters in ``[]`` are marked optional.
167 - definition lists with classifiers for information units.
168 - 2006-05-13: Take moduleinfo from docinfo fields.
169 - 2006-05-08: Change to generate pydoc tableii.
172 - Patch for python 2.3.
173 - Filenames from command line.
174 - Guard definition of ``locallinewidth`` against redefinition.
175 - latex needs definition of ``locallinewidth``.
177 - 2006-04-xx: from theller, ctypes repository.
179 .. _Docutils: http://docutils.sourceforge.net/
180 .. _Documenting Python: <http://docs.python.org/dev/doc/doc.html>