git.iko.soy/typeable/pandoc
on e02fb21 help sign in
typeable/pandoc/tests/writer.context
715 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=middle, backspace=1.5in, cutspace=1.5in,
8 height=middle, header=0.75in, footer=0.75in] % page layout
9\setuppagenumbering[location={footer,center}] % number pages
10\setupbodyfont[12pt] % 12pt font
11\setupwhitespace[medium] % inter-paragraph spacing
13\setuphead[section][style=\tfc]
14\setuphead[subsection][style=\tfb]
15\setuphead[subsubsection][style=\bf]
17% define title block commands
18\unprotect
19\def\doctitle#1{\gdef\@title{#1}}
20\def\author#1{\gdef\@author{#1}}
21\def\date#1{\gdef\@date{#1}}
22\date{\currentdate} % Default to today unless specified otherwise.
23\def\maketitle{%
24 \startalignment[center]
25 \blank[2*big]
26 {\tfd \@title}
27 \blank[3*medium]
28 {\tfa \@author}
29 \blank[2*medium]
30 {\tfa \@date}
31 \blank[3*medium]
32 \stopalignment}
33\protect
35% define descr (for definition lists)
36\definedescription[descr][
37 headstyle=bold,style=normal,align=left,location=hanging,
38 width=broad,margin=1cm]
40% define ltxitem (for bulleted lists)
41\defineitemgroup[ltxitem][levels=4]
42\setupitemgroup[ltxitem][1][1]
43\setupitemgroup[ltxitem][2][2]
44\setupitemgroup[ltxitem][3][3]
45\setupitemgroup[ltxitem][4][4,packed]
47% define ltxenum (for enumerated lists)
48\defineitemgroup[ltxenum][levels=4]
49\setupitemgroup[ltxenum][1][n]
50\setupitemgroup[ltxenum][2][a]
51\setupitemgroup[ltxenum][3][r]
52\setupitemgroup[ltxenum][4][A,packed]
54\setupthinrules[width=15em] % width of horizontal rules
56% for block quotations
57\definestartstop [blockquote]
58 [before={\startnarrower\switchtobodyfont[11pt]
59 \whitespace\setupindenting[no]},
60 after={\stopnarrower\whitespace}]
62\setupheads[sectionnumber=no, style=\bf]
63\doctitle{Pandoc Test Suite}
64 \author{John MacFarlane \& Anonymous}
65 \date{July 17, 2006}
67\starttext
68\maketitle
70This is a set of tests for pandoc. Most of them are adapted from John Gruber's markdown test suite.
72\thinrule
74\section{Headers}
76\subsection{Level 2 with an \useurl[1][/url][][embedded link]\from[1]}
78\subsubsection{Level 3 with {\em emphasis}}
80Level 4
82Level 5
84\section{Level 1}
86\subsection{Level 2 with {\em emphasis}}
88\subsubsection{Level 3}
90with no blank line
92\subsection{Level 2}
94with no blank line
96\thinrule
98\section{Paragraphs}
100Here's a regular paragraph.
102In 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.
104Here's one with a bullet. * criminey.
106There should be a hard line break\hfil\break
107here.
109\thinrule
111\section{Block Quotes}
113E-mail style:
115\startblockquote
116This is a block quote. It is pretty short.
118\stopblockquote
120\startblockquote
121Code in a block quote:
123\starttyping
124sub status {
125 print "working";
127\stoptyping
128A list:
130\startltxenum
131\item item one
132\item item two
133\stopltxenum
134Nested block quotes:
136\startblockquote
137nested
139\stopblockquote
141\startblockquote
142nested
144\stopblockquote
146\stopblockquote
148This should not be a block quote: 2 \lettermore{} 1.
150Box-style:
152\startblockquote
153Example:
155\starttyping
156sub status {
157 print "working";
159\stoptyping
160\stopblockquote
162\startblockquote
163\startltxenum
164\item do laundry
165\item take out the trash
166\stopltxenum
167\stopblockquote
169Here's a nested one:
171\startblockquote
172Joe said:
174\startblockquote
175Don't quote me.
177\stopblockquote
179\stopblockquote
181And a following paragraph.
183\thinrule
185\section{Code Blocks}
187Code:
189\starttyping
190---- (should be four hyphens)
192sub status {
193 print "working";
196this code block is indented by one tab
197\stoptyping
198And:
200\starttyping
201 this code block is indented by two tabs
203These should not be escaped: \$ \\ \> \[ \{
204\stoptyping
205\thinrule
207\section{Lists}
209\subsection{Unordered}
211Asterisks tight:
213\startltxitem
214\item asterisk 1
215\item asterisk 2
216\item asterisk 3
217\stopltxitem
218Asterisks loose:
220\startltxitem
221\item asterisk 1
223\item asterisk 2
225\item asterisk 3
227\stopltxitem
228Pluses tight:
230\startltxitem
231\item Plus 1
232\item Plus 2
233\item Plus 3
234\stopltxitem
235Pluses loose:
237\startltxitem
238\item Plus 1
240\item Plus 2
242\item Plus 3
244\stopltxitem
245Minuses tight:
247\startltxitem
248\item Minus 1
249\item Minus 2
250\item Minus 3
251\stopltxitem
252Minuses loose:
254\startltxitem
255\item Minus 1
257\item Minus 2
259\item Minus 3
261\stopltxitem
262\subsection{Ordered}
264Tight:
266\startltxenum
267\item First
268\item Second
269\item Third
270\stopltxenum
271and:
273\startltxenum
274\item One
275\item Two
276\item Three
277\stopltxenum
278Loose using tabs:
280\startltxenum
281\item First
283\item Second
285\item Third
287\stopltxenum
288and using spaces:
290\startltxenum
291\item One
293\item Two
295\item Three
297\stopltxenum
298Multiple paragraphs:
300\startltxenum
301\item Item 1, graf one.
303Item 1. graf two. The quick brown fox jumped over the lazy dog's back.
305\item Item 2.
307\item Item 3.
309\stopltxenum
310\subsection{Nested}
312\startltxitem
313\item Tab
314\startltxitem
315\item Tab
316\startltxitem
317\item Tab
318\stopltxitem
319\stopltxitem
320\stopltxitem
321Here's another:
323\startltxenum
324\item First
325\item Second:
326\startltxitem
327\item Fee
328\item Fie
329\item Foe
330\stopltxitem
331\item Third
332\stopltxenum
333Same thing but with paragraphs:
335\startltxenum
336\item First
338\item Second:
340\startltxitem
341\item Fee
342\item Fie
343\item Foe
344\stopltxitem
345\item Third
347\stopltxenum
348\subsection{Tabs and spaces}
350\startltxitem
351\item this is a list item indented with tabs
353\item this is a list item indented with spaces
355\startltxitem
356\item this is an example list item indented with tabs
358\item this is an example list item indented with spaces
360\stopltxitem
361\stopltxitem
362\thinrule
364\section{Definition Lists}
366Tight using spaces:
368\startdescr{apple}
369red fruit
371\stopdescr
372\startdescr{orange}
373orange fruit
375\stopdescr
376\startdescr{banana}
377yellow fruit
379\stopdescr
381Tight using tabs:
383\startdescr{apple}
384red fruit
386\stopdescr
387\startdescr{orange}
388orange fruit
390\stopdescr
391\startdescr{banana}
392yellow fruit
394\stopdescr
396Loose:
398\startdescr{apple}
399red fruit
402\stopdescr
403\startdescr{orange}
404orange fruit
407\stopdescr
408\startdescr{banana}
409yellow fruit
412\stopdescr
414Multiple blocks with italics:
416\startdescr{{\em apple}}
417red fruit
419contains seeds, crisp, pleasant to taste
422\stopdescr
423\startdescr{{\em orange}}
424orange fruit
426\starttyping
427{ orange code block }
428\stoptyping
429\startblockquote
430orange block quote
432\stopblockquote
435\stopdescr
437\section{HTML Blocks}
439Simple block on one line:
441foo
442And nested without indentation:
444foo
445bar
446Interpreted markdown in a table:
448This is {\em emphasized}
449And this is {\bf strong}
450Here's a simple block:
452foo
453This should be a code block, though:
455\starttyping
456<div>
457 foo
458</div>
459\stoptyping
460As should this:
462\starttyping
463<div>foo</div>
464\stoptyping
465Now, nested:
467foo
468This should just be an HTML comment:
470Multiline:
472Code block:
474\starttyping
475<!-- Comment -->
476\stoptyping
477Just plain comment, with trailing spaces on the line:
479Code:
481\starttyping
482<hr />
483\stoptyping
484Hr's:
486\thinrule
488\section{Inline Markup}
490This is {\em emphasized}, and so {\em is this}.
492This is {\bf strong}, and so {\bf is this}.
494An {\em \useurl[2][/url][][emphasized link]\from[2]}.
496{\bf {\em This is strong and em.}}
498So is {\bf {\em this}} word.
500{\bf {\em This is strong and em.}}
502So is {\bf {\em this}} word.
504This is code: \type{>}, \type{$}, \type{\}, \type{\$}, \type{<html>}.
506\thinrule
508\section{Smart quotes, ellipses, dashes}
510\quotation{Hello,} said the spider. \quotation{\quote{Shelob} is my name.}
512\quote{A}, \quote{B}, and \quote{C} are letters.
514\quote{Oak,} \quote{elm,} and \quote{beech} are names of trees. So is \quote{pine.}
516\quote{He said, \quotation{I want to go.}} Were you alive in the 70's?
518Here is some quoted \quote{\type{code}} and a \quotation{\useurl[3][http://example.com/?foo=1&bar=2][][quoted link]\from[3]}.
520Some dashes: one---two---three---four---five.
522Dashes between numbers: 5--7, 255--66, 1987--1999.
524Ellipses\ldots{}and\ldots{}and\ldots{}.
526\thinrule
528\section{Special Characters}
530Here is some unicode:
532\startltxitem
533\item I hat: Î
534\item o umlaut: ö
535\item section: §
536\item set membership: ∈
537\item copyright: ©
538\stopltxitem
539AT\&T has an ampersand in their name.
541AT\&T is another way to write it.
543This \& that.
5454 \letterless{} 5.
5476 \lettermore{} 5.
549Backslash: \letterbackslash{}
551Backtick: `
553Asterisk: *
555Underscore: \letterunderscore{}
557Left brace: \letteropenbrace{}
559Right brace: \letterclosebrace{}
561Left bracket: [
563Right bracket: ]
565Left paren: (
567Right paren: )
569Greater-than: \lettermore{}
571Hash: \#
573Period: .
575Bang: !
577Plus: +
579Minus: -
581\thinrule
583\section{Links}
585\subsection{Explicit}
587Just a \useurl[4][/url/][][URL]\from[4].
589\useurl[5][/url/][][URL and title]\from[5].
591\useurl[6][/url/][][URL and title]\from[6].
593\useurl[7][/url/][][URL and title]\from[7].
595\useurl[8][/url/][][URL and title]\from[8]
597\useurl[9][/url/][][URL and title]\from[9]
599\useurl[10][/url/with_underscore][][with\letterunderscore{}underscore]\from[10]
601\useurl[11][mailto:nobody@nowhere.net][][Email link]\from[11]
603\useurl[12][][][Empty]\from[12].
605\subsection{Reference}
607Foo \useurl[13][/url/][][bar]\from[13].
609Foo \useurl[14][/url/][][bar]\from[14].
611Foo \useurl[15][/url/][][bar]\from[15].
613With \useurl[16][/url/][][embedded [brackets]]\from[16].
615\useurl[17][/url/][][b]\from[17] by itself should be a link.
617Indented \useurl[18][/url][][once]\from[18].
619Indented \useurl[19][/url][][twice]\from[19].
621Indented \useurl[20][/url][][thrice]\from[20].
623This should [not][] be a link.
625\starttyping
626[not]: /url
627\stoptyping
628Foo \useurl[21][/url/][][bar]\from[21].
630Foo \useurl[22][/url/][][biz]\from[22].
632\subsection{With ampersands}
634Here's a \useurl[23][http://example.com/?foo=1&bar=2][][link with an ampersand in the URL]\from[23].
636Here's a link with an amersand in the link text: \useurl[24][http://att.com/][][AT\&T]\from[24].
638Here's an \useurl[25][/script?foo=1&bar=2][][inline link]\from[25].
640Here's an \useurl[26][/script?foo=1&bar=2][][inline link in pointy braces]\from[26].
642\subsection{Autolinks}
644With an ampersand: \useurl[27][http://example.com/?foo=1&bar=2][][http://example.com/?foo=1\&bar=2]\from[27]
646\startltxitem
647\item In a list?
648\item \useurl[28][http://example.com/][][http://example.com/]\from[28]
649\item It should.
650\stopltxitem
651An e-mail address: \useurl[29][mailto:nobody@nowhere.net][][nobody@nowhere.net]\from[29]
653\startblockquote
654Blockquoted: \useurl[30][http://example.com/][][http://example.com/]\from[30]
656\stopblockquote
658Auto-links should not occur here: \type{<http://example.com/>}
660\starttyping
661or here: <http://example.com/>
662\stoptyping
663\thinrule
665\section{Images}
667From \quotation{Voyage dans la Lune} by Georges Melies (1902):
669\placefigure
670[]
671[fig:lalune]
672{Voyage dans la Lune}
673{\externalfigure[lalune.jpg]}
675Here is a movie \placefigure
676[]
677[fig:movie]
678{}
679{\externalfigure[movie.jpg]} icon.
681\thinrule
683\section{Footnotes}
685Here 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.
687} and another.\footnote{Here's the long note. This one contains multiple blocks.
689Subsequent blocks are indented to show that they belong to the footnote (as with list items).
691\starttyping
692 { <code> }
693\stoptyping
694If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.
696} 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].
700\startblockquote
701Notes can go in quotes.\footnote{In quote.
705\stopblockquote
707\startltxenum
708\item And in list items.\footnote{In list.
711\stopltxenum
712This paragraph should not be part of the note, as it is not indented.
715\stoptext