git.iko.soy/typeable/pandoc
on 1.8 help sign in
typeable/pandoc/tests/writer.context
891 lines 14 kB history raw
1\enableregime[utf] % use UTF-8
3\setupcolors[state=start]
4\setupinteraction[state=start, color=middleblue] % 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[11pt] % 11pt font
11\setupwhitespace[medium] % inter-paragraph spacing
13\setuphead[section][style=\tfc]
14\setuphead[subsection][style=\tfb]
15\setuphead[subsubsection][style=\bf]
17% define descr (for definition lists)
18\definedescription[descr][
19 headstyle=bold,style=normal,align=left,location=hanging,
20 width=broad,margin=1cm]
22% prevent orphaned list intros
23\setupitemize[autointro]
25% define defaults for bulleted lists
26\setupitemize[1][symbol=1][indentnext=no]
27\setupitemize[2][symbol=2][indentnext=no]
28\setupitemize[3][symbol=3][indentnext=no]
29\setupitemize[4][symbol=4][indentnext=no]
31\setupthinrules[width=15em] % width of horizontal rules
33% for block quotations
34\unprotect
36\startvariables all
37blockquote: blockquote
38\stopvariables
40\definedelimitedtext
41[\v!blockquote][\v!quotation]
43\setupdelimitedtext
44[\v!blockquote]
45[\c!left=,
46\c!right=,
47before={\blank[medium]},
48after={\blank[medium]},
51\protect
53\starttext
54\startalignment[center]
55 \blank[2*big]
56 {\tfd Pandoc Test Suite}
57 \blank[3*medium]
58 {\tfa John MacFarlane\crlf Anonymous}
59 \blank[2*medium]
60 {\tfa July 17, 2006}
61 \blank[3*medium]
62\stopalignment
64This is a set of tests for pandoc. Most of them are adapted from John Gruber's
65markdown test suite.
67\thinrule
69\subject{Headers}
71\subsubject{Level 2 with an \useURL[1][/url][][embedded link]\from[1]}
73\subsubsubject{Level 3 with {\em emphasis}}
75\subsubsubsubject{Level 4}
77\subsubsubsubsubject{Level 5}
79\subject{Level 1}
81\subsubject{Level 2 with {\em emphasis}}
83\subsubsubject{Level 3}
85with no blank line
87\subsubject{Level 2}
89with no blank line
91\thinrule
93\subject{Paragraphs}
95Here's a regular paragraph.
97In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.
98Because a hard-wrapped line in the middle of a paragraph looked like a list
99item.
101Here's one with a bullet. * criminey.
103There should be a hard line break\crlf
104here.
106\thinrule
108\subject{Block Quotes}
110E-mail style:
112\startblockquote
113This is a block quote. It is pretty short.
114\stopblockquote
116\startblockquote
117Code in a block quote:
119\starttyping
120sub status {
121 print "working";
123\stoptyping
125A list:
127\startitemize[n][stopper=.]
128\item
129 item one
130\item
131 item two
132\stopitemize
134Nested block quotes:
136\startblockquote
137nested
138\stopblockquote
140\startblockquote
141nested
142\stopblockquote
143\stopblockquote
145This should not be a block quote: 2 \lettermore{} 1.
147And a following paragraph.
149\thinrule
151\subject{Code Blocks}
153Code:
155\starttyping
156---- (should be four hyphens)
158sub status {
159 print "working";
162this code block is indented by one tab
163\stoptyping
165And:
167\starttyping
168 this code block is indented by two tabs
170These should not be escaped: \$ \\ \> \[ \{
171\stoptyping
173\thinrule
175\subject{Lists}
177\subsubject{Unordered}
179Asterisks tight:
181\startitemize
182\item
183 asterisk 1
184\item
185 asterisk 2
186\item
187 asterisk 3
188\stopitemize
190Asterisks loose:
192\startitemize
193\item
194 asterisk 1
195\item
196 asterisk 2
197\item
198 asterisk 3
199\stopitemize
201Pluses tight:
203\startitemize
204\item
205 Plus 1
206\item
207 Plus 2
208\item
209 Plus 3
210\stopitemize
212Pluses loose:
214\startitemize
215\item
216 Plus 1
217\item
218 Plus 2
219\item
220 Plus 3
221\stopitemize
223Minuses tight:
225\startitemize
226\item
227 Minus 1
228\item
229 Minus 2
230\item
231 Minus 3
232\stopitemize
234Minuses loose:
236\startitemize
237\item
238 Minus 1
239\item
240 Minus 2
241\item
242 Minus 3
243\stopitemize
245\subsubject{Ordered}
247Tight:
249\startitemize[n][stopper=.]
250\item
251 First
252\item
253 Second
254\item
255 Third
256\stopitemize
258and:
260\startitemize[n][stopper=.]
261\item
262 One
263\item
264 Two
265\item
266 Three
267\stopitemize
269Loose using tabs:
271\startitemize[n][stopper=.]
272\item
273 First
274\item
275 Second
276\item
277 Third
278\stopitemize
280and using spaces:
282\startitemize[n][stopper=.]
283\item
284 One
285\item
286 Two
287\item
288 Three
289\stopitemize
291Multiple paragraphs:
293\startitemize[n][stopper=.]
294\item
295 Item 1, graf one.
297 Item 1. graf two. The quick brown fox jumped over the lazy dog's back.
298\item
299 Item 2.
300\item
301 Item 3.
302\stopitemize
304\subsubject{Nested}
306\startitemize
307\item
308 Tab
309 \startitemize
310 \item
311 Tab
312 \startitemize
313 \item
314 Tab
315 \stopitemize
316 \stopitemize
317\stopitemize
319Here's another:
321\startitemize[n][stopper=.]
322\item
323 First
324\item
325 Second:
326 \startitemize
327 \item
328 Fee
329 \item
330 Fie
331 \item
332 Foe
333 \stopitemize
334\item
335 Third
336\stopitemize
338Same thing but with paragraphs:
340\startitemize[n][stopper=.]
341\item
342 First
343\item
344 Second:
346 \startitemize
347 \item
348 Fee
349 \item
350 Fie
351 \item
352 Foe
353 \stopitemize
354\item
355 Third
356\stopitemize
358\subsubject{Tabs and spaces}
360\startitemize
361\item
362 this is a list item indented with tabs
363\item
364 this is a list item indented with spaces
366 \startitemize
367 \item
368 this is an example list item indented with tabs
369 \item
370 this is an example list item indented with spaces
371 \stopitemize
372\stopitemize
374\subsubject{Fancy list markers}
376\startitemize[n][start=2,left=(,stopper=),width=2.0em]
377\item
378 begins with 2
379\item
380 and now 3
382 with a continuation
384 \startitemize[r][start=4,stopper=.,width=2.0em]
385 \item
386 sublist with roman numerals, starting with 4
387 \item
388 more items
389 \startitemize[A][left=(,stopper=),width=2.0em]
390 \item
391 a subsublist
392 \item
393 a subsublist
394 \stopitemize
395 \stopitemize
396\stopitemize
398Nesting:
400\startitemize[A][stopper=.]
401\item
402 Upper Alpha
403 \startitemize[R][stopper=.]
404 \item
405 Upper Roman.
406 \startitemize[n][start=6,left=(,stopper=),width=2.0em]
407 \item
408 Decimal start with 6
409 \startitemize[a][start=3,stopper=)]
410 \item
411 Lower alpha with paren
412 \stopitemize
413 \stopitemize
414 \stopitemize
415\stopitemize
417Autonumbering:
419\startitemize[n]
420\item
421 Autonumber.
422\item
423 More.
424 \startitemize[a]
425 \item
426 Nested.
427 \stopitemize
428\stopitemize
430Should not be a list item:
432M.A.~2007
434B. Williams
436\thinrule
438\subject{Definition Lists}
440Tight using spaces:
442\startdescr{apple}
443 red fruit
444\stopdescr
446\startdescr{orange}
447 orange fruit
448\stopdescr
450\startdescr{banana}
451 yellow fruit
452\stopdescr
454Tight using tabs:
456\startdescr{apple}
457 red fruit
458\stopdescr
460\startdescr{orange}
461 orange fruit
462\stopdescr
464\startdescr{banana}
465 yellow fruit
466\stopdescr
468Loose:
470\startdescr{apple}
471 red fruit
472\stopdescr
474\startdescr{orange}
475 orange fruit
476\stopdescr
478\startdescr{banana}
479 yellow fruit
480\stopdescr
482Multiple blocks with italics:
484\startdescr{{\em apple}}
485 red fruit
487 contains seeds, crisp, pleasant to taste
488\stopdescr
490\startdescr{{\em orange}}
491 orange fruit
493 \starttyping
494{ orange code block }
495 \stoptyping
497 \startblockquote
498 orange block quote
499 \stopblockquote
500\stopdescr
502Multiple definitions, tight:
504\startdescr{apple}
505 red fruit
507 computer
508\stopdescr
510\startdescr{orange}
511 orange fruit
513 bank
514\stopdescr
516Multiple definitions, loose:
518\startdescr{apple}
519 red fruit
521 computer
522\stopdescr
524\startdescr{orange}
525 orange fruit
527 bank
528\stopdescr
530Blank line after term, indented marker, alternate markers:
532\startdescr{apple}
533 red fruit
535 computer
536\stopdescr
538\startdescr{orange}
539 orange fruit
541 \startitemize[n][stopper=.]
542 \item
543 sublist
544 \item
545 sublist
546 \stopitemize
547\stopdescr
549\subject{HTML Blocks}
551Simple block on one line:
553foo
554And nested without indentation:
556foo
557bar
558Interpreted markdown in a table:
560This is {\em emphasized}
561And this is {\bf strong}
562Here's a simple block:
564foo
565This should be a code block, though:
567\starttyping
568<div>
569 foo
570</div>
571\stoptyping
573As should this:
575\starttyping
576<div>foo</div>
577\stoptyping
579Now, nested:
581foo
582This should just be an HTML comment:
584Multiline:
586Code block:
588\starttyping
589<!-- Comment -->
590\stoptyping
592Just plain comment, with trailing spaces on the line:
594Code:
596\starttyping
597<hr />
598\stoptyping
600Hr's:
602\thinrule
604\subject{Inline Markup}
606This is {\em emphasized}, and so {\em is this}.
608This is {\bf strong}, and so {\bf is this}.
610An {\em \useURL[2][/url][][emphasized link]\from[2]}.
612{\bf {\em This is strong and em.}}
614So is {\bf {\em this}} word.
616{\bf {\em This is strong and em.}}
618So is {\bf {\em this}} word.
620This is code: \type{>}, \type{$}, \type{\}, \type{\$}, \type{<html>}.
622\overstrikes{This is {\em strikeout}.}
624Superscripts: a\high{bc}d a\high{{\em hello}} a\high{hello~there}.
626Subscripts: H\low{2}O, H\low{23}O, H\low{many~of~them}O.
628These should not be superscripts or subscripts, because of the unescaped
629spaces: a\letterhat{}b c\letterhat{}d, a\lettertilde{}b c\lettertilde{}d.
631\thinrule
633\subject{Smart quotes, ellipses, dashes}
635\quotation{Hello,} said the spider. \quotation{\quote{Shelob} is my name.}
637\quote{A}, \quote{B}, and \quote{C} are letters.
639\quote{Oak,} \quote{elm,} and \quote{beech} are names of trees. So is
640\quote{pine.}
642\quote{He said, \quotation{I want to go.}} Were you alive in the 70's?
644Here is some quoted \quote{\type{code}} and a
645\quotation{\useURL[3][http://example.com/?foo=1&bar=2][][quoted
646link]\from[3]}.
648Some dashes: one---two --- three---four --- five.
650Dashes between numbers: 5--7, 255--66, 1987--1999.
652Ellipses\ldots{}and\ldots{}and\ldots{}.
654\thinrule
656\subject{LaTeX}
658\startitemize
659\item
660 \cite[22-23]{smith.1899}
661\item
662 $2+2=4$
663\item
664 $x \in y$
665\item
666 $\alpha \wedge \omega$
667\item
668 $223$
669\item
670 $p$-Tree
671\item
672 Here's some display math:
673 \startformula \frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h} \stopformula
674\item
675 Here's one that has a line break in it: $\alpha + \omega \times x^2$.
676\stopitemize
678These shouldn't be math:
680\startitemize
681\item
682 To get the famous equation, write \type{$e = mc^2$}.
683\item
684 \$22,000 is a {\em lot} of money. So is \$34,000. (It worked if
685 \quotation{lot} is emphasized.)
686\item
687 Shoes (\$20) and socks (\$5).
688\item
689 Escaped \type{$}: \$73 {\em this should be emphasized} 23\$.
690\stopitemize
692Here's a LaTeX table:
694\thinrule
696\subject{Special Characters}
698Here is some unicode:
700\startitemize
701\item
702 I hat: Î
703\item
704 o umlaut: ö
705\item
706 section: §
707\item
708 set membership: ∈
709\item
710 copyright: ©
711\stopitemize
713AT\&T has an ampersand in their name.
715AT\&T is another way to write it.
717This \& that.
7194 \letterless{} 5.
7216 \lettermore{} 5.
723Backslash: \letterbackslash{}
725Backtick: `
727Asterisk: *
729Underscore: \letterunderscore{}
731Left brace: \letteropenbrace{}
733Right brace: \letterclosebrace{}
735Left bracket: {[}
737Right bracket: {]}
739Left paren: (
741Right paren: )
743Greater-than: \lettermore{}
745Hash: \#
747Period: .
749Bang: !
751Plus: +
753Minus: -
755\thinrule
757\subject{Links}
759\subsubject{Explicit}
761Just a \useURL[4][/url/][][URL]\from[4].
763\useURL[5][/url/][][URL and title]\from[5].
765\useURL[6][/url/][][URL and title]\from[6].
767\useURL[7][/url/][][URL and title]\from[7].
769\useURL[8][/url/][][URL and title]\from[8]
771\useURL[9][/url/][][URL and title]\from[9]
773\useURL[10][/url/with_underscore][][with\letterunderscore{}underscore]\from[10]
775\useURL[11][mailto:nobody@nowhere.net][][Email link]\from[11]
777\useURL[12][][][Empty]\from[12].
779\subsubject{Reference}
781Foo \useURL[13][/url/][][bar]\from[13].
783Foo \useURL[14][/url/][][bar]\from[14].
785Foo \useURL[15][/url/][][bar]\from[15].
787With \useURL[16][/url/][][embedded {[}brackets{]}]\from[16].
789\useURL[17][/url/][][b]\from[17] by itself should be a link.
791Indented \useURL[18][/url][][once]\from[18].
793Indented \useURL[19][/url][][twice]\from[19].
795Indented \useURL[20][/url][][thrice]\from[20].
797This should {[}not{]}{[}{]} be a link.
799\starttyping
800[not]: /url
801\stoptyping
803Foo \useURL[21][/url/][][bar]\from[21].
805Foo \useURL[22][/url/][][biz]\from[22].
807\subsubject{With ampersands}
809Here's a \useURL[23][http://example.com/?foo=1&bar=2][][link with an ampersand
810in the URL]\from[23].
812Here's a link with an amersand in the link text:
813\useURL[24][http://att.com/][][AT\&T]\from[24].
815Here's an \useURL[25][/script?foo=1&bar=2][][inline link]\from[25].
817Here's an \useURL[26][/script?foo=1&bar=2][][inline link in pointy
818braces]\from[26].
820\subsubject{Autolinks}
822With an ampersand:
823\useURL[27][http://example.com/?foo=1&bar=2][][http://example.com/?foo=1\&bar=2]\from[27]
825\startitemize
826\item
827 In a list?
828\item
829 \useURL[28][http://example.com/][][http://example.com/]\from[28]
830\item
831 It should.
832\stopitemize
834An e-mail address:
835\useURL[29][mailto:nobody@nowhere.net][][nobody@nowhere.net]\from[29]
837\startblockquote
838Blockquoted: \useURL[30][http://example.com/][][http://example.com/]\from[30]
839\stopblockquote
841Auto-links should not occur here: \type{<http://example.com/>}
843\starttyping
844or here: <http://example.com/>
845\stoptyping
847\thinrule
849\subject{Images}
851From \quotation{Voyage dans la Lune} by Georges Melies (1902):
853\placefigure[here,nonumber]{lalune}{\externalfigure[lalune.jpg]}
855Here is a movie {\externalfigure[movie.jpg]} icon.
857\thinrule
859\subject{Footnotes}
861Here is a footnote reference,\footnote{Here is the footnote. It can go
862 anywhere after the footnote reference. It need not be placed at the end of
863 the document.} and another.\footnote{Here's the long note. This one contains
864 multiple blocks.
866 Subsequent blocks are indented to show that they belong to the footnote (as
867 with list items).
869 \starttyping
870 { <code> }
871 \stoptyping
873 If you want, you can indent every line, but you can also be lazy and just
874 indent the first line of each block.} This should {\em not} be a footnote
875reference, because it contains a space.{[}\letterhat{}my note{]} Here is an
876inline note.\footnote{This is {\em easier} to type. Inline notes may contain
877 \useURL[31][http://google.com][][links]\from[31] and \type{]} verbatim
878 characters, as well as {[}bracketed text{]}.}
880\startblockquote
881Notes can go in quotes.\footnote{In quote.}
882\stopblockquote
884\startitemize[n][stopper=.]
885\item
886 And in list items.\footnote{In list.}
887\stopitemize
889This paragraph should not be part of the note, as it is not indented.
891\stoptext