Home > Archive > PHP Documentation > July 2007 > Re: [PHP-DOC] CVS access
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Re: [PHP-DOC] CVS access
|
|
| Philip Olson 2007-07-20, 7:03 pm |
|
On Jul 19, 2007, at 4:09 PM, Xavier De Cock wrote:
> I'm maintainer of the pecl BBCode Extension and i'm trying to make
> some
> documentation for this module in order to help other users
>
> Make use of the entire capabilities of this extension without
> needing to
> read the source file (i needed to do this for way too many extensions)
> therefore if it is possible, i'll be glad to produce documentation.
> (i'm
> able to produce English and french documentation without any major
> problem).
>
> In advance, thanks for your help.
You now have the karma... document away! :) Please submit a few
initial patches to the list for review so that we may help if needed.
Regards,
Philip
| |
| xavier 2007-07-22, 7:02 pm |
|
Here is the patch I hope i didn't make too many errors
-------------------------------
Index: .cvsignore
========================================
===========================
--- .cvsignore (revision 2)
+++ .cvsignore (working copy)
@@ -0,0 +1 @@
+functions.xml
Index: configure.xml
========================================
===========================
--- configure.xml (revision 2)
+++ configure.xml (working copy)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- $Revision: 1.0 $ -->
+<section xml:id="bbcode.installation"
xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink">
+ &reftitle.install;
+ <para>
+ &pecl.info;
+ <link
xlink:href="&url.pecl.package;fileinfo">&url.pecl.package;bbcode</link>
+ </para>
+</section>
+
+
+<!-- Keep this comment at the end of the file
+Local variables:
+mode: sgml
+sgml-omittag:t
+sgml-shorttag:t
+sgml-minimize-attributes:nil
+sgml-always-quote-attributes:t
+sgml-indent-step:1
+sgml-indent-data:t
+indent-tabs-mode:nil
+sgml-parent-document:nil
+sgml-default-dtd-file:"../../../manual.ced"
+sgml-exposed-tags:nil
+sgml-local-catalogs:nil
+sgml-local-ecat-files:nil
+End:
+vim600: syn=xml fen fdm=syntax fdl=2 si
+vim: et tw=78 syn=sgml
+vi: ts=1 sw=1
+-->
Index: constants.xml
========================================
===========================
--- constants.xml (revision 2)
+++ constants.xml (working copy)
@@ -0,0 +1,106 @@
+<?xml version='1.0' encoding='iso-8859-1'?>
+<!-- $Revision: 1.0 $ -->
+<section xml:id="bbcode.constants" xmlns="http://docbook.org/ns/docbook">
+ &reftitle.constants;
+ &extension.constants;
+ <variablelist>
+ <varlistentry>
+ <term>
+ <constant>BBCODE_TYPE_NOARG</constant>
+ (<type>integer</type> )
+ </term>
+ <listitem>
+ <simpara>
+ This BBCode tag does not accept arguments.
+ </simpara>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <constant>BBCODE_TYPE_SINGLE</constant>
+ (<type>integer</type> )
+ </term>
+ <listitem>
+ <simpara>
+ This BBCode tag does not have corresponding close tag.
+ </simpara>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <constant>BBCODE_TYPE_ARG</constant>
+ (<type>integer</type> )
+ </term>
+ <listitem>
+ <simpara>
+ This BBCode tag need an argument.
+ </simpara>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <constant>BBCODE_TYPE_OPTARG</constant>
+ (<type>integer</type> )
+ </term>
+ <listitem>
+ <simpara>
+ This BBCode tag accepts an optional argument.
+ </simpara>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <constant>BBCODE_TYPE_ROOT</constant>
+ (<type>integer</type> )
+ </term>
+ <listitem>
+ <simpara>
+ This BBCode tag is the special tag root (nesting level 0).
+ </simpara>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <constant>BBCODE_FLAGS_ARG_PARSING</constant>
+ (<type>integer</type> )
+ </term>
+ <listitem>
+ <simpara>
+ This BBCode tag require argument subparsing (the argument is reparsed
by the BBCode extension).
+ </simpara>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <constant>BBCODE_FLAGS_CDATA_NOT_ALLOWED</constant>
+ (<type>integer</type> )
+ </term>
+ <listitem>
+ <simpara>
+ This BBCode Tag does not accept content (it voids it automaticaly).
+ </simpara>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+</section>
+
+<!-- Keep this comment at the end of the file
+Local variables:
+mode: sgml
+sgml-omittag:t
+sgml-shorttag:t
+sgml-minimize-attributes:nil
+sgml-always-quote-attributes:t
+sgml-indent-step:1
+sgml-indent-data:t
+indent-tabs-mode:nil
+sgml-parent-document:nil
+sgml-default-dtd-file:"../../../../manual.ced"
+sgml-exposed-tags:nil
+sgml-local-catalogs:nil
+sgml-local-ecat-files:nil
+End:
+vim600: syn=xml fen fdm=syntax fdl=2 si
+vim: et tw=78 syn=sgml
+vi: ts=1 sw=1
+-->
Index: functions/bbcode-add-element.xml
========================================
===========================
--- functions/bbcode-add-element.xml (revision 2)
+++ functions/bbcode-add-element.xml (working copy)
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- $Revision: 1.0 $ -->
+<refentry xml:id="function.bbcode-add-element"
xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>bbcode_add_element</refname>
+ <refpurpose>Close fileinfo resource</refpurpose>
+ </refnamediv>
+ <refsect1 role="description">
+ &reftitle.description;
+ <methodsynopsis>
+ <type>bool</type><methodname>bbcode_add_element</methodname>
+
<methodparam><type>resource</type><parameter>bbcode_container</parameter></methodparam>
+
<methodparam><type>string</type><parameter>tag_name</parameter></methodparam>
+
<methodparam><type>array</type><parameter>tag_rules</parameter></methodparam>
+ </methodsynopsis>
+
+ <para>
+ This function adds a tag to an existing BBCode_Container tag_set see
+ <function>bbcode_create</function> for the format needed for tag_rules
+ </para>
+
+ </refsect1>
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ <varlistentry>
+ <term><parameter>bbcode_container</parameter></term>
+ <listitem>
+ <para>
+ BBCode_Container resource returned by
<function>bbcode_create</function>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><parameter>tag_name</parameter></term>
+ <listitem>
+ <para>
+ The new tag to add to the BBCode_Container tag set.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><parameter>tag_rules</parameter></term>
+ <listitem>
+ <para>
+ An associative array containing the parsing rules see
+ <function>bbcode_create</function> for the keys availables
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </refsect1>
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ &return.success;
+ </para>
+ </refsect1>
+
+</refentry>
+
+<!-- Keep this comment at the end of the file
+Local variables:
+mode: sgml
+sgml-omittag:t
+sgml-shorttag:t
+sgml-minimize-attributes:nil
+sgml-always-quote-attributes:t
+sgml-indent-step:1
+sgml-indent-data:t
+indent-tabs-mode:nil
+sgml-parent-document:nil
+sgml-default-dtd-file:"../../../../manual.ced"
+sgml-exposed-tags:nil
+sgml-local-catalogs:nil
+sgml-local-ecat-files:nil
+End:
+vim600: syn=xml fen fdm=syntax fdl=2 si
+vim: et tw=78 syn=sgml
+vi: ts=1 sw=1
+-->
Index: functions/bbcode-create.xml
========================================
===========================
--- functions/bbcode-create.xml (revision 2)
+++ functions/bbcode-create.xml (working copy)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- $Revision: 1.0 $ -->
+<refentry xml:id="function.bbcode-create"
xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>bbcode_create</refname>
+ <refpurpose>Create a BBCode Ressource</refpurpose>
+ </refnamediv>
+ <refsect1 role="description">
+ &reftitle.description;
+ <methodsynopsis>
+ <methodparam
choice="opt"><type>array</type><parameter>bbcode_initial_tags</parameter></methodparam>
+ </methodsynopsis>
+
+ <para>
+ This function starts a new BBCode Ressource used to pars BBCode strings
+ </para>
+
+ </refsect1>
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ <varlistentry>
+ <term><parameter>bbcode_initial_tags</parameter></term>
+ <listitem>
+ <para>
+ 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:
+ <itemizedlist>
+ <listitem>
+ <simpara>
+ <varname remap="structfield">flags</varname> optional - a flag
+ set based on the BBCODE_FLAGS_* constants.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ <varname remap="structfield">type</varname> needed - an int
+ indicating the type of tag use the BBCODE_TYPE_* constants
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ <varname remap="structfield">open_tag</varname> needed - the HTML
+ replacement for the open tag.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ <varname remap="structfield">close_tag</varname> needed - the HTML
+ replacement for the close tag.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ <varname remap="structfield">default_arg</varname> optional -
+ it gives the default argument if tag_type is of type OPTARG
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ <varname remap="structfield">content_handling</varname> 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;}
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ <varname remap="structfield">param_handling</varname> 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;}
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ <varname remap="structfield">childs</varname> 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.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ <varname remap="structfield">parent</varname> optional - List of
+ accepted childs for the tag. The format of the list is a comma
+ separated string.
+ </simpara>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </refsect1>
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ Returns a BBCode_Container
+ </para>
+ </refsect1>
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <para>
+ <example>
+ <title><function>bbcode_create</function> example</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$arrayBBCode=array(
+ ''=> array('type'=>BBCODE_TYPE_ROOT, 'childs'=>'!i'),
+ 'i'=> array('type'=>BBCODE_TYPE_NOARG, 'open_tag'=>'<i>',
+ 'close_tag'=>'</i>', 'childs'=>'b'),
+ 'url'=> array('type'=>BBCODE_TYPE_OPTARG,
+ 'open_tag'=>'<a href="{PARAM}">', 'close_tag'=>'</a>',
+ 'default_arg'=>'{CONTENT}'
+ 'childs'=>'bi'),
+ 'img'=> array('type'=>BBCODE_TYPE_NOARG,
+ 'open_tag'=>'<img src="', 'close_tag'=>'" />',
+ 'childs'=>''),
+ 'b'=> array('type'=>BBCODE_TYPE_NOARG, 'open_tag'=>'<b>',
+ 'close_tag'=>'</b>'),
+);
+$text=<<<EOF
+Bold Text
+Italic Text
+http://www.php.net/
+Content Text
+http://static.php.net/www.php.net/images/php.gif
+
+http://static.php.net/www.php.net/images/php.gif
+
+EOF;
+$BBHandler=bbcode_create($arrayBBCode);
+echo bbcode_parse($BBHandler,$text);
+?>
+]]>
+ </programlisting>
+ &example.outputs;
+ <screen>
+<![CDATA[
+<b>Bold Text</b>
+<i>Italic Text</i>
+<a href="http://www.php.net/">http://www.php.net/</a>
+<a href="http://pecl.php.net/"><b>Content Text</b></a>
+<img src="http://static.php.net/www.php.net/images/php.gif" />
+<a href="http://www.php.net/">
+http://static.php.net/www.php.net/images/php.gif
+</a>
+]]>
+ </screen>
+ </example>
+ </para>
+ </refsect1>
+
+</refentry>
+
+<!-- Keep this comment at the end of the file
+Local variables:
+mode: sgml
+sgml-omittag:t
+sgml-shorttag:t
+sgml-minimize-attributes:nil
+sgml-always-quote-attributes:t
+sgml-indent-step:1
+sgml-indent-data:t
+indent-tabs-mode:nil
+sgml-parent-document:nil
+sgml-default-dtd-file:"../../../../manual.ced"
+sgml-exposed-tags:nil
+sgml-local-catalogs:nil
+sgml-local-ecat-files:nil
+End:
+vim600: syn=xml fen fdm=syntax fdl=2 si
+vim: et tw=78 syn=sgml
+vi: ts=1 sw=1
+-->
Index: functions/bbcode-destroy.xml
========================================
===========================
--- functions/bbcode-destroy.xml (revision 2)
+++ functions/bbcode-destroy.xml (working copy)
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- $Revision: 1.0 $ -->
+<refentry xml:id="function.bbcode-destroy"
xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>bbcode_destroy</refname>
+ <refpurpose>Close BBCode_container resource</refpurpose>
+ </refnamediv>
+ <refsect1 role="description">
+ &reftitle.description;
+ <methodsynopsis>
+ <type>bool</type><methodname>finfo_close</methodname>
+
<methodparam><type>resource</type><parameter>bbcode_container</parameter></methodparam>
+ </methodsynopsis>
+
+ <para>
+ This function closes the resource opened by
<function>bbcode_create</function>.
+ </para>
+
+ </refsect1>
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ <varlistentry>
+ <term><parameter>bbcode</parameter></term>
+ <listitem>
+ <para>
+ BBCode_Container resource returned by
<function>bbcode_create</function>.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </refsect1>
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ &return.success;
+ </para>
+ </refsect1>
+
+</refentry>
+
+<!-- Keep this comment at the end of the file
+Local variables:
+mode: sgml
+sgml-omittag:t
+sgml-shorttag:t
+sgml-minimize-attributes:nil
+sgml-always-quote-attributes:t
+sgml-indent-step:1
+sgml-indent-data:t
+indent-tabs-mode:nil
+sgml-parent-document:nil
+sgml-default-dtd-file:"../../../../manual.ced"
+sgml-exposed-tags:nil
+sgml-local-catalogs:nil
+sgml-local-ecat-files:nil
+End:
+vim600: syn=xml fen fdm=syntax fdl=2 si
+vim: et tw=78 syn=sgml
+vi: ts=1 sw=1
+-->
Index: functions/bbcode-parse.xml
========================================
===========================
--- functions/bbcode-parse.xml (revision 2)
+++ functions/bbcode-parse.xml (working copy)
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- $Revision: 1.0 $ -->
+<refentry xml:id="function.bbcode_parse"
xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>bbcode_parse</refname>
+ <refpurpose>Parse a string following a given rule set</refpurpose>
+ </refnamediv>
+ <refsect1 role="description">
+ &reftitle.description;
+ <methodsynopsis>
+ <type>string</type><methodname>bbcode_parse</methodname>
+
<methodparam><type>resource</type><parameter>bbcode_container</parameter></methodparam>
+
<methodparam><type>string</type><parameter>to_parse</parameter></methodparam>
+ </methodsynopsis>
+
+ <para>
+ This function parse the string to_parse following the rules in the
+ bbcode_container created by bbcode_create
+ </para>
+
+ </refsect1>
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ <varlistentry>
+ <term><parameter>bbcode_container</parameter></term>
+ <listitem>
+ <para>
+ BBCode_Container resource returned by
<function>bbcode_create</function>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><parameter>to_parse</parameter></term>
+ <listitem>
+ <para>
+ The string we need to parse.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </refsect1>
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ &return.success;
+ </para>
+ </refsect1>
+
+</refentry>
+
+<!-- Keep this comment at the end of the file
+Local variables:
+mode: sgml
+sgml-omittag:t
+sgml-shorttag:t
+sgml-minimize-attributes:nil
+sgml-always-quote-attributes:t
+sgml-indent-step:1
+sgml-indent-data:t
+indent-tabs-mode:nil
+sgml-parent-document:nil
+sgml-default-dtd-file:"../../../../manual.ced"
+sgml-exposed-tags:nil
+sgml-local-catalogs:nil
+sgml-local-ecat-files:nil
+End:
+vim600: syn=xml fen fdm=syntax fdl=2 si
+vim: et tw=78 syn=sgml
+vi: ts=1 sw=1
+-->
Index: reference.xml
========================================
===========================
--- reference.xml (revision 2)
+++ reference.xml (working copy)
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- $Revision: 1.0 $ -->
+<!-- Membership: external, pecl -->
+<reference xml:id="ref.bbcode" xmlns="http://docbook.org/ns/docbook">
+ <title>BBCode Functions</title>
+ <titleabbrev>BBCode</titleabbrev>
+
+ <partintro>
+ <section xml:id="bbcode.intro">
+ &reftitle.intro;
+ <para>
+ 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.
+ </para>
+ </section>
+
+ <!-- Information found in configure.xml -->
+ &reference.bbcode.configure;
+
+ <section xml:id="bbcode.configuration">
+ &reftitle.runtime;
+ &no.config;
+ </section>
+
+ <section xml:id="bbcode.resources">
+ &reftitle.resources;
+ <para>
+ There is one resource used in BBCode extension: a BBCode_Container
+ returned by <function>bbcode_create</function>.
+ </para>
+ </section>
+ <!-- Information found in constants.xml -->
+ &reference.bbcode.constants;
+ </partintro>
+ &reference.bbcode.functions;
+</reference>
+
+<!-- Keep this comment at the end of the file
+Local variables:
+mode: sgml
+sgml-omittag:t
+sgml-shorttag:t
+sgml-minimize-attributes:nil
+sgml-always-quote-attributes:t
+sgml-indent-step:1
+sgml-indent-data:t
+indent-tabs-mode:nil
+sgml-parent-document:nil
+sgml-default-dtd-file:"../../../manual.ced"
+sgml-exposed-tags:nil
+sgml-local-catalogs:nil
+sgml-local-ecat-files:nil
+End:
+vim600: syn=xml fen fdm=syntax fdl=2 si
+vim: et tw=78 syn=sgml
+vi: ts=1 sw=1
+-->
-------------------------------
On Fri, 20 Jul 2007 14:11:11 -0700, Philip Olson <philip@roshambo.org>
wrote:
>
> On Jul 19, 2007, at 4:09 PM, Xavier De Cock wrote:
>
>
> You now have the karma... document away! :) Please submit a few
> initial patches to the list for review so that we may help if needed.
>
> Regards,
> Philip
--
Xavier De Cock
http://www.bmco.be/
|
|
|
|
|