summaryrefslogtreecommitdiff
path: root/doc/context/sources/general/manuals/workflows
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2015-03-09 20:15:05 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2015-03-09 20:15:05 +0100
commitdc98ffdc842271d05903846b460fab90d4d83739 (patch)
tree49603cd805408ebdde3a7eafc59c40279dc7e9ad /doc/context/sources/general/manuals/workflows
parent08128a9710f7a34e16f7487b3bccfe7feadb36f1 (diff)
downloadcontext-dc98ffdc842271d05903846b460fab90d4d83739.tar.gz
2015-03-09 19:29:00
Diffstat (limited to 'doc/context/sources/general/manuals/workflows')
-rw-r--r--doc/context/sources/general/manuals/workflows/workflows-mkiv.tex1
-rw-r--r--doc/context/sources/general/manuals/workflows/workflows-setups.tex72
-rw-r--r--doc/context/sources/general/manuals/workflows/workflows-style.tex1
3 files changed, 73 insertions, 1 deletions
diff --git a/doc/context/sources/general/manuals/workflows/workflows-mkiv.tex b/doc/context/sources/general/manuals/workflows/workflows-mkiv.tex
index 3070a5be6..919b5cc74 100644
--- a/doc/context/sources/general/manuals/workflows/workflows-mkiv.tex
+++ b/doc/context/sources/general/manuals/workflows/workflows-mkiv.tex
@@ -24,6 +24,7 @@
\component workflows-suspects
\component workflows-injectors
\component workflows-xml
+ \component workflows-setups
\stopbodymatter
\stopdocument
diff --git a/doc/context/sources/general/manuals/workflows/workflows-setups.tex b/doc/context/sources/general/manuals/workflows/workflows-setups.tex
new file mode 100644
index 000000000..e9d120f7b
--- /dev/null
+++ b/doc/context/sources/general/manuals/workflows/workflows-setups.tex
@@ -0,0 +1,72 @@
+% language=uk
+
+\environment workflows-style
+
+\startcomponent workflows-setups
+
+\startchapter[title={Setups}]
+
+Setups are a powerful way to organize styles. They are basically macros but live
+in their own namespace. One advantage is that spaces in a setup are ignored so
+you can code without bothering about spurious spaces. Here is a trick that you
+can use when one style contains directives for multiple products:
+
+\startbuffer
+\startsetups tex:whatever
+ \fastsetup{tex:whatever:\documentvariable{stylevariant}}
+\stopsetups
+
+\startsetups tex:whatever:foo
+ FOO
+\stopsetups
+
+\startsetups tex:whatever:bar
+ BAR
+\stopsetups
+\stopbuffer
+
+\typebuffer \getbuffer
+
+Here we define a main setup \type {tex:whatever} that gets expanded in one of two
+variants, controlled by a document variable.
+
+\startbuffer
+\setups{tex:whatever}
+
+\setupdocument
+ [stylevariant=foo]
+
+\setups{tex:whatever}
+
+\setupdocument
+ [stylevariant=bar]
+
+\setups{tex:whatever}
+\stopbuffer
+
+\typebuffer
+
+These lines result in:
+
+\getbuffer
+
+In a similar fashion you can define \XML\ setups that are used to render
+elements:
+
+\starttyping
+\startxmlsetups xml:whatever
+ \xmlsetup{#1}{xml:whatever:\documentvariable{stylevariant}}
+\stopxmlsetups
+
+\startxmlsetups xml:whatever:foo
+ FOO: \xmlflush{#1}
+\stopxmlsetups
+
+\startxmlsetups xml:whatever:bar
+ BAR: \xmlflush{#1}
+\stopxmlsetups
+\stoptyping
+
+\stopchapter
+
+\stopcomponent
diff --git a/doc/context/sources/general/manuals/workflows/workflows-style.tex b/doc/context/sources/general/manuals/workflows/workflows-style.tex
index ed64da6b2..9d46aaad8 100644
--- a/doc/context/sources/general/manuals/workflows/workflows-style.tex
+++ b/doc/context/sources/general/manuals/workflows/workflows-style.tex
@@ -35,7 +35,6 @@
\setuptype
[color=maincolor]
-
\setupdocument
[metadata:author=<author>,
metadata:title=<title>,