git.iko.soy/typeable/pandoc
on de79021 help sign in
typeable/pandoc/tests/writer.context
879 lines 14 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]
20\setuphead[subsection] [style=\tfb]
21\setuphead[subsubsection][style=\bf]
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\subject{Headers}
58\subsubject{Level 2 with an \useURL[1][/url][][embedded link]\from[1]}
60\subsubsubject{Level 3 with {\em emphasis}}
62\subsubsubsubject{Level 4}
64\subsubsubsubsubject{Level 5}
66\subject{Level 1}
68\subsubject{Level 2 with {\em emphasis}}
70\subsubsubject{Level 3}
72with no blank line
74\subsubject{Level 2}
76with no blank line
78\thinrule
80\subject{Paragraphs}
82Here's a regular paragraph.
84In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.
85Because a hard-wrapped line in the middle of a paragraph looked like a list
86item.
88Here's one with a bullet. * criminey.
90There should be a hard line break\crlf
91here.
93\thinrule
95\subject{Block Quotes}
97E-mail style:
99\startblockquote
100This is a block quote. It is pretty short.
101\stopblockquote
103\startblockquote
104Code in a block quote:
106\starttyping
107sub status {
108 print "working";
110\stoptyping
112A list:
114\startitemize[n][stopper=.]
115\item
116 item one
117\item
118 item two
119\stopitemize
121Nested block quotes:
123\startblockquote
124nested
125\stopblockquote
127\startblockquote
128nested
129\stopblockquote
130\stopblockquote
132This should not be a block quote: 2 \lettermore{} 1.
134And a following paragraph.
136\thinrule
138\subject{Code Blocks}
140Code:
142\starttyping
143---- (should be four hyphens)
145sub status {
146 print "working";
149this code block is indented by one tab
150\stoptyping
152And:
154\starttyping
155 this code block is indented by two tabs
157These should not be escaped: \$ \\ \> \[ \{
158\stoptyping
160\thinrule
162\subject{Lists}
164\subsubject{Unordered}
166Asterisks tight:
168\startitemize
169\item
170 asterisk 1
171\item
172 asterisk 2
173\item
174 asterisk 3
175\stopitemize
177Asterisks loose:
179\startitemize
180\item
181 asterisk 1
182\item
183 asterisk 2
184\item
185 asterisk 3
186\stopitemize
188Pluses tight:
190\startitemize
191\item
192 Plus 1
193\item
194 Plus 2
195\item
196 Plus 3
197\stopitemize
199Pluses loose:
201\startitemize
202\item
203 Plus 1
204\item
205 Plus 2
206\item
207 Plus 3
208\stopitemize
210Minuses tight:
212\startitemize
213\item
214 Minus 1
215\item
216 Minus 2
217\item
218 Minus 3
219\stopitemize
221Minuses loose:
223\startitemize
224\item
225 Minus 1
226\item
227 Minus 2
228\item
229 Minus 3
230\stopitemize
232\subsubject{Ordered}
234Tight:
236\startitemize[n][stopper=.]
237\item
238 First
239\item
240 Second
241\item
242 Third
243\stopitemize
245and:
247\startitemize[n][stopper=.]
248\item
249 One
250\item
251 Two
252\item
253 Three
254\stopitemize
256Loose using tabs:
258\startitemize[n][stopper=.]
259\item
260 First
261\item
262 Second
263\item
264 Third
265\stopitemize
267and using spaces:
269\startitemize[n][stopper=.]
270\item
271 One
272\item
273 Two
274\item
275 Three
276\stopitemize
278Multiple paragraphs:
280\startitemize[n][stopper=.]
281\item
282 Item 1, graf one.
284 Item 1. graf two. The quick brown fox jumped over the lazy dog's back.
285\item
286 Item 2.
287\item
288 Item 3.
289\stopitemize
291\subsubject{Nested}
293\startitemize
294\item
295 Tab
296 \startitemize
297 \item
298 Tab
299 \startitemize
300 \item
301 Tab
302 \stopitemize
303 \stopitemize
304\stopitemize
306Here's another:
308\startitemize[n][stopper=.]
309\item
310 First
311\item
312 Second:
313 \startitemize
314 \item
315 Fee
316 \item
317 Fie
318 \item
319 Foe
320 \stopitemize
321\item
322 Third
323\stopitemize
325Same thing but with paragraphs:
327\startitemize[n][stopper=.]
328\item
329 First
330\item
331 Second:
333 \startitemize
334 \item
335 Fee
336 \item
337 Fie
338 \item
339 Foe
340 \stopitemize
341\item
342 Third
343\stopitemize
345\subsubject{Tabs and spaces}
347\startitemize
348\item
349 this is a list item indented with tabs
350\item
351 this is a list item indented with spaces
353 \startitemize
354 \item
355 this is an example list item indented with tabs
356 \item
357 this is an example list item indented with spaces
358 \stopitemize
359\stopitemize
361\subsubject{Fancy list markers}
363\startitemize[n][start=2,left=(,stopper=),width=2.0em]
364\item
365 begins with 2
366\item
367 and now 3
369 with a continuation
371 \startitemize[r][start=4,stopper=.,width=2.0em]
372 \item
373 sublist with roman numerals, starting with 4
374 \item
375 more items
376 \startitemize[A][left=(,stopper=),width=2.0em]
377 \item
378 a subsublist
379 \item
380 a subsublist
381 \stopitemize
382 \stopitemize
383\stopitemize
385Nesting:
387\startitemize[A][stopper=.]
388\item
389 Upper Alpha
390 \startitemize[R][stopper=.]
391 \item
392 Upper Roman.
393 \startitemize[n][start=6,left=(,stopper=),width=2.0em]
394 \item
395 Decimal start with 6
396 \startitemize[a][start=3,stopper=)]
397 \item
398 Lower alpha with paren
399 \stopitemize
400 \stopitemize
401 \stopitemize
402\stopitemize
404Autonumbering:
406\startitemize[n]
407\item
408 Autonumber.
409\item
410 More.
411 \startitemize[a]
412 \item
413 Nested.
414 \stopitemize
415\stopitemize
417Should not be a list item:
419M.A.~2007
421B. Williams
423\thinrule
425\subject{Definition Lists}
427Tight using spaces:
429\startdescription{apple}
430 red fruit
431\stopdescription
433\startdescription{orange}
434 orange fruit
435\stopdescription
437\startdescription{banana}
438 yellow fruit
439\stopdescription
441Tight using tabs:
443\startdescription{apple}
444 red fruit
445\stopdescription
447\startdescription{orange}
448 orange fruit
449\stopdescription
451\startdescription{banana}
452 yellow fruit
453\stopdescription
455Loose:
457\startdescription{apple}
458 red fruit
459\stopdescription
461\startdescription{orange}
462 orange fruit
463\stopdescription
465\startdescription{banana}
466 yellow fruit
467\stopdescription
469Multiple blocks with italics:
471\startdescription{{\em apple}}
472 red fruit
474 contains seeds, crisp, pleasant to taste
475\stopdescription
477\startdescription{{\em orange}}
478 orange fruit
480\starttyping
481{ orange code block }
482\stoptyping
484 \startblockquote
485 orange block quote
486 \stopblockquote
487\stopdescription
489Multiple definitions, tight:
491\startdescription{apple}
492 red fruit
494 computer
495\stopdescription
497\startdescription{orange}
498 orange fruit
500 bank
501\stopdescription
503Multiple definitions, loose:
505\startdescription{apple}
506 red fruit
508 computer
509\stopdescription
511\startdescription{orange}
512 orange fruit
514 bank
515\stopdescription
517Blank line after term, indented marker, alternate markers:
519\startdescription{apple}
520 red fruit
522 computer
523\stopdescription
525\startdescription{orange}
526 orange fruit
528 \startitemize[n][stopper=.]
529 \item
530 sublist
531 \item
532 sublist
533 \stopitemize
534\stopdescription
536\subject{HTML Blocks}
538Simple block on one line:
540foo
541And nested without indentation:
543foo
544bar
545Interpreted markdown in a table:
547This is {\em emphasized}
548And this is {\bf strong}
549Here's a simple block:
551foo
552This should be a code block, though:
554\starttyping
555<div>
556 foo
557</div>
558\stoptyping
560As should this:
562\starttyping
563<div>foo</div>
564\stoptyping
566Now, nested:
568foo
569This should just be an HTML comment:
571Multiline:
573Code block:
575\starttyping
576<!-- Comment -->
577\stoptyping
579Just plain comment, with trailing spaces on the line:
581Code:
583\starttyping
584<hr />
585\stoptyping
587Hr's:
589\thinrule
591\subject{Inline Markup}
593This is {\em emphasized}, and so {\em is this}.
595This is {\bf strong}, and so {\bf is this}.
597An {\em \useURL[2][/url][][emphasized link]\from[2]}.
599{\bf {\em This is strong and em.}}
601So is {\bf {\em this}} word.
603{\bf {\em This is strong and em.}}
605So is {\bf {\em this}} word.
607This is code: \type{>}, \type{$}, \type{\}, \type{\$}, \type{<html>}.
609\overstrikes{This is {\em strikeout}.}
611Superscripts: a\high{bc}d a\high{{\em hello}} a\high{hello~there}.
613Subscripts: H\low{2}O, H\low{23}O, H\low{many~of~them}O.
615These should not be superscripts or subscripts, because of the unescaped
616spaces: a\letterhat{}b c\letterhat{}d, a\lettertilde{}b c\lettertilde{}d.
618\thinrule
620\subject{Smart quotes, ellipses, dashes}
622\quotation{Hello,} said the spider. \quotation{\quote{Shelob} is my name.}
624\quote{A}, \quote{B}, and \quote{C} are letters.
626\quote{Oak,} \quote{elm,} and \quote{beech} are names of trees. So is
627\quote{pine.}
629\quote{He said, \quotation{I want to go.}} Were you alive in the 70's?
631Here is some quoted \quote{\type{code}} and a
632\quotation{\useURL[3][http://example.com/?foo=1&bar=2][][quoted
633link]\from[3]}.
635Some dashes: one---two --- three---four --- five.
637Dashes between numbers: 5--7, 255--66, 1987--1999.
639Ellipses\ldots{}and\ldots{}and\ldots{}.
641\thinrule
643\subject{LaTeX}
645\startitemize
646\item
647 \cite[22-23]{smith.1899}
648\item
649 $2+2=4$
650\item
651 $x \in y$
652\item
653 $\alpha \wedge \omega$
654\item
655 $223$
656\item
657 $p$-Tree
658\item
659 Here's some display math:
660 \startformula \frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h} \stopformula
661\item
662 Here's one that has a line break in it: $\alpha + \omega \times x^2$.
663\stopitemize
665These shouldn't be math:
667\startitemize
668\item
669 To get the famous equation, write \type{$e = mc^2$}.
670\item
671 \$22,000 is a {\em lot} of money. So is \$34,000. (It worked if
672 \quotation{lot} is emphasized.)
673\item
674 Shoes (\$20) and socks (\$5).
675\item
676 Escaped \type{$}: \$73 {\em this should be emphasized} 23\$.
677\stopitemize
679Here's a LaTeX table:
681\thinrule
683\subject{Special Characters}
685Here is some unicode:
687\startitemize
688\item
689 I hat: Î
690\item
691 o umlaut: ö
692\item
693 section: §
694\item
695 set membership: ∈
696\item
697 copyright: ©
698\stopitemize
700AT\&T has an ampersand in their name.
702AT\&T is another way to write it.
704This \& that.
7064 \letterless{} 5.
7086 \lettermore{} 5.
710Backslash: \letterbackslash{}
712Backtick: `
714Asterisk: *
716Underscore: \letterunderscore{}
718Left brace: \letteropenbrace{}
720Right brace: \letterclosebrace{}
722Left bracket: {[}
724Right bracket: {]}
726Left paren: (
728Right paren: )
730Greater-than: \lettermore{}
732Hash: \#
734Period: .
736Bang: !
738Plus: +
740Minus: -
742\thinrule
744\subject{Links}
746\subsubject{Explicit}
748Just a \useURL[4][/url/][][URL]\from[4].
750\useURL[5][/url/][][URL and title]\from[5].
752\useURL[6][/url/][][URL and title]\from[6].
754\useURL[7][/url/][][URL and title]\from[7].
756\useURL[8][/url/][][URL and title]\from[8]
758\useURL[9][/url/][][URL and title]\from[9]
760\useURL[10][/url/with_underscore][][with\letterunderscore{}underscore]\from[10]
762\useURL[11][mailto:nobody@nowhere.net][][Email link]\from[11]
764\useURL[12][][][Empty]\from[12].
766\subsubject{Reference}
768Foo \useURL[13][/url/][][bar]\from[13].
770Foo \useURL[14][/url/][][bar]\from[14].
772Foo \useURL[15][/url/][][bar]\from[15].
774With \useURL[16][/url/][][embedded {[}brackets{]}]\from[16].
776\useURL[17][/url/][][b]\from[17] by itself should be a link.
778Indented \useURL[18][/url][][once]\from[18].
780Indented \useURL[19][/url][][twice]\from[19].
782Indented \useURL[20][/url][][thrice]\from[20].
784This should {[}not{]}{[}{]} be a link.
786\starttyping
787[not]: /url
788\stoptyping
790Foo \useURL[21][/url/][][bar]\from[21].
792Foo \useURL[22][/url/][][biz]\from[22].
794\subsubject{With ampersands}
796Here's a \useURL[23][http://example.com/?foo=1&bar=2][][link with an ampersand
797in the URL]\from[23].
799Here's a link with an amersand in the link text:
800\useURL[24][http://att.com/][][AT\&T]\from[24].
802Here's an \useURL[25][/script?foo=1&bar=2][][inline link]\from[25].
804Here's an \useURL[26][/script?foo=1&bar=2][][inline link in pointy
805braces]\from[26].
807\subsubject{Autolinks}
809With an ampersand:
810\useURL[27][http://example.com/?foo=1&bar=2][][http://example.com/?foo=1\&bar=2]\from[27]
812\startitemize
813\item
814 In a list?
815\item
816 \useURL[28][http://example.com/][][http://example.com/]\from[28]
817\item
818 It should.
819\stopitemize
821An e-mail address:
822\useURL[29][mailto:nobody@nowhere.net][][nobody@nowhere.net]\from[29]
824\startblockquote
825Blockquoted: \useURL[30][http://example.com/][][http://example.com/]\from[30]
826\stopblockquote
828Auto-links should not occur here: \type{<http://example.com/>}
830\starttyping
831or here: <http://example.com/>
832\stoptyping
834\thinrule
836\subject{Images}
838From \quotation{Voyage dans la Lune} by Georges Melies (1902):
840\placefigure[here,nonumber]{lalune}{\externalfigure[lalune.jpg]}
842Here is a movie {\externalfigure[movie.jpg]} icon.
844\thinrule
846\subject{Footnotes}
848Here is a footnote reference,\footnote{Here is the footnote. It can go
849 anywhere after the footnote reference. It need not be placed at the end of
850 the document.} and another.\startbuffer Here's the long note. This one
851 contains multiple blocks.
853 Subsequent blocks are indented to show that they belong to the footnote (as
854 with list items).
856\starttyping
857 { <code> }
858\stoptyping
860 If you want, you can indent every line, but you can also be lazy and just
861 indent the first line of each block.\stopbuffer\footnote{\getbuffer} This
862should {\em not} be a footnote reference, because it contains a
863space.{[}\letterhat{}my note{]} Here is an inline note.\footnote{This is
864 {\em easier} to type. Inline notes may contain
865 \useURL[31][http://google.com][][links]\from[31] and \type{]} verbatim
866 characters, as well as {[}bracketed text{]}.}
868\startblockquote
869Notes can go in quotes.\footnote{In quote.}
870\stopblockquote
872\startitemize[n][stopper=.]
873\item
874 And in list items.\footnote{In list.}
875\stopitemize
877This paragraph should not be part of the note, as it is not indented.
879\stoptext