git.iko.soy/typeable/pandoc
on 229b310 help sign in
typeable/pandoc/tests/writer.context
708 lines 12 kB history raw
1\enableregime[utf] % use UTF-8
3\setupcolors[state=start]
4\setupinteraction[state=start, color=middlered] % needed for hyperlinks
6\setuppapersize[letter][letter] % use letter paper
7\setuplayout[width=6in, height=9.5in] % page layout
8\setuppagenumbering[location={footer,center}, style=bold] % number pages
9\setupbodyfont[11pt] % 11pt font
10\setupwhitespace[medium] % inter-paragraph spacing
12\setuphead[section][style=\tfc]
13\setuphead[subsection][style=\tfb]
14\setuphead[subsubsection][style=\bf]
16% define title block commands
17\unprotect
18\def\doctitle#1{\gdef\@title{#1}}
19\def\author#1{\gdef\@author{#1}}
20\def\date#1{\gdef\@date{#1}}
21\date{\currentdate} % Default to today unless specified otherwise.
22\def\maketitle{%
23 \startalignment[center]
24 \blank[2*big]
25 {\tfd \@title}
26 \blank[3*medium]
27 {\tfa \@author}
28 \blank[2*medium]
29 {\tfa \@date}
30 \blank[3*medium]
31 \stopalignment}
32\protect
34% define descr (for definition lists)
35\definedescription[descr][
36 headstyle=bold,style=normal,align=left,location=hanging,
37 width=broad,margin=1cm]
39% define ltxitem (for bulleted lists)
40\defineitemgroup[ltxitem][levels=4]
41\setupitemgroup[ltxitem][1][1]
42\setupitemgroup[ltxitem][2][2]
43\setupitemgroup[ltxitem][3][3]
44\setupitemgroup[ltxitem][4][4,packed]
46% define ltxenum (for enumerated lists)
47\defineitemgroup[ltxenum][levels=4]
48\setupitemgroup[ltxenum][1][n]
49\setupitemgroup[ltxenum][2][a]
50\setupitemgroup[ltxenum][3][r]
51\setupitemgroup[ltxenum][4][A,packed]
53\setupthinrules[width=15em] % width of horizontal rules
55\setupheads[sectionnumber=no, style=\bf]
56\doctitle{Pandoc Test Suite}
57 \author{John MacFarlane \& Anonymous}
58 \date{July 17, 2006}
60\starttext
61\maketitle
63This is a set of tests for pandoc. Most of them are adapted from John Gruber's markdown test suite.
65\thinrule
67\section{Headers}
69\subsection{Level 2 with an \useurl[1][/url][][embedded link]\from[1]}
71\subsubsection{Level 3 with {\em emphasis}}
73Level 4
75Level 5
77\section{Level 1}
79\subsection{Level 2 with {\em emphasis}}
81\subsubsection{Level 3}
83with no blank line
85\subsection{Level 2}
87with no blank line
89\thinrule
91\section{Paragraphs}
93Here's a regular paragraph.
95In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item. Because a hard-wrapped line in the middle of a paragraph looked like a list item.
97Here's one with a bullet. * criminey.
99There should be a hard line break\hfil\break
100here.
102\thinrule
104\section{Block Quotes}
106E-mail style:
108\startnarrower
109This is a block quote. It is pretty short.
111\stopnarrower
113\startnarrower
114Code in a block quote:
116\starttyping
117sub status {
118 print "working";
120\stoptyping
121A list:
123\startltxenum
124\item item one
125\item item two
126\stopltxenum
127Nested block quotes:
129\startnarrower
130nested
132\stopnarrower
134\startnarrower
135nested
137\stopnarrower
139\stopnarrower
141This should not be a block quote: 2 \lettermore{} 1.
143Box-style:
145\startnarrower
146Example:
148\starttyping
149sub status {
150 print "working";
152\stoptyping
153\stopnarrower
155\startnarrower
156\startltxenum
157\item do laundry
158\item take out the trash
159\stopltxenum
160\stopnarrower
162Here's a nested one:
164\startnarrower
165Joe said:
167\startnarrower
168Don't quote me.
170\stopnarrower
172\stopnarrower
174And a following paragraph.
176\thinrule
178\section{Code Blocks}
180Code:
182\starttyping
183---- (should be four hyphens)
185sub status {
186 print "working";
189this code block is indented by one tab
190\stoptyping
191And:
193\starttyping
194 this code block is indented by two tabs
196These should not be escaped: \$ \\ \> \[ \{
197\stoptyping
198\thinrule
200\section{Lists}
202\subsection{Unordered}
204Asterisks tight:
206\startltxitem
207\item asterisk 1
208\item asterisk 2
209\item asterisk 3
210\stopltxitem
211Asterisks loose:
213\startltxitem
214\item asterisk 1
216\item asterisk 2
218\item asterisk 3
220\stopltxitem
221Pluses tight:
223\startltxitem
224\item Plus 1
225\item Plus 2
226\item Plus 3
227\stopltxitem
228Pluses loose:
230\startltxitem
231\item Plus 1
233\item Plus 2
235\item Plus 3
237\stopltxitem
238Minuses tight:
240\startltxitem
241\item Minus 1
242\item Minus 2
243\item Minus 3
244\stopltxitem
245Minuses loose:
247\startltxitem
248\item Minus 1
250\item Minus 2
252\item Minus 3
254\stopltxitem
255\subsection{Ordered}
257Tight:
259\startltxenum
260\item First
261\item Second
262\item Third
263\stopltxenum
264and:
266\startltxenum
267\item One
268\item Two
269\item Three
270\stopltxenum
271Loose using tabs:
273\startltxenum
274\item First
276\item Second
278\item Third
280\stopltxenum
281and using spaces:
283\startltxenum
284\item One
286\item Two
288\item Three
290\stopltxenum
291Multiple paragraphs:
293\startltxenum
294\item Item 1, graf one.
296Item 1. graf two. The quick brown fox jumped over the lazy dog's back.
298\item Item 2.
300\item Item 3.
302\stopltxenum
303\subsection{Nested}
305\startltxitem
306\item Tab
307\startltxitem
308\item Tab
309\startltxitem
310\item Tab
311\stopltxitem
312\stopltxitem
313\stopltxitem
314Here's another:
316\startltxenum
317\item First
318\item Second:
319\startltxitem
320\item Fee
321\item Fie
322\item Foe
323\stopltxitem
324\item Third
325\stopltxenum
326Same thing but with paragraphs:
328\startltxenum
329\item First
331\item Second:
333\startltxitem
334\item Fee
335\item Fie
336\item Foe
337\stopltxitem
338\item Third
340\stopltxenum
341\subsection{Tabs and spaces}
343\startltxitem
344\item this is a list item indented with tabs
346\item this is a list item indented with spaces
348\startltxitem
349\item this is an example list item indented with tabs
351\item this is an example list item indented with spaces
353\stopltxitem
354\stopltxitem
355\thinrule
357\section{Definition Lists}
359Tight using spaces:
361\startdescr{apple}
362red fruit
364\stopdescr
365\startdescr{orange}
366orange fruit
368\stopdescr
369\startdescr{banana}
370yellow fruit
372\stopdescr
374Tight using tabs:
376\startdescr{apple}
377red fruit
379\stopdescr
380\startdescr{orange}
381orange fruit
383\stopdescr
384\startdescr{banana}
385yellow fruit
387\stopdescr
389Loose:
391\startdescr{apple}
392red fruit
395\stopdescr
396\startdescr{orange}
397orange fruit
400\stopdescr
401\startdescr{banana}
402yellow fruit
405\stopdescr
407Multiple blocks with italics:
409\startdescr{{\em apple}}
410red fruit
412contains seeds, crisp, pleasant to taste
415\stopdescr
416\startdescr{{\em orange}}
417orange fruit
419\starttyping
420{ orange code block }
421\stoptyping
422\startnarrower
423orange block quote
425\stopnarrower
428\stopdescr
430\section{HTML Blocks}
432Simple block on one line:
434foo
435And nested without indentation:
437foo
438bar
439Interpreted markdown in a table:
441This is {\em emphasized}
442And this is {\bf strong}
443Here's a simple block:
445foo
446This should be a code block, though:
448\starttyping
449<div>
450 foo
451</div>
452\stoptyping
453As should this:
455\starttyping
456<div>foo</div>
457\stoptyping
458Now, nested:
460foo
461This should just be an HTML comment:
463Multiline:
465Code block:
467\starttyping
468<!-- Comment -->
469\stoptyping
470Just plain comment, with trailing spaces on the line:
472Code:
474\starttyping
475<hr />
476\stoptyping
477Hr's:
479\thinrule
481\section{Inline Markup}
483This is {\em emphasized}, and so {\em is this}.
485This is {\bf strong}, and so {\bf is this}.
487An {\em \useurl[2][/url][][emphasized link]\from[2]}.
489{\bf {\em This is strong and em.}}
491So is {\bf {\em this}} word.
493{\bf {\em This is strong and em.}}
495So is {\bf {\em this}} word.
497This is code: \type{>}, \type{$}, \type{\}, \type{\$}, \type{<html>}.
499\thinrule
501\section{Smart quotes, ellipses, dashes}
503\quotation{Hello,} said the spider. \quotation{\quote{Shelob} is my name.}
505\quote{A}, \quote{B}, and \quote{C} are letters.
507\quote{Oak,} \quote{elm,} and \quote{beech} are names of trees. So is \quote{pine.}
509\quote{He said, \quotation{I want to go.}} Were you alive in the 70's?
511Here is some quoted \quote{\type{code}} and a \quotation{\useurl[3][http://example.com/?foo=1&bar=2][][quoted link]\from[3]}.
513Some dashes: one---two---three---four---five.
515Dashes between numbers: 5--7, 255--66, 1987--1999.
517Ellipses\ldots{}and\ldots{}and\ldots{}.
519\thinrule
521\section{Special Characters}
523Here is some unicode:
525\startltxitem
526\item I hat: Î
527\item o umlaut: ö
528\item section: §
529\item set membership: ∈
530\item copyright: ©
531\stopltxitem
532AT\&T has an ampersand in their name.
534AT\&T is another way to write it.
536This \& that.
5384 \letterless{} 5.
5406 \lettermore{} 5.
542Backslash: \letterbackslash{}
544Backtick: `
546Asterisk: *
548Underscore: \letterunderscore{}
550Left brace: \letteropenbrace{}
552Right brace: \letterclosebrace{}
554Left bracket: [
556Right bracket: ]
558Left paren: (
560Right paren: )
562Greater-than: \lettermore{}
564Hash: \#
566Period: .
568Bang: !
570Plus: +
572Minus: -
574\thinrule
576\section{Links}
578\subsection{Explicit}
580Just a \useurl[4][/url/][][URL]\from[4].
582\useurl[5][/url/][][URL and title]\from[5].
584\useurl[6][/url/][][URL and title]\from[6].
586\useurl[7][/url/][][URL and title]\from[7].
588\useurl[8][/url/][][URL and title]\from[8]
590\useurl[9][/url/][][URL and title]\from[9]
592\useurl[10][/url/with_underscore][][with\letterunderscore{}underscore]\from[10]
594\useurl[11][mailto:nobody@nowhere.net][][Email link]\from[11]
596\useurl[12][][][Empty]\from[12].
598\subsection{Reference}
600Foo \useurl[13][/url/][][bar]\from[13].
602Foo \useurl[14][/url/][][bar]\from[14].
604Foo \useurl[15][/url/][][bar]\from[15].
606With \useurl[16][/url/][][embedded [brackets]]\from[16].
608\useurl[17][/url/][][b]\from[17] by itself should be a link.
610Indented \useurl[18][/url][][once]\from[18].
612Indented \useurl[19][/url][][twice]\from[19].
614Indented \useurl[20][/url][][thrice]\from[20].
616This should [not][] be a link.
618\starttyping
619[not]: /url
620\stoptyping
621Foo \useurl[21][/url/][][bar]\from[21].
623Foo \useurl[22][/url/][][biz]\from[22].
625\subsection{With ampersands}
627Here's a \useurl[23][http://example.com/?foo=1&bar=2][][link with an ampersand in the URL]\from[23].
629Here's a link with an amersand in the link text: \useurl[24][http://att.com/][][AT\&T]\from[24].
631Here's an \useurl[25][/script?foo=1&bar=2][][inline link]\from[25].
633Here's an \useurl[26][/script?foo=1&bar=2][][inline link in pointy braces]\from[26].
635\subsection{Autolinks}
637With an ampersand: \useurl[27][http://example.com/?foo=1&bar=2][][http://example.com/?foo=1\&bar=2]\from[27]
639\startltxitem
640\item In a list?
641\item \useurl[28][http://example.com/][][http://example.com/]\from[28]
642\item It should.
643\stopltxitem
644An e-mail address: \useurl[29][mailto:nobody@nowhere.net][][nobody@nowhere.net]\from[29]
646\startnarrower
647Blockquoted: \useurl[30][http://example.com/][][http://example.com/]\from[30]
649\stopnarrower
651Auto-links should not occur here: \type{<http://example.com/>}
653\starttyping
654or here: <http://example.com/>
655\stoptyping
656\thinrule
658\section{Images}
660From \quotation{Voyage dans la Lune} by Georges Melies (1902):
662\placefigure
663[]
664[fig:lalune]
665{Voyage dans la Lune}
666{\externalfigure[lalune.jpg]}
668Here is a movie \placefigure
669[]
670[fig:movie]
671{}
672{\externalfigure[movie.jpg]} icon.
674\thinrule
676\section{Footnotes}
678Here 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.
680} and another.\footnote{Here's the long note. This one contains multiple blocks.
682Subsequent blocks are indented to show that they belong to the footnote (as with list items).
684\starttyping
685 { <code> }
686\stoptyping
687If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.
689} 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 characters, as well as [bracketed text].
693\startnarrower
694Notes can go in quotes.\footnote{In quote.
698\stopnarrower
700\startltxenum
701\item And in list items.\footnote{In list.
704\stopltxenum
705This paragraph should not be part of the note, as it is not indented.
708\stoptext