git.iko.soy/typeable/pandoc
on list help sign in
typeable/pandoc/tests/writer.context
883 lines 15 kB history raw
1\startmode[*mkii]
2 \enableregime[utf-8]
3 \setupcolors[state=start]
4\stopmode
6% Enable hyperlinks
7\setupinteraction[state=start, color=middleblue]
9\setuppapersize [letter][letter]
10\setuplayout [width=middle, backspace=1.5in, cutspace=1.5in,
11 height=middle, topspace=0.75in, bottomspace=0.75in]
13\setuppagenumbering[location={footer,center}]
15\setupbodyfont[11pt]
17\setupwhitespace[medium]
19\setuphead[chapter] [style=\tfd]
20\setuphead[section] [style=\tfc]
21\setuphead[subsection] [style=\tfb]
22\setuphead[subsubsection][style=\bf]
24\setuphead[chapter, section, subsection, subsubsection][number=no]
26\definedescription
27 [description]
28 [headstyle=bold, style=normal, location=hanging, width=broad, margin=1cm]
30\setupitemize[autointro] % prevent orphan list intro
31\setupitemize[indentnext=no]
33\setupthinrules[width=15em] % width of horizontal rules
35\setupdelimitedtext
36 [blockquote]
37 [before={\blank[medium]},
38 after={\blank[medium]},
39 indentnext=no,
40 ]
43\starttext
44\startalignment[center]
45 \blank[2*big]
46 {\tfd Pandoc Test Suite}
47 \blank[3*medium]
48 {\tfa John MacFarlane\crlf Anonymous}
49 \blank[2*medium]
50 {\tfa July 17, 2006}
51 \blank[3*medium]
52\stopalignment
54This is a set of tests for pandoc. Most of them are adapted from John Gruber's
55markdown test suite.
57\thinrule
59\section[headers]{Headers}
61\subsection[level-2-with-an-embedded-link]{Level 2 with an
62\useURL[url1][/url][][embedded link]\from[url1]}
64\subsubsection[level-3-with-emphasis]{Level 3 with {\em emphasis}}
66\subsubsubsection[level-4]{Level 4}
68\subsubsubsubsection[level-5]{Level 5}
70\section[level-1]{Level 1}
72\subsection[level-2-with-emphasis]{Level 2 with {\em emphasis}}
74\subsubsection[level-3]{Level 3}
76with no blank line
78\subsection[level-2]{Level 2}
80with no blank line
82\thinrule
84\section[paragraphs]{Paragraphs}
86Here's a regular paragraph.
88In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.
89Because a hard-wrapped line in the middle of a paragraph looked like a list
90item.
92Here's one with a bullet. * criminey.
94There should be a hard line break\crlf
95here.
97\thinrule
99\section[block-quotes]{Block Quotes}
101E-mail style:
103\startblockquote
104This is a block quote. It is pretty short.
105\stopblockquote
107\startblockquote
108Code in a block quote:
110\starttyping
111sub status {
112 print "working";
114\stoptyping
116A list:
118\startitemize[n,packed][stopper=.]
119\item
120 item one
121\item
122 item two
123\stopitemize
125Nested block quotes:
127\startblockquote
128nested
129\stopblockquote
131\startblockquote
132nested
133\stopblockquote
134\stopblockquote
136This should not be a block quote: 2 > 1.
138And a following paragraph.
140\thinrule
142\section[code-blocks]{Code Blocks}
144Code:
146\starttyping
147---- (should be four hyphens)
149sub status {
150 print "working";
153this code block is indented by one tab
154\stoptyping
156And:
158\starttyping
159 this code block is indented by two tabs
161These should not be escaped: \$ \\ \> \[ \{
162\stoptyping
164\thinrule
166\section[lists]{Lists}
168\subsection[unordered]{Unordered}
170Asterisks tight:
172\startitemize[packed]
173\item
174 asterisk 1
175\item
176 asterisk 2
177\item
178 asterisk 3
179\stopitemize
181Asterisks loose:
183\startitemize
184\item
185 asterisk 1
186\item
187 asterisk 2
188\item
189 asterisk 3
190\stopitemize
192Pluses tight:
194\startitemize[packed]
195\item
196 Plus 1
197\item
198 Plus 2
199\item
200 Plus 3
201\stopitemize
203Pluses loose:
205\startitemize
206\item
207 Plus 1
208\item
209 Plus 2
210\item
211 Plus 3
212\stopitemize
214Minuses tight:
216\startitemize[packed]
217\item
218 Minus 1
219\item
220 Minus 2
221\item
222 Minus 3
223\stopitemize
225Minuses loose:
227\startitemize
228\item
229 Minus 1
230\item
231 Minus 2
232\item
233 Minus 3
234\stopitemize
236\subsection[ordered]{Ordered}
238Tight:
240\startitemize[n,packed][stopper=.]
241\item
242 First
243\item
244 Second
245\item
246 Third
247\stopitemize
249and:
251\startitemize[n,packed][stopper=.]
252\item
253 One
254\item
255 Two
256\item
257 Three
258\stopitemize
260Loose using tabs:
262\startitemize[n][stopper=.]
263\item
264 First
265\item
266 Second
267\item
268 Third
269\stopitemize
271and using spaces:
273\startitemize[n][stopper=.]
274\item
275 One
276\item
277 Two
278\item
279 Three
280\stopitemize
282Multiple paragraphs:
284\startitemize[n][stopper=.]
285\item
286 Item 1, graf one.
288 Item 1. graf two. The quick brown fox jumped over the lazy dog's back.
289\item
290 Item 2.
291\item
292 Item 3.
293\stopitemize
295\subsection[nested]{Nested}
297\startitemize[packed]
298\item
299 Tab
300 \startitemize[packed]
301 \item
302 Tab
303 \startitemize[packed]
304 \item
305 Tab
306 \stopitemize
307 \stopitemize
308\stopitemize
310Here's another:
312\startitemize[n,packed][stopper=.]
313\item
314 First
315\item
316 Second:
317 \startitemize[packed]
318 \item
319 Fee
320 \item
321 Fie
322 \item
323 Foe
324 \stopitemize
325\item
326 Third
327\stopitemize
329Same thing but with paragraphs:
331\startitemize[n][stopper=.]
332\item
333 First
334\item
335 Second:
337 \startitemize[packed]
338 \item
339 Fee
340 \item
341 Fie
342 \item
343 Foe
344 \stopitemize
345\item
346 Third
347\stopitemize
349\subsection[tabs-and-spaces]{Tabs and spaces}
351\startitemize
352\item
353 this is a list item indented with tabs
354\item
355 this is a list item indented with spaces
357 \startitemize
358 \item
359 this is an example list item indented with tabs
360 \item
361 this is an example list item indented with spaces
362 \stopitemize
363\stopitemize
365\subsection[fancy-list-markers]{Fancy list markers}
367\startitemize[n][start=2,left=(,stopper=),width=2.0em]
368\item
369 begins with 2
370\item
371 and now 3
373 with a continuation
375 \startitemize[r,packed][start=4,stopper=.,width=2.0em]
376 \item
377 sublist with roman numerals, starting with 4
378 \item
379 more items
380 \startitemize[A,packed][left=(,stopper=),width=2.0em]
381 \item
382 a subsublist
383 \item
384 a subsublist
385 \stopitemize
386 \stopitemize
387\stopitemize
389Nesting:
391\startitemize[A,packed][stopper=.]
392\item
393 Upper Alpha
394 \startitemize[R,packed][stopper=.]
395 \item
396 Upper Roman.
397 \startitemize[n,packed][start=6,left=(,stopper=),width=2.0em]
398 \item
399 Decimal start with 6
400 \startitemize[a,packed][start=3,stopper=)]
401 \item
402 Lower alpha with paren
403 \stopitemize
404 \stopitemize
405 \stopitemize
406\stopitemize
408Autonumbering:
410\startitemize[n,packed]
411\item
412 Autonumber.
413\item
414 More.
415 \startitemize[a,packed]
416 \item
417 Nested.
418 \stopitemize
419\stopitemize
421Should not be a list item:
423M.A.~2007
425B. Williams
427\thinrule
429\section[definition-lists]{Definition Lists}
431Tight using spaces:
433\startdescription{apple}
434 red fruit
435\stopdescription
437\startdescription{orange}
438 orange fruit
439\stopdescription
441\startdescription{banana}
442 yellow fruit
443\stopdescription
445Tight using tabs:
447\startdescription{apple}
448 red fruit
449\stopdescription
451\startdescription{orange}
452 orange fruit
453\stopdescription
455\startdescription{banana}
456 yellow fruit
457\stopdescription
459Loose:
461\startdescription{apple}
462 red fruit
463\stopdescription
465\startdescription{orange}
466 orange fruit
467\stopdescription
469\startdescription{banana}
470 yellow fruit
471\stopdescription
473Multiple blocks with italics:
475\startdescription{{\em apple}}
476 red fruit
478 contains seeds, crisp, pleasant to taste
479\stopdescription
481\startdescription{{\em orange}}
482 orange fruit
484\starttyping
485{ orange code block }
486\stoptyping
488 \startblockquote
489 orange block quote
490 \stopblockquote
491\stopdescription
493Multiple definitions, tight:
495\startdescription{apple}
496 red fruit
498 computer
499\stopdescription
501\startdescription{orange}
502 orange fruit
504 bank
505\stopdescription
507Multiple definitions, loose:
509\startdescription{apple}
510 red fruit
512 computer
513\stopdescription
515\startdescription{orange}
516 orange fruit
518 bank
519\stopdescription
521Blank line after term, indented marker, alternate markers:
523\startdescription{apple}
524 red fruit
526 computer
527\stopdescription
529\startdescription{orange}
530 orange fruit
532 \startitemize[n,packed][stopper=.]
533 \item
534 sublist
535 \item
536 sublist
537 \stopitemize
538\stopdescription
540\section[html-blocks]{HTML Blocks}
542Simple block on one line:
544foo
545And nested without indentation:
547foo
548bar
549Interpreted markdown in a table:
551This is {\em emphasized}
552And this is {\bf strong}
553Here's a simple block:
555foo
556This should be a code block, though:
558\starttyping
559<div>
560 foo
561</div>
562\stoptyping
564As should this:
566\starttyping
567<div>foo</div>
568\stoptyping
570Now, nested:
572foo
573This should just be an HTML comment:
575Multiline:
577Code block:
579\starttyping
580<!-- Comment -->
581\stoptyping
583Just plain comment, with trailing spaces on the line:
585Code:
587\starttyping
588<hr />
589\stoptyping
591Hr's:
593\thinrule
595\section[inline-markup]{Inline Markup}
597This is {\em emphasized}, and so {\em is this}.
599This is {\bf strong}, and so {\bf is this}.
601An {\em \useURL[url2][/url][][emphasized link]\from[url2]}.
603{\bf {\em This is strong and em.}}
605So is {\bf {\em this}} word.
607{\bf {\em This is strong and em.}}
609So is {\bf {\em this}} word.
611This is code: \type{>}, \type{$}, \type{\}, \type{\$}, \type{<html>}.
613\overstrikes{This is {\em strikeout}.}
615Superscripts: a\high{bc}d a\high{{\em hello}} a\high{hello~there}.
617Subscripts: H\low{2}O, H\low{23}O, H\low{many~of~them}O.
619These should not be superscripts or subscripts, because of the unescaped
620spaces: a^b c^d, a\lettertilde{}b c\lettertilde{}d.
622\thinrule
624\section[smart-quotes-ellipses-dashes]{Smart quotes, ellipses, dashes}
626\quotation{Hello,} said the spider. \quotation{\quote{Shelob} is my name.}
628\quote{A}, \quote{B}, and \quote{C} are letters.
630\quote{Oak,} \quote{elm,} and \quote{beech} are names of trees. So is
631\quote{pine.}
633\quote{He said, \quotation{I want to go.}} Were you alive in the 70's?
635Here is some quoted \quote{\type{code}} and a
636\quotation{\useURL[url3][http://example.com/?foo=1&bar=2][][quoted
637link]\from[url3]}.
639Some dashes: one---two --- three---four --- five.
641Dashes between numbers: 5--7, 255--66, 1987--1999.
643Ellipses\ldots{}and\ldots{}and\ldots{}.
645\thinrule
647\section[latex]{LaTeX}
649\startitemize[packed]
650\item
651 \cite[22-23]{smith.1899}
652\item
653 $2+2=4$
654\item
655 $x \in y$
656\item
657 $\alpha \wedge \omega$
658\item
659 $223$
660\item
661 $p$-Tree
662\item
663 Here's some display math:
664 \startformula \frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h} \stopformula
665\item
666 Here's one that has a line break in it: $\alpha + \omega \times x^2$.
667\stopitemize
669These shouldn't be math:
671\startitemize[packed]
672\item
673 To get the famous equation, write \type{$e = mc^2$}.
674\item
675 \$22,000 is a {\em lot} of money. So is \$34,000. (It worked if
676 \quotation{lot} is emphasized.)
677\item
678 Shoes (\$20) and socks (\$5).
679\item
680 Escaped \type{$}: \$73 {\em this should be emphasized} 23\$.
681\stopitemize
683Here's a LaTeX table:
685\thinrule
687\section[special-characters]{Special Characters}
689Here is some unicode:
691\startitemize[packed]
692\item
693 I hat: Î
694\item
695 o umlaut: ö
696\item
697 section: §
698\item
699 set membership: ∈
700\item
701 copyright: ©
702\stopitemize
704AT&T has an ampersand in their name.
706AT&T is another way to write it.
708This & that.
7104 < 5.
7126 > 5.
714Backslash: \letterbackslash{}
716Backtick: `
718Asterisk: *
720Underscore: _
722Left brace: \{
724Right brace: \}
726Left bracket: {[}
728Right bracket: {]}
730Left paren: (
732Right paren: )
734Greater-than: >
736Hash: \#
738Period: .
740Bang: !
742Plus: +
744Minus: -
746\thinrule
748\section[links]{Links}
750\subsection[explicit]{Explicit}
752Just a \useURL[url4][/url/][][URL]\from[url4].
754\useURL[url5][/url/][][URL and title]\from[url5].
756\useURL[url6][/url/][][URL and title]\from[url6].
758\useURL[url7][/url/][][URL and title]\from[url7].
760\useURL[url8][/url/][][URL and title]\from[url8]
762\useURL[url9][/url/][][URL and title]\from[url9]
764\useURL[url10][/url/with_underscore][][with_underscore]\from[url10]
766\useURL[url11][mailto:nobody@nowhere.net][][Email link]\from[url11]
768\useURL[url12][][][Empty]\from[url12].
770\subsection[reference]{Reference}
772Foo \useURL[url13][/url/][][bar]\from[url13].
774Foo \useURL[url14][/url/][][bar]\from[url14].
776Foo \useURL[url15][/url/][][bar]\from[url15].
778With \useURL[url16][/url/][][embedded {[}brackets{]}]\from[url16].
780\useURL[url17][/url/][][b]\from[url17] by itself should be a link.
782Indented \useURL[url18][/url][][once]\from[url18].
784Indented \useURL[url19][/url][][twice]\from[url19].
786Indented \useURL[url20][/url][][thrice]\from[url20].
788This should {[}not{]}{[}{]} be a link.
790\starttyping
791[not]: /url
792\stoptyping
794Foo \useURL[url21][/url/][][bar]\from[url21].
796Foo \useURL[url22][/url/][][biz]\from[url22].
798\subsection[with-ampersands]{With ampersands}
800Here's a \useURL[url23][http://example.com/?foo=1&bar=2][][link with an
801ampersand in the URL]\from[url23].
803Here's a link with an amersand in the link text:
804\useURL[url24][http://att.com/][][AT&T]\from[url24].
806Here's an \useURL[url25][/script?foo=1&bar=2][][inline link]\from[url25].
808Here's an \useURL[url26][/script?foo=1&bar=2][][inline link in pointy
809braces]\from[url26].
811\subsection[autolinks]{Autolinks}
813With an ampersand:
814\useURL[url27][http://example.com/?foo=1&bar=2][][\hyphenatedurl{http://example.com/?foo=1&bar=2}]\from[url27]
816\startitemize[packed]
817\item
818 In a list?
819\item
820 \useURL[url28][http://example.com/][][\hyphenatedurl{http://example.com/}]\from[url28]
821\item
822 It should.
823\stopitemize
825An e-mail address:
826\useURL[url29][mailto:nobody@nowhere.net][][\hyphenatedurl{nobody@nowhere.net}]\from[url29]
828\startblockquote
829Blockquoted:
830\useURL[url30][http://example.com/][][\hyphenatedurl{http://example.com/}]\from[url30]
831\stopblockquote
833Auto-links should not occur here: \type{<http://example.com/>}
835\starttyping
836or here: <http://example.com/>
837\stoptyping
839\thinrule
841\section[images]{Images}
843From \quotation{Voyage dans la Lune} by Georges Melies (1902):
845\placefigure[here,nonumber]{lalune}{\externalfigure[lalune.jpg]}
847Here is a movie {\externalfigure[movie.jpg]} icon.
849\thinrule
851\section[footnotes]{Footnotes}
853Here is a footnote reference,\footnote{Here is the footnote. It can go
854 anywhere after the footnote reference. It need not be placed at the end of
855 the document.} and another.\startbuffer Here's the long note. This one
856 contains multiple blocks.
858 Subsequent blocks are indented to show that they belong to the footnote (as
859 with list items).
861\starttyping
862 { <code> }
863\stoptyping
865 If you want, you can indent every line, but you can also be lazy and just
866 indent the first line of each block.\stopbuffer\footnote{\getbuffer} This
867should {\em not} be a footnote reference, because it contains a space.{[}^my
868note{]} Here is an inline note.\footnote{This is {\em easier} to type. Inline
869 notes may contain \useURL[url31][http://google.com][][links]\from[url31] and
870 \type{]} verbatim characters, as well as {[}bracketed text{]}.}
872\startblockquote
873Notes can go in quotes.\footnote{In quote.}
874\stopblockquote
876\startitemize[n,packed][stopper=.]
877\item
878 And in list items.\footnote{In list.}
879\stopitemize
881This paragraph should not be part of the note, as it is not indented.
883\stoptext