<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<!--
    filename : context-debug.lmx
    comment  : companion to context.tex
    author   : Hans Hagen, PRAGMA-ADE, Hasselt NL
    copyright: PRAGMA ADE / ConTeXt Development Team
    license  : see context related readme files
-->

<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    <head>
        <script type='text/javascript'>
            <!--
                window.focus();
            -->
        </script>
        <title><?lua pv('title') ?></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <style type="text/css">
            <!--
                <?lmx-include context.css ?>
                #type {
                    text-align: center ;
                }
                #variable {
                    width: 10em ;
                    text-align: right ;
                    margin-right: 1em ;
                }
                #value {
                    text-align: left ;
                }
            -->
        </style>
    </head>
    <body>
        <div id="top"><div id="top-one"><div id="top-two">
            <?lua pv('title') ?>
        </div></div></div>
        <div id="left"><div id="left-one"><div id="left-two">
            <!-- empty -->
        </div></div></div>
        <div id="right"><div id="right-safari"><div id="right-one"><div id="right-two"><div id="right-three"><div id="right-four"><div id="right-five">
            <!-- empty -->
        </div></div></div></div></div></div></div>
        <div id="main"><div id='main-settings'>
        <?lua if tracers.knownlist('scratch') then ?>
            <h1>Scratch Variables</h1>
            <table>
                <tr>
                    <th align='middle'>index</th>
                    <th align='middle'>&nbsp;&nbsp;&nbsp;dimen</th>
                    <th align='middle'>&nbsp;&nbsp;&nbsp;count</th>
                    <th align='left'  >&nbsp;&nbsp;&nbsp;toks</th>
                </tr>
            <?lua for k,v in pairs(tracers.list['scratch']) do ?>
                <tr>
                    <th align='middle'><?lua t(v) ?></th>
                    <th align='middle'>&nbsp;&nbsp;&nbsp;<?lua t(tracers.dimen(v)) ?></th>
                    <th align='middle'>&nbsp;&nbsp;&nbsp;<?lua t(tracers.count(v)) ?></th>
                    <th align='left'  >&nbsp;&nbsp;&nbsp;<?lua t(tracers.toks (v)) ?></th>
                </tr>
            <?lua end ?>
            </table>
            <br/>
        <?lua end ?>
        <?lmx-define-begin tvv-head ?>
                <tr>
                    <th><div id="type"    >type    </div></th>
                    <th><div id="variable">variable</div></th>
                    <th><div id="value"   >value   </div></th>
                </tr>
        <?lmx-define-end ?>
        <?lmx-define-begin tvv-body ?>
                <tr>
                    <th><div id="type"    ><?lua t(tracers.type(v)) ?></div></th>
                    <th><div id="variable"><?lua t(tracers.name(v)) ?></div></th>
                    <th><div id="value"   ><?lua t(tracers.cs(v))   ?></div></th>
                </tr>
        <?lmx-define-end ?>
        <?lua if tracers.knownlist('internals') then ?>
            <h1>Internal Variables</h1>
            <table>
                <?lmx-resolve tvv-head ?>
            <?lua for k,v in pairs(tracers.list['internals']) do ?>
                <?lmx-resolve tvv-body ?>
            <?lua end ?>
            </table>
            <br/>
        <?lua end ?>
        <?lua if tracers.knownlist('context') then ?>
            <h1>ConTeXt Variables</h1>
            <table>
                <?lmx-resolve tvv-head ?>
            <?lua for k,v in pairs(tracers.list['context']) do ?>
                <?lmx-resolve tvv-body ?>
            <?lua end ?>
            </table>
            <br/>
        <?lua end ?>
        </div></div>
        <div id="bottom"><div id="bottom-one"><div id="bottom-two">
            Job Name: <?lua p(environment.jobname) ?> &nbsp;&nbsp;&nbsp;
            ConTeXt Version: <?lua p(environment.version) ?> &nbsp;&nbsp;&nbsp;
            Real Page: <?lua p(tracers.cs('c:realpageno')) ?> &nbsp;&nbsp;&nbsp;
            Page: <?lua p(tracers.cs('c:pageno')) ?> &nbsp;&nbsp;&nbsp;
        </div></div></div>
    </body>
</html>
