Here is a real-world example. I am an academic and I write my grant proposals using ConTeXt. The formatting guidelines are relatively simple (use this font, set these margins, and that's about it). I usually submit to two funding agencies, FRQNT and NSERC, and they have slightly different formatting instructions. Occasionally, I also write a generic proposal that is submitted to other agencies.
I have a private module p-proposal to take care of the different formatting requirements. Since this was for personal use, most of it was undocumented. I have added brief explanations in the comments; if something doesn't make sense, feel free to ask:
\startmodule proposal
\setupmodule[size=10pt, alternative=default]
\processaction
[\currentmoduleparameter{alternative}]
[
default=>{\enablemode[compact]},
frqnt=>{\enablemode[frqnt]},
nserc=>{\enablemode[nserc]},
]
% Grants to FRQNT should be in 10bp.
\startmode[frqnt]
\setupmodule[site=10bp]
\stopmode
% Grants to NSERC should be in 12pt.
\startmode[nserc]
\setupmodule[size=12pt]
\stopmode
% Enable microtype protrusion.
\definefontfeature
[default]
[default]
[protrusion=quality,expansion=quality]
\setupalign[hanging,tolerant]
% Most grant agencies want Times. Use MS Times rather than
% some other clone like Termes; I once had a grant application
% returned because pdffonts didn't list Times!
\usetypescriptfile[mscore]
\usetypescriptfile[texgyre]
\usetypescriptfile[euler]
\starttypescript[mainface]
\definetypeface [mainface][rm][serif][mscoretimes][default]
\definetypeface [mainface][ss][sans] [helvetica][default] [rscale=auto]
\definetypeface [mainface][tt][mono] [modern] [default] [rscale=auto]
\definetypeface [mainface][mm][math] [pagellaovereuler] [default]
[rscale=0.9]
\stoptypescript
% I tend to use math sparingly, therefore the math font is Euler.
% Set all math characters to be upright rather than italic.
\setupmathematics[default=normal, lcgreek=normal, ucgreek=normal]
% I don't like Euler bullets (when used in itemize); take bullets
% from the text font instead.
\setupsymbolset[text]
% MS Times does not have small caps. The headers are typeset in small caps.
% So, use Termes for headers.
\starttypescript[headerface]
\definetypeface [headerface][rm][serif][termes][default]
\definetypeface [headerface][ss][sans] [helvetica][default] [rscale=auto]
\definetypeface [headerface][tt][mono] [modern] [default] [rscale=auto]
\definetypeface [headerface][mm][math] [pagellaovereuler] [default] [rscale=auto]
\stoptypescript
\setupbodyfont[headerface] % To initialize the header font globally
\setupbodyfont[mainface,\currentmoduleparameter{size}]
% \em should be italic rather than slanted.
\definebodyfontenvironment[default][em=italic]
% Many funding agencies cannot handle a higher PDF version, sigh!
\pdfminorversion 4
\setuppapersize[letter][letter]
\setuplayout[
width=middle,
height=middle,
location=middle,
topspace=0.75in,
bottomspace=0.75in,
bottom=0.25in,
backspace=1in,
cutspace=1in,
leftmargin=.45in,
rightmargin=.45in,
leftmargindistance=0.05in,
rightmargindistance=0.05in,
header=0.20in,
footer=0.20in,
headerdistance=0.05in,
footerdistance=0.05in,
]
\startmode[compact,frqnt, nserc]
\setuplayout
[
topspace=0.5in, bottomspace=0.5in,
backspace=0.75in, cutspace=0.75in, width=middle,
footer=0pt, footerdistance=0pt,
]
\stopmode
\startmode[frqnt,nserc]
\setupinterlinespace[line=12.25bp]
\stopmode
\setuppagenumbering[location=]
\setupheader[style={\switchtobodyfont[headerface]\sc}]
\setupfooter[style={\switchtobodyfont[headerface]\sc}]
\setupbottom[style={\switchtobodyfont[headerface]\sc}]
\setupbackgrounds[header][text][bottomframe=on]
\startmode[compact]
\setuphead[section,subject]
[number=no, style=bold, alternative=text,before={\blank[small]},distance=0.25em,after=]
\def\deepstructuretitlecommand#1{#1:}
\stopmode
\setuphead[title][alternative=middle, style=\ssbfb]
\startnotmode[compact]
\setuphead[section,subject]
[style=\ssbfa, before={\blank[big]}, after={\blank[medium]}]
\setuphead[subsection,subsubject]
[style=\ssbf, before={\blank[medium]}, after={\blank[small]}]
\stopnotmode
\startmode[frqnt, nserc]
\setuphead[section,subject]
[style=\bfa,before={\blank[small]}, after={\blank[none]}]
\setuphead[subsection,subsubsection]
[style=\bf,%alternative=text,
deeptextcommand=\groupedcommand{}{\removeunwantedspaces:},
distance=1ex,
before={\blank[small]}]
\setuphead[subsection,subsubsection, subsubsubsection, subsubject]
[style=\bf,alternative=text,
deeptextcommand=\groupedcommand{}{\removeunwantedspaces:},
distance=1ex,
before={\blank[small]}]
\stopmode
% Be more linient with hyphenation.
\definebreakpoint [compound] [-] [nleft=2,nright=2]
\setbreakpoints [compound]
\setupindenting[medium,yes]
\setupwhitespace[none]
\setupblank[halfline]
\startmode[compact]
\setupitemize[nowhite]
\setupitemize[margin=2em]
\stopmode
\definehighlight[important][style=bolditalic]
\definecolor[lightyellow][r=1,g=1,b=0.88]
\setupframedtext
[
width=broad,
offset=5bp,
align={hanging,hz},
background={color},
backgroundcolor=lightyellow,
rulethickness=1bp,
frame=on,
framecolor=black,
]
\setupitemize[autointro, broad, fit]
\setupitemize[distance=0.5em, indentnext=auto]
\definetabulate[titletabulate][|k0lB|i1p|]
\setuptabulate[titletabulate][unit=0.25em]
\setupcaptions[style={\small\setupinterlinespace}, distance=0.5em]
\setupfloats[sidespaceafter=0pt]
\setupformula
[
spacebefore={nowhite,fixed,quarterline},
spaceafter={back,fixed,nowhite,halfline},
]
\stopmodule
To show the output, I use the following test file:
% Change the alternative for different results
\usemodule[proposal][alternative=default]
% The header should be the title of the grant and the PIN of the PI
\startmode[nserc,frqnt]
\setupheadertexts[\fakewords{3}{4}][PIN: 12345]
\stopmode
\usemodule[visual]
\starttext
%In the generic proposal, the title is given at the top
\startnotmode[frqnt,nserc]
\starttitletabulate
\NC Project \NC \fakewords{5}{10} \NC \NR
\NC Investigators \NC \fakewords{3}{5} \NC \NR
\stoptitletabulate
\stopnotmode
\dorecurse{6}
{\section{\fakewords{3}{7}}
\dorecurse{2}
{\fakewords{100}{200}\endgraf
\placefigure[left]{\fakewords{4}{8}}{\fakeimage{4cm}{3cm}{5cm}{6cm}}
\dorecurse{2}{\fakewords{100}{200}\endgraf}}}
\stoptext
With alternative=frqnt the output is

With alternative=nserc the output is almost the same but uses a bigger font:

With alternative=default, the output is:

]at the end giving an error when you visit the page. – daleif May 04 '16 at 12:38\starttext ... \stoptextit's difficult to know what to say here. – Joseph Wright May 04 '16 at 12:39