[pmwiki-users] Some experiments with whitespace indentation

Patrick R. Michaud pmichaud at pobox.com
Sun Oct 16 20:40:15 CDT 2005


On Mon, Oct 17, 2005 at 01:58:41PM +1300, John Rankin wrote:
> On Saturday, 15 October 2005 4:20 PM, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> At the moment,
> # list item 1
>   sub text 1
>   sub text 2
> produces
>
> 1 list item 1 sub text 1 sub text 2
>
> 1. What's the rationale for inserting p class='vspace', but not
>    wrapping the subsequent text in <p> tags?

It's not clear that the subsequent text should be treated any
differently than the text of the list item itself -- since
the list item isn't wrapped in <p>...</p>, I'm not sure that
any continuation text should be.  

>    I wonder if:
> 
> # an item
>   its continuation
> 
>   more continuation
> 
> might perhaps produce something like:
> 
> <ol><li>an item<p>its continuation
> </p><p class='vspace'></p><p>more continuation
> </p></li></ol>

This can be easily done; it might become a configuration setting.

> 2. How will this work for continuation of definition lists?

I'm still working that out -- *so far* the continuation text aligns
with the first character of the defined term

    ::term: definition
      continued text

I thought about aligning with the definition, but that seemed like too
much indent.

> 3. What's the rationale for choosing spaces at the start 
>    of a line over continuation markup at the end of the 
>    previous line?

A1: It's what authors tend to naturally.  In fact, look at how 
you indented the text under the "1." and "3." in the questions 
you sent in the email... :-)

A2: The markup ends up looking like the resulting output.

> 4. you may wish to consider adjusting p.vspace within lists:
> # an item
> 
>   its continuation
> 
> # another item
> 
> making the space between an item and its continuation less 
> than the space between its continuation and another item 
> would enhance readability.

My basic thought is that most people expect vertical spaces
between paragraphs to remain the same, regardless of whether
they're embedded in lists.  But perhaps it can be handled with
CSS:

   li p.vspace { margin-top:1em; }
   p.vspace + li { margin-top:1.33em; }

Or if that doesn't work we can see about adding some more tags
(<div>, <span> or something) to the continuation text to give it 
some more styling options.

> 5. Just an observation -- matching the exact number of spaces
>    seems a bit fragile; for example this is incorrect:
> 
> #an item
> 
>   its continuation paragraph
> 
> # another item
> 
>   its continuation
> 
>    I wonder if it would be easier to get right if you put the 
>    same number of spaces as the list markup character, rather 
>    than the list markup character plus any spaces?

I did think of this, but like my answers to #3 above, it "looks
right" when the continuation text aligns with the item text
above it.  I think that an author looking at your incorrect
example would naturally expect it to not be a continuation,
as it aligns with neither the markup nor the item text.  Perhaps
we need to be more concerned with things like:

# an item
 its continuation
# another item
  its continuation

where an author might be surprised that "its continuation" isn't
treated as one here.  Perhaps we allow both the length of the
list markup and the length of markup with spaces to be used as
the indent levels for a continuation.  Or maybe anything in
between the two?  This might make definition list continuations
easier to deal with...  

::term:definition
  this is a continuation
       so is this

         This is preformatted text

Pm




More information about the pmwiki-users mailing list