git.iko.soy/typeable/pandoc
on fa12d4e help sign in
typeable/pandoc/test/writer.context
908 lines 16 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=]
10% make chapter, section bookmarks visible when opening document
11\placebookmarks[chapter, section, subsection, subsubsection, subsubsubsection, subsubsubsubsection][chapter, section]
12\setupinteractionscreen[option=bookmark]
14\setupbackend[export=yes]
15\setupstructure[state=start,method=auto]
17% use microtypography
18\definefontfeature[default][default][script=latn, protrusion=quality, expansion=quality, itlc=yes, textitalics=yes, onum=yes, pnum=yes]
19\definefontfeature[smallcaps][script=latn, protrusion=quality, expansion=quality, smcp=yes, onum=yes, pnum=yes]
20\setupalign[hz,hanging]
21\setupitaliccorrection[global, always]
23\setupbodyfontenvironment[default][em=italic] % use italic as em, not slanted
25\definefallbackfamily[mainface][rm][CMU Serif][preset=range:greek, force=yes]
26\definefontfamily[mainface][rm][Latin Modern Roman]
27\definefontfamily[mainface][mm][Latin Modern Math]
28\definefontfamily[mainface][ss][Latin Modern Sans]
29\definefontfamily[mainface][tt][Latin Modern Typewriter][features=none]
30\setupbodyfont[mainface]
32\setupwhitespace[medium]
34\setuphead[chapter] [style=\tfd,header=empty]
35\setuphead[section] [style=\tfc]
36\setuphead[subsection] [style=\tfb]
37\setuphead[subsubsection] [style=\bf]
38\setuphead[subsubsubsection] [style=\sc]
39\setuphead[subsubsubsubsection][style=\it]
41\setuphead[chapter, section, subsection, subsubsection, subsubsubsection, subsubsubsubsection][number=no]
43\definedescription
44 [description]
45 [headstyle=bold, style=normal, location=hanging, width=broad, margin=1cm, alternative=hanging]
47\setupitemize[autointro] % prevent orphan list intro
48\setupitemize[indentnext=no]
50\setupfloat[figure][default={here,nonumber}]
51\setupfloat[table][default={here,nonumber}]
53\setupthinrules[width=15em] % width of horizontal rules
55\setupxtable[frame=off]
56\setupxtable[head][topframe=on,bottomframe=on]
57\setupxtable[body][]
58\setupxtable[foot][bottomframe=on]
61\starttext
62\startalignment[middle]
63 {\tfd Pandoc Test Suite}
64 \smallskip
65 {\tfa John MacFarlane\crlf Anonymous}
66 \smallskip
67 {\tfa July 17, 2006}
68 \bigskip
69\stopalignment
71This is a set of tests for pandoc. Most of them are adapted from John Gruber's
72markdown test suite.
74\thinrule
76\section[title={Headers},reference={headers}]
78\subsection[title={Level 2 with an \useURL[url1][/url][][embedded
79link]\from[url1]},reference={level-2-with-an-embedded-link}]
81\subsubsection[title={Level 3 with
82{\em emphasis}},reference={level-3-with-emphasis}]
84\subsubsubsection[title={Level 4},reference={level-4}]
86\subsubsubsubsection[title={Level 5},reference={level-5}]
88\section[title={Level 1},reference={level-1}]
90\subsection[title={Level 2 with
91{\em emphasis}},reference={level-2-with-emphasis}]
93\subsubsection[title={Level 3},reference={level-3}]
95with no blank line
97\subsection[title={Level 2},reference={level-2}]
99with no blank line
101\thinrule
103\section[title={Paragraphs},reference={paragraphs}]
105Here's a regular paragraph.
107In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.
108Because a hard-wrapped line in the middle of a paragraph looked like a list
109item.
111Here's one with a bullet. * criminey.
113There should be a hard line break\crlf
114here.
116\thinrule
118\section[title={Block Quotes},reference={block-quotes}]
120E-mail style:
122\startblockquote
123This is a block quote. It is pretty short.
124\stopblockquote
126\startblockquote
127Code in a block quote:
129\starttyping
130sub status {
131 print "working";
133\stoptyping
135A list:
137\startitemize[n,packed][stopper=.]
138\item
139 item one
140\item
141 item two
142\stopitemize
144Nested block quotes:
146\startblockquote
147nested
148\stopblockquote
150\startblockquote
151nested
152\stopblockquote
153\stopblockquote
155This should not be a block quote: 2 > 1.
157And a following paragraph.
159\thinrule
161\section[title={Code Blocks},reference={code-blocks}]
163Code:
165\starttyping
166---- (should be four hyphens)
168sub status {
169 print "working";
172this code block is indented by one tab
173\stoptyping
175And:
177\starttyping
178 this code block is indented by two tabs
180These should not be escaped: \$ \\ \> \[ \{
181\stoptyping
183\thinrule
185\section[title={Lists},reference={lists}]
187\subsection[title={Unordered},reference={unordered}]
189Asterisks tight:
191\startitemize[packed]
192\item
193 asterisk 1
194\item
195 asterisk 2
196\item
197 asterisk 3
198\stopitemize
200Asterisks loose:
202\startitemize
203\item
204 asterisk 1
205\item
206 asterisk 2
207\item
208 asterisk 3
209\stopitemize
211Pluses tight:
213\startitemize[packed]
214\item
215 Plus 1
216\item
217 Plus 2
218\item
219 Plus 3
220\stopitemize
222Pluses loose:
224\startitemize
225\item
226 Plus 1
227\item
228 Plus 2
229\item
230 Plus 3
231\stopitemize
233Minuses tight:
235\startitemize[packed]
236\item
237 Minus 1
238\item
239 Minus 2
240\item
241 Minus 3
242\stopitemize
244Minuses loose:
246\startitemize
247\item
248 Minus 1
249\item
250 Minus 2
251\item
252 Minus 3
253\stopitemize
255\subsection[title={Ordered},reference={ordered}]
257Tight:
259\startitemize[n,packed][stopper=.]
260\item
261 First
262\item
263 Second
264\item
265 Third
266\stopitemize
268and:
270\startitemize[n,packed][stopper=.]
271\item
272 One
273\item
274 Two
275\item
276 Three
277\stopitemize
279Loose using tabs:
281\startitemize[n][stopper=.]
282\item
283 First
284\item
285 Second
286\item
287 Third
288\stopitemize
290and using spaces:
292\startitemize[n][stopper=.]
293\item
294 One
295\item
296 Two
297\item
298 Three
299\stopitemize
301Multiple paragraphs:
303\startitemize[n][stopper=.]
304\item
305 Item 1, graf one.
307 Item 1. graf two. The quick brown fox jumped over the lazy dog's back.
308\item
309 Item 2.
310\item
311 Item 3.
312\stopitemize
314\subsection[title={Nested},reference={nested}]
316\startitemize[packed]
317\item
318 Tab
319 \startitemize[packed]
320 \item
321 Tab
322 \startitemize[packed]
323 \item
324 Tab
325 \stopitemize
326 \stopitemize
327\stopitemize
329Here's another:
331\startitemize[n,packed][stopper=.]
332\item
333 First
334\item
335 Second:
336 \startitemize[packed]
337 \item
338 Fee
339 \item
340 Fie
341 \item
342 Foe
343 \stopitemize
344\item
345 Third
346\stopitemize
348Same thing but with paragraphs:
350\startitemize[n][stopper=.]
351\item
352 First
353\item
354 Second:
356 \startitemize[packed]
357 \item
358 Fee
359 \item
360 Fie
361 \item
362 Foe
363 \stopitemize
364\item
365 Third
366\stopitemize
368\subsection[title={Tabs and spaces},reference={tabs-and-spaces}]
370\startitemize
371\item
372 this is a list item indented with tabs
373\item
374 this is a list item indented with spaces
376 \startitemize
377 \item
378 this is an example list item indented with tabs
379 \item
380 this is an example list item indented with spaces
381 \stopitemize
382\stopitemize
384\subsection[title={Fancy list markers},reference={fancy-list-markers}]
386\startitemize[n][start=2,left=(,stopper=),width=2.0em]
387\item
388 begins with 2
389\item
390 and now 3
392 with a continuation
394 \startitemize[r,packed][start=4,stopper=.,width=2.0em]
395 \item
396 sublist with roman numerals, starting with 4
397 \item
398 more items
399 \startitemize[A,packed][left=(,stopper=),width=2.0em]
400 \item
401 a subsublist
402 \item
403 a subsublist
404 \stopitemize
405 \stopitemize
406\stopitemize
408Nesting:
410\startitemize[A,packed][stopper=.]
411\item
412 Upper Alpha
413 \startitemize[R,packed][stopper=.]
414 \item
415 Upper Roman.
416 \startitemize[n,packed][start=6,left=(,stopper=),width=2.0em]
417 \item
418 Decimal start with 6
419 \startitemize[a,packed][start=3,stopper=)]
420 \item
421 Lower alpha with paren
422 \stopitemize
423 \stopitemize
424 \stopitemize
425\stopitemize
427Autonumbering:
429\startitemize[n,packed]
430\item
431 Autonumber.
432\item
433 More.
434 \startitemize[a,packed]
435 \item
436 Nested.
437 \stopitemize
438\stopitemize
440Should not be a list item:
442M.A.~2007
444B. Williams
446\thinrule
448\section[title={Definition Lists},reference={definition-lists}]
450Tight using spaces:
452\startdescription{apple}
453 red fruit
454\stopdescription
456\startdescription{orange}
457 orange fruit
458\stopdescription
460\startdescription{banana}
461 yellow fruit
462\stopdescription
464Tight using tabs:
466\startdescription{apple}
467 red fruit
468\stopdescription
470\startdescription{orange}
471 orange fruit
472\stopdescription
474\startdescription{banana}
475 yellow fruit
476\stopdescription
478Loose:
480\startdescription{apple}
481 red fruit
482\stopdescription
484\startdescription{orange}
485 orange fruit
486\stopdescription
488\startdescription{banana}
489 yellow fruit
490\stopdescription
492Multiple blocks with italics:
494\startdescription{{\em apple}}
495 red fruit
497 contains seeds, crisp, pleasant to taste
498\stopdescription
500\startdescription{{\em orange}}
501 orange fruit
503\starttyping
504{ orange code block }
505\stoptyping
507 \startblockquote
508 orange block quote
509 \stopblockquote
510\stopdescription
512Multiple definitions, tight:
514\startdescription{apple}
515 red fruit
517 computer
518\stopdescription
520\startdescription{orange}
521 orange fruit
523 bank
524\stopdescription
526Multiple definitions, loose:
528\startdescription{apple}
529 red fruit
531 computer
532\stopdescription
534\startdescription{orange}
535 orange fruit
537 bank
538\stopdescription
540Blank line after term, indented marker, alternate markers:
542\startdescription{apple}
543 red fruit
545 computer
546\stopdescription
548\startdescription{orange}
549 orange fruit
551 \startitemize[n,packed][stopper=.]
552 \item
553 sublist
554 \item
555 sublist
556 \stopitemize
557\stopdescription
559\section[title={HTML Blocks},reference={html-blocks}]
561Simple block on one line:
563foo
565And nested without indentation:
567foo
569bar
571Interpreted markdown in a table:
573This is {\em emphasized}
574And this is {\bf strong}
575Here's a simple block:
577foo
579This should be a code block, though:
581\starttyping
582<div>
583 foo
584</div>
585\stoptyping
587As should this:
589\starttyping
590<div>foo</div>
591\stoptyping
593Now, nested:
595foo
597This should just be an HTML comment:
599Multiline:
601Code block:
603\starttyping
604<!-- Comment -->
605\stoptyping
607Just plain comment, with trailing spaces on the line:
609Code:
611\starttyping
612<hr />
613\stoptyping
615Hr's:
617\thinrule
619\section[title={Inline Markup},reference={inline-markup}]
621This is {\em emphasized}, and so {\em is this}.
623This is {\bf strong}, and so {\bf is this}.
625An {\em \useURL[url2][/url][][emphasized link]\from[url2]}.
627{\bf {\em This is strong and em.}}
629So is {\bf {\em this}} word.
631{\bf {\em This is strong and em.}}
633So is {\bf {\em this}} word.
635This is code: \type{>}, \type{$}, \type{\}, \type{\$}, \type{<html>}.
637\overstrikes{This is {\em strikeout}.}
639Superscripts: a\high{bc}d a\high{{\em hello}} a\high{hello~there}.
641Subscripts: H\low{2}O, H\low{23}O, H\low{many~of~them}O.
643These should not be superscripts or subscripts, because of the unescaped
644spaces: a^b c^d, a\lettertilde{}b c\lettertilde{}d.
646\thinrule
648\section[title={Smart quotes, ellipses,
649dashes},reference={smart-quotes-ellipses-dashes}]
651\quotation{Hello,} said the spider. \quotation{\quote{Shelob} is my name.}
653\quote{A}, \quote{B}, and \quote{C} are letters.
655\quote{Oak,} \quote{elm,} and \quote{beech} are names of trees. So is
656\quote{pine.}
658\quote{He said, \quotation{I want to go.}} Were you alive in the 70's?
660Here is some quoted \quote{\type{code}} and a
661\quotation{\useURL[url3][http://example.com/?foo=1&bar=2][][quoted
662link]\from[url3]}.
664Some dashes: one---two --- three---four --- five.
666Dashes between numbers: 5--7, 255--66, 1987--1999.
668Ellipses\ldots{}and\ldots{}and\ldots{}.
670\thinrule
672\section[title={LaTeX},reference={latex}]
674\startitemize[packed]
675\item
676 \cite[22-23]{smith.1899}
677\item
678 $2+2=4$
679\item
680 $x \in y$
681\item
682 $\alpha \wedge \omega$
683\item
684 $223$
685\item
686 $p$-Tree
687\item
688 Here's some display math:
689 \startformula \frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h} \stopformula
690\item
691 Here's one that has a line break in it: $\alpha + \omega \times x^2$.
692\stopitemize
694These shouldn't be math:
696\startitemize[packed]
697\item
698 To get the famous equation, write \type{$e = mc^2$}.
699\item
700 \$22,000 is a {\em lot} of money. So is \$34,000. (It worked if
701 \quotation{lot} is emphasized.)
702\item
703 Shoes (\$20) and socks (\$5).
704\item
705 Escaped \type{$}: \$73 {\em this should be emphasized} 23\$.
706\stopitemize
708Here's a LaTeX table:
710\begin{tabular}{|l|l|}\hline
711Animal & Number \\ \hline
712Dog & 2 \\
713Cat & 1 \\ \hline
714\end{tabular}
716\thinrule
718\section[title={Special Characters},reference={special-characters}]
720Here is some unicode:
722\startitemize[packed]
723\item
724 I hat: Î
725\item
726 o umlaut: ö
727\item
728 section: §
729\item
730 set membership: ∈
731\item
732 copyright: ©
733\stopitemize
735AT&T has an ampersand in their name.
737AT&T is another way to write it.
739This & that.
7414 < 5.
7436 > 5.
745Backslash: \letterbackslash{}
747Backtick: `
749Asterisk: *
751Underscore: _
753Left brace: \{
755Right brace: \}
757Left bracket: {[}
759Right bracket: {]}
761Left paren: (
763Right paren: )
765Greater-than: >
767Hash: \#
769Period: .
771Bang: !
773Plus: +
775Minus: -
777\thinrule
779\section[title={Links},reference={links}]
781\subsection[title={Explicit},reference={explicit}]
783Just a \useURL[url4][/url/][][URL]\from[url4].
785\useURL[url5][/url/][][URL and title]\from[url5].
787\useURL[url6][/url/][][URL and title]\from[url6].
789\useURL[url7][/url/][][URL and title]\from[url7].
791\useURL[url8][/url/][][URL and title]\from[url8]
793\useURL[url9][/url/][][URL and title]\from[url9]
795\useURL[url10][/url/with_underscore][][with_underscore]\from[url10]
797\useURL[url11][mailto:nobody@nowhere.net][][Email link]\from[url11]
799\useURL[url12][][][Empty]\from[url12].
801\subsection[title={Reference},reference={reference}]
803Foo \useURL[url13][/url/][][bar]\from[url13].
805With \useURL[url14][/url/][][embedded {[}brackets{]}]\from[url14].
807\useURL[url15][/url/][][b]\from[url15] by itself should be a link.
809Indented \useURL[url16][/url][][once]\from[url16].
811Indented \useURL[url17][/url][][twice]\from[url17].
813Indented \useURL[url18][/url][][thrice]\from[url18].
815This should {[}not{]}{[}{]} be a link.
817\starttyping
818[not]: /url
819\stoptyping
821Foo \useURL[url19][/url/][][bar]\from[url19].
823Foo \useURL[url20][/url/][][biz]\from[url20].
825\subsection[title={With ampersands},reference={with-ampersands}]
827Here's a \useURL[url21][http://example.com/?foo=1&bar=2][][link with an
828ampersand in the URL]\from[url21].
830Here's a link with an amersand in the link text:
831\useURL[url22][http://att.com/][][AT&T]\from[url22].
833Here's an \useURL[url23][/script?foo=1&bar=2][][inline link]\from[url23].
835Here's an \useURL[url24][/script?foo=1&bar=2][][inline link in pointy
836braces]\from[url24].
838\subsection[title={Autolinks},reference={autolinks}]
840With an ampersand: \useURL[url25][http://example.com/?foo=1&bar=2]\from[url25]
842\startitemize[packed]
843\item
844 In a list?
845\item
846 \useURL[url26][http://example.com/]\from[url26]
847\item
848 It should.
849\stopitemize
851An e-mail address:
852\useURL[url27][mailto:nobody@nowhere.net][][nobody@nowhere.net]\from[url27]
854\startblockquote
855Blockquoted: \useURL[url28][http://example.com/]\from[url28]
856\stopblockquote
858Auto-links should not occur here: \type{<http://example.com/>}
860\starttyping
861or here: <http://example.com/>
862\stoptyping
864\thinrule
866\section[title={Images},reference={images}]
868From \quotation{Voyage dans la Lune} by Georges Melies (1902):
870\placefigure{lalune}{\externalfigure[lalune.jpg]}
872Here is a movie {\externalfigure[movie.jpg]} icon.
874\thinrule
876\section[title={Footnotes},reference={footnotes}]
878Here is a footnote reference,\footnote{Here is the footnote. It can go
879 anywhere after the footnote reference. It need not be placed at the end of
880 the document.} and another.\startbuffer Here's the long note. This one
881 contains multiple blocks.
883 Subsequent blocks are indented to show that they belong to the footnote (as
884 with list items).
886\starttyping
887 { <code> }
888\stoptyping
890 If you want, you can indent every line, but you can also be lazy and just
891 indent the first line of each block.\stopbuffer\footnote{\getbuffer} This
892should {\em not} be a footnote reference, because it contains a space.{[}^my
893note{]} Here is an inline note.\footnote{This is {\em easier} to type. Inline
894 notes may contain \useURL[url29][http://google.com][][links]\from[url29] and
895 \type{]} verbatim characters, as well as {[}bracketed text{]}.}
897\startblockquote
898Notes can go in quotes.\footnote{In quote.}
899\stopblockquote
901\startitemize[n,packed][stopper=.]
902\item
903 And in list items.\footnote{In list.}
904\stopitemize
906This paragraph should not be part of the note, as it is not indented.
908\stoptext