summaryrefslogtreecommitdiff
path: root/mod/tex/context/third/rst
diff options
context:
space:
mode:
authorPhilipp Gesang <megas.kapaneus@gmail.com>2011-08-28 16:09:25 +0200
committerPhilipp Gesang <megas.kapaneus@gmail.com>2011-08-28 16:09:25 +0200
commitb01ed84fbebae5c219d3d621c5d2fff67a59f905 (patch)
tree54d07ff9d7dfd2644c445b68f879383046b15c57 /mod/tex/context/third/rst
parent8c8f6783423a44dc0623b0b1f409d3a71457c6ab (diff)
downloadcontext-rst-b01ed84fbebae5c219d3d621c5d2fff67a59f905.tar.gz
updated XML interface; inclusion setup
Diffstat (limited to 'mod/tex/context/third/rst')
-rw-r--r--mod/tex/context/third/rst/t-rst.mkiv31
1 files changed, 29 insertions, 2 deletions
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]{%