Summary: Debugging Markup Ruleset
Version: 25 January 2006
Prerequisites: Requires at least PmWiki version: 2.0beta28 (may work on earlier versions); last tested on PmWiki version: 2.0beta28
Status:
Goal
Markup issues are often difficult to resolve. This has many reasons:
- Information on the exact regular expression used to identify the markup is often nonexistent, or listed by example.
- Markups are substituted sequentially. If a markup emits text that looks like another markup, it will be recognized if the new markup is processed later in the sequence, and passed through unchanged if that markup was already done. Finding the right place to insert the markup can be tricky. (See CustomMarkup.)
Installation
Copy ruletable.phpΔ to your cookbook/ directory.
In local/config.php, add the following lines:
if (IsEnabled($EnableDiag,0) && $action == 'ruletable') {
include_once ('cookbook/ruletable.php');
}
Usage
Call up the URL http://path/to/wiki/pmwiki.php?action=ruletable.
By default, all columns will be shown. If you wish to see only a specific set of columns, add the string ?column,column,... (no blanks allowed here).
The list of available columns is taken directly from the internal data structures. The most useful ones are pat and rep (these specify the pattern to be searched for, and what it's to be replaced with). seq is used to establish the order in which rules are applied. The remaining fields are for internal use, i.e. mostly interesting to Pm when he's debugging the markup rule engine.
If you find the column display too wide, add ?columnwidth=<number>, where <number> is any valid HTML width specification such as 100px or 10em (again, no blanks allowed).
Customisation
The script generates CSS style tags that define the ways how various types of values (arrays, strings, nulls, etc.) are displayed.
The CSS styles used are:
.type_unset | Not set in PHP (i.e. PHP's NULL value). |
.type_null | SQL NULL value. |
.type_resource | An external resource (file handle etc.). |
.type_syntax | Delimiters (such as commas between array elements). |
.type_bool | True and False values. |
.type_scalar | A scalar (number or string). |
.type_controlcode | A control code within a string. |
.type_unkown | Some PHP type that ruletable.php doesn't know about. (This Should Not Happen.) |
Note that there is no provision for configuring the styles in config.php - it would definitely be preferrable over editing the PHP code that generates the styles which is the current method, but I didn't have the nerve to implement it.
Notes and comments
See Also
Contributors
Change History
| 2006-01-25 | Fixed PHP5 incompatibility. |
| 2005-04-15 | Made column and width settings configurable via URL (in the query string). |
| | Available column names now taken from PmWiki variable, not from hardcoded list. |
| | Improvements for control code handling: catches all nonprinting codes, and makes them their own CSS class now. |
| 2005-04-03 | Initial revision. |
Comments
Questions and comments that you feel are best answered by the author should be mailed to jo@durchholz.org. I rarely notice changes on this page.