[pmwiki-users] Proposed Default Stylesheet (pmwiki.css)

Joachim Durchholz jo at durchholz.org
Sun Feb 19 11:57:52 CST 2006


Patrick R. Michaud schrieb:
> On Sat, Feb 18, 2006 at 01:28:03AM +0100, Joachim Durchholz wrote:
> 
>>>Ultimately  I don't think PmWiki should automatically eat blank 
>>>lines after headings.  Better is to use CSS to style those blank
>>>lines as we want:
>>>
>>>    h1 + p.vspace { margin-top: ...  }
>>>
>>>(Unfortunately, IE 6 doesn't support the CSS "+" selector yet.)
>>
>>I'd try to avoid that if at all possible. Using "+" means you have to 
>>revisit a lot of corner cases, such as "<h2> after <h1>", "<h3> after 
>><h1>", ..., "<h6> after <h1>", "<hr> after <h1>"; repeat for <h2>, <h3> 
>>etc. etc. etc. - horror!
> 
> Why?  Seems to me that h1 + p.vspace, h2 + p.vspace, h3 + p.vspace, etc.
> would be sufficient to cover things.

What if somebody writes

!!Heading

!!!Subheading

You'd want to determine the spacing there, too.

Not to mention all the other block items - tables, <pre>, etc. etc. etc.

Of course, if you mean to place a vspace <p> between all block elements, 
the number of spacings needed would reduce from NxN to N, but then 
you're basically back at what CSS does...

>>Here's an alternative:
>>Make lines that start with ! eat the following blank line if it exists. 
>>That way, if a page author truly wants more empty space after a heading, 
>>he can insert two empty lines.
>>(Maybe too subtle... but empty lines after headings are subtle no matter 
>>what.)
> 
> For some reason I'm also uneasy about summarily eating any blank line
> that follows a heading -- that feels at least as wrong to me as using '+'
> in the CSS.

The alternative would be to drop the vspace <p>, and use CSS styling 
exclusively.
Why was <p class="vspace"> introduced in PmWiki?

> Ignoring PmWiki for a moment, how would one adjust the heading
> margins with CSS assuming "normal" HTML semantics -- i.e., 
> "How HTML Is Supposed To Be Done"?  
> 
>     <h1>Heading</h1>
>     <p>Here's my first paragraph</p>
>     <p>Here's my second paragraph</p>

I happened to come across that question in Hagan's post first, and 
answered it there.
Basically, I'd use vertical margins. AFAIK they are well-supported, 
vertical margin collapsing prevents some blunders (though they also tend 
to surprise authors), and it could all be styled using CSS.

>>On a tangent, I noticed that PmWiki has an interesting deviant behavior 
>>if a ! line is followed with [@: it will run the preformatted text into 
>>the header. I.e.
>>
>>!!Header
>>[@
>>lorem ipsum
>>@]
>>
>>will give
>>
>><h2>header <pre>lorem ipsum</pre></h2>
>>
>>which isn't quite what I expected. (Quoting from memory, so I may have 
>>gotten some details wrong.)
> 
> 
> I'm unable to produce this behavior on pmwiki.org --
> see http://www.pmwiki.org/wiki/Test/HeadingAndPre .

I can't reproduce it either on pmwiki.org.
It reproduces reliably on my wiki. Try this: go to 
http://durchholz.org/jo/debian-install/Main/DownloadDebian?action=edit 
and find this sequence:
--- snip ---
!!Get and run @@debootstrap@@
Do
[@
cd /tmp
w3m ${local_mirror}/pool/main/d/debootstrap/
@]
--- snip ---
Remove the line that contains the word "Do", giving this sequence:
--- snip ---
!!Get and run @@debootstrap@@
[@
cd /tmp
w3m ${local_mirror}/pool/main/d/debootstrap/
@]
--- snip ---
and hit the Preview button.

Very strange.

I'm using the latest stable version.
The non-comment lines in config.php are
--- snip ---
<?php if (!defined('PmWiki')) exit();
$WikiTitle = 'Debian Configuration';
$ScriptUrl = 'http://durchholz.org/jo/debian-install';
$PubDirUrl = 'http://durchholz.org/jo/debian-install/pub';
$EnablePathInfo = 1;
$PageLogoUrl = 
"http://gnuart.onshore.com/images/debian/logos/open/openHorColor-90.jpg";
$Skin = 'local';
$PageSkinList = array(
   'default' => 'local',
   'pmwiki' => 'pmwiki',
   'haganfox' => 'haganfox'
);
include_once('cookbook/skinchange.php');
$DefaultPasswords['admin'] = crypt('***');
$DefaultPasswords['edit'] = crypt('quick');
$EnableGUIButtons = 1;
$LinkWikiWords = 0;
$EnableDiag = 1;
$EnableIMSCaching = 1;
$SpaceWikiWords = 1;
$EnableBypassAuth = 0;
$JournalDatePattern = '/^$/';
$DiaryPattern = '/^$/';
include_once ('cookbook/commentboxstyled.php');
--- snip ---

Regards,
Jo




More information about the pmwiki-users mailing list