git.iko.soy/typeable/pandoc
on 1.15.0.5 help sign in
typeable/pandoc/tests/writer.context
886 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, alternative=hanging]
30\setupitemize[autointro] % prevent orphan list intro
31\setupitemize[indentnext=no]
33\setupfloat[figure][default={here,nonumber}]
34\setupfloat[table][default={here,nonumber}]
36\setupthinrules[width=15em] % width of horizontal rules
38\setupdelimitedtext
39 [blockquote]
40 [before={\blank[medium]},
41 after={\blank[medium]},
42 indentnext=no,
43 ]
46\starttext
47\startalignment[center]
48 \blank[2*big]
49 {\tfd Pandoc Test Suite}
50 \blank[3*medium]
51 {\tfa John MacFarlane\crlf Anonymous}
52 \blank[2*medium]
53 {\tfa July 17, 2006}
54 \blank[3*medium]
55\stopalignment
57This is a set of tests for pandoc. Most of them are adapted from John Gruber's
58markdown test suite.
60\thinrule
62\section[headers]{Headers}
64\subsection[level-2-with-an-embedded-link]{Level 2 with an
65\useURL[url1][/url][][embedded link]\from[url1]}
67\subsubsection[level-3-with-emphasis]{Level 3 with {\em emphasis}}
69\subsubsubsection[level-4]{Level 4}
71\subsubsubsubsection[level-5]{Level 5}
73\section[level-1]{Level 1}
75\subsection[level-2-with-emphasis]{Level 2 with {\em emphasis}}
77\subsubsection[level-3]{Level 3}
79with no blank line
81\subsection[level-2]{Level 2}
83with no blank line
85\thinrule
87\section[paragraphs]{Paragraphs}
89Here's a regular paragraph.
91In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.
92Because a hard-wrapped line in the middle of a paragraph looked like a list
93item.
95Here's one with a bullet. * criminey.
97There should be a hard line break\crlf
98here.
100\thinrule
102\section[block-quotes]{Block Quotes}
104E-mail style:
106\startblockquote
107This is a block quote. It is pretty short.
108\stopblockquote
110\startblockquote
111Code in a block quote:
113\starttyping
114sub status {
115 print "working";
117\stoptyping
119A list:
121\startitemize[n,packed][stopper=.]
122\item
123 item one
124\item
125 item two
126\stopitemize
128Nested block quotes:
130\startblockquote
131nested
132\stopblockquote
134\startblockquote
135nested
136\stopblockquote
137\stopblockquote
139This should not be a block quote: 2 > 1.
141And a following paragraph.
143\thinrule
145\section[code-blocks]{Code Blocks}
147Code:
149\starttyping
150---- (should be four hyphens)
152sub status {
153 print "working";
156this code block is indented by one tab
157\stoptyping
159And:
161\starttyping
162 this code block is indented by two tabs
164These should not be escaped: \$ \\ \> \[ \{
165\stoptyping
167\thinrule
169\section[lists]{Lists}
171\subsection[unordered]{Unordered}
173Asterisks tight:
175\startitemize[packed]
176\item
177 asterisk 1
178\item
179 asterisk 2
180\item
181 asterisk 3
182\stopitemize
184Asterisks loose:
186\startitemize
187\item
188 asterisk 1
189\item
190 asterisk 2
191\item
192 asterisk 3
193\stopitemize
195Pluses tight:
197\startitemize[packed]
198\item
199 Plus 1
200\item
201 Plus 2
202\item
203 Plus 3
204\stopitemize
206Pluses loose:
208\startitemize
209\item
210 Plus 1
211\item
212 Plus 2
213\item
214 Plus 3
215\stopitemize
217Minuses tight:
219\startitemize[packed]
220\item
221 Minus 1
222\item
223 Minus 2
224\item
225 Minus 3
226\stopitemize
228Minuses loose:
230\startitemize
231\item
232 Minus 1
233\item
234 Minus 2
235\item
236 Minus 3
237\stopitemize
239\subsection[ordered]{Ordered}
241Tight:
243\startitemize[n,packed][stopper=.]
244\item
245 First
246\item
247 Second
248\item
249 Third
250\stopitemize
252and:
254\startitemize[n,packed][stopper=.]
255\item
256 One
257\item
258 Two
259\item
260 Three
261\stopitemize
263Loose using tabs:
265\startitemize[n][stopper=.]
266\item
267 First
268\item
269 Second
270\item
271 Third
272\stopitemize
274and using spaces:
276\startitemize[n][stopper=.]
277\item
278 One
279\item
280 Two
281\item
282 Three
283\stopitemize
285Multiple paragraphs:
287\startitemize[n][stopper=.]
288\item
289 Item 1, graf one.
291 Item 1. graf two. The quick brown fox jumped over the lazy dog's back.
292\item
293 Item 2.
294\item
295 Item 3.
296\stopitemize
298\subsection[nested]{Nested}
300\startitemize[packed]
301\item
302 Tab
303 \startitemize[packed]
304 \item
305 Tab
306 \startitemize[packed]
307 \item
308 Tab
309 \stopitemize
310 \stopitemize
311\stopitemize
313Here's another:
315\startitemize[n,packed][stopper=.]
316\item
317 First
318\item
319 Second:
320 \startitemize[packed]
321 \item
322 Fee
323 \item
324 Fie
325 \item
326 Foe
327 \stopitemize
328\item
329 Third
330\stopitemize
332Same thing but with paragraphs:
334\startitemize[n][stopper=.]
335\item
336 First
337\item
338 Second:
340 \startitemize[packed]
341 \item
342 Fee
343 \item
344 Fie
345 \item
346 Foe
347 \stopitemize
348\item
349 Third
350\stopitemize
352\subsection[tabs-and-spaces]{Tabs and spaces}
354\startitemize
355\item
356 this is a list item indented with tabs
357\item
358 this is a list item indented with spaces
360 \startitemize
361 \item
362 this is an example list item indented with tabs
363 \item
364 this is an example list item indented with spaces
365 \stopitemize
366\stopitemize
368\subsection[fancy-list-markers]{Fancy list markers}
370\startitemize[n][start=2,left=(,stopper=),width=2.0em]
371\item
372 begins with 2
373\item
374 and now 3
376 with a continuation
378 \startitemize[r,packed][start=4,stopper=.,width=2.0em]
379 \item
380 sublist with roman numerals, starting with 4
381 \item
382 more items
383 \startitemize[A,packed][left=(,stopper=),width=2.0em]
384 \item
385 a subsublist
386 \item
387 a subsublist
388 \stopitemize
389 \stopitemize
390\stopitemize
392Nesting:
394\startitemize[A,packed][stopper=.]
395\item
396 Upper Alpha
397 \startitemize[R,packed][stopper=.]
398 \item
399 Upper Roman.
400 \startitemize[n,packed][start=6,left=(,stopper=),width=2.0em]
401 \item
402 Decimal start with 6
403 \startitemize[a,packed][start=3,stopper=)]
404 \item
405 Lower alpha with paren
406 \stopitemize
407 \stopitemize
408 \stopitemize
409\stopitemize
411Autonumbering:
413\startitemize[n,packed]
414\item
415 Autonumber.
416\item
417 More.
418 \startitemize[a,packed]
419 \item
420 Nested.
421 \stopitemize
422\stopitemize
424Should not be a list item:
426M.A.~2007
428B. Williams
430\thinrule
432\section[definition-lists]{Definition Lists}
434Tight using spaces:
436\startdescription{apple}
437 red fruit
438\stopdescription
440\startdescription{orange}
441 orange fruit
442\stopdescription
444\startdescription{banana}
445 yellow fruit
446\stopdescription
448Tight using tabs:
450\startdescription{apple}
451 red fruit
452\stopdescription
454\startdescription{orange}
455 orange fruit
456\stopdescription
458\startdescription{banana}
459 yellow fruit
460\stopdescription
462Loose:
464\startdescription{apple}
465 red fruit
466\stopdescription
468\startdescription{orange}
469 orange fruit
470\stopdescription
472\startdescription{banana}
473 yellow fruit
474\stopdescription
476Multiple blocks with italics:
478\startdescription{{\em apple}}
479 red fruit
481 contains seeds, crisp, pleasant to taste
482\stopdescription
484\startdescription{{\em orange}}
485 orange fruit
487\starttyping
488{ orange code block }
489\stoptyping
491 \startblockquote
492 orange block quote
493 \stopblockquote
494\stopdescription
496Multiple definitions, tight:
498\startdescription{apple}
499 red fruit
501 computer
502\stopdescription
504\startdescription{orange}
505 orange fruit
507 bank
508\stopdescription
510Multiple definitions, loose:
512\startdescription{apple}
513 red fruit
515 computer
516\stopdescription
518\startdescription{orange}
519 orange fruit
521 bank
522\stopdescription
524Blank line after term, indented marker, alternate markers:
526\startdescription{apple}
527 red fruit
529 computer
530\stopdescription
532\startdescription{orange}
533 orange fruit
535 \startitemize[n,packed][stopper=.]
536 \item
537 sublist
538 \item
539 sublist
540 \stopitemize
541\stopdescription
543\section[html-blocks]{HTML Blocks}
545Simple block on one line:
547foo
548And nested without indentation:
550foo
552bar
553Interpreted markdown in a table:
555This is {\em emphasized}
556And this is {\bf strong}
557Here's a simple block:
559foo
561This should be a code block, though:
563\starttyping
564<div>
565 foo
566</div>
567\stoptyping
569As should this:
571\starttyping
572<div>foo</div>
573\stoptyping
575Now, nested:
577foo
578This should just be an HTML comment:
580Multiline:
582Code block:
584\starttyping
585<!-- Comment -->
586\stoptyping
588Just plain comment, with trailing spaces on the line:
590Code:
592\starttyping
593<hr />
594\stoptyping
596Hr's:
598\thinrule
600\section[inline-markup]{Inline Markup}
602This is {\em emphasized}, and so {\em is this}.
604This is {\bf strong}, and so {\bf is this}.
606An {\em \useURL[url2][/url][][emphasized link]\from[url2]}.
608{\bf {\em This is strong and em.}}
610So is {\bf {\em this}} word.
612{\bf {\em This is strong and em.}}
614So is {\bf {\em this}} word.
616This is code: \type{>}, \type{$}, \type{\}, \type{\$}, \type{<html>}.
618\overstrikes{This is {\em strikeout}.}
620Superscripts: a\high{bc}d a\high{{\em hello}} a\high{hello~there}.
622Subscripts: H\low{2}O, H\low{23}O, H\low{many~of~them}O.
624These should not be superscripts or subscripts, because of the unescaped
625spaces: a^b c^d, a\lettertilde{}b c\lettertilde{}d.
627\thinrule
629\section[smart-quotes-ellipses-dashes]{Smart quotes, ellipses, dashes}
631\quotation{Hello,} said the spider. \quotation{\quote{Shelob} is my name.}
633\quote{A}, \quote{B}, and \quote{C} are letters.
635\quote{Oak,} \quote{elm,} and \quote{beech} are names of trees. So is
636\quote{pine.}
638\quote{He said, \quotation{I want to go.}} Were you alive in the 70's?
640Here is some quoted \quote{\type{code}} and a
641\quotation{\useURL[url3][http://example.com/?foo=1&bar=2][][quoted
642link]\from[url3]}.
644Some dashes: one---two --- three---four --- five.
646Dashes between numbers: 5--7, 255--66, 1987--1999.
648Ellipses\ldots{}and\ldots{}and\ldots{}.
650\thinrule
652\section[latex]{LaTeX}
654\startitemize[packed]
655\item
656 \cite[22-23]{smith.1899}
657\item
658 $2+2=4$
659\item
660 $x \in y$
661\item
662 $\alpha \wedge \omega$
663\item
664 $223$
665\item
666 $p$-Tree
667\item
668 Here's some display math:
669 \startformula \frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h} \stopformula
670\item
671 Here's one that has a line break in it: $\alpha + \omega \times x^2$.
672\stopitemize
674These shouldn't be math:
676\startitemize[packed]
677\item
678 To get the famous equation, write \type{$e = mc^2$}.
679\item
680 \$22,000 is a {\em lot} of money. So is \$34,000. (It worked if
681 \quotation{lot} is emphasized.)
682\item
683 Shoes (\$20) and socks (\$5).
684\item
685 Escaped \type{$}: \$73 {\em this should be emphasized} 23\$.
686\stopitemize
688Here's a LaTeX table:
690\thinrule
692\section[special-characters]{Special Characters}
694Here is some unicode:
696\startitemize[packed]
697\item
698 I hat: Î
699\item
700 o umlaut: ö
701\item
702 section: §
703\item
704 set membership: ∈
705\item
706 copyright: ©
707\stopitemize
709AT&T has an ampersand in their name.
711AT&T is another way to write it.
713This & that.
7154 < 5.
7176 > 5.
719Backslash: \letterbackslash{}
721Backtick: `
723Asterisk: *
725Underscore: _
727Left brace: \{
729Right brace: \}
731Left bracket: {[}
733Right bracket: {]}
735Left paren: (
737Right paren: )
739Greater-than: >
741Hash: \#
743Period: .
745Bang: !
747Plus: +
749Minus: -
751\thinrule
753\section[links]{Links}
755\subsection[explicit]{Explicit}
757Just a \useURL[url4][/url/][][URL]\from[url4].
759\useURL[url5][/url/][][URL and title]\from[url5].
761\useURL[url6][/url/][][URL and title]\from[url6].
763\useURL[url7][/url/][][URL and title]\from[url7].
765\useURL[url8][/url/][][URL and title]\from[url8]
767\useURL[url9][/url/][][URL and title]\from[url9]
769\useURL[url10][/url/with_underscore][][with_underscore]\from[url10]
771\useURL[url11][mailto:nobody@nowhere.net][][Email link]\from[url11]
773\useURL[url12][][][Empty]\from[url12].
775\subsection[reference]{Reference}
777Foo \useURL[url13][/url/][][bar]\from[url13].
779Foo \useURL[url14][/url/][][bar]\from[url14].
781Foo \useURL[url15][/url/][][bar]\from[url15].
783With \useURL[url16][/url/][][embedded {[}brackets{]}]\from[url16].
785\useURL[url17][/url/][][b]\from[url17] by itself should be a link.
787Indented \useURL[url18][/url][][once]\from[url18].
789Indented \useURL[url19][/url][][twice]\from[url19].
791Indented \useURL[url20][/url][][thrice]\from[url20].
793This should {[}not{]}{[}{]} be a link.
795\starttyping
796[not]: /url
797\stoptyping
799Foo \useURL[url21][/url/][][bar]\from[url21].
801Foo \useURL[url22][/url/][][biz]\from[url22].
803\subsection[with-ampersands]{With ampersands}
805Here's a \useURL[url23][http://example.com/?foo=1&bar=2][][link with an
806ampersand in the URL]\from[url23].
808Here's a link with an amersand in the link text:
809\useURL[url24][http://att.com/][][AT&T]\from[url24].
811Here's an \useURL[url25][/script?foo=1&bar=2][][inline link]\from[url25].
813Here's an \useURL[url26][/script?foo=1&bar=2][][inline link in pointy
814braces]\from[url26].
816\subsection[autolinks]{Autolinks}
818With an ampersand: \useURL[url27][http://example.com/?foo=1&bar=2]\from[url27]
820\startitemize[packed]
821\item
822 In a list?
823\item
824 \useURL[url28][http://example.com/]\from[url28]
825\item
826 It should.
827\stopitemize
829An e-mail address:
830\useURL[url29][mailto:nobody@nowhere.net][][nobody@nowhere.net]\from[url29]
832\startblockquote
833Blockquoted: \useURL[url30][http://example.com/]\from[url30]
834\stopblockquote
836Auto-links should not occur here: \type{<http://example.com/>}
838\starttyping
839or here: <http://example.com/>
840\stoptyping
842\thinrule
844\section[images]{Images}
846From \quotation{Voyage dans la Lune} by Georges Melies (1902):
848\placefigure{lalune}{\externalfigure[lalune.jpg]}
850Here is a movie {\externalfigure[movie.jpg]} icon.
852\thinrule
854\section[footnotes]{Footnotes}
856Here is a footnote reference,\footnote{Here is the footnote. It can go
857 anywhere after the footnote reference. It need not be placed at the end of
858 the document.} and another.\startbuffer Here's the long note. This one
859 contains multiple blocks.
861 Subsequent blocks are indented to show that they belong to the footnote (as
862 with list items).
864\starttyping
865 { <code> }
866\stoptyping
868 If you want, you can indent every line, but you can also be lazy and just
869 indent the first line of each block.\stopbuffer\footnote{\getbuffer} This
870should {\em not} be a footnote reference, because it contains a space.{[}^my
871note{]} Here is an inline note.\footnote{This is {\em easier} to type. Inline
872 notes may contain \useURL[url31][http://google.com][][links]\from[url31] and
873 \type{]} verbatim characters, as well as {[}bracketed text{]}.}
875\startblockquote
876Notes can go in quotes.\footnote{In quote.}
877\stopblockquote
879\startitemize[n,packed][stopper=.]
880\item
881 And in list items.\footnote{In list.}
882\stopitemize
884This paragraph should not be part of the note, as it is not indented.
886\stoptext