summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/mtx-context-xml.tex
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkiv/mtx-context-xml.tex')
-rw-r--r--tex/context/base/mkiv/mtx-context-xml.tex17
1 files changed, 13 insertions, 4 deletions
diff --git a/tex/context/base/mkiv/mtx-context-xml.tex b/tex/context/base/mkiv/mtx-context-xml.tex
index 9d0680e2a..f8bfeef3a 100644
--- a/tex/context/base/mkiv/mtx-context-xml.tex
+++ b/tex/context/base/mkiv/mtx-context-xml.tex
@@ -18,11 +18,15 @@
% 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
\input mtx-context-common.tex
@@ -50,8 +54,10 @@
\starttext
\startluacode
- local pattern = document.arguments.pattern
- local files = document.files
+ 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)
@@ -61,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