Go to the FreeLists Home Page Home Signup Help Login
 



[dokuwiki] || [Date Prev] [05-2008 Date Index] [Date Next] || [Thread Prev] [05-2008 Thread Index] [Thread Next]

[dokuwiki] Re: Leaner HTML Markup

  • From: fantasai <fantasai.lists@xxxxxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Wed, 07 May 2008 09:01:52 -0700
fantasai wrote:
One thing I've been considering for awhile is tweaking DokuWiki to
generate leaner markup: less unnecessary elements and classes, better
structural markup. The flip side is there would in some cases be less
elements to use as styling hooks, and in others cases selectors would
need to be changed to rely on nesting structure rather than explicit
elements. Before I make my dokuwiki upgrades difficult, I wanted to
know if there would be any interest in or opposition to accepting such
patches upstream...

Some examples, as requested:

<h1><a name="playground" id="playground">PlayGround</a></h1>
<div class="level1">
  <p>paragraph</p>
  <ul>
  <li class="level1"><div class="li">list item</div>
  </li>
  </ul>
</div>

I would ideally write as

<div class="section" id="playground">
  <h1>PlayGround</h1>
  <p>paragraph</p>
  <ul>
    <li>list item</li>
  </ul>
</div>

If you're using proper header structure, you can select the
appropriate level <div> with decedent selectors

  .section { level one styling }
  .section .section { level two styling }
  .section .section .section { level three styling }

Likewise for list items.

The two losses of functionality above are:
  - ID targetting doesn't work in older browsers (NS4 and below)
    An alternative would be to keep the anchor on the heading.
  - Can't style the list marker differently, would have to use
    list-style-image for the blue boxes. An alternative would be
    to add back an unclassed <div> and style it with li > div.

Additional functionality given by the better section structure
is that you can, e.g. put a box around the entire section, or
style it with :target

  :target { border: solid; } /* Put a border around the section
                                when it is our link target */

(If sections are indented, outdenting the section header can be
done with negative margins.)

~fantasai
--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist




[ Home | Signup | Help | Login | Archives | Lists ]

All trademarks and copyrights within the FreeLists archives are owned by their respective owners.
Everything else ©2007 Avenir Technologies, LLC.