summaryrefslogtreecommitdiff
path: root/tex/context/base/x-pending.mkiv
blob: 20fe5fb6ae2082e07455f81cecd469722600e4db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
%D \module
%D   [      file=x-pending,
%D        version=2008.04.04,
%D          title=\CONTEXT\ Style File,
%D       subtitle=Track \MKII\ \XML\ usage in \MKIV,
%D         author=Hans Hagen,
%D           date=\currentdate,
%D      copyright={PRAGMA / Hans Hagen \& Ton Otten}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

%D Including this module will result in the production of
%D a file \type {jobname-pending-xml.log} which has a
%D \LUA\ table with \XML\ elements that are still catched by
%D \MKII\ code, when enabled.

\startluacode
    dofile(resolvers.find_file("lxml-inf.lua"))
    local list = { }
    function document.check_pending_xml_element(str)
        list[str] = (list[str] and (list[str]+1)) or 1
    end
    function document.show_pending_xml_elements()
        io.savedata("\jobname-pending-xml-mkii.log", table.serialize(list))
        io.savedata("\jobname-pending-xml-mkiv.log", table.serialize(lxml.get_command_status()))
    end
\stopluacode

\defineXMLcommand
  [default]
  {\ctxlua{document.check_pending_xml_element("\currentXMLelement")}}

\appendtoks
    \ctxlua{document.show_pending_xml_elements()}%
\to \everystoptext

\endinput