[Doc-SIG] Field lists for directive attributes?

David Goodger goodger@users.sourceforge.net
Tue, 26 Feb 2002 22:57:22 -0500


reStructuredText's image and figure directives currently use a
specialized "[name=value]" attribute specification syntax::

    .. image:: picture.png
       [height=100 width=200 scale=50 alt="alternate text"]

There's a mini-parser called "dps.utils.parseattributes". It does a
decent job, but it can't handle complex stuff like::

       [alt="Joe \"Bulldog\" O'Roarke"]

I'm thinking of replacing the "[name=value]" syntax with field lists
for attributes::

    .. image:: picture.png
       :height: 100
       :width: 200
       :scale: 50
       :alt: alternate text

Advantages: standard syntax (less to remember), easier implementation,
more straightforward, more robust, more flexible, emphasizes role of
field lists as "extension/specialized syntax" (as currently used in
bibliographic field lists and the "meta" directive).

Disadvantage: more verbose.

It seems useful to standardize on a single syntax, which may be used
in other directives in the future. Throwing away the current system
and reusing field lists appeals to me on minimalistic principles.

Any objections or alternate ideas?

-- 
David Goodger    goodger@users.sourceforge.net    Open-source projects:
 - Python Docstring Processing System: http://docstring.sourceforge.net
 - reStructuredText: http://structuredtext.sourceforge.net
 - The Go Tools Project: http://gotools.sourceforge.net