git.iko.soy/typeable/pandoc
on 2.0.2 help sign in
typeable/pandoc/test/writer.context
893 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=]
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][DejaVu 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
55\starttext
56\startalignment[middle]
57 {\tfd Pandoc Test Suite}
58 \smallskip
59 {\tfa John MacFarlane\crlf Anonymous}
60 \smallskip
61 {\tfa July 17, 2006}
62 \bigskip
63\stopalignment
65This is a set of tests for pandoc. Most of them are adapted from John Gruber's
66markdown test suite.
68\thinrule
70\section[headers]{Headers}
72\subsection[level-2-with-an-embedded-link]{Level 2 with an
73\useURL[url1][/url][][embedded link]\from[url1]}
75\subsubsection[level-3-with-emphasis]{Level 3 with {\em emphasis}}
77\subsubsubsection[level-4]{Level 4}
79\subsubsubsubsection[level-5]{Level 5}
81\section[level-1]{Level 1}
83\subsection[level-2-with-emphasis]{Level 2 with {\em emphasis}}
85\subsubsection[level-3]{Level 3}
87with no blank line
89\subsection[level-2]{Level 2}
91with no blank line
93\thinrule
95\section[paragraphs]{Paragraphs}
97Here's a regular paragraph.
99In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.
100Because a hard-wrapped line in the middle of a paragraph looked like a list
101item.
103Here's one with a bullet. * criminey.
105There should be a hard line break\crlf
106here.
108\thinrule
110\section[block-quotes]{Block Quotes}
112E-mail style:
114\startblockquote
115This is a block quote. It is pretty short.
116\stopblockquote
118\startblockquote
119Code in a block quote:
121\starttyping
122sub status {
123 print "working";
125\stoptyping
127A list:
129\startitemize[n,packed][stopper=.]
130\item
131 item one
132\item
133 item two
134\stopitemize
136Nested block quotes:
138\startblockquote
139nested
140\stopblockquote
142\startblockquote
143nested
144\stopblockquote
145\stopblockquote
147This should not be a block quote: 2 > 1.
149And a following paragraph.
151\thinrule
153\section[code-blocks]{Code Blocks}
155Code:
157\starttyping
158---- (should be four hyphens)
160sub status {
161 print "working";
164this code block is indented by one tab
165\stoptyping
167And:
169\starttyping
170 this code block is indented by two tabs
172These should not be escaped: \$ \\ \> \[ \{
173\stoptyping
175\thinrule
177\section[lists]{Lists}
179\subsection[unordered]{Unordered}
181Asterisks tight:
183\startitemize[packed]
184\item
185 asterisk 1
186\item
187 asterisk 2
188\item
189 asterisk 3
190\stopitemize
192Asterisks loose:
194\startitemize
195\item
196 asterisk 1
197\item
198 asterisk 2
199\item
200 asterisk 3
201\stopitemize
203Pluses tight:
205\startitemize[packed]
206\item
207 Plus 1
208\item
209 Plus 2
210\item
211 Plus 3
212\stopitemize
214Pluses loose:
216\startitemize
217\item
218 Plus 1
219\item
220 Plus 2
221\item
222 Plus 3
223\stopitemize
225Minuses tight:
227\startitemize[packed]
228\item
229 Minus 1
230\item
231 Minus 2
232\item
233 Minus 3
234\stopitemize
236Minuses loose:
238\startitemize
239\item
240 Minus 1
241\item
242 Minus 2
243\item
244 Minus 3
245\stopitemize
247\subsection[ordered]{Ordered}
249Tight:
251\startitemize[n,packed][stopper=.]
252\item
253 First
254\item
255 Second
256\item
257 Third
258\stopitemize
260and:
262\startitemize[n,packed][stopper=.]
263\item
264 One
265\item
266 Two
267\item
268 Three
269\stopitemize
271Loose using tabs:
273\startitemize[n][stopper=.]
274\item
275 First
276\item
277 Second
278\item
279 Third
280\stopitemize
282and using spaces:
284\startitemize[n][stopper=.]
285\item
286 One
287\item
288 Two
289\item
290 Three
291\stopitemize
293Multiple paragraphs:
295\startitemize[n][stopper=.]
296\item
297 Item 1, graf one.
299 Item 1. graf two. The quick brown fox jumped over the lazy dog's back.
300\item
301 Item 2.
302\item
303 Item 3.
304\stopitemize
306\subsection[nested]{Nested}
308\startitemize[packed]
309\item
310 Tab
311 \startitemize[packed]
312 \item
313 Tab
314 \startitemize[packed]
315 \item
316 Tab
317 \stopitemize
318 \stopitemize
319\stopitemize
321Here's another:
323\startitemize[n,packed][stopper=.]
324\item
325 First
326\item
327 Second:
328 \startitemize[packed]
329 \item
330 Fee
331 \item
332 Fie
333 \item
334 Foe
335 \stopitemize
336\item
337 Third
338\stopitemize
340Same thing but with paragraphs:
342\startitemize[n][stopper=.]
343\item
344 First
345\item
346 Second:
348 \startitemize[packed]
349 \item
350 Fee
351 \item
352 Fie
353 \item
354 Foe
355 \stopitemize
356\item
357 Third
358\stopitemize
360\subsection[tabs-and-spaces]{Tabs and spaces}
362\startitemize
363\item
364 this is a list item indented with tabs
365\item
366 this is a list item indented with spaces
368 \startitemize
369 \item
370 this is an example list item indented with tabs
371 \item
372 this is an example list item indented with spaces
373 \stopitemize
374\stopitemize
376\subsection[fancy-list-markers]{Fancy list markers}
378\startitemize[n][start=2,left=(,stopper=),width=2.0em]
379\item
380 begins with 2
381\item
382 and now 3
384 with a continuation
386 \startitemize[r,packed][start=4,stopper=.,width=2.0em]
387 \item
388 sublist with roman numerals, starting with 4
389 \item
390 more items
391 \startitemize[A,packed][left=(,stopper=),width=2.0em]
392 \item
393 a subsublist
394 \item
395 a subsublist
396 \stopitemize
397 \stopitemize
398\stopitemize
400Nesting:
402\startitemize[A,packed][stopper=.]
403\item
404 Upper Alpha
405 \startitemize[R,packed][stopper=.]
406 \item
407 Upper Roman.
408 \startitemize[n,packed][start=6,left=(,stopper=),width=2.0em]
409 \item
410 Decimal start with 6
411 \startitemize[a,packed][start=3,stopper=)]
412 \item
413 Lower alpha with paren
414 \stopitemize
415 \stopitemize
416 \stopitemize
417\stopitemize
419Autonumbering:
421\startitemize[n,packed]
422\item
423 Autonumber.
424\item
425 More.
426 \startitemize[a,packed]
427 \item
428 Nested.
429 \stopitemize
430\stopitemize
432Should not be a list item:
434M.A.~2007
436B. Williams
438\thinrule
440\section[definition-lists]{Definition Lists}
442Tight using spaces:
444\startdescription{apple}
445 red fruit
446\stopdescription
448\startdescription{orange}
449 orange fruit
450\stopdescription
452\startdescription{banana}
453 yellow fruit
454\stopdescription
456Tight using tabs:
458\startdescription{apple}
459 red fruit
460\stopdescription
462\startdescription{orange}
463 orange fruit
464\stopdescription
466\startdescription{banana}
467 yellow fruit
468\stopdescription
470Loose:
472\startdescription{apple}
473 red fruit
474\stopdescription
476\startdescription{orange}
477 orange fruit
478\stopdescription
480\startdescription{banana}
481 yellow fruit
482\stopdescription
484Multiple blocks with italics:
486\startdescription{{\em apple}}
487 red fruit
489 contains seeds, crisp, pleasant to taste
490\stopdescription
492\startdescription{{\em orange}}
493 orange fruit
495\starttyping
496{ orange code block }
497\stoptyping
499 \startblockquote
500 orange block quote
501 \stopblockquote
502\stopdescription
504Multiple definitions, tight:
506\startdescription{apple}
507 red fruit
509 computer
510\stopdescription
512\startdescription{orange}
513 orange fruit
515 bank
516\stopdescription
518Multiple definitions, loose:
520\startdescription{apple}
521 red fruit
523 computer
524\stopdescription
526\startdescription{orange}
527 orange fruit
529 bank
530\stopdescription
532Blank line after term, indented marker, alternate markers:
534\startdescription{apple}
535 red fruit
537 computer
538\stopdescription
540\startdescription{orange}
541 orange fruit
543 \startitemize[n,packed][stopper=.]
544 \item
545 sublist
546 \item
547 sublist
548 \stopitemize
549\stopdescription
551\section[html-blocks]{HTML Blocks}
553Simple block on one line:
555foo
557And nested without indentation:
559foo
561bar
563Interpreted markdown in a table:
565This is {\em emphasized}
566And this is {\bf strong}
567Here's a simple block:
569foo
571This should be a code block, though:
573\starttyping
574<div>
575 foo
576</div>
577\stoptyping
579As should this:
581\starttyping
582<div>foo</div>
583\stoptyping
585Now, nested:
587foo
589This should just be an HTML comment:
591Multiline:
593Code block:
595\starttyping
596<!-- Comment -->
597\stoptyping
599Just plain comment, with trailing spaces on the line:
601Code:
603\starttyping
604<hr />
605\stoptyping
607Hr's:
609\thinrule
611\section[inline-markup]{Inline Markup}
613This is {\em emphasized}, and so {\em is this}.
615This is {\bf strong}, and so {\bf is this}.
617An {\em \useURL[url2][/url][][emphasized link]\from[url2]}.
619{\bf {\em This is strong and em.}}
621So is {\bf {\em this}} word.
623{\bf {\em This is strong and em.}}
625So is {\bf {\em this}} word.
627This is code: \type{>}, \type{$}, \type{\}, \type{\$}, \type{<html>}.
629\overstrikes{This is {\em strikeout}.}
631Superscripts: a\high{bc}d a\high{{\em hello}} a\high{hello~there}.
633Subscripts: H\low{2}O, H\low{23}O, H\low{many~of~them}O.
635These should not be superscripts or subscripts, because of the unescaped
636spaces: a^b c^d, a\lettertilde{}b c\lettertilde{}d.
638\thinrule
640\section[smart-quotes-ellipses-dashes]{Smart quotes, ellipses, dashes}
642\quotation{Hello,} said the spider. \quotation{\quote{Shelob} is my name.}
644\quote{A}, \quote{B}, and \quote{C} are letters.
646\quote{Oak,} \quote{elm,} and \quote{beech} are names of trees. So is
647\quote{pine.}
649\quote{He said, \quotation{I want to go.}} Were you alive in the 70's?
651Here is some quoted \quote{\type{code}} and a
652\quotation{\useURL[url3][http://example.com/?foo=1&bar=2][][quoted
653link]\from[url3]}.
655Some dashes: one---two --- three---four --- five.
657Dashes between numbers: 5--7, 255--66, 1987--1999.
659Ellipses\ldots{}and\ldots{}and\ldots{}.
661\thinrule
663\section[latex]{LaTeX}
665\startitemize[packed]
666\item
667 \cite[22-23]{smith.1899}
668\item
669 $2+2=4$
670\item
671 $x \in y$
672\item
673 $\alpha \wedge \omega$
674\item
675 $223$
676\item
677 $p$-Tree
678\item
679 Here's some display math:
680 \startformula \frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h} \stopformula
681\item
682 Here's one that has a line break in it: $\alpha + \omega \times x^2$.
683\stopitemize
685These shouldn't be math:
687\startitemize[packed]
688\item
689 To get the famous equation, write \type{$e = mc^2$}.
690\item
691 \$22,000 is a {\em lot} of money. So is \$34,000. (It worked if
692 \quotation{lot} is emphasized.)
693\item
694 Shoes (\$20) and socks (\$5).
695\item
696 Escaped \type{$}: \$73 {\em this should be emphasized} 23\$.
697\stopitemize
699Here's a LaTeX table:
701\thinrule
703\section[special-characters]{Special Characters}
705Here is some unicode:
707\startitemize[packed]
708\item
709 I hat: Î
710\item
711 o umlaut: ö
712\item
713 section: §
714\item
715 set membership: ∈
716\item
717 copyright: ©
718\stopitemize
720AT&T has an ampersand in their name.
722AT&T is another way to write it.
724This & that.
7264 < 5.
7286 > 5.
730Backslash: \letterbackslash{}
732Backtick: `
734Asterisk: *
736Underscore: _
738Left brace: \{
740Right brace: \}
742Left bracket: {[}
744Right bracket: {]}
746Left paren: (
748Right paren: )
750Greater-than: >
752Hash: \#
754Period: .
756Bang: !
758Plus: +
760Minus: -
762\thinrule
764\section[links]{Links}
766\subsection[explicit]{Explicit}
768Just a \useURL[url4][/url/][][URL]\from[url4].
770\useURL[url5][/url/][][URL and title]\from[url5].
772\useURL[url6][/url/][][URL and title]\from[url6].
774\useURL[url7][/url/][][URL and title]\from[url7].
776\useURL[url8][/url/][][URL and title]\from[url8]
778\useURL[url9][/url/][][URL and title]\from[url9]
780\useURL[url10][/url/with_underscore][][with_underscore]\from[url10]
782\useURL[url11][mailto:nobody@nowhere.net][][Email link]\from[url11]
784\useURL[url12][][][Empty]\from[url12].
786\subsection[reference]{Reference}
788Foo \useURL[url13][/url/][][bar]\from[url13].
790With \useURL[url14][/url/][][embedded {[}brackets{]}]\from[url14].
792\useURL[url15][/url/][][b]\from[url15] by itself should be a link.
794Indented \useURL[url16][/url][][once]\from[url16].
796Indented \useURL[url17][/url][][twice]\from[url17].
798Indented \useURL[url18][/url][][thrice]\from[url18].
800This should {[}not{]}{[}{]} be a link.
802\starttyping
803[not]: /url
804\stoptyping
806Foo \useURL[url19][/url/][][bar]\from[url19].
808Foo \useURL[url20][/url/][][biz]\from[url20].
810\subsection[with-ampersands]{With ampersands}
812Here's a \useURL[url21][http://example.com/?foo=1&bar=2][][link with an
813ampersand in the URL]\from[url21].
815Here's a link with an amersand in the link text:
816\useURL[url22][http://att.com/][][AT&T]\from[url22].
818Here's an \useURL[url23][/script?foo=1&bar=2][][inline link]\from[url23].
820Here's an \useURL[url24][/script?foo=1&bar=2][][inline link in pointy
821braces]\from[url24].
823\subsection[autolinks]{Autolinks}
825With an ampersand: \useURL[url25][http://example.com/?foo=1&bar=2]\from[url25]
827\startitemize[packed]
828\item
829 In a list?
830\item
831 \useURL[url26][http://example.com/]\from[url26]
832\item
833 It should.
834\stopitemize
836An e-mail address:
837\useURL[url27][mailto:nobody@nowhere.net][][nobody@nowhere.net]\from[url27]
839\startblockquote
840Blockquoted: \useURL[url28][http://example.com/]\from[url28]
841\stopblockquote
843Auto-links should not occur here: \type{<http://example.com/>}
845\starttyping
846or here: <http://example.com/>
847\stoptyping
849\thinrule
851\section[images]{Images}
853From \quotation{Voyage dans la Lune} by Georges Melies (1902):
855\placefigure{lalune}{\externalfigure[lalune.jpg]}
857Here is a movie {\externalfigure[movie.jpg]} icon.
859\thinrule
861\section[footnotes]{Footnotes}
863Here is a footnote reference,\footnote{Here is the footnote. It can go
864 anywhere after the footnote reference. It need not be placed at the end of
865 the document.} and another.\startbuffer Here's the long note. This one
866 contains multiple blocks.
868 Subsequent blocks are indented to show that they belong to the footnote (as
869 with list items).
871\starttyping
872 { <code> }
873\stoptyping
875 If you want, you can indent every line, but you can also be lazy and just
876 indent the first line of each block.\stopbuffer\footnote{\getbuffer} This
877should {\em not} be a footnote reference, because it contains a space.{[}^my
878note{]} Here is an inline note.\footnote{This is {\em easier} to type. Inline
879 notes may contain \useURL[url29][http://google.com][][links]\from[url29] and
880 \type{]} verbatim characters, as well as {[}bracketed text{]}.}
882\startblockquote
883Notes can go in quotes.\footnote{In quote.}
884\stopblockquote
886\startitemize[n,packed][stopper=.]
887\item
888 And in list items.\footnote{In list.}
889\stopitemize
891This paragraph should not be part of the note, as it is not indented.
893\stoptext