git.iko.soy/typeable/pandoc
on 2.7.2 help sign in
typeable/pandoc/test/writer.context
907 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]
13\setuptagging[state=start]
16% use microtypography
17\definefontfeature[default][default][script=latn, protrusion=quality, expansion=quality, itlc=yes, textitalics=yes, onum=yes, pnum=yes]
18\definefontfeature[smallcaps][script=latn, protrusion=quality, expansion=quality, smcp=yes, onum=yes, pnum=yes]
19\setupalign[hz,hanging]
20\setupitaliccorrection[global, always]
22\setupbodyfontenvironment[default][em=italic] % use italic as em, not slanted
24\definefallbackfamily[mainface][rm][CMU Serif][preset=range:greek, force=yes]
25\definefontfamily[mainface][rm][Latin Modern Roman]
26\definefontfamily[mainface][mm][Latin Modern Math]
27\definefontfamily[mainface][ss][Latin Modern Sans]
28\definefontfamily[mainface][tt][Latin Modern Typewriter][features=none]
29\setupbodyfont[mainface]
31\setupwhitespace[medium]
33\setuphead[chapter] [style=\tfd,header=empty]
34\setuphead[section] [style=\tfc]
35\setuphead[subsection] [style=\tfb]
36\setuphead[subsubsection] [style=\bf]
37\setuphead[subsubsubsection] [style=\sc]
38\setuphead[subsubsubsubsection][style=\it]
40\setuphead[chapter, section, subsection, subsubsection, subsubsubsection, subsubsubsubsection][number=no]
42\definedescription
43 [description]
44 [headstyle=bold, style=normal, location=hanging, width=broad, margin=1cm, alternative=hanging]
46\setupitemize[autointro] % prevent orphan list intro
47\setupitemize[indentnext=no]
49\setupfloat[figure][default={here,nonumber}]
50\setupfloat[table][default={here,nonumber}]
52\setupthinrules[width=15em] % width of horizontal rules
54\setupxtable[frame=off]
55\setupxtable[head][topframe=on,bottomframe=on]
56\setupxtable[body][]
57\setupxtable[foot][bottomframe=on]
60\starttext
61\startalignment[middle]
62 {\tfd Pandoc Test Suite}
63 \smallskip
64 {\tfa John MacFarlane\crlf Anonymous}
65 \smallskip
66 {\tfa July 17, 2006}
67 \bigskip
68\stopalignment
70This is a set of tests for pandoc. Most of them are adapted from John Gruber's
71markdown test suite.
73\thinrule
75\section[title={Headers},reference={headers}]
77\subsection[title={Level 2 with an \useURL[url1][/url][][embedded
78link]\from[url1]},reference={level-2-with-an-embedded-link}]
80\subsubsection[title={Level 3 with
81{\em emphasis}},reference={level-3-with-emphasis}]
83\subsubsubsection[title={Level 4},reference={level-4}]
85\subsubsubsubsection[title={Level 5},reference={level-5}]
87\section[title={Level 1},reference={level-1}]
89\subsection[title={Level 2 with
90{\em emphasis}},reference={level-2-with-emphasis}]
92\subsubsection[title={Level 3},reference={level-3}]
94with no blank line
96\subsection[title={Level 2},reference={level-2}]
98with no blank line
100\thinrule
102\section[title={Paragraphs},reference={paragraphs}]
104Here's a regular paragraph.
106In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.
107Because a hard-wrapped line in the middle of a paragraph looked like a list
108item.
110Here's one with a bullet. * criminey.
112There should be a hard line break\crlf
113here.
115\thinrule
117\section[title={Block Quotes},reference={block-quotes}]
119E-mail style:
121\startblockquote
122This is a block quote. It is pretty short.
123\stopblockquote
125\startblockquote
126Code in a block quote:
128\starttyping
129sub status {
130 print "working";
132\stoptyping
134A list:
136\startitemize[n,packed][stopper=.]
137\item
138 item one
139\item
140 item two
141\stopitemize
143Nested block quotes:
145\startblockquote
146nested
147\stopblockquote
149\startblockquote
150nested
151\stopblockquote
152\stopblockquote
154This should not be a block quote: 2 > 1.
156And a following paragraph.
158\thinrule
160\section[title={Code Blocks},reference={code-blocks}]
162Code:
164\starttyping
165---- (should be four hyphens)
167sub status {
168 print "working";
171this code block is indented by one tab
172\stoptyping
174And:
176\starttyping
177 this code block is indented by two tabs
179These should not be escaped: \$ \\ \> \[ \{
180\stoptyping
182\thinrule
184\section[title={Lists},reference={lists}]
186\subsection[title={Unordered},reference={unordered}]
188Asterisks tight:
190\startitemize[packed]
191\item
192 asterisk 1
193\item
194 asterisk 2
195\item
196 asterisk 3
197\stopitemize
199Asterisks loose:
201\startitemize
202\item
203 asterisk 1
204\item
205 asterisk 2
206\item
207 asterisk 3
208\stopitemize
210Pluses tight:
212\startitemize[packed]
213\item
214 Plus 1
215\item
216 Plus 2
217\item
218 Plus 3
219\stopitemize
221Pluses loose:
223\startitemize
224\item
225 Plus 1
226\item
227 Plus 2
228\item
229 Plus 3
230\stopitemize
232Minuses tight:
234\startitemize[packed]
235\item
236 Minus 1
237\item
238 Minus 2
239\item
240 Minus 3
241\stopitemize
243Minuses loose:
245\startitemize
246\item
247 Minus 1
248\item
249 Minus 2
250\item
251 Minus 3
252\stopitemize
254\subsection[title={Ordered},reference={ordered}]
256Tight:
258\startitemize[n,packed][stopper=.]
259\item
260 First
261\item
262 Second
263\item
264 Third
265\stopitemize
267and:
269\startitemize[n,packed][stopper=.]
270\item
271 One
272\item
273 Two
274\item
275 Three
276\stopitemize
278Loose using tabs:
280\startitemize[n][stopper=.]
281\item
282 First
283\item
284 Second
285\item
286 Third
287\stopitemize
289and using spaces:
291\startitemize[n][stopper=.]
292\item
293 One
294\item
295 Two
296\item
297 Three
298\stopitemize
300Multiple paragraphs:
302\startitemize[n][stopper=.]
303\item
304 Item 1, graf one.
306 Item 1. graf two. The quick brown fox jumped over the lazy dog's back.
307\item
308 Item 2.
309\item
310 Item 3.
311\stopitemize
313\subsection[title={Nested},reference={nested}]
315\startitemize[packed]
316\item
317 Tab
318 \startitemize[packed]
319 \item
320 Tab
321 \startitemize[packed]
322 \item
323 Tab
324 \stopitemize
325 \stopitemize
326\stopitemize
328Here's another:
330\startitemize[n,packed][stopper=.]
331\item
332 First
333\item
334 Second:
335 \startitemize[packed]
336 \item
337 Fee
338 \item
339 Fie
340 \item
341 Foe
342 \stopitemize
343\item
344 Third
345\stopitemize
347Same thing but with paragraphs:
349\startitemize[n][stopper=.]
350\item
351 First
352\item
353 Second:
355 \startitemize[packed]
356 \item
357 Fee
358 \item
359 Fie
360 \item
361 Foe
362 \stopitemize
363\item
364 Third
365\stopitemize
367\subsection[title={Tabs and spaces},reference={tabs-and-spaces}]
369\startitemize
370\item
371 this is a list item indented with tabs
372\item
373 this is a list item indented with spaces
375 \startitemize
376 \item
377 this is an example list item indented with tabs
378 \item
379 this is an example list item indented with spaces
380 \stopitemize
381\stopitemize
383\subsection[title={Fancy list markers},reference={fancy-list-markers}]
385\startitemize[n][start=2,left=(,stopper=),width=2.0em]
386\item
387 begins with 2
388\item
389 and now 3
391 with a continuation
393 \startitemize[r,packed][start=4,stopper=.,width=2.0em]
394 \item
395 sublist with roman numerals, starting with 4
396 \item
397 more items
398 \startitemize[A,packed][left=(,stopper=),width=2.0em]
399 \item
400 a subsublist
401 \item
402 a subsublist
403 \stopitemize
404 \stopitemize
405\stopitemize
407Nesting:
409\startitemize[A,packed][stopper=.]
410\item
411 Upper Alpha
412 \startitemize[R,packed][stopper=.]
413 \item
414 Upper Roman.
415 \startitemize[n,packed][start=6,left=(,stopper=),width=2.0em]
416 \item
417 Decimal start with 6
418 \startitemize[a,packed][start=3,stopper=)]
419 \item
420 Lower alpha with paren
421 \stopitemize
422 \stopitemize
423 \stopitemize
424\stopitemize
426Autonumbering:
428\startitemize[n,packed]
429\item
430 Autonumber.
431\item
432 More.
433 \startitemize[a,packed]
434 \item
435 Nested.
436 \stopitemize
437\stopitemize
439Should not be a list item:
441M.A.~2007
443B. Williams
445\thinrule
447\section[title={Definition Lists},reference={definition-lists}]
449Tight using spaces:
451\startdescription{apple}
452 red fruit
453\stopdescription
455\startdescription{orange}
456 orange fruit
457\stopdescription
459\startdescription{banana}
460 yellow fruit
461\stopdescription
463Tight using tabs:
465\startdescription{apple}
466 red fruit
467\stopdescription
469\startdescription{orange}
470 orange fruit
471\stopdescription
473\startdescription{banana}
474 yellow fruit
475\stopdescription
477Loose:
479\startdescription{apple}
480 red fruit
481\stopdescription
483\startdescription{orange}
484 orange fruit
485\stopdescription
487\startdescription{banana}
488 yellow fruit
489\stopdescription
491Multiple blocks with italics:
493\startdescription{{\em apple}}
494 red fruit
496 contains seeds, crisp, pleasant to taste
497\stopdescription
499\startdescription{{\em orange}}
500 orange fruit
502\starttyping
503{ orange code block }
504\stoptyping
506 \startblockquote
507 orange block quote
508 \stopblockquote
509\stopdescription
511Multiple definitions, tight:
513\startdescription{apple}
514 red fruit
516 computer
517\stopdescription
519\startdescription{orange}
520 orange fruit
522 bank
523\stopdescription
525Multiple definitions, loose:
527\startdescription{apple}
528 red fruit
530 computer
531\stopdescription
533\startdescription{orange}
534 orange fruit
536 bank
537\stopdescription
539Blank line after term, indented marker, alternate markers:
541\startdescription{apple}
542 red fruit
544 computer
545\stopdescription
547\startdescription{orange}
548 orange fruit
550 \startitemize[n,packed][stopper=.]
551 \item
552 sublist
553 \item
554 sublist
555 \stopitemize
556\stopdescription
558\section[title={HTML Blocks},reference={html-blocks}]
560Simple block on one line:
562foo
564And nested without indentation:
566foo
568bar
570Interpreted markdown in a table:
572This is {\em emphasized}
573And this is {\bf strong}
574Here's a simple block:
576foo
578This should be a code block, though:
580\starttyping
581<div>
582 foo
583</div>
584\stoptyping
586As should this:
588\starttyping
589<div>foo</div>
590\stoptyping
592Now, nested:
594foo
596This should just be an HTML comment:
598Multiline:
600Code block:
602\starttyping
603<!-- Comment -->
604\stoptyping
606Just plain comment, with trailing spaces on the line:
608Code:
610\starttyping
611<hr />
612\stoptyping
614Hr's:
616\thinrule
618\section[title={Inline Markup},reference={inline-markup}]
620This is {\em emphasized}, and so {\em is this}.
622This is {\bf strong}, and so {\bf is this}.
624An {\em \useURL[url2][/url][][emphasized link]\from[url2]}.
626{\bf {\em This is strong and em.}}
628So is {\bf {\em this}} word.
630{\bf {\em This is strong and em.}}
632So is {\bf {\em this}} word.
634This is code: \type{>}, \type{$}, \type{\}, \type{\$}, \type{<html>}.
636\overstrikes{This is {\em strikeout}.}
638Superscripts: a\high{bc}d a\high{{\em hello}} a\high{hello~there}.
640Subscripts: H\low{2}O, H\low{23}O, H\low{many~of~them}O.
642These should not be superscripts or subscripts, because of the unescaped
643spaces: a^b c^d, a\lettertilde{}b c\lettertilde{}d.
645\thinrule
647\section[title={Smart quotes, ellipses,
648dashes},reference={smart-quotes-ellipses-dashes}]
650\quotation{Hello,} said the spider. \quotation{\quote{Shelob} is my name.}
652\quote{A}, \quote{B}, and \quote{C} are letters.
654\quote{Oak,} \quote{elm,} and \quote{beech} are names of trees. So is
655\quote{pine.}
657\quote{He said, \quotation{I want to go.}} Were you alive in the 70's?
659Here is some quoted \quote{\type{code}} and a
660\quotation{\useURL[url3][http://example.com/?foo=1&bar=2][][quoted
661link]\from[url3]}.
663Some dashes: one---two --- three---four --- five.
665Dashes between numbers: 5--7, 255--66, 1987--1999.
667Ellipses\ldots{}and\ldots{}and\ldots{}.
669\thinrule
671\section[title={LaTeX},reference={latex}]
673\startitemize[packed]
674\item
675 \cite[22-23]{smith.1899}
676\item
677 $2+2=4$
678\item
679 $x \in y$
680\item
681 $\alpha \wedge \omega$
682\item
683 $223$
684\item
685 $p$-Tree
686\item
687 Here's some display math:
688 \startformula \frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h} \stopformula
689\item
690 Here's one that has a line break in it: $\alpha + \omega \times x^2$.
691\stopitemize
693These shouldn't be math:
695\startitemize[packed]
696\item
697 To get the famous equation, write \type{$e = mc^2$}.
698\item
699 \$22,000 is a {\em lot} of money. So is \$34,000. (It worked if
700 \quotation{lot} is emphasized.)
701\item
702 Shoes (\$20) and socks (\$5).
703\item
704 Escaped \type{$}: \$73 {\em this should be emphasized} 23\$.
705\stopitemize
707Here's a LaTeX table:
709\begin{tabular}{|l|l|}\hline
710Animal & Number \\ \hline
711Dog & 2 \\
712Cat & 1 \\ \hline
713\end{tabular}
715\thinrule
717\section[title={Special Characters},reference={special-characters}]
719Here is some unicode:
721\startitemize[packed]
722\item
723 I hat: Î
724\item
725 o umlaut: ö
726\item
727 section: §
728\item
729 set membership: ∈
730\item
731 copyright: ©
732\stopitemize
734AT&T has an ampersand in their name.
736AT&T is another way to write it.
738This & that.
7404 < 5.
7426 > 5.
744Backslash: \letterbackslash{}
746Backtick: `
748Asterisk: *
750Underscore: _
752Left brace: \{
754Right brace: \}
756Left bracket: {[}
758Right bracket: {]}
760Left paren: (
762Right paren: )
764Greater-than: >
766Hash: \#
768Period: .
770Bang: !
772Plus: +
774Minus: -
776\thinrule
778\section[title={Links},reference={links}]
780\subsection[title={Explicit},reference={explicit}]
782Just a \useURL[url4][/url/][][URL]\from[url4].
784\useURL[url5][/url/][][URL and title]\from[url5].
786\useURL[url6][/url/][][URL and title]\from[url6].
788\useURL[url7][/url/][][URL and title]\from[url7].
790\useURL[url8][/url/][][URL and title]\from[url8]
792\useURL[url9][/url/][][URL and title]\from[url9]
794\useURL[url10][/url/with_underscore][][with_underscore]\from[url10]
796\useURL[url11][mailto:nobody@nowhere.net][][Email link]\from[url11]
798\useURL[url12][][][Empty]\from[url12].
800\subsection[title={Reference},reference={reference}]
802Foo \useURL[url13][/url/][][bar]\from[url13].
804With \useURL[url14][/url/][][embedded {[}brackets{]}]\from[url14].
806\useURL[url15][/url/][][b]\from[url15] by itself should be a link.
808Indented \useURL[url16][/url][][once]\from[url16].
810Indented \useURL[url17][/url][][twice]\from[url17].
812Indented \useURL[url18][/url][][thrice]\from[url18].
814This should {[}not{]}{[}{]} be a link.
816\starttyping
817[not]: /url
818\stoptyping
820Foo \useURL[url19][/url/][][bar]\from[url19].
822Foo \useURL[url20][/url/][][biz]\from[url20].
824\subsection[title={With ampersands},reference={with-ampersands}]
826Here's a \useURL[url21][http://example.com/?foo=1&bar=2][][link with an
827ampersand in the URL]\from[url21].
829Here's a link with an amersand in the link text:
830\useURL[url22][http://att.com/][][AT&T]\from[url22].
832Here's an \useURL[url23][/script?foo=1&bar=2][][inline link]\from[url23].
834Here's an \useURL[url24][/script?foo=1&bar=2][][inline link in pointy
835braces]\from[url24].
837\subsection[title={Autolinks},reference={autolinks}]
839With an ampersand: \useURL[url25][http://example.com/?foo=1&bar=2]\from[url25]
841\startitemize[packed]
842\item
843 In a list?
844\item
845 \useURL[url26][http://example.com/]\from[url26]
846\item
847 It should.
848\stopitemize
850An e-mail address:
851\useURL[url27][mailto:nobody@nowhere.net][][nobody@nowhere.net]\from[url27]
853\startblockquote
854Blockquoted: \useURL[url28][http://example.com/]\from[url28]
855\stopblockquote
857Auto-links should not occur here: \type{<http://example.com/>}
859\starttyping
860or here: <http://example.com/>
861\stoptyping
863\thinrule
865\section[title={Images},reference={images}]
867From \quotation{Voyage dans la Lune} by Georges Melies (1902):
869\placefigure{lalune}{\externalfigure[lalune.jpg]}
871Here is a movie {\externalfigure[movie.jpg]} icon.
873\thinrule
875\section[title={Footnotes},reference={footnotes}]
877Here is a footnote reference,\footnote{Here is the footnote. It can go
878 anywhere after the footnote reference. It need not be placed at the end of
879 the document.} and another.\startbuffer Here's the long note. This one
880 contains multiple blocks.
882 Subsequent blocks are indented to show that they belong to the footnote (as
883 with list items).
885\starttyping
886 { <code> }
887\stoptyping
889 If you want, you can indent every line, but you can also be lazy and just
890 indent the first line of each block.\stopbuffer\footnote{\getbuffer} This
891should {\em not} be a footnote reference, because it contains a space.{[}^my
892note{]} Here is an inline note.\footnote{This is {\em easier} to type. Inline
893 notes may contain \useURL[url29][http://google.com][][links]\from[url29] and
894 \type{]} verbatim characters, as well as {[}bracketed text{]}.}
896\startblockquote
897Notes can go in quotes.\footnote{In quote.}
898\stopblockquote
900\startitemize[n,packed][stopper=.]
901\item
902 And in list items.\footnote{In list.}
903\stopitemize
905This paragraph should not be part of the note, as it is not indented.
907\stoptext