diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2015-05-16 00:15:04 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2015-05-16 00:15:04 +0200 |
commit | b55577d0998160c0174e250b542016ecd6ca9056 (patch) | |
tree | 27093212d5ca3e6ffe4ae434c3ec094233ed37ba /tex/context/base/s-structure-sections.mkiv | |
parent | 624cbb5da392e9403984dd1cf368c0d408b1c2a8 (diff) | |
download | context-b55577d0998160c0174e250b542016ecd6ca9056.tar.gz |
2015-05-15 23:06:00
Diffstat (limited to 'tex/context/base/s-structure-sections.mkiv')
-rw-r--r-- | tex/context/base/s-structure-sections.mkiv | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/tex/context/base/s-structure-sections.mkiv b/tex/context/base/s-structure-sections.mkiv new file mode 100644 index 000000000..daaab5abc --- /dev/null +++ b/tex/context/base/s-structure-sections.mkiv @@ -0,0 +1,80 @@ +%D \module +%D [ file=s-structure-sections, +%D version=2015.02.02, +%D title=\CONTEXT\ Style File, +%D subtitle=Show Structure Sections, +%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. + +\unprotect + +\startluacode + local context = context + local ctx_NC, ctx_NR = context.NC, context.NR + local ctx_bold = context.bold + + structures.tracers = structures.tracers or { } + + function structures.tracers.showsections() + + local list = structures.sections.registered + local keys = table.keys(list) + table.sort(keys,function(a,b) + local la, lb = list[a].level, list[b].level + if la == lb then + return a < b + else + return la < lb + end + end) + context.start() + context.switchtobodyfont { "tt" } + context.starttabulate { "||c||||" } + context.FL() + ctx_NC() ctx_bold("name") + ctx_NC() ctx_bold("level") + ctx_NC() ctx_bold("parent") + ctx_NC() ctx_bold("section") + ctx_NC() ctx_bold("coupling") + ctx_NC() context.NR() + context.ML() + for i=1,#keys do + local k = keys[i] + local v = list[k] + ctx_NC() ctx_bold(k) + ctx_NC() context(v.level) + ctx_NC() context(v.parent) + ctx_NC() context(v.section) + ctx_NC() context(v.coupling) + ctx_NC() context.NR() + end + context.LL() + context.stoptabulate() + context.stop() + + end +\stopluacode + + +\starttexdefinition showstructuresections + + % no settings yet + + \ctxlua{structures.tracers.showsections()} + +\stoptexdefinition + +\protect + +\continueifinputfile{s-structure-sections.mkiv} + +\starttext + + \showstructuresections + +\stoptext |