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.

Changes between revision 1 and 3

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
Diff Revision 1 Diff Revision 3
[20] 23 lines
[+20]
24
  <!ELEMENT agi (synopsis?,syntax?,description?,see-also?)>
24
  <!ELEMENT agi (synopsis?,syntax?,description?,see-also?)>
25
  <!ATTLIST agi name CDATA #REQUIRED>
25
  <!ATTLIST agi name CDATA #REQUIRED>
26
  <!ATTLIST agi language CDATA #REQUIRED>
26
  <!ATTLIST agi language CDATA #REQUIRED>
27
  <!ATTLIST agi module CDATA #IMPLIED>
27
  <!ATTLIST agi module CDATA #IMPLIED>
28

    
   
28

   
29
  <!ELEMENT manager (synopsis?,syntax?,description?,see-also?)>
29
  <!ELEMENT manager (synopsis?,syntax?,description?,see-also?,responses?)>
30
  <!ATTLIST manager name CDATA #REQUIRED>
30
  <!ATTLIST manager name CDATA #REQUIRED>
31
  <!ATTLIST manager language CDATA #REQUIRED>
31
  <!ATTLIST manager language CDATA #REQUIRED>
32
  <!ATTLIST manager module CDATA #IMPLIED>
32
  <!ATTLIST manager module CDATA #IMPLIED>
33

    
   
33

   

    
   
34
  <!ELEMENT responses (list-elements?,(managerEvent|xi:include))>

    
   
35

   

    
   
36
  <!ELEMENT list-elements (managerEvent+|xi:include+)>

    
   
37

   
34
  <!ELEMENT managerEvent (managerEventInstance+)>
38
  <!ELEMENT managerEvent (managerEventInstance+)>
35
  <!ATTLIST managerEvent name CDATA #REQUIRED>
39
  <!ATTLIST managerEvent name CDATA #REQUIRED>
36
  <!ATTLIST managerEvent language CDATA #REQUIRED>
40
  <!ATTLIST managerEvent language CDATA #REQUIRED>
37
  <!ATTLIST managerEvent module CDATA #IMPLIED>
41
  <!ATTLIST managerEvent module CDATA #IMPLIED>
38

    
   
42

   
[+20] [20] 103 lines
/trunk/funcs/func_jitterbuffer.c
Diff Revision 1 Diff Revision 3
 
/trunk/main/xmldoc.c
Diff Revision 1 Diff Revision 3
 
  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.