summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/mtx-context-xml.tex
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2017-05-14 19:58:50 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2017-05-14 19:58:50 +0200
commitfd0c4577a4b6e85ca2db664906e1a03807ce133f (patch)
treefa23fcc04248d03ff82e34634b8ef1bb9cf28acb /tex/context/base/mkiv/mtx-context-xml.tex
parentdb581096187dc2d3cbdbe4cdc39d247c168b1607 (diff)
downloadcontext-fd0c4577a4b6e85ca2db664906e1a03807ce133f.tar.gz
2017-05-14 19:15:00
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