From b01ed84fbebae5c219d3d621c5d2fff67a59f905 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 28 Aug 2011 16:09:25 +0200 Subject: updated XML interface; inclusion setup --- mod/tex/context/interface/third/t-rst.xml | 38 +++++++++++++++++++++++++++++++ mod/tex/context/third/rst/t-rst.mkiv | 31 +++++++++++++++++++++++-- 2 files changed, 67 insertions(+), 2 deletions(-) (limited to 'mod/tex/context') diff --git a/mod/tex/context/interface/third/t-rst.xml b/mod/tex/context/interface/third/t-rst.xml index cce4f3a..40015e2 100644 --- a/mod/tex/context/interface/third/t-rst.xml +++ b/mod/tex/context/interface/third/t-rst.xml @@ -42,4 +42,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mod/tex/context/third/rst/t-rst.mkiv b/mod/tex/context/third/rst/t-rst.mkiv index 7971e3f..35ba054 100644 --- a/mod/tex/context/third/rst/t-rst.mkiv +++ b/mod/tex/context/third/rst/t-rst.mkiv @@ -178,14 +178,41 @@ \ctxlua{thirddata.rst.do_rst_snippet(\!!bs#1\!!es)}% } -\def\do_define_RST_inclusion[#1][#2]{% +%D \subsection{Including multiple reST files} +%D +%D \macros +%D {defineRSTinclusion,startRSTproject,RSTinclusion} +%D +%D When content is split among multiple files, these macros allow +%D for including them in arbitrary order. Note that setups from +%D previous includes, unless overwritten, will remain defined. +%D \type{\defineRSTinclusion} takes three arguments: the first one +%D will be the identifier that can be used to refer to the actual +%D inclusion, which is specified via the second argument as a +%D filename. The third optional argument receives the usual +%D setups \type{stripBOM}, \type{expandtab} and +%D \type{shiftwidth}. +%D +%D Defined inclusions can be typeset only within an the +%D \type{\startRSTproject} environment using the macro +%D \type{RSTinclusion}. Between those inclusion all kinds of +%D \TEX\ code except for \type{\starttext} and \type{\stoptext} +%D are permitted. + +\def\do_define_RST_inclusion[#1][#2][#3]{% + \ifthirdargument + \getparameters[RST][#3]% + \doifdefined{RSTstripBOM} {\ctxlua{thirddata.rst.strip_BOM = \RSTstripBOM}}% + \doifdefined{RSTexpandtab} {\ctxlua{thirddata.rst.expandtab = \RSTexpandtab}}% + \doifdefined{RSTshiftwidth}{\ctxlua{thirddata.rst.shiftwidth = \RSTshiftwidth}}% + \fi \ifsecondargument \ctxlua{thirddata.rst.do_rst_inclusion("#1", "#2")}% \fi% } \def\defineRSTinclusion{% - \dodoubleempty\do_define_RST_inclusion% + \dotripleempty\do_define_RST_inclusion% } \def\do_RST_inclusion[#1]{% -- cgit v1.2.3