From e6f2079827b1fdaa19b50f549ac40784436b88ba Mon Sep 17 00:00:00 2001 From: De Cock Xavier Date: Tue, 24 Jul 2007 12:13:12 +0000 Subject: [PATCH] make test_xml && make html were successfull, commiting bbcode documentation to CVS * Hope i didn't make too many mistakes :/ * git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@240262 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/bbcode/configure.xml | 31 +++ reference/bbcode/constants.xml | 106 ++++++++++ .../bbcode/functions/bbcode-add-element.xml | 83 ++++++++ reference/bbcode/functions/bbcode-create.xml | 182 ++++++++++++++++++ reference/bbcode/functions/bbcode-destroy.xml | 63 ++++++ reference/bbcode/functions/bbcode-parse.xml | 73 +++++++ reference/bbcode/reference.xml | 61 ++++++ 7 files changed, 599 insertions(+) create mode 100644 reference/bbcode/configure.xml create mode 100644 reference/bbcode/constants.xml create mode 100644 reference/bbcode/functions/bbcode-add-element.xml create mode 100644 reference/bbcode/functions/bbcode-create.xml create mode 100644 reference/bbcode/functions/bbcode-destroy.xml create mode 100644 reference/bbcode/functions/bbcode-parse.xml create mode 100644 reference/bbcode/reference.xml diff --git a/reference/bbcode/configure.xml b/reference/bbcode/configure.xml new file mode 100644 index 0000000000..46e2d69c98 --- /dev/null +++ b/reference/bbcode/configure.xml @@ -0,0 +1,31 @@ + + +
+ &reftitle.install; + + &pecl.info; + &url.pecl.package;bbcode + +
+ + + diff --git a/reference/bbcode/constants.xml b/reference/bbcode/constants.xml new file mode 100644 index 0000000000..b14e55694f --- /dev/null +++ b/reference/bbcode/constants.xml @@ -0,0 +1,106 @@ + + +
+ &reftitle.constants; + &extension.constants; + + + + BBCODE_TYPE_NOARG + (integer) + + + + This BBCode tag does not accept arguments. + + + + + + BBCODE_TYPE_SINGLE + (integer) + + + + This BBCode tag does not have corresponding close tag. + + + + + + BBCODE_TYPE_ARG + (integer) + + + + This BBCode tag need an argument. + + + + + + BBCODE_TYPE_OPTARG + (integer) + + + + This BBCode tag accepts an optional argument. + + + + + + BBCODE_TYPE_ROOT + (integer) + + + + This BBCode tag is the special tag root (nesting level 0). + + + + + + BBCODE_FLAGS_ARG_PARSING + (integer) + + + + This BBCode tag require argument subparsing (the argument is reparsed by the BBCode extension). + + + + + + BBCODE_FLAGS_CDATA_NOT_ALLOWED + (integer) + + + + This BBCode Tag does not accept content (it voids it automaticaly). + + + + +
+ + diff --git a/reference/bbcode/functions/bbcode-add-element.xml b/reference/bbcode/functions/bbcode-add-element.xml new file mode 100644 index 0000000000..efa696ad2e --- /dev/null +++ b/reference/bbcode/functions/bbcode-add-element.xml @@ -0,0 +1,83 @@ + + + + + bbcode_add_element + Close fileinfo resource + + + &reftitle.description; + + boolbbcode_add_element + resourcebbcode_container + stringtag_name + arraytag_rules + + + + This function adds a tag to an existing BBCode_Container tag_set see + bbcode_create for the format needed for tag_rules + + + + + &reftitle.parameters; + + + + bbcode_container + + + BBCode_Container resource returned by bbcode_create. + + + + + tag_name + + + The new tag to add to the BBCode_Container tag set. + + + + + tag_rules + + + An associative array containing the parsing rules see + bbcode_create for the keys availables + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + + diff --git a/reference/bbcode/functions/bbcode-create.xml b/reference/bbcode/functions/bbcode-create.xml new file mode 100644 index 0000000000..11cea5b48e --- /dev/null +++ b/reference/bbcode/functions/bbcode-create.xml @@ -0,0 +1,182 @@ + + + + + bbcode_create + Create a BBCode Ressource + + + &reftitle.description; + + arraybbcode_initial_tags + + + + This function starts a new BBCode Ressource used to pars BBCode strings + + + + + &reftitle.parameters; + + + + bbcode_initial_tags + + + It's an associative array containing tag name as keys and parameters + needed to correctly parse BBCode as value in an associative array of + the form: + + + + flags optional - a flag + set based on the BBCODE_FLAGS_* constants. + + + + + type needed - an int + indicating the type of tag use the BBCODE_TYPE_* constants + + + + + open_tag needed - the HTML + replacement for the open tag. + + + + + close_tag needed - the HTML + replacement for the close tag. + + + + + default_arg optional - + it gives the default argument if tag_type is of type OPTARG + + + + + content_handling optional - + Gives the name of the function used as callback for modification + of the content - currently only supports functions not methods. + callback layout is: function name($content,$argument){return + $content;} + + + + + param_handling optional - + Gives the name of the function used as callback for modification + of the argument - currently only supports functions not methods. + callback layout is: function name($content,$argument){return + $parameter;} + + + + + childs optional - List of + accepted childs for the tag. The format of the list is a comma + separated string. If the list starts with ! it will be the list of + rejected childs for the tag. + + + + + parent optional - List of + accepted childs for the tag. The format of the list is a comma + separated string. + + + + + + + + + + + &reftitle.returnvalues; + + Returns a BBCode_Container + + + + &reftitle.examples; + + + <function>bbcode_create</function> example + + array('type'=>BBCODE_TYPE_ROOT, 'childs'=>'!i'), + 'i'=> array('type'=>BBCODE_TYPE_NOARG, 'open_tag'=>'', + 'close_tag'=>'', 'childs'=>'b'), + 'url'=> array('type'=>BBCODE_TYPE_OPTARG, + 'open_tag'=>'', 'close_tag'=>'', + 'default_arg'=>'{CONTENT}' + 'childs'=>'bi'), + 'img'=> array('type'=>BBCODE_TYPE_NOARG, + 'open_tag'=>'', + 'childs'=>''), + 'b'=> array('type'=>BBCODE_TYPE_NOARG, 'open_tag'=>'', + 'close_tag'=>''), +); +$text=<< +]]> + + &example.outputs; + +Bold Text +Italic Text +http://www.php.net/ +Content Text + + +[img]http://static.php.net/www.php.net/images/php.gif[/img] + +]]> + + + + + + + + diff --git a/reference/bbcode/functions/bbcode-destroy.xml b/reference/bbcode/functions/bbcode-destroy.xml new file mode 100644 index 0000000000..aa98f5f12c --- /dev/null +++ b/reference/bbcode/functions/bbcode-destroy.xml @@ -0,0 +1,63 @@ + + + + + bbcode_destroy + Close BBCode_container resource + + + &reftitle.description; + + boolfinfo_close + resourcebbcode_container + + + + This function closes the resource opened by bbcode_create. + + + + + &reftitle.parameters; + + + + bbcode + + + BBCode_Container resource returned by bbcode_create. + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + + diff --git a/reference/bbcode/functions/bbcode-parse.xml b/reference/bbcode/functions/bbcode-parse.xml new file mode 100644 index 0000000000..eead5af357 --- /dev/null +++ b/reference/bbcode/functions/bbcode-parse.xml @@ -0,0 +1,73 @@ + + + + + bbcode_parse + Parse a string following a given rule set + + + &reftitle.description; + + stringbbcode_parse + resourcebbcode_container + stringto_parse + + + + This function parse the string to_parse following the rules in the + bbcode_container created by bbcode_create + + + + + &reftitle.parameters; + + + + bbcode_container + + + BBCode_Container resource returned by bbcode_create. + + + + + to_parse + + + The string we need to parse. + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + + diff --git a/reference/bbcode/reference.xml b/reference/bbcode/reference.xml new file mode 100644 index 0000000000..c952ec26b4 --- /dev/null +++ b/reference/bbcode/reference.xml @@ -0,0 +1,61 @@ + + + + + BBCode Functions + BBCode + + +
+ &reftitle.intro; + + The functions of this extensions are aimed to help parse BBCode text in + order to convert it to HTML or another markup / markdown langage. It uses + a one pass parsing and provides great speed improvement over the common + approach based on regular expressions. Further more, it helps provide + valid HTML by reordering open / close tags and closing automaticaly + unclosed tags. + +
+ + + &reference.bbcode.configure; + +
+ &reftitle.runtime; + &no.config; +
+ +
+ &reftitle.resources; + + There is one resource used in BBCode extension: a BBCode_Container + returned by bbcode_create. + +
+ + &reference.bbcode.constants; +
+ &reference.bbcode.functions; +
+ +