diff options
author | Kinsey Moore <kmoore@digium.com> | 2013-08-01 17:07:52 +0000 |
---|---|---|
committer | Kinsey Moore <kmoore@digium.com> | 2013-08-01 17:07:52 +0000 |
commit | 03090a88bab15b94843e3850df68b37ff8948b54 (patch) | |
tree | b32e51b384941143881c82dbb1a2d90e8de3536f /doc | |
parent | 5601b0f50cf30fd05c97a44ff7e18c20f58fc947 (diff) |
Fix documentation replication issues
This prevents XML documentation duplication by expanding channel and
bridge snapshot tags into channel and bridge snapshot parameter sets
with a given prefix or defaulting to no prefix. This also prevents
documentation from becoming fractured and out of date by keeping all
variations of the documentation in template form such that it only
needs to be updated once and keeps maintenance to a minimum.
Review: https://reviewboard.asterisk.org/r/2708/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395985 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'doc')
-rw-r--r-- | doc/appdocsxml.dtd | 8 | ||||
-rw-r--r-- | doc/snapshots.xslt | 115 |
2 files changed, 122 insertions, 1 deletions
diff --git a/doc/appdocsxml.dtd b/doc/appdocsxml.dtd index f8e7100f2..d56c8a860 100644 --- a/doc/appdocsxml.dtd +++ b/doc/appdocsxml.dtd @@ -76,9 +76,15 @@ <!ELEMENT synopsis (#PCDATA)> - <!ELEMENT syntax (parameter|dataType|category|matchInfo|xi:include)*> + <!ELEMENT syntax (parameter|dataType|category|matchInfo|xi:include|channel_snapshot|bridge_snapshot)*> <!ATTLIST syntax argsep CDATA ","> + <!ELEMENT channel_snapshot (#PCDATA)> + <!ATTLIST channel_snapshot prefix CDATA ""> + + <!ELEMENT bridge_snapshot (#PCDATA)> + <!ATTLIST bridge_snapshot prefix CDATA ""> + <!ELEMENT description (para|note|warning|variablelist|enumlist|info|xi:include)*> <!ELEMENT parameter (optionlist|enumlist|argument|para|note|warning|parameter|info|xi:include)*> diff --git a/doc/snapshots.xslt b/doc/snapshots.xslt new file mode 100644 index 000000000..17114cbcd --- /dev/null +++ b/doc/snapshots.xslt @@ -0,0 +1,115 @@ +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + <xsl:output omit-xml-declaration="yes" indent="yes"/> + + <xsl:param name="pNewType" select="'myNewType'"/> + + <xsl:template match="node()|@*"> + <xsl:copy> + <xsl:apply-templates select="node()|@*"/> + </xsl:copy> + </xsl:template> + + <xsl:template match="channel_snapshot"> + <xsl:element name="parameter"> + <xsl:attribute name="name"> + <xsl:value-of select="concat(@prefix,'Channel')"/> + </xsl:attribute> + </xsl:element> + <xsl:element name="parameter"> + <xsl:attribute name="name"> + <xsl:value-of select="concat(@prefix,'ChannelState')"/> + </xsl:attribute> + <para>A numeric code for the channel's current state, related to <xsl:value-of select="concat(@prefix,'ChannelStateDesc')"/></para> + </xsl:element> + <xsl:element name="parameter"> + <xsl:attribute name="name"> + <xsl:value-of select="concat(@prefix,'ChannelStateDesc')"/> + </xsl:attribute> + <enumlist> + <enum name="Down"/> + <enum name="Rsrvd"/> + <enum name="OffHook"/> + <enum name="Dialing"/> + <enum name="Ring"/> + <enum name="Ringing"/> + <enum name="Up"/> + <enum name="Busy"/> + <enum name="Dialing Offhook"/> + <enum name="Pre-ring"/> + <enum name="Unknown"/> + </enumlist> + </xsl:element> + <xsl:element name="parameter"> + <xsl:attribute name="name"> + <xsl:value-of select="concat(@prefix,'CallerIDNum')"/> + </xsl:attribute> + </xsl:element> + <xsl:element name="parameter"> + <xsl:attribute name="name"> + <xsl:value-of select="concat(@prefix,'CallerIDName')"/> + </xsl:attribute> + </xsl:element> + <xsl:element name="parameter"> + <xsl:attribute name="name"> + <xsl:value-of select="concat(@prefix,'ConnectedLineNum')"/> + </xsl:attribute> + </xsl:element> + <xsl:element name="parameter"> + <xsl:attribute name="name"> + <xsl:value-of select="concat(@prefix,'ConnectedLineName')"/> + </xsl:attribute> + </xsl:element> + <xsl:element name="parameter"> + <xsl:attribute name="name"> + <xsl:value-of select="concat(@prefix,'AccountCode')"/> + </xsl:attribute> + </xsl:element> + <xsl:element name="parameter"> + <xsl:attribute name="name"> + <xsl:value-of select="concat(@prefix,'Context')"/> + </xsl:attribute> + </xsl:element> + <xsl:element name="parameter"> + <xsl:attribute name="name"> + <xsl:value-of select="concat(@prefix,'Exten')"/> + </xsl:attribute> + </xsl:element> + <xsl:element name="parameter"> + <xsl:attribute name="name"> + <xsl:value-of select="concat(@prefix,'Priority')"/> + </xsl:attribute> + </xsl:element> + <xsl:element name="parameter"> + <xsl:attribute name="name"> + <xsl:value-of select="concat(@prefix,'Uniqueid')"/> + </xsl:attribute> + </xsl:element> + </xsl:template> + + <xsl:template match="bridge_snapshot"> + <xsl:element name="parameter"> + <xsl:attribute name="name"> + <xsl:value-of select="concat(@prefix,'BridgeUniqueid')"/> + </xsl:attribute> + </xsl:element> + <xsl:element name="parameter"> + <xsl:attribute name="name"> + <xsl:value-of select="concat(@prefix,'BridgeType')"/> + </xsl:attribute> + <para>The type of bridge</para> + </xsl:element> + <xsl:element name="parameter"> + <xsl:attribute name="name"> + <xsl:value-of select="concat(@prefix,'BridgeTechnology')"/> + </xsl:attribute> + <para>Technology in use by the bridge</para> + </xsl:element> + <xsl:element name="parameter"> + <xsl:attribute name="name"> + <xsl:value-of select="concat(@prefix,'BridgeNumChannels')"/> + </xsl:attribute> + <para>Number of channels in the bridge</para> + </xsl:element> + </xsl:template> +</xsl:stylesheet> |