diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-08-15 23:17:11 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-08-15 23:17:11 +0200 |
commit | 30b3a925bfc1857a31e23d9b17b8da0be572d02a (patch) | |
tree | 994685218d0ab6c1c65df36dcc5a5a08a231171e /tex/context/base/mkiv/mtx-context-xml.tex | |
parent | 01440ae8999ee20351f0538792e415ade8cd3d5c (diff) | |
download | context-30b3a925bfc1857a31e23d9b17b8da0be572d02a.tar.gz |
2016-08-15 22:45:00
Diffstat (limited to 'tex/context/base/mkiv/mtx-context-xml.tex')
-rw-r--r-- | tex/context/base/mkiv/mtx-context-xml.tex | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/tex/context/base/mkiv/mtx-context-xml.tex b/tex/context/base/mkiv/mtx-context-xml.tex index 8e4d229f5..f8bfeef3a 100644 --- a/tex/context/base/mkiv/mtx-context-xml.tex +++ b/tex/context/base/mkiv/mtx-context-xml.tex @@ -18,12 +18,14 @@ % usage: context --extra=xml [options] list-of-files % % --analyze : show elements and characters +% --template : also export template % --topspace=dimension : distance above first line % --backspace=dimension : distance before left margin % --bodyfont=list : additional bodyfont settings % --paperformat=spec : paper*print or paperxprint % % context --extra=xml --analyze path::i-context.xml +% context --extra=xml --analyze --template path::i-context.xml % context --extra=xml --analyze selfautoparent:texmf-context/tex/context/interface/mkiv/i-*.xml % end help @@ -52,8 +54,10 @@ \starttext \startluacode - local files = document.files - local pattern = document.arguments.pattern or (#files == 1 and files[1]) + local files = document.files + local pattern = document.arguments.pattern or (#files == 1 and files[1]) + local analyze = document.arguments.analyze + local template = document.arguments.template if pattern then files = dir.glob(pattern) @@ -63,12 +67,15 @@ end if #files > 0 then - if document.arguments.analyze then - moduledata.xml.analyzers.structure (files) + if analyze then + moduledata.xml.analyzers.structure(files) context.page() moduledata.xml.analyzers.characters(files) context.page() moduledata.xml.analyzers.entities(files) + if template then + moduledata.xml.analyzers.allsetups(files,type(template) == "string" and template or nil) + end else context("no action given") end |