summaryrefslogtreecommitdiff
path: root/tex/context/modules/mkiv/s-references-identify.mkiv
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2019-02-22 20:29:46 +0100
committerContext Git Mirror Bot <phg@phi-gamma.net>2019-02-22 20:29:46 +0100
commit7b271baae19db1528fbe6621bdf50af89a5a336b (patch)
tree4fc24a8f2be20aa90e90f6e1bcb62d69f4946235 /tex/context/modules/mkiv/s-references-identify.mkiv
parent67b9965fe473d18f13ed4c40f1e4e008eb870322 (diff)
downloadcontext-7b271baae19db1528fbe6621bdf50af89a5a336b.tar.gz
2019-02-22 19:43:00
Diffstat (limited to 'tex/context/modules/mkiv/s-references-identify.mkiv')
-rw-r--r--tex/context/modules/mkiv/s-references-identify.mkiv69
1 files changed, 69 insertions, 0 deletions
diff --git a/tex/context/modules/mkiv/s-references-identify.mkiv b/tex/context/modules/mkiv/s-references-identify.mkiv
new file mode 100644
index 000000000..85187be9d
--- /dev/null
+++ b/tex/context/modules/mkiv/s-references-identify.mkiv
@@ -0,0 +1,69 @@
+%D \module
+%D [ file=s-references-identity,
+%D version=2018.09.15,
+%D title=\CONTEXT\ Style File,
+%D subtitle=Analyze References,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+% begin info
+%
+% title : analyze reference
+%
+% comment : show the building blocks of a reference (list)
+%
+% end info
+
+\startmodule[references-identify]
+
+\startluacode
+
+moduledata.references = moduledata.references or { }
+
+local context = context
+local NC, NR = context.NC, context.NR
+local bold = context.bold
+local text = context
+
+function moduledata.references.show(str)
+ local t = structures.references.identify(str)
+ context.starttabulate { "|T|T|T|" }
+ for i=1,#t do
+ if i == 1 then
+ context.FL()
+ else
+ context.ML()
+ end
+ local ti = t[i]
+ NC() bold(i) NC() bold("reference") NC() bold(ti.reference) NC() NR()
+ NC() NC() text("kind") NC() text(ti.kind) NC() NR()
+ NC() NC() text("operation") NC() text(ti.operation) NC() NR()
+ NC() NC() text("arguments") NC() text(ti.arguments) NC() NR()
+ NC() NC() text("special") NC() text(ti.special) NC() NR()
+ end
+ context.LL()
+ context.stoptabulate()
+end
+
+\stopluacode
+
+\installmodulecommandluasingle \showreference {moduledata.references.show}
+
+\stopmodule
+
+\continueifinputfile{s-references-identify.mkiv}
+
+\usemodule[art-01]
+
+\starttext
+
+ \showreference[page(123),StartMovie{mymovie}]
+ \showreference[JS(Forget_Changes),CloseDocument]
+ \showreference[manual::contents]
+
+\stoptext