[pmwiki-users] Improvements for ?action=ruleset

Joachim Durchholz jo at durchholz.org
Tue Mar 15 11:35:22 CST 2005


Hi,

In anticipation of markup design I'm going to do this week, I took a 
look at the ?action=ruleset output and decided to improve on it.

The results were as follows:

1) Output is now an HTML table.
2) Column width and the columns to print are customizable in config.php.

Here are the new sections for the config.php file (they should go 
immediately after the $EnableDiag line):

--- snip ---
##  $RulesetColumns specifies which columns to show for action=ruleset.
##  (This action is good for markup designers: it shows what markups
##  are defined, and in which order they will be executed.)
##  The default is array('pat', 'rep').
##  Displayable columns are:
##    id   Rule name. (This column is always displayed
##         and must not be given in $RulesetColumns.)
##    pat  Patterns to be replaced.
##    rep  Replacement text.
##    seq  Determines the order in which rules are executed.
##    cmd  Configuration-specified execution order constraint. (?)
##    dep  Array or execution order constraints. (?)
# $RulesetColumns = array('pat', 'rep', 'seq');

##  $MaxRulesetColumnWidth gives the width of a column
##  for action=ruleset.
##  If this variable is set, every table cell will get a
##  horizontal scroll bar so that excessively wide data
##  can be viewed in its entirety.
##  If this variable is unset, ruleset data will display
##  in full width (which means an excessively wide table).
##  Specify the width in HTML units such as '20em' or '50px'.
# $MaxRulesetColumnWidth = '15em';
--- snip ---

The code for HandleRuleset is in the attachment (my mail program would 
have wrapped the lines and made a mess of the code layout, so posting it 
inline wouldn't have worked).

The Ruleset() function in diag.php isn't called anymore and can be 
removed. (Or the appropriate code from HandleRuleset could be factored 
out - though I'm unsure for what purpose that would help.)


Issues
------

1) The "pat" and "rep" columns are far too wide. I've been toying with 
ideas like printing only the first 20 or so characters and adding the 
full text as a tooltip window, but at least Mozilla 1.7 won't display 
"title" styles (at least not on <span>s, maybe a <div> would have worked 
- dunno, and I didn't want to fiddle with browser specifics). Maybe 
inserting a pseudo graphic with an alt= attribute would be the best 
solution, but I didn't have a good idea how the graphics should look 
like and didn't have the nerve to pursue the issue to its end, so I 
punted on the issue.

2) I'm not sure that the column names listed are really all that are 
available. Also, the commentary text on "cmd" and "dep" is pure 
guesswork and not very enlightening actually; somebody with a better 
knowledge of the markup machinery should improve the descriptions.

3) I hope that the default column selection meets the needs of a markup 
designer. If it doesn't, this should be updated.


Conclusions
-----------

Enjoy!
Jo
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: HandleRuleset.php
Url: /pipermail/pmwiki-users/attachments/20050315/a8cd6a61/attachment.asc 


More information about the pmwiki-users mailing list