git.iko.soy/typeable/pandoc
on fe3d8ea help sign in
typeable/pandoc/tests/writer.context
881 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[section] [style=\tfc,number=no]
20\setuphead[subsection] [style=\tfb,number=no]
21\setuphead[subsubsection][style=\bf,number=no]
23\definedescription
24 [description]
25 [headstyle=bold, style=normal, location=hanging, width=broad, margin=1cm]
27\setupitemize[autointro] % prevent orphan list intro
28\setupitemize[indentnext=no]
30\setupthinrules[width=15em] % width of horizontal rules
32\setupdelimitedtext
33 [blockquote]
34 [before={\blank[medium]},
35 after={\blank[medium]},
36 indentnext=no,
37 ]
40\starttext
41\startalignment[center]
42 \blank[2*big]
43 {\tfd Pandoc Test Suite}
44 \blank[3*medium]
45 {\tfa John MacFarlane\crlf Anonymous}
46 \blank[2*medium]
47 {\tfa July 17, 2006}
48 \blank[3*medium]
49\stopalignment
51This is a set of tests for pandoc. Most of them are adapted from John Gruber's
52markdown test suite.
54\thinrule
56\section[headers]{Headers}
58\subsection[level-2-with-an-embedded-link]{Level 2 with an
59\useURL[url1][/url][][embedded link]\from[url1]}
61\subsubsection[level-3-with-emphasis]{Level 3 with {\em emphasis}}
63\subsubsubsection[level-4]{Level 4}
65\subsubsubsubsection[level-5]{Level 5}
67\section[level-1]{Level 1}
69\subsection[level-2-with-emphasis]{Level 2 with {\em emphasis}}
71\subsubsection[level-3]{Level 3}
73with no blank line
75\subsection[level-2]{Level 2}
77with no blank line
79\thinrule
81\section[paragraphs]{Paragraphs}
83Here's a regular paragraph.
85In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.
86Because a hard-wrapped line in the middle of a paragraph looked like a list
87item.
89Here's one with a bullet. * criminey.
91There should be a hard line break\crlf
92here.
94\thinrule
96\section[block-quotes]{Block Quotes}
98E-mail style:
100\startblockquote
101This is a block quote. It is pretty short.
102\stopblockquote
104\startblockquote
105Code in a block quote:
107\starttyping
108sub status {
109 print "working";
111\stoptyping
113A list:
115\startitemize[n][stopper=.]
116\item
117 item one
118\item
119 item two
120\stopitemize
122Nested block quotes:
124\startblockquote
125nested
126\stopblockquote
128\startblockquote
129nested
130\stopblockquote
131\stopblockquote
133This should not be a block quote: 2 \lettermore{} 1.
135And a following paragraph.
137\thinrule
139\section[code-blocks]{Code Blocks}
141Code:
143\starttyping
144---- (should be four hyphens)
146sub status {
147 print "working";
150this code block is indented by one tab
151\stoptyping
153And:
155\starttyping
156 this code block is indented by two tabs
158These should not be escaped: \$ \\ \> \[ \{
159\stoptyping
161\thinrule
163\section[lists]{Lists}
165\subsection[unordered]{Unordered}
167Asterisks tight:
169\startitemize
170\item
171 asterisk 1
172\item
173 asterisk 2
174\item
175 asterisk 3
176\stopitemize
178Asterisks loose:
180\startitemize
181\item
182 asterisk 1
183\item
184 asterisk 2
185\item
186 asterisk 3
187\stopitemize
189Pluses tight:
191\startitemize
192\item
193 Plus 1
194\item
195 Plus 2
196\item
197 Plus 3
198\stopitemize
200Pluses loose:
202\startitemize
203\item
204 Plus 1
205\item
206 Plus 2
207\item
208 Plus 3
209\stopitemize
211Minuses tight:
213\startitemize
214\item
215 Minus 1
216\item
217 Minus 2
218\item
219 Minus 3
220\stopitemize
222Minuses loose:
224\startitemize
225\item
226 Minus 1
227\item
228 Minus 2
229\item
230 Minus 3
231\stopitemize
233\subsection[ordered]{Ordered}
235Tight:
237\startitemize[n][stopper=.]
238\item
239 First
240\item
241 Second
242\item
243 Third
244\stopitemize
246and:
248\startitemize[n][stopper=.]
249\item
250 One
251\item
252 Two
253\item
254 Three
255\stopitemize
257Loose using tabs:
259\startitemize[n][stopper=.]
260\item
261 First
262\item
263 Second
264\item
265 Third
266\stopitemize
268and using spaces:
270\startitemize[n][stopper=.]
271\item
272 One
273\item
274 Two
275\item
276 Three
277\stopitemize
279Multiple paragraphs:
281\startitemize[n][stopper=.]
282\item
283 Item 1, graf one.
285 Item 1. graf two. The quick brown fox jumped over the lazy dog's back.
286\item
287 Item 2.
288\item
289 Item 3.
290\stopitemize
292\subsection[nested]{Nested}
294\startitemize
295\item
296 Tab
297 \startitemize
298 \item
299 Tab
300 \startitemize
301 \item
302 Tab
303 \stopitemize
304 \stopitemize
305\stopitemize
307Here's another:
309\startitemize[n][stopper=.]
310\item
311 First
312\item
313 Second:
314 \startitemize
315 \item
316 Fee
317 \item
318 Fie
319 \item
320 Foe
321 \stopitemize
322\item
323 Third
324\stopitemize
326Same thing but with paragraphs:
328\startitemize[n][stopper=.]
329\item
330 First
331\item
332 Second:
334 \startitemize
335 \item
336 Fee
337 \item
338 Fie
339 \item
340 Foe
341 \stopitemize
342\item
343 Third
344\stopitemize
346\subsection[tabs-and-spaces]{Tabs and spaces}
348\startitemize
349\item
350 this is a list item indented with tabs
351\item
352 this is a list item indented with spaces
354 \startitemize
355 \item
356 this is an example list item indented with tabs
357 \item
358 this is an example list item indented with spaces
359 \stopitemize
360\stopitemize
362\subsection[fancy-list-markers]{Fancy list markers}
364\startitemize[n][start=2,left=(,stopper=),width=2.0em]
365\item
366 begins with 2
367\item
368 and now 3
370 with a continuation
372 \startitemize[r][start=4,stopper=.,width=2.0em]
373 \item
374 sublist with roman numerals, starting with 4
375 \item
376 more items
377 \startitemize[A][left=(,stopper=),width=2.0em]
378 \item
379 a subsublist
380 \item
381 a subsublist
382 \stopitemize
383 \stopitemize
384\stopitemize
386Nesting:
388\startitemize[A][stopper=.]
389\item
390 Upper Alpha
391 \startitemize[R][stopper=.]
392 \item
393 Upper Roman.
394 \startitemize[n][start=6,left=(,stopper=),width=2.0em]
395 \item
396 Decimal start with 6
397 \startitemize[a][start=3,stopper=)]
398 \item
399 Lower alpha with paren
400 \stopitemize
401 \stopitemize
402 \stopitemize
403\stopitemize
405Autonumbering:
407\startitemize[n]
408\item
409 Autonumber.
410\item
411 More.
412 \startitemize[a]
413 \item
414 Nested.
415 \stopitemize
416\stopitemize
418Should not be a list item:
420M.A.~2007
422B. Williams
424\thinrule
426\section[definition-lists]{Definition Lists}
428Tight using spaces:
430\startdescription{apple}
431 red fruit
432\stopdescription
434\startdescription{orange}
435 orange fruit
436\stopdescription
438\startdescription{banana}
439 yellow fruit
440\stopdescription
442Tight using tabs:
444\startdescription{apple}
445 red fruit
446\stopdescription
448\startdescription{orange}
449 orange fruit
450\stopdescription
452\startdescription{banana}
453 yellow fruit
454\stopdescription
456Loose:
458\startdescription{apple}
459 red fruit
460\stopdescription
462\startdescription{orange}
463 orange fruit
464\stopdescription
466\startdescription{banana}
467 yellow fruit
468\stopdescription
470Multiple blocks with italics:
472\startdescription{{\em apple}}
473 red fruit
475 contains seeds, crisp, pleasant to taste
476\stopdescription
478\startdescription{{\em orange}}
479 orange fruit
481\starttyping
482{ orange code block }
483\stoptyping
485 \startblockquote
486 orange block quote
487 \stopblockquote
488\stopdescription
490Multiple definitions, tight:
492\startdescription{apple}
493 red fruit
495 computer
496\stopdescription
498\startdescription{orange}
499 orange fruit
501 bank
502\stopdescription
504Multiple definitions, loose:
506\startdescription{apple}
507 red fruit
509 computer
510\stopdescription
512\startdescription{orange}
513 orange fruit
515 bank
516\stopdescription
518Blank line after term, indented marker, alternate markers:
520\startdescription{apple}
521 red fruit
523 computer
524\stopdescription
526\startdescription{orange}
527 orange fruit
529 \startitemize[n][stopper=.]
530 \item
531 sublist
532 \item
533 sublist
534 \stopitemize
535\stopdescription
537\section[html-blocks]{HTML Blocks}
539Simple block on one line:
541foo
542And nested without indentation:
544foo
545bar
546Interpreted markdown in a table:
548This is {\em emphasized}
549And this is {\bf strong}
550Here's a simple block:
552foo
553This should be a code block, though:
555\starttyping
556<div>
557 foo
558</div>
559\stoptyping
561As should this:
563\starttyping
564<div>foo</div>
565\stoptyping
567Now, nested:
569foo
570This should just be an HTML comment:
572Multiline:
574Code block:
576\starttyping
577<!-- Comment -->
578\stoptyping
580Just plain comment, with trailing spaces on the line:
582Code:
584\starttyping
585<hr />
586\stoptyping
588Hr's:
590\thinrule
592\section[inline-markup]{Inline Markup}
594This is {\em emphasized}, and so {\em is this}.
596This is {\bf strong}, and so {\bf is this}.
598An {\em \useURL[url2][/url][][emphasized link]\from[url2]}.
600{\bf {\em This is strong and em.}}
602So is {\bf {\em this}} word.
604{\bf {\em This is strong and em.}}
606So is {\bf {\em this}} word.
608This is code: \type{>}, \type{$}, \type{\}, \type{\$}, \type{<html>}.
610\overstrikes{This is {\em strikeout}.}
612Superscripts: a\high{bc}d a\high{{\em hello}} a\high{hello~there}.
614Subscripts: H\low{2}O, H\low{23}O, H\low{many~of~them}O.
616These should not be superscripts or subscripts, because of the unescaped
617spaces: a\letterhat{}b c\letterhat{}d, a\lettertilde{}b c\lettertilde{}d.
619\thinrule
621\section[smart-quotes-ellipses-dashes]{Smart quotes, ellipses, dashes}
623\quotation{Hello,} said the spider. \quotation{\quote{Shelob} is my name.}
625\quote{A}, \quote{B}, and \quote{C} are letters.
627\quote{Oak,} \quote{elm,} and \quote{beech} are names of trees. So is
628\quote{pine.}
630\quote{He said, \quotation{I want to go.}} Were you alive in the 70's?
632Here is some quoted \quote{\type{code}} and a
633\quotation{\useURL[url3][http://example.com/?foo=1&bar=2][][quoted
634link]\from[url3]}.
636Some dashes: one---two --- three---four --- five.
638Dashes between numbers: 5--7, 255--66, 1987--1999.
640Ellipses\ldots{}and\ldots{}and\ldots{}.
642\thinrule
644\section[latex]{LaTeX}
646\startitemize
647\item
648 \cite[22-23]{smith.1899}
649\item
650 $2+2=4$
651\item
652 $x \in y$
653\item
654 $\alpha \wedge \omega$
655\item
656 $223$
657\item
658 $p$-Tree
659\item
660 Here's some display math:
661 \startformula \frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h} \stopformula
662\item
663 Here's one that has a line break in it: $\alpha + \omega \times x^2$.
664\stopitemize
666These shouldn't be math:
668\startitemize
669\item
670 To get the famous equation, write \type{$e = mc^2$}.
671\item
672 \$22,000 is a {\em lot} of money. So is \$34,000. (It worked if
673 \quotation{lot} is emphasized.)
674\item
675 Shoes (\$20) and socks (\$5).
676\item
677 Escaped \type{$}: \$73 {\em this should be emphasized} 23\$.
678\stopitemize
680Here's a LaTeX table:
682\thinrule
684\section[special-characters]{Special Characters}
686Here is some unicode:
688\startitemize
689\item
690 I hat: Î
691\item
692 o umlaut: ö
693\item
694 section: §
695\item
696 set membership: ∈
697\item
698 copyright: ©
699\stopitemize
701AT\&T has an ampersand in their name.
703AT\&T is another way to write it.
705This \& that.
7074 \letterless{} 5.
7096 \lettermore{} 5.
711Backslash: \letterbackslash{}
713Backtick: `
715Asterisk: *
717Underscore: \letterunderscore{}
719Left brace: \letteropenbrace{}
721Right brace: \letterclosebrace{}
723Left bracket: {[}
725Right bracket: {]}
727Left paren: (
729Right paren: )
731Greater-than: \lettermore{}
733Hash: \#
735Period: .
737Bang: !
739Plus: +
741Minus: -
743\thinrule
745\section[links]{Links}
747\subsection[explicit]{Explicit}
749Just a \useURL[url4][/url/][][URL]\from[url4].
751\useURL[url5][/url/][][URL and title]\from[url5].
753\useURL[url6][/url/][][URL and title]\from[url6].
755\useURL[url7][/url/][][URL and title]\from[url7].
757\useURL[url8][/url/][][URL and title]\from[url8]
759\useURL[url9][/url/][][URL and title]\from[url9]
761\useURL[url10][/url/with_underscore][][with\letterunderscore{}underscore]\from[url10]
763\useURL[url11][mailto:nobody@nowhere.net][][Email link]\from[url11]
765\useURL[url12][][][Empty]\from[url12].
767\subsection[reference]{Reference}
769Foo \useURL[url13][/url/][][bar]\from[url13].
771Foo \useURL[url14][/url/][][bar]\from[url14].
773Foo \useURL[url15][/url/][][bar]\from[url15].
775With \useURL[url16][/url/][][embedded {[}brackets{]}]\from[url16].
777\useURL[url17][/url/][][b]\from[url17] by itself should be a link.
779Indented \useURL[url18][/url][][once]\from[url18].
781Indented \useURL[url19][/url][][twice]\from[url19].
783Indented \useURL[url20][/url][][thrice]\from[url20].
785This should {[}not{]}{[}{]} be a link.
787\starttyping
788[not]: /url
789\stoptyping
791Foo \useURL[url21][/url/][][bar]\from[url21].
793Foo \useURL[url22][/url/][][biz]\from[url22].
795\subsection[with-ampersands]{With ampersands}
797Here's a \useURL[url23][http://example.com/?foo=1&bar=2][][link with an
798ampersand in the URL]\from[url23].
800Here's a link with an amersand in the link text:
801\useURL[url24][http://att.com/][][AT\&T]\from[url24].
803Here's an \useURL[url25][/script?foo=1&bar=2][][inline link]\from[url25].
805Here's an \useURL[url26][/script?foo=1&bar=2][][inline link in pointy
806braces]\from[url26].
808\subsection[autolinks]{Autolinks}
810With an ampersand:
811\useURL[url27][http://example.com/?foo=1&bar=2][][\hyphenatedurl{http://example.com/?foo=1\&bar=2}]\from[url27]
813\startitemize
814\item
815 In a list?
816\item
817 \useURL[url28][http://example.com/][][\hyphenatedurl{http://example.com/}]\from[url28]
818\item
819 It should.
820\stopitemize
822An e-mail address:
823\useURL[url29][mailto:nobody@nowhere.net][][\hyphenatedurl{nobody@nowhere.net}]\from[url29]
825\startblockquote
826Blockquoted:
827\useURL[url30][http://example.com/][][\hyphenatedurl{http://example.com/}]\from[url30]
828\stopblockquote
830Auto-links should not occur here: \type{<http://example.com/>}
832\starttyping
833or here: <http://example.com/>
834\stoptyping
836\thinrule
838\section[images]{Images}
840From \quotation{Voyage dans la Lune} by Georges Melies (1902):
842\placefigure[here,nonumber]{lalune}{\externalfigure[lalune.jpg]}
844Here is a movie {\externalfigure[movie.jpg]} icon.
846\thinrule
848\section[footnotes]{Footnotes}
850Here is a footnote reference,\footnote{Here is the footnote. It can go
851 anywhere after the footnote reference. It need not be placed at the end of
852 the document.} and another.\startbuffer Here's the long note. This one
853 contains multiple blocks.
855 Subsequent blocks are indented to show that they belong to the footnote (as
856 with list items).
858\starttyping
859 { <code> }
860\stoptyping
862 If you want, you can indent every line, but you can also be lazy and just
863 indent the first line of each block.\stopbuffer\footnote{\getbuffer} This
864should {\em not} be a footnote reference, because it contains a
865space.{[}\letterhat{}my note{]} Here is an inline note.\footnote{This is
866 {\em easier} to type. Inline notes may contain
867 \useURL[url31][http://google.com][][links]\from[url31] and \type{]} verbatim
868 characters, as well as {[}bracketed text{]}.}
870\startblockquote
871Notes can go in quotes.\footnote{In quote.}
872\stopblockquote
874\startitemize[n][stopper=.]
875\item
876 And in list items.\footnote{In list.}
877\stopitemize
879This paragraph should not be part of the note, as it is not indented.
881\stoptext