Table of contents ▼▲
Differencies between v2 and v3
The most obvious difference, which will affect existing sites is the layout of the datafiles. An update script will need to be written to allow v2 sites to work with v3.Section Editing
A page can now be split into sections, determined by the headers, which enables smaller subsets to edit.This is configured using the SectionEdit option.
Markup
- <-- - at the end of a line is a newline
- \\ - two slashes followed by a space anywhere in the text, is a newline
- [= =] - can now be split over multiple lines to prevent large blocks of text from being formatted.
- [@ @] - New multiline markup for monospace ( @@ @@ )
Linking
The limitation of group / subgroup / page has been removed, and with it, the Linking syntax has had to be adapted. Gone are thesg: and g: options. These are replaced with the more recognisable [[group/group/group/group/page]] layout, which follows most directory structures.
Links are relative to the current group. Below are a few examples.
Assume current page being viewed is books/fiction/fantasy/pratchett.xml
[[reaperman]] - link to books/fiction/fantasy/reaperman.xml
[[pratchett/reaperman]] - link to books/fiction/fantasy/pratchett/reaperman.xml
[[<horror/page1]] - link to books/fiction/horror/page1.xml
[[<<nonfiction/language/page1]] - link to books/nonfiction/language/page1.xml
[[:films/comedy/page1]] - link to films/comedy/page1.xml
[[http://www.<where-ever>.com]] - As before link to outside world..
The use of a : character at the start of the link indicates a top most grouping.
Syntax [ [ <link> <options> <alternate text> ] ]
- link - Can be image, internal link, or www, etc as before
-
options. Currently only
t:<target>, iet:_blankto open link in a new window. - anything following link or options will be used as the link text.
Table processing
- Single | chars used now. The double || method still works but creates an extra cell at beginning.
-
You are now not able to supply extra 'table header' info via a
|| <options>row. - also allows for row and column headers via the ^ char..
Single
^''cell 1''|@@cell2[[http://blah]]|
^row|cell|
| cell 1 | @@cell2blah |
|---|---|
| row | cell |
||cell 1||cell 2||
| cell 1 | cell 2 | |||
Rules Processing
Page formatting is now controlled via a Rules Engine. This controls what is converted to what and in what order it is run. preg_replace() is used internally.$Rules is a global variable/class holding all the rules. There are two steps to creating a rule
- Create a rule group
- Create a rule in a group
$Rules->AddGrp("inline"
;
$Rules->AddGrp("inline");
$Rules->Add("bold", "inline", "/'''(.*?)'''/", "<strong>\\1</strong>";
AddGrp()
AddGrp(groupname, order);
- groupname - Name of the group. Must be unique.
- order - optional parm to set order. ie "<name" would place the group before the group named 'name', ">name" would place it after.
Add()
Add(rulename, groupname, regexp, action, order);
- rulename - Name of the rule. Must be unique within the <groupname>.
- groupname - group the rule belongs too. Defined using ->AddGrp() method
- regexp - regular expression to be used as parm 1 in the preg_replace() function
- action - What to do. Used as parm 2 in the preg_replace() function
- order - optional parm to set order. ie "<name" would place the rule before the rule named 'name', "<name" would place it after.
Error Handling
cls_error.php has been renamed to cls_msghandler.php, and its usage extended.The content of a msg can now be returned to the calling code, which means it can also be displayed on the page. This in turn allows standard messages to be displayed in any language.
A
die="Y" attribute has been added to msgs to force the php code to die(). If no die attribute is found, then the msg text is returned.
-
Have done it for
wikidx_changes.phpscript. - If msg does not exist in the language specified, script will try the default language ('en'). If still no luck, then fails.
Others
- Links are stored in the XML file at save time. This will allow 'orphan' checking to be carried out. There is an extra overhead of processing the Rules inorder to get the Links but I think it will be worth it.
- edit conflict is detected.
- The number of template files (*.wtp) has been reduced to one!
-
Tools directory added. Contains 'standalone' stuff.
- 'crypt' no longer an action. Now part of Tools
- 'text -> XML safe' ascii util created. Use to create XML safe text. Extremely useful for generating language file text... IE To put special chars, like ÃõÃ, etc...