Summary Page improvements
commit
fd47e239ba
|
@ -2,7 +2,7 @@
|
|||
<!--
|
||||
Handles calculation output in LaTeX format for styling by Mathjax
|
||||
|
||||
Copyright (C) 2016 LoVullo Associates, Inc.
|
||||
Copyright (C) 2016, 2017 LoVullo Associates, Inc.
|
||||
|
||||
This file is part of TAME.
|
||||
|
||||
|
@ -631,6 +631,8 @@
|
|||
@return LaTeX equation
|
||||
-->
|
||||
<xsl:template match="c:eq|c:ne|c:gt|c:lt|c:gte|c:lte" mode="calc-iversons">
|
||||
<xsl:param name="recurse" select="true()" />
|
||||
|
||||
<xsl:variable name="name" select="local-name()" />
|
||||
|
||||
<!-- map to LaTeX equivalent -->
|
||||
|
@ -646,7 +648,9 @@
|
|||
<xsl:value-of select="$map/*[ @id=$name ]" />
|
||||
<xsl:text> </xsl:text>
|
||||
|
||||
<xsl:apply-templates select="." mode="calc-recurse" />
|
||||
<xsl:if test="$recurse">
|
||||
<xsl:apply-templates select="." mode="calc-recurse" />
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
|
||||
<xsl:template match="preproc:sym[ @type='rate' ]" mode="summary:desc" priority="5">
|
||||
<span class="letlist-{@name}">
|
||||
<a href="#{@name}">
|
||||
<a href="#{@name}" class="sym-ref sym-rate">
|
||||
<xsl:value-of select="@name" />
|
||||
</a>
|
||||
<xsl:text> scalar</xsl:text>
|
||||
|
@ -56,14 +56,14 @@
|
|||
|
||||
<xsl:template match="preproc:sym[ @type='gen' ]" mode="summary:desc" priority="5">
|
||||
<span class="letlist-{@parent}">
|
||||
<a href="#{@parent}">
|
||||
<a href="#{@parent}" class="sym-ref sym-gen">
|
||||
<xsl:value-of select="@name" />
|
||||
</a>
|
||||
<xsl:text> generator; vector</xsl:text>
|
||||
|
||||
<span class="param">
|
||||
<xsl:text> (</xsl:text>
|
||||
<a href="#{@parent}">
|
||||
<a href="#{@parent}" class="sym-ref sym-rate">
|
||||
<xsl:value-of select="@parent" />
|
||||
</a>
|
||||
<xsl:text>)</xsl:text>
|
||||
|
@ -125,7 +125,7 @@
|
|||
<!-- TODO: use generator in letlist-* -->
|
||||
<span class="param">
|
||||
<xsl:text> (</xsl:text>
|
||||
<a href="#:class:{$class/@as}">
|
||||
<a href="#:class:{$class/@as}" class="sym-ref sym-class">
|
||||
<xsl:value-of select="$class/@as" />
|
||||
</a>
|
||||
<xsl:text>)</xsl:text>
|
||||
|
@ -135,7 +135,9 @@
|
|||
|
||||
|
||||
<xsl:template match="preproc:sym[ @type='const' ]" mode="summary:desc" priority="5">
|
||||
<xsl:value-of select="@name" />
|
||||
<a href="#{@name}" class="sym-ref sym-const">
|
||||
<xsl:value-of select="@name" />
|
||||
</a>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
|
@ -157,7 +159,7 @@
|
|||
|
||||
<span class="param letlist-{$param/@name}">
|
||||
<xsl:text> (</xsl:text>
|
||||
<a href="#{$param/@name}">
|
||||
<a href="#{$param/@name}" class="sym-ref sym-param">
|
||||
<xsl:value-of select="$param/@name" />
|
||||
</a>
|
||||
<xsl:text>)</xsl:text>
|
||||
|
@ -165,6 +167,14 @@
|
|||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="preproc:sym[ @type='func' ]" mode="summary:desc" priority="5">
|
||||
<a href="#{@name}" class="sym-ref sym-func">
|
||||
<xsl:value-of select="@name" />
|
||||
</a>
|
||||
<xsl:text> function</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="preproc:sym" mode="summary:desc" priority="1">
|
||||
<xsl:value-of select="@name" />
|
||||
<xsl:text> (!)</xsl:text>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<!--
|
||||
Outputs HTML form that can be used to feed values to the rater for testing
|
||||
|
||||
Copyright (C) 2016 LoVullo Associates, Inc.
|
||||
Copyright (C) 2016, 2017 LoVullo Associates, Inc.
|
||||
|
||||
This file is part of TAME.
|
||||
|
||||
|
@ -23,6 +23,7 @@
|
|||
<xsl:stylesheet version="1.0"
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:lv="http://www.lovullo.com/rater"
|
||||
xmlns:c="http://www.lovullo.com/calc"
|
||||
xmlns:l="http://www.lovullo.com/rater/linker"
|
||||
|
@ -92,16 +93,43 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<dl>
|
||||
<!-- generate HTML elements for each *global* parameter, *but only if it
|
||||
is used in the rater* -->
|
||||
<xsl:apply-templates
|
||||
select="/lv:package/l:dep/preproc:sym[ @type='param' ]"
|
||||
mode="entry-form">
|
||||
<!-- generate form fields for each param -->
|
||||
<xsl:for-each-group select="/lv:package/l:dep/preproc:sym[ @type='param' ]"
|
||||
group-by="@src">
|
||||
<xsl:variable name="pkg"
|
||||
select="if ( not( @src = '' ) ) then
|
||||
document( concat( @src, '.xmlo' ), $root-pkg )/lv:*
|
||||
else
|
||||
()" />
|
||||
|
||||
<xsl:with-param name="root-pkg" select="$root-pkg" />
|
||||
</xsl:apply-templates>
|
||||
</dl>
|
||||
<xsl:variable name="pkg-display"
|
||||
select="if ( $pkg ) then
|
||||
concat( $pkg/@desc, ' (', $pkg/@name, ')' )
|
||||
else
|
||||
''" />
|
||||
|
||||
<xsl:variable name="pkg-name" select="$pkg/@name" />
|
||||
|
||||
<fieldset class="param-set">
|
||||
<legend data-pkg-name="{$pkg-name}">
|
||||
<a href="#pkg-{$pkg-name}" class="sym-ref sym-pkg sym-large">
|
||||
<xsl:value-of select="$pkg-display" />
|
||||
</a>
|
||||
</legend>
|
||||
|
||||
<xsl:variable name="syms" as="element( preproc:sym )*">
|
||||
<xsl:perform-sort select="current-group()">
|
||||
<xsl:sort select="@desc"></xsl:sort>
|
||||
</xsl:perform-sort>
|
||||
</xsl:variable>
|
||||
|
||||
<dl>
|
||||
<xsl:apply-templates mode="entry-form" select="$syms">
|
||||
<xsl:with-param name="root-pkg" select="$root-pkg" />
|
||||
</xsl:apply-templates>
|
||||
</dl>
|
||||
</fieldset>
|
||||
</xsl:for-each-group>
|
||||
</form>
|
||||
|
||||
<script type="text/javascript" src="{$fw-path}/rater/scripts/entry-form.js"></script>
|
||||
|
@ -138,12 +166,14 @@
|
|||
select="$package/lv:param[ @name=$self/@name ]" />
|
||||
|
||||
<dt id="param-{@name}">
|
||||
<xsl:value-of select="@desc" />
|
||||
<span class="param-desc">
|
||||
<xsl:value-of select="@desc" />
|
||||
</span>
|
||||
|
||||
<span class="param-id">
|
||||
<xsl:text> </xsl:text>
|
||||
<a href="#{@name}">
|
||||
<xsl:sequence select="concat( '[', @name, ']' )" />
|
||||
<a href="#{@name}" class="sym-ref sym-param">
|
||||
<xsl:value-of select="@name" />
|
||||
</a>
|
||||
</span>
|
||||
</dt>
|
||||
|
|
|
@ -2140,7 +2140,7 @@ var client = ( function()
|
|||
}
|
||||
catch ( e )
|
||||
{
|
||||
alert( 'Failed setting param values from URL.\n\n' + e.message );
|
||||
// probably not the type of data we're looking for; just ignore
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ body {
|
|||
position: fixed;
|
||||
overflow: scroll;
|
||||
|
||||
background-color: #ad7fa8;
|
||||
background-color: #474c55;
|
||||
border-right: 1px solid black;
|
||||
|
||||
top: 0px;
|
||||
|
@ -41,13 +41,23 @@ body {
|
|||
|
||||
resize: horizontal;
|
||||
z-index: 10;
|
||||
|
||||
color: #dfdfe0;
|
||||
line-height: 1.25em;
|
||||
}
|
||||
|
||||
.menu a, .menu a:link, .menu a:active,
|
||||
.menu a:visited
|
||||
{
|
||||
color: #dfdfe0;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.menu h1
|
||||
{
|
||||
font-size: 1.4em;
|
||||
font-size: 1.2em;
|
||||
margin-bottom: 0.15em;
|
||||
border-bottom: 1px solid #75507b;
|
||||
border-bottom: 1px solid #dfdfe0;
|
||||
}
|
||||
.menu h1:not(:first-child)
|
||||
{
|
||||
|
@ -56,7 +66,7 @@ body {
|
|||
|
||||
.menu h2
|
||||
{
|
||||
font-size: 1.2em;
|
||||
font-size: 1.1em;
|
||||
margin-left: 0.5em;
|
||||
margin-bottom: 0.15em;
|
||||
}
|
||||
|
@ -68,7 +78,7 @@ body {
|
|||
list-style: none;
|
||||
}
|
||||
|
||||
fieldset,
|
||||
body > fieldset,
|
||||
.container-param,
|
||||
.tcontent
|
||||
{
|
||||
|
@ -86,6 +96,33 @@ fieldset fieldset
|
|||
display: block;
|
||||
}
|
||||
|
||||
fieldset > legend .entry-value
|
||||
{
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
|
||||
fieldset.param-set
|
||||
{
|
||||
margin-top: 3ex;
|
||||
border-top: 1px solid black;
|
||||
}
|
||||
|
||||
fieldset.param-set > legend[data-pkg-name=""]
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
|
||||
fieldset.param-set > legend
|
||||
{
|
||||
padding: 0px;
|
||||
margin: 0px 0px 1ex 0px;
|
||||
}
|
||||
|
||||
fieldset.param-set > legend > a
|
||||
{
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#xml-raw:not(.show)
|
||||
{
|
||||
|
@ -99,10 +136,8 @@ table > caption
|
|||
|
||||
dt
|
||||
{
|
||||
font-size: 1.1em;
|
||||
font-weight: bold;
|
||||
|
||||
margin-top: 0.5em;
|
||||
margin-top: 2ex;
|
||||
}
|
||||
|
||||
dt.param.classifies {
|
||||
|
@ -306,13 +341,10 @@ body > fieldset > legend
|
|||
|
||||
body > fieldset > legend > a.pkg
|
||||
{
|
||||
float: right;
|
||||
font-size: 0.5em;
|
||||
float: right;
|
||||
font-size: 0.5em;
|
||||
line-height: 2.5em;
|
||||
|
||||
color: inherit;
|
||||
border: none;
|
||||
text-decoration: none;
|
||||
padding: 0px 0.5em;
|
||||
}
|
||||
|
||||
body > fieldset > legend + p.desc
|
||||
|
@ -321,12 +353,6 @@ body > fieldset > legend + p.desc
|
|||
font-size: 1.1em;
|
||||
}
|
||||
|
||||
fieldset.rate > legend > a
|
||||
{
|
||||
text-decoration: none;
|
||||
border-bottom: 1px dotted black;
|
||||
}
|
||||
|
||||
fieldset.rate .classes
|
||||
{
|
||||
display: inline-block;
|
||||
|
@ -475,10 +501,123 @@ form.entry-form dt
|
|||
clear: left;
|
||||
}
|
||||
|
||||
form.entry-form fieldset
|
||||
{
|
||||
/* desc is limited to 65ch */
|
||||
max-width: 120ch;
|
||||
}
|
||||
|
||||
form.entry-form dt > .param-id
|
||||
{
|
||||
float: right;
|
||||
}
|
||||
|
||||
.menu a.sym-ref:visited,
|
||||
.menu a.sym-ref:link,
|
||||
.menu a.sym-ref:active
|
||||
{
|
||||
color: black;
|
||||
}
|
||||
|
||||
.sym-ref,
|
||||
.entry-value,
|
||||
.entry-value-prior
|
||||
{
|
||||
display: inline-block;
|
||||
|
||||
font-weight: normal;
|
||||
font-family: monospace;
|
||||
letter-spacing: 0em;
|
||||
text-decoration: none;
|
||||
white-space: nowrap;
|
||||
color: black;
|
||||
|
||||
border: 1px solid;
|
||||
border-radius: 0.25em;
|
||||
padding: 0.15em;
|
||||
margin: 0.15em;
|
||||
}
|
||||
.sym-ref.sym-large
|
||||
{
|
||||
font-size: 1.1em;
|
||||
padding: 0.5em;
|
||||
}
|
||||
|
||||
.sym-pkg
|
||||
{
|
||||
background-color: #d1c3e9;
|
||||
border-color: #673ab7;
|
||||
}
|
||||
.sym-rate,
|
||||
.sym-gen
|
||||
{
|
||||
background-color: #ffe3ba;
|
||||
border-color: #ff9800;
|
||||
}
|
||||
.sym-func
|
||||
{
|
||||
background-color: #ffdfd5;
|
||||
border-color: #ff5722;
|
||||
}
|
||||
.sym-const
|
||||
{
|
||||
background-color: #ececec;
|
||||
border-color: #9E9E9E;
|
||||
}
|
||||
.sym-type
|
||||
{
|
||||
background-color: #d4c8c4;
|
||||
border-color: #795548;
|
||||
}
|
||||
.sym-param
|
||||
{
|
||||
background-color: #cfd8dc;
|
||||
border-color: #607D8B;
|
||||
}
|
||||
.sym-class,
|
||||
.sym-cgen
|
||||
{
|
||||
background-color: #dfeecc;
|
||||
border-color: #4caf50;
|
||||
}
|
||||
.sym-tpl
|
||||
{
|
||||
background-color: #fffcdb;
|
||||
border-color: #ffeb3b;
|
||||
}
|
||||
|
||||
|
||||
.entry-value,
|
||||
.entry-value-prior
|
||||
{
|
||||
background-color: yellow;
|
||||
|
||||
margin-left: 2em;
|
||||
|
||||
font-weight: bold;
|
||||
font-size: 1.1em;
|
||||
color: green;
|
||||
}
|
||||
.entry-value-prior
|
||||
{
|
||||
background-color: purple;
|
||||
border-color: black;
|
||||
|
||||
font-weight: normal;
|
||||
font-family: monospace;
|
||||
font-size: 0.9em;
|
||||
color: white;
|
||||
}
|
||||
body:not(.prior) .entry-value-prior
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
form.entry-form dt > .param-desc
|
||||
{
|
||||
display: inline-block;
|
||||
clear: left;
|
||||
max-width: 65ch;
|
||||
}
|
||||
|
||||
form.entry-form .matrix
|
||||
|
@ -657,32 +796,6 @@ form .final-comments #final-submit
|
|||
}
|
||||
|
||||
|
||||
|
||||
.entry-value,
|
||||
.entry-value-prior
|
||||
{
|
||||
background-color: yellow;
|
||||
|
||||
padding: 0.1em;
|
||||
margin-left: 1em;
|
||||
|
||||
font-weight: bold;
|
||||
color: green;
|
||||
}
|
||||
.entry-value-prior
|
||||
{
|
||||
background-color: purple;
|
||||
|
||||
font-weight: normal;
|
||||
font-size: 0.9em;
|
||||
color: white;
|
||||
}
|
||||
body:not(.prior) .entry-value-prior
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
/** validation errors **/
|
||||
.validation-errors
|
||||
{
|
||||
|
@ -757,16 +870,6 @@ body:not(.prior) .entry-value-prior
|
|||
color: gray;
|
||||
}
|
||||
|
||||
.ultra-breakdown legend > .tplid
|
||||
{
|
||||
font-family: monospace;
|
||||
background-color: lightgoldenrodyellow;
|
||||
border: 1px solid palegoldenrod;
|
||||
border-radius: 0.25em;
|
||||
padding: 0.15em;
|
||||
margin: 0.15em;
|
||||
}
|
||||
|
||||
.ultra-breakdown fieldset
|
||||
{
|
||||
margin-top: 1em;
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
<xsl:stylesheet version="2.0"
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:lv="http://www.lovullo.com/rater"
|
||||
xmlns:lvp="http://www.lovullo.com"
|
||||
xmlns:c="http://www.lovullo.com/calc"
|
||||
|
@ -61,6 +62,7 @@
|
|||
and JS -->
|
||||
<xsl:param name="fw-path" select="lv:package/@__rootpath" />
|
||||
|
||||
<xsl:variable name="program" select="/lv:package" />
|
||||
|
||||
|
||||
<!--
|
||||
|
@ -218,6 +220,8 @@
|
|||
|
||||
<!-- global functions for developers -->
|
||||
<script type="text/javascript">
|
||||
window.addEventListener( 'load', function()
|
||||
{
|
||||
// expected VOI order
|
||||
window.voi_order = [
|
||||
<xsl:apply-templates
|
||||
|
@ -283,6 +287,7 @@
|
|||
|
||||
// begin processing
|
||||
client.begin();
|
||||
} );
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -297,7 +302,7 @@
|
|||
|
||||
<div class="menu" id="pkgmenu">
|
||||
<!-- build our own menu -->
|
||||
<h1 id="pkg-{@name}">
|
||||
<h1 id="pkg-{@name}" class="sym-ref sym-pkg">
|
||||
<xsl:value-of select="@name" />
|
||||
</h1>
|
||||
|
||||
|
@ -305,6 +310,7 @@
|
|||
<ul>
|
||||
<li><a href="#test-data">Test Case</a></li>
|
||||
<li><a id="load-prior" href="#prior">Prior Test Cases</a></li>
|
||||
<li><a href="#__nb">N.B.</a></li>
|
||||
</ul>
|
||||
|
||||
<xsl:apply-templates select="." mode="gen-menu">
|
||||
|
@ -340,7 +346,7 @@
|
|||
<xsl:variable name="pkg-name"
|
||||
select="preproc:pkg-name( . )" />
|
||||
|
||||
<h1 id="pkg-{$pkg-name}">
|
||||
<h1 id="pkg-{$pkg-name}" class="sym-ref sym-pkg">
|
||||
<xsl:value-of select="concat( '/', $pkg-name )" />
|
||||
</h1>
|
||||
|
||||
|
@ -370,7 +376,7 @@
|
|||
<xsl:for-each select="$deps/*">
|
||||
<xsl:sort select="@name" data-type="text" />
|
||||
<li>
|
||||
<a href="#{@name}">
|
||||
<a href="#{@name}" class="sym-ref sym-{$type}">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$after">
|
||||
<xsl:value-of select="substring-after( @name, $after )" />
|
||||
|
@ -454,7 +460,9 @@
|
|||
<!-- first output any rate blocks are are ungrouped -->
|
||||
<xsl:for-each select="$src/lv:rate[ @yields=$rates/@name ]">
|
||||
<li>
|
||||
<a href="#{@yields}"><xsl:value-of select="@yields" /></a>
|
||||
<a href="#{@yields}" class="sym-ref sym-rate">
|
||||
<xsl:value-of select="@yields" />
|
||||
</a>
|
||||
</li>
|
||||
</xsl:for-each>
|
||||
|
||||
|
@ -502,6 +510,8 @@
|
|||
and ( not( @src ) or @src='' )
|
||||
)
|
||||
)
|
||||
and not( starts-with( @orig-name, '__' ) )
|
||||
and not( starts-with( @orig-name, '--' ) )
|
||||
]" />
|
||||
</xsl:template>
|
||||
|
||||
|
@ -634,7 +644,7 @@
|
|||
<xsl:template name="pkg-out">
|
||||
<xsl:variable name="name" select="/lv:*/@name" />
|
||||
|
||||
<a class="pkg" href="#pkg-{$name}">
|
||||
<a href="#pkg-{$name}" class="pkg sym-ref sym-pkg">
|
||||
<xsl:text>/</xsl:text>
|
||||
<xsl:value-of select="$name" />
|
||||
</a>
|
||||
|
@ -680,7 +690,13 @@
|
|||
<xsl:value-of select="@name" />
|
||||
</xsl:attribute>
|
||||
|
||||
<legend>
|
||||
<xsl:variable name="type"
|
||||
select="if ( local-name() = 'item' ) then
|
||||
'const'
|
||||
else
|
||||
local-name()" />
|
||||
|
||||
<legend class="sym-{$type}">
|
||||
<xsl:variable name="sym"
|
||||
select="/lv:*/preproc:symtable
|
||||
/preproc:sym[ @name=$name ]" />
|
||||
|
@ -913,7 +929,7 @@
|
|||
<xsl:value-of select="@name" />
|
||||
</xsl:attribute>
|
||||
|
||||
<legend>
|
||||
<legend class="sym-type">
|
||||
<xsl:value-of select="@desc" />
|
||||
|
||||
<span class="name">
|
||||
|
@ -965,7 +981,7 @@
|
|||
<xsl:value-of select="@name" />
|
||||
</xsl:attribute>
|
||||
|
||||
<legend>
|
||||
<legend class="sym-type">
|
||||
<xsl:value-of select="@desc" />
|
||||
|
||||
<span class="name">
|
||||
|
@ -1015,7 +1031,7 @@
|
|||
<xsl:for-each select="lv:item">
|
||||
<tr>
|
||||
<td>
|
||||
<a href="#{@name}">
|
||||
<a href="#{@name}" class="sym-ref sym-const">
|
||||
<xsl:value-of select="@name" />
|
||||
</a>
|
||||
</td>
|
||||
|
@ -1073,11 +1089,13 @@
|
|||
<xsl:value-of select="@as" />
|
||||
</xsl:attribute>
|
||||
|
||||
<legend>
|
||||
<legend class="sym-class">
|
||||
<xsl:value-of select="@desc" />
|
||||
<span class="name">
|
||||
<xsl:text> (</xsl:text>
|
||||
<span>
|
||||
<xsl:value-of select="@as" />
|
||||
</span>
|
||||
<xsl:text>)</xsl:text>
|
||||
</span>
|
||||
|
||||
|
@ -1098,7 +1116,10 @@
|
|||
</xsl:attribute>
|
||||
|
||||
<span class="calc-yields">Yields: </span>
|
||||
<xsl:value-of select="@yields" />
|
||||
|
||||
<span class="sym-ref sym-cgen">
|
||||
<xsl:value-of select="@yields" />
|
||||
</span>
|
||||
</div>
|
||||
</xsl:if>
|
||||
</fieldset>
|
||||
|
@ -1174,9 +1195,7 @@
|
|||
-->
|
||||
<xsl:template match="lv:match" priority="5" mode="process-match">
|
||||
<xsl:variable name="on" select="@on" />
|
||||
<xsl:variable name="sym" select="
|
||||
/lv:*/preproc:symtable/preproc:sym[ @name=$on ]
|
||||
" />
|
||||
<xsl:variable name="sym" select="preproc:sym-lookup( $on )" />
|
||||
|
||||
<p class="debugid">
|
||||
<xsl:attribute name="id">
|
||||
|
@ -1184,7 +1203,7 @@
|
|||
<xsl:value-of select="@_id" />
|
||||
</xsl:attribute>
|
||||
|
||||
<a>
|
||||
<a class="sym-ref sym-{$sym/@type}">
|
||||
<xsl:attribute name="href">
|
||||
<xsl:text>#</xsl:text>
|
||||
<xsl:choose>
|
||||
|
@ -1193,7 +1212,7 @@
|
|||
</xsl:when>
|
||||
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="@on" />
|
||||
<xsl:value-of select="$sym/@name" />
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:attribute>
|
||||
|
@ -1318,9 +1337,14 @@
|
|||
@return match HTML
|
||||
-->
|
||||
<xsl:template match="lv:match[@value]" mode="match-desc">
|
||||
<xsl:variable name="value" select="@value" />
|
||||
|
||||
<xsl:variable name="sym"
|
||||
select="/lv:*/preproc:symtable/preproc:sym[ @name=$value ]" />
|
||||
|
||||
<xsl:text>= </xsl:text>
|
||||
|
||||
<a href="#{@value}">
|
||||
<a href="#{@value}" class="sym-ref sym-{$sym/@type}">
|
||||
<xsl:value-of select="@value" />
|
||||
</a>
|
||||
</xsl:template>
|
||||
|
@ -1330,11 +1354,45 @@
|
|||
<xsl:text> be </xsl:text>
|
||||
|
||||
<xsl:text>\(</xsl:text>
|
||||
<xsl:apply-templates select="./c:*" mode="calc-iversons" />
|
||||
<xsl:apply-templates select="./c:*" mode="calc-iversons">
|
||||
<xsl:with-param name="recurse" select="false()" />
|
||||
</xsl:apply-templates>
|
||||
<xsl:text>\) </xsl:text>
|
||||
|
||||
<xsl:apply-templates mode="match-desc"
|
||||
select="c:*/c:*" />
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="c:value-of" mode="match-desc" priority="5">
|
||||
<xsl:variable name="name"
|
||||
select="@name" />
|
||||
|
||||
<xsl:variable name="sym" as="element( preproc:sym )"
|
||||
select="/lv:*/preproc:symtable/preproc:sym[ @name=$name ]" />
|
||||
|
||||
<a href="#{$name}" class="sym-ref sym-{$sym/@type}">
|
||||
<xsl:value-of select="$name" />
|
||||
</a>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="c:const" mode="match-desc" priority="5">
|
||||
<xsl:text>\(</xsl:text>
|
||||
<xsl:value-of select="@value" />
|
||||
<xsl:text>\)</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="c:*" mode="match-desc" priority="1">
|
||||
<xsl:message terminate="yes">
|
||||
<xsl:text>[summary] internal: unknown match calculation for `</xsl:text>
|
||||
<xsl:value-of select="ancestor::c:classify/@as" />
|
||||
<xsl:text>'</xsl:text>
|
||||
</xsl:message>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!--
|
||||
Output function details
|
||||
|
||||
|
@ -1368,7 +1426,7 @@
|
|||
<xsl:value-of select="@name" />
|
||||
</xsl:attribute>
|
||||
|
||||
<legend>
|
||||
<legend class="sym-func">
|
||||
<xsl:text>\(</xsl:text>
|
||||
|
||||
<xsl:choose>
|
||||
|
@ -1461,7 +1519,7 @@
|
|||
<xsl:value-of select="@yields" />
|
||||
</xsl:attribute>
|
||||
|
||||
<legend>
|
||||
<legend class="sym-rate">
|
||||
<xsl:variable name="tex" select="
|
||||
/lv:*/preproc:symtable/preproc:sym[ @name=$name ]/@tex
|
||||
" />
|
||||
|
@ -1474,8 +1532,9 @@
|
|||
<xsl:text>\) </xsl:text>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:text> </xsl:text>
|
||||
|
||||
<span class="yields">
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:value-of select="@yields" />
|
||||
</span>
|
||||
|
||||
|
@ -1536,7 +1595,7 @@
|
|||
" />
|
||||
|
||||
<!-- output description -->
|
||||
<a href="#{$csymid}">
|
||||
<a href="#{$csymid}" class="sym-ref sym-class">
|
||||
<xsl:value-of select="
|
||||
$pkg/lv:*/lv:classify[ @as=$cname ]/@desc
|
||||
" />
|
||||
|
@ -1765,12 +1824,29 @@
|
|||
<xsl:text>, </xsl:text>
|
||||
</xsl:if>
|
||||
|
||||
<span class="tplid">
|
||||
<xsl:text>@</xsl:text>
|
||||
<span class="tplid sym-ref sym-tpl">
|
||||
<xsl:value-of select="@name" />
|
||||
</span>
|
||||
</xsl:for-each>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:if test="@name">
|
||||
<xsl:variable name="name" select="@name" />
|
||||
<xsl:variable name="sym"
|
||||
select="/lv:*/preproc:symtable
|
||||
/preproc:sym[ @name=$name ]" />
|
||||
|
||||
<xsl:variable name="ref"
|
||||
select="if ( $sym/@parent ) then
|
||||
$sym/@parent
|
||||
else
|
||||
$name" />
|
||||
|
||||
<xsl:text> </xsl:text>
|
||||
<a href="#{$ref}" class="sym-ref sym-{$sym/@type}">
|
||||
<xsl:value-of select="$name" />
|
||||
</a>
|
||||
</xsl:if>
|
||||
</legend>
|
||||
|
||||
<xsl:apply-templates select="$c" mode="ultra-breakdown-equ" />
|
||||
|
@ -1915,7 +1991,9 @@
|
|||
<div class="desc">
|
||||
<xsl:value-of select="@desc" />
|
||||
<xsl:text> (</xsl:text>
|
||||
<a href="#{@generates}" class="sym-ref sym-gen">
|
||||
<xsl:value-of select="@generates" />
|
||||
</a>
|
||||
<xsl:text>)</xsl:text>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1993,10 +2071,14 @@
|
|||
|
||||
<!-- basic summary info -->
|
||||
<xsl:template name="summary-info">
|
||||
<div class="tcontent" id="__nb">
|
||||
<div class="tcontent math-typeset-hover" id="__nb">
|
||||
<h2 class="nb">N.B.</h2>
|
||||
<dl class="math-typeset-hover">
|
||||
<dt>Iverson's Convention</dt>
|
||||
<p>
|
||||
This "Summary Page" provides both an overview of the rater as a whole
|
||||
and a breakdown of all of its details on an intimate level.
|
||||
</p>
|
||||
<dl>
|
||||
<dt>Iverson's Brackets</dt>
|
||||
<dd>
|
||||
<p>
|
||||
As is customary for many mathematical notations in CS, this system uses
|
||||
|
@ -2014,37 +2096,44 @@
|
|||
</p>
|
||||
</dd>
|
||||
|
||||
<dt>Sets</dt>
|
||||
<dt>Arrays (Vectors, Matrices, etc.)</dt>
|
||||
<dd>
|
||||
<p>
|
||||
All sequences/arrays of values are represented as matrices.
|
||||
For one-dimensional arrays, column vectors are used; written
|
||||
horizontally, their notation is
|
||||
\(\left[\begin{array}\\x_0 & x_1 & \ldots & x_n\end{array}\right]^T\),
|
||||
where the \(T\) means "transpose".
|
||||
</p>
|
||||
<p>
|
||||
In the equations represented above, it is to be assumed that undefined
|
||||
values in a set are implicitly 0; this simplifies the representations of
|
||||
values in a vector are implicitly \(0\); this simplifies the representations of
|
||||
the various summations; they are not intended to be vigorous.
|
||||
</p>
|
||||
<p>
|
||||
For example: let \( x \) = \( \{ 1, 2, 3 \} \). Given the equation \(
|
||||
For example: let \( x \) = \( \left[\begin{array}\\1 & 2 & 3\end{array}\right]^T \). Given the equation \(
|
||||
\sum_k x_k \), it is assumed that the solution is \( 1 + 2 + 3 = 6 \),
|
||||
not undefined. Formally, the former sum is to be interpreted as: \(
|
||||
\sum_{k=0}^n x_k \) where \( n \) is the length of set \( x \), or \(
|
||||
\sum_{k=0}^n x_k \) where \( n \) is the length of vector \( x \), or \(
|
||||
\sum_k x_k [x_k \textrm{ is defined}] \) using Iverson's convention (the
|
||||
latter of which our first notation is based upon by simply omitting the
|
||||
brackets and implying their existence).
|
||||
</p>
|
||||
</dd>
|
||||
|
||||
<dt>Counting Sets</dt>
|
||||
<dt>Counting Vectors</dt>
|
||||
<dd>
|
||||
Let \(N(S)\) = the number of values within the set \(S\); this notation is
|
||||
Let \(\#V\) = the number of values within the vector \(V\); this notation is
|
||||
used within certain summations. You may also see the following notations:
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
\(\sum_{k} S_k\) to count the number of one-values in boolean set
|
||||
\(S\) (e.g. if \(S\) denotes properties with swimming pools, we can
|
||||
\(\sum_{k} V_k\) to count the number of one-values in boolean vector
|
||||
\(V\) (e.g. if \(V\) denotes properties with swimming pools, we can
|
||||
count the number of swimming pools).
|
||||
</li>
|
||||
<li>
|
||||
\(\sum_{k=0}^{N(S)} 1\) to count the number of values in set \(S\).
|
||||
\(\sum_{k=0}^{\#V-1} 1\) to count the number of values in vector \(V\).
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
|
@ -2059,7 +2148,7 @@
|
|||
<dt>Subscript Precedence</dt>
|
||||
<dd>
|
||||
Subscripts should be applied from right to left. That is:
|
||||
\(S_{x_{y_z}}\) = \(S_{(x_{(y_z)})}\). In the event where a notation may
|
||||
\(V_{x_{y_z}}\) = \(V_{(x_{(y_z)})}\). In the event where a notation may
|
||||
be ambiguous (e.g. \(\theta_{1_x}\), since \(1_x\) could not possibly make
|
||||
sense in the context of this system), parenthesis will always be added to
|
||||
clarify intent.
|
||||
|
@ -2146,4 +2235,17 @@
|
|||
</xsl:template>
|
||||
|
||||
|
||||
<!--
|
||||
TODO: Everything should use this rather than consulting the symbol table
|
||||
directly! Further, anything that does not return a symbol is likely not
|
||||
linked, in which case it should not be rendered at all. Maybe we should
|
||||
output those somewhere.
|
||||
-->
|
||||
<xsl:function name="preproc:sym-lookup" as="element( preproc:sym )">
|
||||
<xsl:param name="name" as="xs:string" />
|
||||
|
||||
<xsl:sequence select="$program/l:dep/preproc:sym[ @name=$name ]" />
|
||||
</xsl:function>
|
||||
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
|
Loading…
Reference in New Issue