[wp-docs] CSS Styles in the Codex

Charles K. Clarkson cclarkson at htcomp.net
Wed Dec 31 17:53:14 GMT 2008


Chris wrote:

 >  * Lack of styling for DD and DT elements. I solved this by manually
 >    applying style information to each element. The way that DD and DT
 >    elements are styled in the PHP documentation is very nice. Similar
 >    to my request with tables, I'd like to be able to use a class on
 >    the DL element to apply this type of styling to the DD and DT
 >    elements.

     I think you are referring to the Parameters section. There is a
wikitext Parameter Template [1] which is easy to use. Here's one from a
function I uploaded recently [2].

{{Parameter|$commentarr|array|Contains information on the comment.}}

     The template translates this template into the following markup. I
added whitespace for clarification.

<dl>
     <dt> <tt>$commentarr</tt></dt>
     <dd> (<i>array</i>) (<i>required</i>)
         Contains information on the comment.
         <dl>
             <dd> Default: <i>None</i></dd>
         </dl>
     </dd>
</dl>

     Note that all the xhtml is added by the template, not by the human
function reference editor. Using a template, inline styling is more
convenient because automation handles all the markup.

     The inline style only needs to be changed in one place (the template
definition). Changing that style from inline to a class or id based
style would not require changes to the function reference pages.

     Whether this markup is represented using dictionary lists, spans or
divs using inline styles or separate css shouldn't matter to the
function reference editor.

     I would like to see similar templates for the Return Values, Usage,
Source File and Related sections (or subsections).

[1] http://codex.wordpress.org/Template:Parameter
[2] http://codex.wordpress.org/Function_Reference/wp_update_comment


HTH,

Charles Clarkson
-- 
Mobile Home Investor
Free Market Advocate
Programmer

Stephenville, TX
http://www.clarksonenergyhomes.com/wordpress/about/
http://twitter.com/CharlesClarkson
+1 (254) 968-8328


More information about the wp-docs mailing list