closing paragraphs </p> (Was Re: [Pmwiki-users] Another idea bef..)

Patrick R. Michaud pmichaud
Fri Jan 16 10:43:47 CST 2004


On Fri, Jan 16, 2004 at 12:10:19PM -0500, Reimer Behrends wrote:
> On Wed, Jan 14, 2004 at 02:45:23PM -0700, Patrick R. Michaud wrote:
> > This is why I'm somewhat in favor of using
> > <br /><br /> instead of <p /> to mean "vertical space between elements".
> 
> If I set paragraph margins to, e.g.:
>   p { margin: 0.667em 0 }
> then using <br> to generate vertical white space will look all wrong.

Excellent point.

> For another example, consider the case where I am trying to typeset
> paragraphs in the traditional way. I.e, there are no margins around
> paragraphs, but instead the first line is indented by 1em, i.e.
> something like:
>   p { margin: 0 }
>   p:first-letter { padding-left: 1em } 
> I'd also add additional CSS to remove the indent of the first paragraph
> after a heading or as part of a list element. 

Another excellent example.  However, to me it seems the way to solve 
this particular problem in wiki is to introduce a paragraph markup 
meaning "what follows should be a typeset paragraph using <p> (or <div>
or whatever)".  For example, using "[p]" as the wiki markup for "paragraph"
in the example below...

    This is wiki markup.

    [p] This is a paragraph
    * item 1 
    [p] And another paragraph
    * item 2


resulting in the HTML

    This is wiki markup.<br />
    <br />
    <p> This is a paragraph</p>
    <ul>
      <li>item 1
        <p> And another paragraph</p>
      </li>
      <li>item 2</li>
    </ul>

And you have largely what was desired, including the ability for
paragraphs to be first-letter indented, to have a different interline
spacing, etc.  And a wiki administrator who wants blank lines in markup
to mean "new paragraph" in the HTML output instead of "<br /><br />" 
ought to be able to do so via some sort of simple pattern replacement
that replaces multiple newlines with "\n[p]" (i.e., I could change 
PmWiki's processing model to make this customization possible).

Something like "[p]" can also easily be made into a stackable element 
in PmWiki's model, so that paragraphs are appropriately closed within
lists and other HTML elements.

This is also probably a bad time to bring this up, but we can always
re-examine the proposal made back in August that lines with leading
spaces mean "paragraph or more text at the current indent level".
(Yes, this would break the interpretation that leading spaces produce
preformatted text, and we'd have to have an alternate markup for that
as well as a conversion utility for existing pages.)

> Unfortunately, as you may have noticed, I am naming only the
> problem and do not have a workable solution, either, except
> for using CSS at a much larger scale.

Yes, I did notice this.  But if HTML and CSS were easy to write
and translate then we wouldn't need wikis.  :-) :-)

Thanks for your excellent points and suggestions.

Pm



More information about the pmwiki-users mailing list