[Pmwiki-users] rendering question about lists (somewhat important)

Patrick R. Michaud pmichaud
Tue Feb 3 12:09:17 CST 2004


On Tue, Feb 03, 2004 at 01:07:44PM -0500, Reimer Behrends wrote:
> A note up front: while this is fairly lengthy (mostly due to some
> technical points), I think this discussion is also at an "agree to
> disagree point", and when I express opinions below, I do not presume to
> be "right" at the expense of contrary opinions.

Same here, and your opinions have always been extremely valuable to me.  :-)
On to the discussion:

> That effectively is equivalent to:
> 
>   <div>This is some text</div>
>   <ul><li>bullet 1</li></ul>
>   <div>This is some more text</div>
> 
> where each div encloses an anonymous block level element. 
> [...]
> This has its own set of problems. To begin with, you cannot really set
> the style for those anonymous boxes because you cannot specify a
> selector for them. 

Actually, they *are* in a named block element, they're in the enclosing 
<div id='wikitext'> block from the overall page layout.  So you can
still specify a selector for them.  They just aren't separated from
each other, and from a wiki perspective even if they were placed
in separate blocks for most practical purposes they'd be in the same
selector anyway.

> As a practical example, using anonymous block boxes side by side with P
> elements breaks usage of the CSS text-indent property in an essentially
> unfixable way.

In 0.6 one can eliminate/change the <p></p> "blank line" sequence to
be whatever is desired via the $HTMLVSpace variable.  In particular, 
one could change $HTMLVSpace to be something like "</div><div class='p'>" 
and start to move towards making blank lines of markup into logical 
separators for top-level elements.

> > 2. Whether the behavior I'm describing is a "problem" or a 
> >    "desirable feature"
> 
> There is probably some disagreement here, yes. However, I think the
> main difference lies in me seeing blank lines as a logical separator
> for top-level elements, whereas you see them as a layout tool. That
> is indeed a fundamental difference of opinion, with neither position
> being obviously the better one.

Agreed entirely.

> > Authors typically *want* the output to look like what they entered.  
> 
> That tends to be a sore spot with me, mostly because I had to deal with
> too many Word documents where the authors were using blank lines to add
> inter-paragraph spacing. (Such a document is essentially unmaintainable,
> because the design decisions regarding spacing are not localized in a
> single place.)

Yes, and I've had to deal with the same problem many times.  However,
PmWiki's model still provides some real opportunities to systematically
and automatically "correct" such author mistakes.  For example...

> Yes, but it requires conscious effort to shoot yourself in the foot by
> replacing P elements with DIV elements and thereby stripping the HTML of
> useful semantic information (HTML is not only processed by visual user
> agents). Conversely, there is no obvious guideline that indicates
> whether to enclose lists in blank lines or not, which is likely to
> result in inconsistent results.

...except that if such consistency is needed it's pretty easy to
add a replacement rule to convert all sequences of "\n+\*" to "\n*",
effectively eliminating any extraneous blank lines authors may be 
putting in front of lists and forcing a consistent result.  

> However, I see the problem
> as div-based lists being treated differently from standard lists,
> and I would personally solve the consistency problem by adding the
> regular whitespace around top-level div-based lists and remove it
> from normal lists nested inside div-based lists, which should result
> in a layout that matches the style of the standard HTML CSS.

...and PmWiki generally makes it possible for you to do exactly
that.  :-)  The problem I was having was figuring out how to distinguish
top-level div-based lists from nested ones without substantially 
modifying the PmWiki rendering engine.  This isn't to imply that
ease of implementation should trump other concerns, it's just that
using CSS to change the margins on lists for now appears to be a 
workable solution that doesn't really "close the doors" to taking 
other content/layout approaches in the future.  

If there's already a way in CSS to distinguish top-level divs from 
nested ones, then it's already possible to get the behavior you're
describing without having to change any PmWiki code and we're
just effectively choosing different stylesheets to control the 
layout.  Which, of course, is exactly what stylesheets are for. :-)
I grant that authors in my stylesheet may change how they write
markup (and the resulting HTML) to achieve a certain layout
effect, but the change in markup doesn't produce substantial 
structural changes to the HTML that PmWiki is currently producing,
and over time we can always add improvements to the translation 
engine to let the site administrators get the exact look/rules they 
wish to enforce.

> > To me it's much nicer
> > and more natural if vertical space appears only where one was 
> > explicitly placed in the markup.
> 
> That is where we agree to disagree, I think. No offense meant by any of
> the above, just an explanation of a different position.

No offense taken, your position is quite valid and I truly appreciate
your taking the time to express it so clearly.  The whole reason I 
brought this question to the list was to be able to understand the 
potential impact of issues like the ones you've described.  I think
in the long run I will eventually be able to come up with something
that more closely matches the environment you're describing--but I
don't think I want to delay the 0.6 release for it.  Some changes
just take longer than others to evolve...

Pm



More information about the pmwiki-users mailing list