xmldocs: Add support for an <example> tag in the Asterisk XML Documentation

This patch adds support for an <example /> tag in the XML documentation schema.

For CLI help, this doesn't change the formatting too much:
 - Preceeding white space is removed
 - Unlike with para elements, new lines are preserved

However, having an <example /> tag in the XML schema allows for the wiki
documentation generation script to surround the documentation with {code} or
{noformat} tags, generating much better content for the wiki - and allowing us
to put dialplan examples (and other code snippets, if desired) into the
documentation for an application/function/AMI command/etc.

Review: https://reviewboard.asterisk.org/r/3807/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419822 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Matthew Jordan
2014-07-31 11:49:40 +00:00
parent 485d0379ae
commit 922e3203a9
3 changed files with 103 additions and 18 deletions

View File

@@ -92,7 +92,7 @@
<!ELEMENT configOptionToEnum (configOption|xi:include)*>
<!ATTLIST configOptionToEnum prefix CDATA "">
<!ELEMENT description (para|note|warning|variablelist|enumlist|info|xi:include)*>
<!ELEMENT description (para|note|warning|variablelist|enumlist|info|example|xi:include)*>
<!ELEMENT parameter (optionlist|enumlist|argument|para|note|warning|parameter|info|xi:include)*>
<!ATTLIST parameter name CDATA "">
@@ -129,6 +129,10 @@
<!ELEMENT directory (#PCDATA)>
<!ELEMENT astcli (#PCDATA)>
<!ELEMENT example (#PCDATA|xi:include)*>
<!ATTLIST example title CDATA "">
<!ATTLIST example language CDATA "" >
<!ELEMENT note (para+|xi:include*)>
<!ELEMENT warning (para+|xi:include*)>