Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: David Goodger <goodger <at> python.org>
Subject: Re: Overcoming limitations of reST tables
Newsgroups: gmane.text.docutils.devel
Date: Thursday 25th August 2005 21:59:37 UTC (over 12 years ago)
> David Goodger wrote:
>> Perhaps we need a "container-class" directive: like "class", but
>> applies to the container/parent.  This would also be useful for list
>> items.

[Mark Nodine]
> This proposal might be useful in some contexts, but it wouldn't
> allow, for example, to apply a class to a  since it's
> a level above the  container.

It would if defined flexibly enough:

    .. container-class:: classname
       :levels: 2

The existing class directive could simply be extended instead:

    .. class:: classname
       :parent: 2

The parent option's default could be 1 if used without an argument,
meaning "immediate parent".  2 means parent's parent, etc.  Of course,
not including the parent option at all would leave the behavior as it
is now.

Alternatively or additionally, the parent option could take the name
of the element as argument:

    .. class:: classname
       :parent: row

Admittedly, this would be an ¸ber-power-user feature.

>> Why bother?  Why not go whole-hog instead, and make a directive
>> that parses an established table standard, like the OASIS XML
>> Exchange Table Model (a.k.a. CALS tables)?
...
> Yes.  Something like this would be a reasonable compromise and would
> be eminently generatable.  Observations:
>
> 1. It's not quite "whole hog" since the contents of  would
>    still need to be parsed in your example to produce the
>    bullet_list.

Call it half-hog then ;-)

Would it be useful to support XML parsing at the whole-hog level?  If
that's the case, the directive ceases to be "xml-table", and becomes
"xml-include".  This would be much more general and potentially useful
in other cases.

> 2. It could be a bit more compact by using the pseudo-XML format
>    with indenting::

True, but that would require writing a pseudo-XML parser.  Not a
trivial task.  XML tools abound, and since the use case here is
computer-generated data, it seems preferable.  In any case, I don't
think the minor gain in convenience is worth the trouble.

(BTW, could you avoid hard-tabs in future?  Not all mail apps agree on
how to render & quote them.)

-- 
David Goodger <http://python.net/~goodger>
 
CD: 2ms