summaryrefslogtreecommitdiff
path: root/tests/writer.context
diff options
context:
space:
mode:
Diffstat (limited to 'tests/writer.context')
-rw-r--r--tests/writer.context274
1 files changed, 132 insertions, 142 deletions
diff --git a/tests/writer.context b/tests/writer.context
index 9c3221c31..3aaf8c14b 100644
--- a/tests/writer.context
+++ b/tests/writer.context
@@ -1,54 +1,41 @@
-\enableregime[utf] % use UTF-8
+\startmode[*mkii]
+ \enableregime[utf-8]
+ \setupcolors[state=start]
+\stopmode
-\setupcolors[state=start]
-\setupinteraction[state=start, color=middleblue] % needed for hyperlinks
+% Enable hyperlinks
+\setupinteraction[state=start, color=middleblue]
-\setuppapersize[letter][letter] % use letter paper
-\setuplayout[width=middle, backspace=1.5in, cutspace=1.5in,
- height=middle, header=0.75in, footer=0.75in] % page layout
-\setuppagenumbering[location={footer,center}] % number pages
-\setupbodyfont[11pt] % 11pt font
-\setupwhitespace[medium] % inter-paragraph spacing
+\setuppapersize [letter][letter]
+\setuplayout [width=middle, backspace=1.5in, cutspace=1.5in,
+ height=middle, topspace=0.75in, bottomspace=0.75in]
-\setuphead[section][style=\tfc]
-\setuphead[subsection][style=\tfb]
-\setuphead[subsubsection][style=\bf]
+\setuppagenumbering[location={footer,center}]
-% define descr (for definition lists)
-\definedescription[descr][
- headstyle=bold,style=normal,align=left,location=hanging,
- width=broad,margin=1cm]
+\setupbodyfont[11pt]
-% prevent orphaned list intros
-\setupitemize[autointro]
+\setupwhitespace[medium]
-% define defaults for bulleted lists
-\setupitemize[1][symbol=1][indentnext=no]
-\setupitemize[2][symbol=2][indentnext=no]
-\setupitemize[3][symbol=3][indentnext=no]
-\setupitemize[4][symbol=4][indentnext=no]
+\setuphead[section] [style=\tfc,number=no]
+\setuphead[subsection] [style=\tfb,number=no]
+\setuphead[subsubsection][style=\bf,number=no]
-\setupthinrules[width=15em] % width of horizontal rules
+\definedescription
+ [description]
+ [headstyle=bold, style=normal, location=hanging, width=broad, margin=1cm]
-% for block quotations
-\unprotect
+\setupitemize[autointro] % prevent orphan list intro
+\setupitemize[indentnext=no]
-\startvariables all
-blockquote: blockquote
-\stopvariables
-
-\definedelimitedtext
-[\v!blockquote][\v!quotation]
+\setupthinrules[width=15em] % width of horizontal rules
\setupdelimitedtext
-[\v!blockquote]
-[\c!left=,
-\c!right=,
-before={\blank[medium]},
-after={\blank[medium]},
-]
+ [blockquote]
+ [before={\blank[medium]},
+ after={\blank[medium]},
+ indentnext=no,
+ ]
-\protect
\starttext
\startalignment[center]
@@ -66,31 +53,32 @@ markdown test suite.
\thinrule
-\subject{Headers}
+\section[headers]{Headers}
-\subsubject{Level 2 with an \useURL[1][/url][][embedded link]\from[1]}
+\subsection[level-2-with-an-embedded-link]{Level 2 with an
+\useURL[url1][/url][][embedded link]\from[url1]}
-\subsubsubject{Level 3 with {\em emphasis}}
+\subsubsection[level-3-with-emphasis]{Level 3 with {\em emphasis}}
-\subsubsubsubject{Level 4}
+\subsubsubsection[level-4]{Level 4}
-\subsubsubsubsubject{Level 5}
+\subsubsubsubsection[level-5]{Level 5}
-\subject{Level 1}
+\section[level-1]{Level 1}
-\subsubject{Level 2 with {\em emphasis}}
+\subsection[level-2-with-emphasis]{Level 2 with {\em emphasis}}
-\subsubsubject{Level 3}
+\subsubsection[level-3]{Level 3}
with no blank line
-\subsubject{Level 2}
+\subsection[level-2]{Level 2}
with no blank line
\thinrule
-\subject{Paragraphs}
+\section[paragraphs]{Paragraphs}
Here's a regular paragraph.
@@ -105,7 +93,7 @@ here.
\thinrule
-\subject{Block Quotes}
+\section[block-quotes]{Block Quotes}
E-mail style:
@@ -148,7 +136,7 @@ And a following paragraph.
\thinrule
-\subject{Code Blocks}
+\section[code-blocks]{Code Blocks}
Code:
@@ -172,9 +160,9 @@ These should not be escaped: \$ \\ \> \[ \{
\thinrule
-\subject{Lists}
+\section[lists]{Lists}
-\subsubject{Unordered}
+\subsection[unordered]{Unordered}
Asterisks tight:
@@ -242,7 +230,7 @@ Minuses loose:
Minus 3
\stopitemize
-\subsubject{Ordered}
+\subsection[ordered]{Ordered}
Tight:
@@ -301,7 +289,7 @@ Multiple paragraphs:
Item 3.
\stopitemize
-\subsubject{Nested}
+\subsection[nested]{Nested}
\startitemize
\item
@@ -355,7 +343,7 @@ Same thing but with paragraphs:
Third
\stopitemize
-\subsubject{Tabs and spaces}
+\subsection[tabs-and-spaces]{Tabs and spaces}
\startitemize
\item
@@ -371,7 +359,7 @@ Same thing but with paragraphs:
\stopitemize
\stopitemize
-\subsubject{Fancy list markers}
+\subsection[fancy-list-markers]{Fancy list markers}
\startitemize[n][start=2,left=(,stopper=),width=2.0em]
\item
@@ -435,59 +423,59 @@ B. Williams
\thinrule
-\subject{Definition Lists}
+\section[definition-lists]{Definition Lists}
Tight using spaces:
-\startdescr{apple}
+\startdescription{apple}
red fruit
-\stopdescr
+\stopdescription
-\startdescr{orange}
+\startdescription{orange}
orange fruit
-\stopdescr
+\stopdescription
-\startdescr{banana}
+\startdescription{banana}
yellow fruit
-\stopdescr
+\stopdescription
Tight using tabs:
-\startdescr{apple}
+\startdescription{apple}
red fruit
-\stopdescr
+\stopdescription
-\startdescr{orange}
+\startdescription{orange}
orange fruit
-\stopdescr
+\stopdescription
-\startdescr{banana}
+\startdescription{banana}
yellow fruit
-\stopdescr
+\stopdescription
Loose:
-\startdescr{apple}
+\startdescription{apple}
red fruit
-\stopdescr
+\stopdescription
-\startdescr{orange}
+\startdescription{orange}
orange fruit
-\stopdescr
+\stopdescription
-\startdescr{banana}
+\startdescription{banana}
yellow fruit
-\stopdescr
+\stopdescription
Multiple blocks with italics:
-\startdescr{{\em apple}}
+\startdescription{{\em apple}}
red fruit
contains seeds, crisp, pleasant to taste
-\stopdescr
+\stopdescription
-\startdescr{{\em orange}}
+\startdescription{{\em orange}}
orange fruit
\starttyping
@@ -497,45 +485,45 @@ Multiple blocks with italics:
\startblockquote
orange block quote
\stopblockquote
-\stopdescr
+\stopdescription
Multiple definitions, tight:
-\startdescr{apple}
+\startdescription{apple}
red fruit
computer
-\stopdescr
+\stopdescription
-\startdescr{orange}
+\startdescription{orange}
orange fruit
bank
-\stopdescr
+\stopdescription
Multiple definitions, loose:
-\startdescr{apple}
+\startdescription{apple}
red fruit
computer
-\stopdescr
+\stopdescription
-\startdescr{orange}
+\startdescription{orange}
orange fruit
bank
-\stopdescr
+\stopdescription
Blank line after term, indented marker, alternate markers:
-\startdescr{apple}
+\startdescription{apple}
red fruit
computer
-\stopdescr
+\stopdescription
-\startdescr{orange}
+\startdescription{orange}
orange fruit
\startitemize[n][stopper=.]
@@ -544,9 +532,9 @@ Blank line after term, indented marker, alternate markers:
\item
sublist
\stopitemize
-\stopdescr
+\stopdescription
-\subject{HTML Blocks}
+\section[html-blocks]{HTML Blocks}
Simple block on one line:
@@ -601,13 +589,13 @@ Hr's:
\thinrule
-\subject{Inline Markup}
+\section[inline-markup]{Inline Markup}
This is {\em emphasized}, and so {\em is this}.
This is {\bf strong}, and so {\bf is this}.
-An {\em \useURL[2][/url][][emphasized link]\from[2]}.
+An {\em \useURL[url2][/url][][emphasized link]\from[url2]}.
{\bf {\em This is strong and em.}}
@@ -630,7 +618,7 @@ spaces: a\letterhat{}b c\letterhat{}d, a\lettertilde{}b c\lettertilde{}d.
\thinrule
-\subject{Smart quotes, ellipses, dashes}
+\section[smart-quotes-ellipses-dashes]{Smart quotes, ellipses, dashes}
\quotation{Hello,} said the spider. \quotation{\quote{Shelob} is my name.}
@@ -642,8 +630,8 @@ spaces: a\letterhat{}b c\letterhat{}d, a\lettertilde{}b c\lettertilde{}d.
\quote{He said, \quotation{I want to go.}} Were you alive in the 70's?
Here is some quoted \quote{\type{code}} and a
-\quotation{\useURL[3][http://example.com/?foo=1&bar=2][][quoted
-link]\from[3]}.
+\quotation{\useURL[url3][http://example.com/?foo=1&bar=2][][quoted
+link]\from[url3]}.
Some dashes: one---two --- three---four --- five.
@@ -653,7 +641,7 @@ Ellipses\ldots{}and\ldots{}and\ldots{}.
\thinrule
-\subject{LaTeX}
+\section[latex]{LaTeX}
\startitemize
\item
@@ -693,7 +681,7 @@ Here's a LaTeX table:
\thinrule
-\subject{Special Characters}
+\section[special-characters]{Special Characters}
Here is some unicode:
@@ -754,45 +742,45 @@ Minus: -
\thinrule
-\subject{Links}
+\section[links]{Links}
-\subsubject{Explicit}
+\subsection[explicit]{Explicit}
-Just a \useURL[4][/url/][][URL]\from[4].
+Just a \useURL[url4][/url/][][URL]\from[url4].
-\useURL[5][/url/][][URL and title]\from[5].
+\useURL[url5][/url/][][URL and title]\from[url5].
-\useURL[6][/url/][][URL and title]\from[6].
+\useURL[url6][/url/][][URL and title]\from[url6].
-\useURL[7][/url/][][URL and title]\from[7].
+\useURL[url7][/url/][][URL and title]\from[url7].
-\useURL[8][/url/][][URL and title]\from[8]
+\useURL[url8][/url/][][URL and title]\from[url8]
-\useURL[9][/url/][][URL and title]\from[9]
+\useURL[url9][/url/][][URL and title]\from[url9]
-\useURL[10][/url/with_underscore][][with\letterunderscore{}underscore]\from[10]
+\useURL[url10][/url/with_underscore][][with\letterunderscore{}underscore]\from[url10]
-\useURL[11][mailto:nobody@nowhere.net][][Email link]\from[11]
+\useURL[url11][mailto:nobody@nowhere.net][][Email link]\from[url11]
-\useURL[12][][][Empty]\from[12].
+\useURL[url12][][][Empty]\from[url12].
-\subsubject{Reference}
+\subsection[reference]{Reference}
-Foo \useURL[13][/url/][][bar]\from[13].
+Foo \useURL[url13][/url/][][bar]\from[url13].
-Foo \useURL[14][/url/][][bar]\from[14].
+Foo \useURL[url14][/url/][][bar]\from[url14].
-Foo \useURL[15][/url/][][bar]\from[15].
+Foo \useURL[url15][/url/][][bar]\from[url15].
-With \useURL[16][/url/][][embedded {[}brackets{]}]\from[16].
+With \useURL[url16][/url/][][embedded {[}brackets{]}]\from[url16].
-\useURL[17][/url/][][b]\from[17] by itself should be a link.
+\useURL[url17][/url/][][b]\from[url17] by itself should be a link.
-Indented \useURL[18][/url][][once]\from[18].
+Indented \useURL[url18][/url][][once]\from[url18].
-Indented \useURL[19][/url][][twice]\from[19].
+Indented \useURL[url19][/url][][twice]\from[url19].
-Indented \useURL[20][/url][][thrice]\from[20].
+Indented \useURL[url20][/url][][thrice]\from[url20].
This should {[}not{]}{[}{]} be a link.
@@ -800,42 +788,43 @@ This should {[}not{]}{[}{]} be a link.
[not]: /url
\stoptyping
-Foo \useURL[21][/url/][][bar]\from[21].
+Foo \useURL[url21][/url/][][bar]\from[url21].
-Foo \useURL[22][/url/][][biz]\from[22].
+Foo \useURL[url22][/url/][][biz]\from[url22].
-\subsubject{With ampersands}
+\subsection[with-ampersands]{With ampersands}
-Here's a \useURL[23][http://example.com/?foo=1&bar=2][][link with an ampersand
-in the URL]\from[23].
+Here's a \useURL[url23][http://example.com/?foo=1&bar=2][][link with an
+ampersand in the URL]\from[url23].
Here's a link with an amersand in the link text:
-\useURL[24][http://att.com/][][AT\&T]\from[24].
+\useURL[url24][http://att.com/][][AT\&T]\from[url24].
-Here's an \useURL[25][/script?foo=1&bar=2][][inline link]\from[25].
+Here's an \useURL[url25][/script?foo=1&bar=2][][inline link]\from[url25].
-Here's an \useURL[26][/script?foo=1&bar=2][][inline link in pointy
-braces]\from[26].
+Here's an \useURL[url26][/script?foo=1&bar=2][][inline link in pointy
+braces]\from[url26].
-\subsubject{Autolinks}
+\subsection[autolinks]{Autolinks}
With an ampersand:
-\useURL[27][http://example.com/?foo=1&bar=2][][http://example.com/?foo=1\&bar=2]\from[27]
+\useURL[url27][http://example.com/?foo=1&bar=2][][\hyphenatedurl{http://example.com/?foo=1\&bar=2}]\from[url27]
\startitemize
\item
In a list?
\item
- \useURL[28][http://example.com/][][http://example.com/]\from[28]
+ \useURL[url28][http://example.com/][][\hyphenatedurl{http://example.com/}]\from[url28]
\item
It should.
\stopitemize
An e-mail address:
-\useURL[29][mailto:nobody@nowhere.net][][nobody@nowhere.net]\from[29]
+\useURL[url29][mailto:nobody@nowhere.net][][\hyphenatedurl{nobody@nowhere.net}]\from[url29]
\startblockquote
-Blockquoted: \useURL[30][http://example.com/][][http://example.com/]\from[30]
+Blockquoted:
+\useURL[url30][http://example.com/][][\hyphenatedurl{http://example.com/}]\from[url30]
\stopblockquote
Auto-links should not occur here: \type{<http://example.com/>}
@@ -846,7 +835,7 @@ or here: <http://example.com/>
\thinrule
-\subject{Images}
+\section[images]{Images}
From \quotation{Voyage dans la Lune} by Georges Melies (1902):
@@ -856,12 +845,12 @@ Here is a movie {\externalfigure[movie.jpg]} icon.
\thinrule
-\subject{Footnotes}
+\section[footnotes]{Footnotes}
Here is a footnote reference,\footnote{Here is the footnote. It can go
anywhere after the footnote reference. It need not be placed at the end of
- the document.} and another.\footnote{Here's the long note. This one contains
- multiple blocks.
+ the document.} and another.\startbuffer Here's the long note. This one
+ contains multiple blocks.
Subsequent blocks are indented to show that they belong to the footnote (as
with list items).
@@ -871,10 +860,11 @@ Here is a footnote reference,\footnote{Here is the footnote. It can go
\stoptyping
If you want, you can indent every line, but you can also be lazy and just
- indent the first line of each block.} This should {\em not} be a footnote
-reference, because it contains a space.{[}\letterhat{}my note{]} Here is an
-inline note.\footnote{This is {\em easier} to type. Inline notes may contain
- \useURL[31][http://google.com][][links]\from[31] and \type{]} verbatim
+ indent the first line of each block.\stopbuffer\footnote{\getbuffer} This
+should {\em not} be a footnote reference, because it contains a
+space.{[}\letterhat{}my note{]} Here is an inline note.\footnote{This is
+ {\em easier} to type. Inline notes may contain
+ \useURL[url31][http://google.com][][links]\from[url31] and \type{]} verbatim
characters, as well as {[}bracketed text{]}.}
\startblockquote