[Python-Dev] reST limitations? (was Re: status of development documentation) (original) (raw)

Fredrik Lundh fredrik at pythonware.com
Fri Dec 23 09:14:26 CET 2005


Martin Blais wrote:

> So, definitions of functions, classes, and other structured stuff would > just use fields under a directive, and references to those definitions > would just be reST links.

So you end up with a document with a bunch of custom directives, like:: .. python-class:: MyClass :arg: comfobulator :arg optional: bliptor My Class description. This does not look significantly better to me than the LaTeX code, and the docutils directives are not as flexible as the commands provided by tex/latex.

Except that tex/latex don't give you the same structure. Using the real- life example from the documentation list again:

Informationwise, this is mostly identical to the latex example, except that you can use existing tools to get an XML structure from this markup.

The LaTeX solution is one line shorter, but the JavaDoc/PythonDoc solution squeezes a lot more structural information into those 11 lines.

Also note that the JavaDoc/PythonDoc version is the only one that reflects the designer's intent: all arguments but the first are keyword options, not optional positional arguments (I don't know how to express that efficiently in today's LaTeX markup).

It's also the only one here where existing tools can be used to get a clean information model

dumps Convert a Python tuple or a Fault instance to an XML-RPC request. Convert a Python tuple or a Fault instance to an XML-RPC request. dumps(params, **options) A tuple or Fault instance. If given, create a methodCall request for this method name. If given, create a methodResponse request. If used with a tuple, the tuple must be a singleton (that is, it must contain exactly one element). The request encoding. Defaults to UTF-8. A string containing marshalled data.

for further processing (using XSLT to turn this into nice HTML is trivial, for example). It's impossible to extract this level of information from the given LaTeX and ReST examples.



More information about the Python-Dev mailing list