add a test file for documenting fluid settings

This commit is contained in:
derselbst 2017-09-28 20:08:53 +02:00
parent dc1be114fd
commit 81f30ce6d1
2 changed files with 156 additions and 0 deletions

86
doc/fluidsettings.xml Normal file
View file

@ -0,0 +1,86 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="fluidsettings.xsl"?>
<fluidsettings>
<synth>
<setting>
<name>something</name>
<type>int</type>
<def>10</def>
<vals>0-90</vals>
<desc>some very very very very very very very very very very very very very very long very very very very very very very very very very very very very very very very very very very desc goes here</desc>
</setting>
<setting>
<name>asdf</name>
<type>num</type>
<def>10</def>
<vals>[0;90]</vals>
<desc>some very very very very very very very very very very very very very very long very very very very very very very very very very very very very very very very very very very desc goes here</desc>
</setting>
<setting>
<name>qwer</name>
<type>bool</type>
<def>10</def>
<vals>0-90</vals>
<desc>some very very very very very very very very very very very very very very long very very very very very very very very very very very very very very very very very very very desc goes here</desc>
</setting>
<setting>
<name>ölkj</name>
<type>str</type>
<def>10</def>
<vals>"asdf", "jköl", "qwertz"</vals>
<desc>some very very very very very very very very very very very very very very long very very very very very very very very very very very very very very very very very very very desc goes here</desc>
</setting>
<setting>
<name>oipu</name>
<type>int</type>
<def>10</def>
<vals>0-90</vals>
<desc>some very very very very very very very very very very very very very very long very very very very very very very very very very very very very very very very very very very desc goes here</desc>
</setting>
</synth>
<audio>
<setting>
<name>channels</name>
<type>int</type>
<def>10</def>
<vals>0-90</vals>
<desc>some very very very very very very very very very very very very very very long very very very very very very very very very very very very very very very very very very very desc goes here</desc>
</setting>
<setting>
<name>groups</name>
<type>int</type>
<def>10</def>
<vals>0-90</vals>
<desc>some very very very very very very very very very very very very very very long very very very very very very very very very very very very very very very very very very very desc goes here</desc>
</setting>
</audio>
<midi>
<setting>
<name>channels</name>
<type>int</type>
<def>10</def>
<vals>0-90</vals>
<desc>some very very very very very very very very very very very very very very long very very very very very very very very very very very very very very very very very very very desc goes here</desc>
</setting>
<setting>
<name>sample-timer</name>
<type>int</type>
<def>10</def>
<vals>0-90</vals>
<desc>some very very very very very very very very very very very very very very long very very very very very very very very very very very very very very very very very very very desc goes here</desc>
</setting>
</midi>
<player>
<setting>
<name>reset-synth</name>
<type>bool</type>
<def>10</def>
<vals>0-90</vals>
<desc>some very very very very very very very very very very very very very very long very very very very very very very very very very very very very very very very very very very desc goes here</desc>
</setting>
</player>
</fluidsettings>

70
doc/fluidsettings.xsl Normal file
View file

@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<html>
<head>
<style>
.int {background-color: powderblue;}
.bool {background-color: lime;}
.num {background-color: yellow;}
.str {background-color: red;}
.audio {background-color: rgb( 255, 190, 170 );}
.midi {background-color: rgb( 200, 255, 240 );}
.player {background-color: rgb( 255, 255, 180 );}
.synth {background-color: rgb( 190, 255, 170 );}
</style>
</head>
<body>
<h2>FluidSettings</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th>Name</th>
<th>Type</th>
<th>Default Value</th>
<th>Allowed Values</th>
<th>Description</th>
</tr>
<!--print each and every setting to its own row in the table-->
<xsl:for-each select="fluidsettings/*/*">
<xsl:sort select=".." />
<xsl:sort select="name" />
<tr>
<!-- the class attribute of tr shall be the name of the settings group of the current setting -->
<xsl:attribute name="class">
<xsl:value-of select="name(..)" />
</xsl:attribute>
<td>
<xsl:value-of select="name(..)" />.<xsl:value-of select="name" />
</td>
<xsl:choose>
<xsl:when test="type = 'Integer'">
<td style="text-align:center">
<xsl:value-of select="type" />
</td>
</xsl:when>
<xsl:otherwise>
<td style="text-align:center">
<xsl:value-of select="type" />
</td>
</xsl:otherwise>
</xsl:choose>
<td style="text-align:center">
<xsl:value-of select="def" />
</td>
<td style="text-align:center">
<xsl:value-of select="vals" />
</td>
<td>
<xsl:value-of select="desc" />
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>