diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-05-17 19:31:15 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-05-17 19:31:15 +0200 |
commit | 2017d30b4ca772c8eeac4fc0eb9b54e547a9a1d8 (patch) | |
tree | d96df31f305a095c078ea5fb9f639ca34ac36c12 /tex/context/modules/mkiv/s-languages-system.lua | |
parent | 53ff76b73cd1f373ecdfb0f7f17df6f352621d6e (diff) | |
download | context-2017d30b4ca772c8eeac4fc0eb9b54e547a9a1d8.tar.gz |
2016-05-17 19:25:00
Diffstat (limited to 'tex/context/modules/mkiv/s-languages-system.lua')
-rw-r--r-- | tex/context/modules/mkiv/s-languages-system.lua | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/tex/context/modules/mkiv/s-languages-system.lua b/tex/context/modules/mkiv/s-languages-system.lua new file mode 100644 index 000000000..3b422db9f --- /dev/null +++ b/tex/context/modules/mkiv/s-languages-system.lua @@ -0,0 +1,62 @@ +if not modules then modules = { } end modules ['s-languages-system'] = { + version = 1.001, + comment = "companion to s-languages-system.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +moduledata.languages = moduledata.languages or { } +moduledata.languages.system = moduledata.languages.system or { } + +local NC, NR, HL = context.NC, context.NR, context.HL +local sortedhash = table.sortedhash +local registered = languages.registered +local context = context +local ctx_NC = context.NC +local ctx_NR = context.NR +local ctx_bold = context.bold + +function moduledata.languages.system.loadinstalled() + context.start() + for k, v in table.sortedhash(registered) do + context.language{ k } + end + context.stop() +end + +function moduledata.languages.system.showinstalled() + -- + context.starttabulate { "|l|r|l|l|p(7em)|r|p|" } + context.FL() + ctx_NC() ctx_bold("tag") + ctx_NC() ctx_bold("n") + ctx_NC() ctx_bold("parent") + ctx_NC() ctx_bold("file") + ctx_NC() ctx_bold("synonyms") + ctx_NC() ctx_bold("patterns") + ctx_NC() ctx_bold("characters") + ctx_NC() ctx_NR() + context.FL() + for k, v in sortedhash(registered) do + local parent = v.parent + local resources = v.resources + local patterns = resources and resources.patterns + ctx_NC() context(k) + ctx_NC() context(v.number) + ctx_NC() context(v.parent) + ctx_NC() context(v.patterns) + ctx_NC() for k, v in sortedhash(v.synonyms) do context("%s\\par",k) end + if patterns then + ctx_NC() context(patterns.n) + ctx_NC() context("% t",utf.split(patterns.characters)) + else + ctx_NC() + ctx_NC() + end + ctx_NC() ctx_NR() + end + context.LL() + context.stoptabulate() + -- +end |