I've ended up delving into the dark art that is Lua for this solution:

\define[0]\SummaryTable{%
\placetable[force, none]{}{%
\setupTABLE[frame=off]
\bTABLE
\bTABLEhead
\bTR\bTH Reference\eTH\bTH Title\eTH\bTH Page\eTH\eTR
\eTABLEhead
\bTABLEbody
\startluacode
    for k, v in ipairs(structures.lists.collected) do
        if v.metadata.kind == "section" and v.metadata.name == "section" then
            context.bTR()
                context.bTD()
                    context("REFREF")
                context.eTD()
                context.bTD()
                    context(v.titledata.title)
                context.eTD()
                context.bTD()
                    context(v.references.realpage)
                context.eTD()
            context.eTR()
        end
    end
\stopluacode%
\eTABLEbody
\eTABLE
}%
}%
\starttext
\section{Test}
\input{knuth}
\section{Test}
\input{knuth}
\section{Test}
\input{knuth}
\section{Test}
\input{knuth}
\section{Test}
\input{knuth}
\section{Test}
\input{knuth}
\section{Test}
\input{knuth}
\SummaryTable
\stoptext

This works to some degree though I have the following questions about it:

1. Is there a way to access a document global variable from Lua? I
will use this to replace the REFREF text.

2. v.references.realpage isn't the actual page of the title. How can I
access the page number that would have appeared in the ToC? (I've
restarted the page numbering in my master doc, the above example works
fine)

3. Is there a way to store some metadata along with my title? I'd like
something similar to this:
\myheader[author=me, date=2011-12-14]{This is my header with meta-data}
and then be able to access it from Lua again.

Thanks for any help you can give with this.

Felix
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to