Commit e6a9941c authored by Stefan Kost's avatar Stefan Kost

Also extract element caps for plugin-docs. Fixes parts of #117692.

Original commit message from CVS:
* gst-xmlinspect.py:
* plugins.xsl:
Also extract element caps for plugin-docs. Fixes parts of #117692.
parent 14c5a689
2007-06-25 Stefan Kost <ensonic@users.sf.net>
* gst-xmlinspect.py:
* plugins.xsl:
Also extract element caps for plugin-docs. Fixes parts of #117692.
2007-06-21 Tim-Philipp Müller <tim at centricular dot net>
Patch by: Andreas Schwab
......
......@@ -15,12 +15,23 @@ import gst
INDENT_SIZE = 2
# all templates
PAD_TEMPLATE = """<caps>
<name>%(name)s</name>
<direction>%(direction)s</direction>
<presence>%(presence)s</presence>
<details>%(details)s</details>
</caps>"""
ELEMENT_TEMPLATE = """<element>
<name>%(name)s</name>
<longname>%(longname)s</longname>
<class>%(class)s</class>
<description>%(description)s</description>
<author>%(author)s</author>
<pads>
%(pads)s
</pads>
</element>"""
PLUGIN_TEMPLATE = """<plugin>
......@@ -50,17 +61,40 @@ def xmlencode(line):
def get_offset(indent):
return " " * INDENT_SIZE * indent
def output_pad_template(pt, indent=0):
print "PAD TEMPLATE", pt.name_template
paddir = ("unknown","source","sink")
padpres = ("always","sometimes","request")
d = {
'name': xmlencode(pt.name_template),
'direction': xmlencode(paddir[pt.direction]),
'presence': xmlencode(padpres[pt.presence]),
'details': xmlencode(pt.static_caps.string),
}
block = PAD_TEMPLATE % d
offset = get_offset(indent)
return offset + ("\n" + offset).join(block.split("\n"))
def output_element_factory(elf, indent=0):
print "ELEMENT", elf.get_name()
padsoutput = []
padtemplates = elf.get_static_pad_templates()
for padtemplate in padtemplates:
padsoutput.append(output_pad_template(padtemplate, indent))
d = {
'name': xmlencode(elf.get_name()),
'longname': xmlencode(elf.get_longname()),
'class': xmlencode(elf.get_klass()),
'description': xmlencode(elf.get_description()),
'author': xmlencode(elf.get_author()),
'pads': "\n".join(padsoutput),
}
block = ELEMENT_TEMPLATE % d
offset = get_offset(indent)
return offset + ("\n" + offset).join(block.split("\n"))
......
......@@ -10,6 +10,7 @@
doctype-system = "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"/>
<xsl:param name="module" />
<xsl:template match="element">
<xsl:element name="varlistentry">
<xsl:element name="term">
......@@ -26,37 +27,76 @@
<!-- here we write an element-(name)-details.xml file for the element -->
<exsl:document href="{concat ('xml/element-', $name, '-details.xml')}" method="xml" indent="yes">
<xsl:element name="refsect2">
<xsl:element name="title">Element Information</xsl:element>
<xsl:element name="refsect2">
<xsl:element name="title">Element Information</xsl:element>
<xsl:element name="variablelist">
<!-- plugin name and link -->
<xsl:element name="varlistentry">
<xsl:element name="term">plugin</xsl:element>
<xsl:element name="listitem">
<xsl:element name="simpara">
<xsl:element name="link">
<xsl:attribute name="linkend">plugin-<xsl:value-of select="../../name"/></xsl:attribute>
<xsl:value-of select="../../name" />
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:element>
<xsl:element name="varlistentry">
<xsl:element name="term">author</xsl:element>
<xsl:element name="listitem">
<xsl:element name="simpara"><xsl:value-of select="author" /></xsl:element>
</xsl:element>
</xsl:element>
<xsl:element name="varlistentry">
<xsl:element name="term">class</xsl:element>
<xsl:element name="listitem">
<xsl:element name="simpara"><xsl:value-of select="class" /></xsl:element>
</xsl:element>
</xsl:element>
</xsl:element> <!-- variablelist -->
<xsl:element name="title">Element Pads</xsl:element>
<!-- process all caps -->
<xsl:for-each select="pads/caps">
<xsl:element name="variablelist">
<!-- plugin name and link -->
<xsl:element name="varlistentry">
<xsl:element name="term">plugin</xsl:element>
<xsl:element name="term">name</xsl:element>
<xsl:element name="listitem">
<xsl:element name="simpara">
<xsl:element name="link">
<xsl:attribute name="linkend">plugin-<xsl:value-of select="../../name"/></xsl:attribute>
<xsl:value-of select="../../name" />
</xsl:element>
</xsl:element>
<xsl:element name="simpara"><xsl:value-of select="name" /></xsl:element>
</xsl:element>
</xsl:element>
<xsl:element name="varlistentry">
<xsl:element name="term">author</xsl:element>
<xsl:element name="term">direction</xsl:element>
<xsl:element name="listitem">
<xsl:element name="simpara"><xsl:value-of select="author" /></xsl:element>
<xsl:element name="simpara"><xsl:value-of select="direction" /></xsl:element>
</xsl:element>
</xsl:element>
<xsl:element name="varlistentry">
<xsl:element name="term">class</xsl:element>
<xsl:element name="term">presence</xsl:element>
<xsl:element name="listitem">
<xsl:element name="simpara"><xsl:value-of select="class" /></xsl:element>
<xsl:element name="simpara"><xsl:value-of select="presence" /></xsl:element>
</xsl:element>
</xsl:element>
<xsl:element name="varlistentry">
<xsl:element name="term">details</xsl:element>
<xsl:element name="listitem">
<xsl:element name="simpara"><xsl:value-of select="details" /></xsl:element>
</xsl:element>
</xsl:element>
</xsl:element> <!-- variablelist -->
<!--xsl:element name="programlisting"><xsl:value-of select="details" /></xsl:element-->
</xsl:for-each>
</xsl:element>
</exsl:document>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment