git.iko.soy/typeable/pandoc
on e02cfcd help sign in
typeable/pandoc/test/writer.context
888 lines 15 kB history raw
1% Enable hyperlinks
2\setupinteraction
3 [state=start,
4 title={Pandoc Test Suite},
5 author={John MacFarlane; Anonymous},
6 style=,
7 color=,
8 contrastcolor=]
9% make chapter, section bookmarks visible when opening document
10\placebookmarks[chapter, section, subsection, subsubsection, subsubsubsection, subsubsubsubsection][chapter, section]
11\setupinteractionscreen[option=bookmark]
12\setuptagging[state=start]
14% use microtypography
15\definefontfeature[default][default][script=latn, protrusion=quality, expansion=quality, itlc=yes, textitalics=yes, onum=yes, pnum=yes]
16\definefontfeature[smallcaps][script=latn, protrusion=quality, expansion=quality, smcp=yes, onum=yes, pnum=yes]
17\setupalign[hz,hanging]
18\setupitaliccorrection[global, always]
19\setupbodyfontenvironment[default][em=italic] % use italic as em, not slanted
20\usemodule[simplefonts]
21\setmainfontfallback[DejaVu Serif][range={greekandcoptic, greekextended}, force=yes, rscale=auto]
22\setupwhitespace[medium]
24\setuphead[chapter] [style=\tfd,header=empty]
25\setuphead[section] [style=\tfc]
26\setuphead[subsection] [style=\tfb]
27\setuphead[subsubsection] [style=\bf]
28\setuphead[subsubsubsection] [style=\sc]
29\setuphead[subsubsubsubsection][style=\it]
31\setuphead[chapter, section, subsection, subsubsection, subsubsubsection, subsubsubsubsection][number=no]
33\definedescription
34 [description]
35 [headstyle=bold, style=normal, location=hanging, width=broad, margin=1cm, alternative=hanging]
37\setupitemize[autointro] % prevent orphan list intro
38\setupitemize[indentnext=no]
40\setupfloat[figure][default={here,nonumber}]
41\setupfloat[table][default={here,nonumber}]
43\setupthinrules[width=15em] % width of horizontal rules
46\starttext
47\startalignment[middle]
48 {\tfd Pandoc Test Suite}
49 \smallskip
50 {\tfa John MacFarlane\crlf Anonymous}
51 \smallskip
52 {\tfa July 17, 2006}
53 \bigskip
54\stopalignment
56This is a set of tests for pandoc. Most of them are adapted from John Gruber's
57markdown test suite.
59\thinrule
61\section[headers]{Headers}
63\subsection[level-2-with-an-embedded-link]{Level 2 with an
64\useURL[url1][/url][][embedded link]\from[url1]}
66\subsubsection[level-3-with-emphasis]{Level 3 with {\em emphasis}}
68\subsubsubsection[level-4]{Level 4}
70\subsubsubsubsection[level-5]{Level 5}
72\section[level-1]{Level 1}
74\subsection[level-2-with-emphasis]{Level 2 with {\em emphasis}}
76\subsubsection[level-3]{Level 3}
78with no blank line
80\subsection[level-2]{Level 2}
82with no blank line
84\thinrule
86\section[paragraphs]{Paragraphs}
88Here's a regular paragraph.
90In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.
91Because a hard-wrapped line in the middle of a paragraph looked like a list
92item.
94Here's one with a bullet. * criminey.
96There should be a hard line break\crlf
97here.
99\thinrule
101\section[block-quotes]{Block Quotes}
103E-mail style:
105\startblockquote
106This is a block quote. It is pretty short.
107\stopblockquote
109\startblockquote
110Code in a block quote:
112\starttyping
113sub status {
114 print "working";
116\stoptyping
118A list:
120\startitemize[n,packed][stopper=.]
121\item
122 item one
123\item
124 item two
125\stopitemize
127Nested block quotes:
129\startblockquote
130nested
131\stopblockquote
133\startblockquote
134nested
135\stopblockquote
136\stopblockquote
138This should not be a block quote: 2 > 1.
140And a following paragraph.
142\thinrule
144\section[code-blocks]{Code Blocks}
146Code:
148\starttyping
149---- (should be four hyphens)
151sub status {
152 print "working";
155this code block is indented by one tab
156\stoptyping
158And:
160\starttyping
161 this code block is indented by two tabs
163These should not be escaped: \$ \\ \> \[ \{
164\stoptyping
166\thinrule
168\section[lists]{Lists}
170\subsection[unordered]{Unordered}
172Asterisks tight:
174\startitemize[packed]
175\item
176 asterisk 1
177\item
178 asterisk 2
179\item
180 asterisk 3
181\stopitemize
183Asterisks loose:
185\startitemize
186\item
187 asterisk 1
188\item
189 asterisk 2
190\item
191 asterisk 3
192\stopitemize
194Pluses tight:
196\startitemize[packed]
197\item
198 Plus 1
199\item
200 Plus 2
201\item
202 Plus 3
203\stopitemize
205Pluses loose:
207\startitemize
208\item
209 Plus 1
210\item
211 Plus 2
212\item
213 Plus 3
214\stopitemize
216Minuses tight:
218\startitemize[packed]
219\item
220 Minus 1
221\item
222 Minus 2
223\item
224 Minus 3
225\stopitemize
227Minuses loose:
229\startitemize
230\item
231 Minus 1
232\item
233 Minus 2
234\item
235 Minus 3
236\stopitemize
238\subsection[ordered]{Ordered}
240Tight:
242\startitemize[n,packed][stopper=.]
243\item
244 First
245\item
246 Second
247\item
248 Third
249\stopitemize
251and:
253\startitemize[n,packed][stopper=.]
254\item
255 One
256\item
257 Two
258\item
259 Three
260\stopitemize
262Loose using tabs:
264\startitemize[n][stopper=.]
265\item
266 First
267\item
268 Second
269\item
270 Third
271\stopitemize
273and using spaces:
275\startitemize[n][stopper=.]
276\item
277 One
278\item
279 Two
280\item
281 Three
282\stopitemize
284Multiple paragraphs:
286\startitemize[n][stopper=.]
287\item
288 Item 1, graf one.
290 Item 1. graf two. The quick brown fox jumped over the lazy dog's back.
291\item
292 Item 2.
293\item
294 Item 3.
295\stopitemize
297\subsection[nested]{Nested}
299\startitemize[packed]
300\item
301 Tab
302 \startitemize[packed]
303 \item
304 Tab
305 \startitemize[packed]
306 \item
307 Tab
308 \stopitemize
309 \stopitemize
310\stopitemize
312Here's another:
314\startitemize[n,packed][stopper=.]
315\item
316 First
317\item
318 Second:
319 \startitemize[packed]
320 \item
321 Fee
322 \item
323 Fie
324 \item
325 Foe
326 \stopitemize
327\item
328 Third
329\stopitemize
331Same thing but with paragraphs:
333\startitemize[n][stopper=.]
334\item
335 First
336\item
337 Second:
339 \startitemize[packed]
340 \item
341 Fee
342 \item
343 Fie
344 \item
345 Foe
346 \stopitemize
347\item
348 Third
349\stopitemize
351\subsection[tabs-and-spaces]{Tabs and spaces}
353\startitemize
354\item
355 this is a list item indented with tabs
356\item
357 this is a list item indented with spaces
359 \startitemize
360 \item
361 this is an example list item indented with tabs
362 \item
363 this is an example list item indented with spaces
364 \stopitemize
365\stopitemize
367\subsection[fancy-list-markers]{Fancy list markers}
369\startitemize[n][start=2,left=(,stopper=),width=2.0em]
370\item
371 begins with 2
372\item
373 and now 3
375 with a continuation
377 \startitemize[r,packed][start=4,stopper=.,width=2.0em]
378 \item
379 sublist with roman numerals, starting with 4
380 \item
381 more items
382 \startitemize[A,packed][left=(,stopper=),width=2.0em]
383 \item
384 a subsublist
385 \item
386 a subsublist
387 \stopitemize
388 \stopitemize
389\stopitemize
391Nesting:
393\startitemize[A,packed][stopper=.]
394\item
395 Upper Alpha
396 \startitemize[R,packed][stopper=.]
397 \item
398 Upper Roman.
399 \startitemize[n,packed][start=6,left=(,stopper=),width=2.0em]
400 \item
401 Decimal start with 6
402 \startitemize[a,packed][start=3,stopper=)]
403 \item
404 Lower alpha with paren
405 \stopitemize
406 \stopitemize
407 \stopitemize
408\stopitemize
410Autonumbering:
412\startitemize[n,packed]
413\item
414 Autonumber.
415\item
416 More.
417 \startitemize[a,packed]
418 \item
419 Nested.
420 \stopitemize
421\stopitemize
423Should not be a list item:
425M.A.~2007
427B. Williams
429\thinrule
431\section[definition-lists]{Definition Lists}
433Tight using spaces:
435\startdescription{apple}
436 red fruit
437\stopdescription
439\startdescription{orange}
440 orange fruit
441\stopdescription
443\startdescription{banana}
444 yellow fruit
445\stopdescription
447Tight using tabs:
449\startdescription{apple}
450 red fruit
451\stopdescription
453\startdescription{orange}
454 orange fruit
455\stopdescription
457\startdescription{banana}
458 yellow fruit
459\stopdescription
461Loose:
463\startdescription{apple}
464 red fruit
465\stopdescription
467\startdescription{orange}
468 orange fruit
469\stopdescription
471\startdescription{banana}
472 yellow fruit
473\stopdescription
475Multiple blocks with italics:
477\startdescription{{\em apple}}
478 red fruit
480 contains seeds, crisp, pleasant to taste
481\stopdescription
483\startdescription{{\em orange}}
484 orange fruit
486\starttyping
487{ orange code block }
488\stoptyping
490 \startblockquote
491 orange block quote
492 \stopblockquote
493\stopdescription
495Multiple definitions, tight:
497\startdescription{apple}
498 red fruit
500 computer
501\stopdescription
503\startdescription{orange}
504 orange fruit
506 bank
507\stopdescription
509Multiple definitions, loose:
511\startdescription{apple}
512 red fruit
514 computer
515\stopdescription
517\startdescription{orange}
518 orange fruit
520 bank
521\stopdescription
523Blank line after term, indented marker, alternate markers:
525\startdescription{apple}
526 red fruit
528 computer
529\stopdescription
531\startdescription{orange}
532 orange fruit
534 \startitemize[n,packed][stopper=.]
535 \item
536 sublist
537 \item
538 sublist
539 \stopitemize
540\stopdescription
542\section[html-blocks]{HTML Blocks}
544Simple block on one line:
546foo
548And nested without indentation:
550foo
552bar
554Interpreted markdown in a table:
556This is {\em emphasized}
557And this is {\bf strong}
558Here's a simple block:
560foo
562This should be a code block, though:
564\starttyping
565<div>
566 foo
567</div>
568\stoptyping
570As should this:
572\starttyping
573<div>foo</div>
574\stoptyping
576Now, nested:
578foo
580This should just be an HTML comment:
582Multiline:
584Code block:
586\starttyping
587<!-- Comment -->
588\stoptyping
590Just plain comment, with trailing spaces on the line:
592Code:
594\starttyping
595<hr />
596\stoptyping
598Hr's:
600\thinrule
602\section[inline-markup]{Inline Markup}
604This is {\em emphasized}, and so {\em is this}.
606This is {\bf strong}, and so {\bf is this}.
608An {\em \useURL[url2][/url][][emphasized link]\from[url2]}.
610{\bf {\em This is strong and em.}}
612So is {\bf {\em this}} word.
614{\bf {\em This is strong and em.}}
616So is {\bf {\em this}} word.
618This is code: \type{>}, \type{$}, \type{\}, \type{\$}, \type{<html>}.
620\overstrikes{This is {\em strikeout}.}
622Superscripts: a\high{bc}d a\high{{\em hello}} a\high{hello~there}.
624Subscripts: H\low{2}O, H\low{23}O, H\low{many~of~them}O.
626These should not be superscripts or subscripts, because of the unescaped
627spaces: a^b c^d, a\lettertilde{}b c\lettertilde{}d.
629\thinrule
631\section[smart-quotes-ellipses-dashes]{Smart quotes, ellipses, dashes}
633\quotation{Hello,} said the spider. \quotation{\quote{Shelob} is my name.}
635\quote{A}, \quote{B}, and \quote{C} are letters.
637\quote{Oak,} \quote{elm,} and \quote{beech} are names of trees. So is
638\quote{pine.}
640\quote{He said, \quotation{I want to go.}} Were you alive in the 70's?
642Here is some quoted \quote{\type{code}} and a
643\quotation{\useURL[url3][http://example.com/?foo=1&bar=2][][quoted
644link]\from[url3]}.
646Some dashes: one---two --- three---four --- five.
648Dashes between numbers: 5--7, 255--66, 1987--1999.
650Ellipses\ldots{}and\ldots{}and\ldots{}.
652\thinrule
654\section[latex]{LaTeX}
656\startitemize[packed]
657\item
658 \cite[22-23]{smith.1899}
659\item
660 $2+2=4$
661\item
662 $x \in y$
663\item
664 $\alpha \wedge \omega$
665\item
666 $223$
667\item
668 $p$-Tree
669\item
670 Here's some display math:
671 \startformula \frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h} \stopformula
672\item
673 Here's one that has a line break in it: $\alpha + \omega \times x^2$.
674\stopitemize
676These shouldn't be math:
678\startitemize[packed]
679\item
680 To get the famous equation, write \type{$e = mc^2$}.
681\item
682 \$22,000 is a {\em lot} of money. So is \$34,000. (It worked if
683 \quotation{lot} is emphasized.)
684\item
685 Shoes (\$20) and socks (\$5).
686\item
687 Escaped \type{$}: \$73 {\em this should be emphasized} 23\$.
688\stopitemize
690Here's a LaTeX table:
692\thinrule
694\section[special-characters]{Special Characters}
696Here is some unicode:
698\startitemize[packed]
699\item
700 I hat: Î
701\item
702 o umlaut: ö
703\item
704 section: §
705\item
706 set membership: ∈
707\item
708 copyright: ©
709\stopitemize
711AT&T has an ampersand in their name.
713AT&T is another way to write it.
715This & that.
7174 < 5.
7196 > 5.
721Backslash: \letterbackslash{}
723Backtick: `
725Asterisk: *
727Underscore: _
729Left brace: \{
731Right brace: \}
733Left bracket: {[}
735Right bracket: {]}
737Left paren: (
739Right paren: )
741Greater-than: >
743Hash: \#
745Period: .
747Bang: !
749Plus: +
751Minus: -
753\thinrule
755\section[links]{Links}
757\subsection[explicit]{Explicit}
759Just a \useURL[url4][/url/][][URL]\from[url4].
761\useURL[url5][/url/][][URL and title]\from[url5].
763\useURL[url6][/url/][][URL and title]\from[url6].
765\useURL[url7][/url/][][URL and title]\from[url7].
767\useURL[url8][/url/][][URL and title]\from[url8]
769\useURL[url9][/url/][][URL and title]\from[url9]
771\useURL[url10][/url/with_underscore][][with_underscore]\from[url10]
773\useURL[url11][mailto:nobody@nowhere.net][][Email link]\from[url11]
775\useURL[url12][][][Empty]\from[url12].
777\subsection[reference]{Reference}
779Foo \useURL[url13][/url/][][bar]\from[url13].
781Foo \useURL[url14][/url/][][bar]\from[url14].
783Foo \useURL[url15][/url/][][bar]\from[url15].
785With \useURL[url16][/url/][][embedded {[}brackets{]}]\from[url16].
787\useURL[url17][/url/][][b]\from[url17] by itself should be a link.
789Indented \useURL[url18][/url][][once]\from[url18].
791Indented \useURL[url19][/url][][twice]\from[url19].
793Indented \useURL[url20][/url][][thrice]\from[url20].
795This should {[}not{]}{[}{]} be a link.
797\starttyping
798[not]: /url
799\stoptyping
801Foo \useURL[url21][/url/][][bar]\from[url21].
803Foo \useURL[url22][/url/][][biz]\from[url22].
805\subsection[with-ampersands]{With ampersands}
807Here's a \useURL[url23][http://example.com/?foo=1&bar=2][][link with an
808ampersand in the URL]\from[url23].
810Here's a link with an amersand in the link text:
811\useURL[url24][http://att.com/][][AT&T]\from[url24].
813Here's an \useURL[url25][/script?foo=1&bar=2][][inline link]\from[url25].
815Here's an \useURL[url26][/script?foo=1&bar=2][][inline link in pointy
816braces]\from[url26].
818\subsection[autolinks]{Autolinks}
820With an ampersand: \useURL[url27][http://example.com/?foo=1&bar=2]\from[url27]
822\startitemize[packed]
823\item
824 In a list?
825\item
826 \useURL[url28][http://example.com/]\from[url28]
827\item
828 It should.
829\stopitemize
831An e-mail address:
832\useURL[url29][mailto:nobody@nowhere.net][][nobody@nowhere.net]\from[url29]
834\startblockquote
835Blockquoted: \useURL[url30][http://example.com/]\from[url30]
836\stopblockquote
838Auto-links should not occur here: \type{<http://example.com/>}
840\starttyping
841or here: <http://example.com/>
842\stoptyping
844\thinrule
846\section[images]{Images}
848From \quotation{Voyage dans la Lune} by Georges Melies (1902):
850\placefigure{lalune}{\externalfigure[lalune.jpg]}
852Here is a movie {\externalfigure[movie.jpg]} icon.
854\thinrule
856\section[footnotes]{Footnotes}
858Here is a footnote reference,\footnote{Here is the footnote. It can go
859 anywhere after the footnote reference. It need not be placed at the end of
860 the document.} and another.\startbuffer Here's the long note. This one
861 contains multiple blocks.
863 Subsequent blocks are indented to show that they belong to the footnote (as
864 with list items).
866\starttyping
867 { <code> }
868\stoptyping
870 If you want, you can indent every line, but you can also be lazy and just
871 indent the first line of each block.\stopbuffer\footnote{\getbuffer} This
872should {\em not} be a footnote reference, because it contains a space.{[}^my
873note{]} Here is an inline note.\footnote{This is {\em easier} to type. Inline
874 notes may contain \useURL[url31][http://google.com][][links]\from[url31] and
875 \type{]} verbatim characters, as well as {[}bracketed text{]}.}
877\startblockquote
878Notes can go in quotes.\footnote{In quote.}
879\stopblockquote
881\startitemize[n,packed][stopper=.]
882\item
883 And in list items.\footnote{In list.}
884\stopitemize
886This paragraph should not be part of the note, as it is not indented.
888\stoptext