Review Board 1.7.16


xmldoc: Add support for an <example> tag in the Asterisk XML documentation

Review Request #3807 - Created July 16, 2014 and submitted

Matt Jordan
trunk
Reviewers
asterisk-dev
Asterisk
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.
Updated the JITTERBUFFER function. It now displays its dialplan examples in a single example block in the CLI help.

Diff revision 1

This is not the most recent revision of the diff. The latest diff is revision 4. See what's changed.

1 2 3 4
1 2 3 4

  1. /trunk/doc/appdocsxml.dtd: Loading...
  2. /trunk/funcs/func_jitterbuffer.c: Loading...
  3. /trunk/main/xmldoc.c: Loading...
/trunk/doc/appdocsxml.dtd
Revision 418779 New Change
[20] 85 lines
[+20]
86
  <!ATTLIST bridge_snapshot prefix CDATA "">
86
  <!ATTLIST bridge_snapshot prefix CDATA "">
87

    
   
87

   
88
  <!ELEMENT configOptionToEnum (configOption|xi:include)*>
88
  <!ELEMENT configOptionToEnum (configOption|xi:include)*>
89
  <!ATTLIST configOptionToEnum prefix CDATA "">
89
  <!ATTLIST configOptionToEnum prefix CDATA "">
90

    
   
90

   
91
  <!ELEMENT description (para|note|warning|variablelist|enumlist|info|xi:include)*>
91
  <!ELEMENT description (para|note|warning|variablelist|enumlist|info|example|xi:include)*>
92

    
   
92

   
93
  <!ELEMENT parameter (optionlist|enumlist|argument|para|note|warning|parameter|info|xi:include)*>
93
  <!ELEMENT parameter (optionlist|enumlist|argument|para|note|warning|parameter|info|xi:include)*>
94
  <!ATTLIST parameter name CDATA "">
94
  <!ATTLIST parameter name CDATA "">
95
  <!ATTLIST parameter required (yes|no|true|false) "false">
95
  <!ATTLIST parameter required (yes|no|true|false) "false">
96
  <!ATTLIST parameter multiple (yes|no|true|false) "false">
96
  <!ATTLIST parameter multiple (yes|no|true|false) "false">
[+20] [20] 26 lines
[+20]
123
  <!ELEMENT filename (#PCDATA)>
123
  <!ELEMENT filename (#PCDATA)>
124
  <!ELEMENT replaceable (#PCDATA)>
124
  <!ELEMENT replaceable (#PCDATA)>
125
  <!ELEMENT directory (#PCDATA)>
125
  <!ELEMENT directory (#PCDATA)>
126
  <!ELEMENT astcli (#PCDATA)>
126
  <!ELEMENT astcli (#PCDATA)>
127

    
   
127

   

    
   
128
  <!ELEMENT example (#PCDATA|xi:include)*>

    
   
129
  <!ATTLIST example title CDATA "">

    
   
130
  <!ATTLIST example language CDATA "" >

    
   
131

   
128
  <!ELEMENT note (para+|xi:include*)>
132
  <!ELEMENT note (para+|xi:include*)>
129
  <!ELEMENT warning (para+|xi:include*)>
133
  <!ELEMENT warning (para+|xi:include*)>
130

    
   
134

   
131
  <!ELEMENT variablelist (variable+|xi:include*)>
135
  <!ELEMENT variablelist (variable+|xi:include*)>
132
  <!ELEMENT variable (#PCDATA|value|para|info|xi:include)*>
136
  <!ELEMENT variable (#PCDATA|value|para|info|xi:include)*>
133
  <!ATTLIST variable name CDATA "">
137
  <!ATTLIST variable name CDATA "">
134

    
   
138

   
135
  <!ELEMENT value (#PCDATA)>
139
  <!ELEMENT value (#PCDATA)>
136
  <!ATTLIST value name CDATA #REQUIRED>
140
  <!ATTLIST value name CDATA #REQUIRED>
137
  <!ATTLIST value default CDATA "">
141
  <!ATTLIST value default CDATA "">
/trunk/funcs/func_jitterbuffer.c
Revision 418779 New Change
 
/trunk/main/xmldoc.c
Revision 418779 New Change
 
  1. /trunk/doc/appdocsxml.dtd: Loading...
  2. /trunk/funcs/func_jitterbuffer.c: Loading...
  3. /trunk/main/xmldoc.c: Loading...

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.