diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/back-exp.mkiv')
-rw-r--r-- | Master/texmf-dist/tex/context/base/mkiv/back-exp.mkiv | 93 |
1 files changed, 67 insertions, 26 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/back-exp.mkiv b/Master/texmf-dist/tex/context/base/mkiv/back-exp.mkiv index 48f4d3c4871..ad5ba837121 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/back-exp.mkiv +++ b/Master/texmf-dist/tex/context/base/mkiv/back-exp.mkiv @@ -13,7 +13,7 @@ \writestatus{loading}{ConTeXt Backend Macros / XML export} -\registerctxluafile{back-exp.lua}{1.001} +\registerctxluafile{back-exp}{} %D This is an experimental exporter and a logical follow up on tagging. The %D exporter assumes a properly tagged document. Some elements get a couple @@ -94,7 +94,9 @@ \appendtoks \unexpanded\def\dotagtabulatecell - {\iftrialtypesetting\else\clf_settagtabulatecell\c_tabl_tabulate_align\fi}% + {\iftrialtypesetting\else + \clf_settagtabulatecell\c_tabl_tabulate_align\c_tabl_tabulate_kind + \fi}% \unexpanded\def\dotagtabulatesignal {\dontleavehmode\signalcharacter\ignorespaces}% \to \everyenableelements @@ -110,9 +112,26 @@ \to \everyenableelements \appendtoks % frozen and assumed global per highlight class + \unexpanded\def\dotagconstruct + {\iftrialtypesetting\else + \clf_settagconstruct + {\currentstartstop}% + {\startstopparameter\c!style}% + \attribute\colorattribute + \ifvmode\plusone\else\zerocount\fi + \relax + \fi}% +\to \everyenableelements + +\appendtoks % frozen and assumed global per highlight class \unexpanded\def\dotaghighlight {\iftrialtypesetting\else - \clf_settaghighlight{\highlightparameter\c!style}\attribute\colorattribute\relax + \clf_settaghighlight + {\currenthighlight}% + {\highlightparameter\c!style} + \attribute\colorattribute + \ifvmode\plusone\else\zerocount\fi + \relax \fi}% \to \everyenableelements @@ -209,6 +228,13 @@ \to \everyenableelements \appendtoks + \unexpanded\def\dotagregisterfloat#1#2% + {\iftrialtypesetting\else + \clf_settagfloat{#1}{#2}\relax + \fi}% +\to \everyenableelements + +\appendtoks \let\specialfixedspace \explicitfixedspace \let\specialobeyedspace \explicitobeyedspace \let\specialstretchedspace\explicitstretchedspace @@ -239,10 +265,27 @@ \c!properties=\v!no, % no: ignore, yes: as attribute, otherwise: use as prefix \c!hyphen=\v!no, \c!svgstyle=, - \c!cssfile=] + \c!cssfile=, + \c!file={\backendparameter\c!export}] % downward compatibility + +\resetsystemmode\v!export + +\unexpanded\def\doinitializeexport + {\edef\p_export{\backendparameter\c!export}% + \ifx\p_export\empty \else + \setuptagging[\c!state=\v!start]% + \clf_initializeexport + \setsystemmode\v!export + \exportingtrue + \writestatus\m!backend\empty % so messages will stand out a bit + \the\everyinitializeexport + \writestatus\m!backend\empty % so messages will stand out a bit + \glet\doinitializeexport\relax + \fi} -\def\dosynchronizeexport - {\let\currentexport\empty +\unexpanded\def\dostartexport + {%\glet\dostartexport\relax + \let\currentexport\empty \clf_setupexport align {\exportparameter\c!align}% bodyfont \dimexpr\exportparameter\c!bodyfont\relax @@ -256,37 +299,35 @@ lastpage {\exportparameter\c!lastpage}% svgstyle {\exportparameter\c!svgstyle}% cssfile {\exportparameter\c!cssfile}% + file {\exportparameter\c!file}% \relax} +\unexpanded\def\dostopexport + {\glet\dostopexport\relax + \clf_finishexport} + +\appendtoks + \doinitializeexport +\to \everysetupbackend + \appendtoks - \doifsomething{\backendparameter\c!export}\dosynchronizeexport + \ifexporting + \dostartexport + \fi \to \everystarttext % better (before pdf gets closed, so we can embed), but it needs testing: \appendtoks - \clf_finishexport + \ifexporting + \dostopexport + \fi \to \everystoptext \appendtoks - \doifsomething{\backendparameter\c!export}\dosynchronizeexport % in case it is done inside \starttext + \ifexporting + \dostartexport % in case it is done inside \starttext + \fi \to \everysetupdocument -% \appendtoks -% \doifsomething{\backendparameter\c!xhtml} -% {\enabledirectives[backend.export.xhtml=\backendparameter\c!xhtml]}% -% \doifsomething{\backendparameter\c!css} -% {\enabledirectives[backend.export.css={\backendparameter\c!css}]}% -% \doifsomething{\backendparameter\c!alternative} -% {\enabledirectives[backend.export.alternative={\backendparameter\c!alternative}]}% -% \to \everysetupbackend - -\appendtoks - \doifelsenothing{\backendparameter\c!export} - {\resetsystemmode\v!export} - {\setuptagging[\c!state=\v!start]% - \enabledirectives[backend.export=\backendparameter\c!export]% - \setsystemmode\v!export}% -\to \everysetupbackend - \protect \endinput |