git.iko.soy/typeable/pandoc
on ca2bbaf help sign in
typeable/pandoc/tests/writer.context
931 lines 14 kB history raw
1\enableregime[utf] % use UTF-8
3\setupcolors[state=start]
4\setupinteraction[state=start, color=middleblue] % needed for hyperlinks
6\setuppapersize[letter][letter] % use letter paper
7\setuplayout[width=middle, backspace=1.5in, cutspace=1.5in,
8 height=middle, header=0.75in, footer=0.75in] % page layout
9\setuppagenumbering[location={footer,center}] % number pages
10\setupbodyfont[11pt] % 11pt font
11\setupwhitespace[medium] % inter-paragraph spacing
13\setuphead[section][style=\tfc]
14\setuphead[subsection][style=\tfb]
15\setuphead[subsubsection][style=\bf]
17% define title block commands
18\unprotect
19\def\doctitle#1{\gdef\@title{#1}}
20\def\author#1{\gdef\@author{#1}}
21\def\date#1{\gdef\@date{#1}}
22\date{\currentdate} % Default to today unless specified otherwise.
23\def\maketitle{%
24 \startalignment[center]
25 \blank[2*big]
26 {\tfd \@title}
27 \blank[3*medium]
28 {\tfa \@author}
29 \blank[2*medium]
30 {\tfa \@date}
31 \blank[3*medium]
32 \stopalignment}
33\protect
35% define descr (for definition lists)
36\definedescription[descr][
37 headstyle=bold,style=normal,align=left,location=hanging,
38 width=broad,margin=1cm]
40% prevent orphaned list intros
41\setupitemize[autointro]
43% define defaults for bulleted lists
44\setupitemize[1][symbol=1][indentnext=no]
45\setupitemize[2][symbol=2][indentnext=no]
46\setupitemize[3][symbol=3][indentnext=no]
47\setupitemize[4][symbol=4][indentnext=no]
49\setupthinrules[width=15em] % width of horizontal rules
51% for block quotations
52\unprotect
54\startvariables all
55blockquote: blockquote
56\stopvariables
58\definedelimitedtext
59[\v!blockquote][\v!quotation]
61\setupdelimitedtext
62[\v!blockquote]
63[\c!left=,
64\c!right=,
65before={\blank[medium]},
66after={\blank[medium]},
69\protect
71\doctitle{Pandoc Test Suite}
72\author{John MacFarlane\\Anonymous}
73\date{July 17, 2006}
74\starttext
75\maketitle
77This is a set of tests for pandoc. Most of them are adapted from
78John Gruber's markdown test suite.
80\thinrule
82\subject{Headers}
84\subsubject{Level 2 with an \useURL[1][/url][][embedded link]\from[1]}
86\subsubsubject{Level 3 with {\em emphasis}}
88\subsubsubsubject{Level 4}
90\subsubsubsubsubject{Level 5}
92\subject{Level 1}
94\subsubject{Level 2 with {\em emphasis}}
96\subsubsubject{Level 3}
98with no blank line
100\subsubject{Level 2}
102with no blank line
104\thinrule
106\subject{Paragraphs}
108Here's a regular paragraph.
110In Markdown 1.0.0 and earlier. Version 8. This line turns into a
111list item. Because a hard-wrapped line in the middle of a paragraph
112looked like a list item.
114Here's one with a bullet. * criminey.
116There should be a hard line break\crlf
117here.
119\thinrule
121\subject{Block Quotes}
123E-mail style:
125\startblockquote
126This is a block quote. It is pretty short.
127\stopblockquote
129\startblockquote
130Code in a block quote:
132\starttyping
133sub status {
134 print "working";
136\stoptyping
138A list:
140\startitemize[n][stopper=.]
141\item
142 item one
143\item
144 item two
145\stopitemize
147Nested block quotes:
149\startblockquote
150nested
151\stopblockquote
153\startblockquote
154nested
155\stopblockquote
156\stopblockquote
158This should not be a block quote: 2 \lettermore{} 1.
160And a following paragraph.
162\thinrule
164\subject{Code Blocks}
166Code:
168\starttyping
169---- (should be four hyphens)
171sub status {
172 print "working";
175this code block is indented by one tab
176\stoptyping
178And:
180\starttyping
181 this code block is indented by two tabs
183These should not be escaped: \$ \\ \> \[ \{
184\stoptyping
186\thinrule
188\subject{Lists}
190\subsubject{Unordered}
192Asterisks tight:
194\startitemize
195\item
196 asterisk 1
197\item
198 asterisk 2
199\item
200 asterisk 3
201\stopitemize
203Asterisks loose:
205\startitemize
206\item
207 asterisk 1
208\item
209 asterisk 2
210\item
211 asterisk 3
212\stopitemize
214Pluses tight:
216\startitemize
217\item
218 Plus 1
219\item
220 Plus 2
221\item
222 Plus 3
223\stopitemize
225Pluses loose:
227\startitemize
228\item
229 Plus 1
230\item
231 Plus 2
232\item
233 Plus 3
234\stopitemize
236Minuses tight:
238\startitemize
239\item
240 Minus 1
241\item
242 Minus 2
243\item
244 Minus 3
245\stopitemize
247Minuses loose:
249\startitemize
250\item
251 Minus 1
252\item
253 Minus 2
254\item
255 Minus 3
256\stopitemize
258\subsubject{Ordered}
260Tight:
262\startitemize[n][stopper=.]
263\item
264 First
265\item
266 Second
267\item
268 Third
269\stopitemize
271and:
273\startitemize[n][stopper=.]
274\item
275 One
276\item
277 Two
278\item
279 Three
280\stopitemize
282Loose using tabs:
284\startitemize[n][stopper=.]
285\item
286 First
287\item
288 Second
289\item
290 Third
291\stopitemize
293and using spaces:
295\startitemize[n][stopper=.]
296\item
297 One
298\item
299 Two
300\item
301 Three
302\stopitemize
304Multiple paragraphs:
306\startitemize[n][stopper=.]
307\item
308 Item 1, graf one.
310 Item 1. graf two. The quick brown fox jumped over the lazy dog's
311 back.
312\item
313 Item 2.
314\item
315 Item 3.
316\stopitemize
318\subsubject{Nested}
320\startitemize
321\item
322 Tab
323 \startitemize
324 \item
325 Tab
326 \startitemize
327 \item
328 Tab
329 \stopitemize
330 \stopitemize
331\stopitemize
333Here's another:
335\startitemize[n][stopper=.]
336\item
337 First
338\item
339 Second:
340 \startitemize
341 \item
342 Fee
343 \item
344 Fie
345 \item
346 Foe
347 \stopitemize
348\item
349 Third
350\stopitemize
352Same thing but with paragraphs:
354\startitemize[n][stopper=.]
355\item
356 First
357\item
358 Second:
360 \startitemize
361 \item
362 Fee
363 \item
364 Fie
365 \item
366 Foe
367 \stopitemize
368\item
369 Third
370\stopitemize
372\subsubject{Tabs and spaces}
374\startitemize
375\item
376 this is a list item indented with tabs
377\item
378 this is a list item indented with spaces
380 \startitemize
381 \item
382 this is an example list item indented with tabs
383 \item
384 this is an example list item indented with spaces
385 \stopitemize
386\stopitemize
388\subsubject{Fancy list markers}
390\startitemize[n][start=2,left=(,stopper=),width=2.0em]
391\item
392 begins with 2
393\item
394 and now 3
396 with a continuation
398 \startitemize[r][start=4,stopper=.,width=2.0em]
399 \item
400 sublist with roman numerals, starting with 4
401 \item
402 more items
403 \startitemize[A][left=(,stopper=),width=2.0em]
404 \item
405 a subsublist
406 \item
407 a subsublist
408 \stopitemize
409 \stopitemize
410\stopitemize
412Nesting:
414\startitemize[A][stopper=.]
415\item
416 Upper Alpha
417 \startitemize[R][stopper=.]
418 \item
419 Upper Roman.
420 \startitemize[n][start=6,left=(,stopper=),width=2.0em]
421 \item
422 Decimal start with 6
423 \startitemize[a][start=3,stopper=)]
424 \item
425 Lower alpha with paren
426 \stopitemize
427 \stopitemize
428 \stopitemize
429\stopitemize
431Autonumbering:
433\startitemize[n]
434\item
435 Autonumber.
436\item
437 More.
438 \startitemize[a]
439 \item
440 Nested.
441 \stopitemize
442\stopitemize
444Should not be a list item:
446M.A.~2007
448B. Williams
450\thinrule
452\subject{Definition Lists}
454Tight using spaces:
456\startdescr{apple}
457red fruit
458\stopdescr
460\startdescr{orange}
461orange fruit
462\stopdescr
464\startdescr{banana}
465yellow fruit
466\stopdescr
468Tight using tabs:
470\startdescr{apple}
471red fruit
472\stopdescr
474\startdescr{orange}
475orange fruit
476\stopdescr
478\startdescr{banana}
479yellow fruit
480\stopdescr
482Loose:
484\startdescr{apple}
485red fruit
486\stopdescr
488\startdescr{orange}
489orange fruit
490\stopdescr
492\startdescr{banana}
493yellow fruit
494\stopdescr
496Multiple blocks with italics:
498\startdescr{{\em apple}}
499red fruit
501contains seeds, crisp, pleasant to taste
502\stopdescr
504\startdescr{{\em orange}}
505orange fruit
507\starttyping
508{ orange code block }
509\stoptyping
511\startblockquote
512orange block quote
513\stopblockquote
514\stopdescr
516Multiple definitions, tight:
518\startdescr{apple}
519red fruit
521computer
522\stopdescr
524\startdescr{orange}
525orange fruit
527bank
528\stopdescr
530Multiple definitions, loose:
532\startdescr{apple}
533red fruit
535computer
536\stopdescr
538\startdescr{orange}
539orange fruit
541bank
542\stopdescr
544Blank line after term, indented marker, alternate markers:
546\startdescr{apple}
547red fruit
549computer
550\stopdescr
552\startdescr{orange}
553orange fruit
555\startitemize[n][stopper=.]
556\item
557 sublist
558\item
559 sublist
560\stopitemize
561\stopdescr
563\subject{HTML Blocks}
565Simple block on one line:
567foo
568And nested without indentation:
570foo
571bar
572Interpreted markdown in a table:
574This is {\em emphasized}
575And this is {\bf strong}
576Here's a simple block:
578foo
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
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\subject{Inline Markup}
620This is {\em emphasized}, and so {\em is this}.
622This is {\bf strong}, and so {\bf is this}.
624An {\em \useURL[2][/url][][emphasized link]\from[2]}.
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{\$},
635\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
644unescaped spaces: a\letterhat{}b c\letterhat{}d, a\lettertilde{}b
645c\lettertilde{}d.
647\thinrule
649\subject{Smart quotes, ellipses, dashes}
651\quotation{Hello,} said the spider.
652\quotation{\quote{Shelob} is my name.}
654\quote{A}, \quote{B}, and \quote{C} are letters.
656\quote{Oak,} \quote{elm,} and \quote{beech} are names of trees. So
657is \quote{pine.}
659\quote{He said, \quotation{I want to go.}} Were you alive in the
66070's?
662Here is some quoted \quote{\type{code}} and a
663\quotation{\useURL[3][http://example.com/?foo=1&bar=2][][quoted link]\from[3]}.
665Some dashes: one---two --- three---four --- five.
667Dashes between numbers: 5--7, 255--66, 1987--1999.
669Ellipses\ldots{}and\ldots{}and\ldots{}.
671\thinrule
673\subject{LaTeX}
675\startitemize
676\item
677 \cite[22-23]{smith.1899}
678\item
679 $2+2=4$
680\item
681 $x \in y$
682\item
683 $\alpha \wedge \omega$
684\item
685 $223$
686\item
687 $p$-Tree
688\item
689 Here's some display math:
690 \startformula \frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h} \stopformula
691\item
692 Here's one that has a line break in it:
693 $\alpha + \omega \times x^2$.
694\stopitemize
696These shouldn't be math:
698\startitemize
699\item
700 To get the famous equation, write \type{$e = mc^2$}.
701\item
702 \$22,000 is a {\em lot} of money. So is \$34,000. (It worked if
703 \quotation{lot} is emphasized.)
704\item
705 Shoes (\$20) and socks (\$5).
706\item
707 Escaped \type{$}: \$73 {\em this should be emphasized} 23\$.
708\stopitemize
710Here's a LaTeX table:
712\begin{tabular}{|l|l|}\hline
713Animal & Number \\ \hline
714Dog & 2 \\
715Cat & 1 \\ \hline
716\end{tabular}
718\thinrule
720\subject{Special Characters}
722Here is some unicode:
724\startitemize
725\item
726 I hat: Î
727\item
728 o umlaut: ö
729\item
730 section: §
731\item
732 set membership: ∈
733\item
734 copyright: ©
735\stopitemize
737AT\&T has an ampersand in their name.
739AT\&T is another way to write it.
741This \& that.
7434 \letterless{} 5.
7456 \lettermore{} 5.
747Backslash: \letterbackslash{}
749Backtick: `
751Asterisk: *
753Underscore: \letterunderscore{}
755Left brace: \letteropenbrace{}
757Right brace: \letterclosebrace{}
759Left bracket: [
761Right bracket: ]
763Left paren: (
765Right paren: )
767Greater-than: \lettermore{}
769Hash: \#
771Period: .
773Bang: !
775Plus: +
777Minus: -
779\thinrule
781\subject{Links}
783\subsubject{Explicit}
785Just a \useURL[4][/url/][][URL]\from[4].
787\useURL[5][/url/][][URL and title]\from[5].
789\useURL[6][/url/][][URL and title]\from[6].
791\useURL[7][/url/][][URL and title]\from[7].
793\useURL[8][/url/][][URL and title]\from[8]
795\useURL[9][/url/][][URL and title]\from[9]
797\useURL[10][/url/with_underscore][][with\letterunderscore{}underscore]\from[10]
799\useURL[11][mailto:nobody@nowhere.net][][Email link]\from[11]
801\useURL[12][][][Empty]\from[12].
803\subsubject{Reference}
805Foo \useURL[13][/url/][][bar]\from[13].
807Foo \useURL[14][/url/][][bar]\from[14].
809Foo \useURL[15][/url/][][bar]\from[15].
811With \useURL[16][/url/][][embedded [brackets]]\from[16].
813\useURL[17][/url/][][b]\from[17] by itself should be a link.
815Indented \useURL[18][/url][][once]\from[18].
817Indented \useURL[19][/url][][twice]\from[19].
819Indented \useURL[20][/url][][thrice]\from[20].
821This should [not][] be a link.
823\starttyping
824[not]: /url
825\stoptyping
827Foo \useURL[21][/url/][][bar]\from[21].
829Foo \useURL[22][/url/][][biz]\from[22].
831\subsubject{With ampersands}
833Here's a
834\useURL[23][http://example.com/?foo=1&bar=2][][link with an ampersand in the URL]\from[23].
836Here's a link with an amersand in the link text:
837\useURL[24][http://att.com/][][AT\&T]\from[24].
839Here's an \useURL[25][/script?foo=1&bar=2][][inline link]\from[25].
841Here's an
842\useURL[26][/script?foo=1&bar=2][][inline link in pointy braces]\from[26].
844\subsubject{Autolinks}
846With an ampersand:
847\useURL[27][http://example.com/?foo=1&bar=2][][http://example.com/?foo=1\&bar=2]\from[27]
849\startitemize
850\item
851 In a list?
852\item
853 \useURL[28][http://example.com/][][http://example.com/]\from[28]
854\item
855 It should.
856\stopitemize
858An e-mail address:
859\useURL[29][mailto:nobody@nowhere.net][][nobody@nowhere.net]\from[29]
861\startblockquote
862Blockquoted:
863\useURL[30][http://example.com/][][http://example.com/]\from[30]
864\stopblockquote
866Auto-links should not occur here: \type{<http://example.com/>}
868\starttyping
869or here: <http://example.com/>
870\stoptyping
872\thinrule
874\subject{Images}
876From \quotation{Voyage dans la Lune} by Georges Melies (1902):
878\placefigure
879[]
880[fig:lalune]
881{Voyage dans la Lune}
882{\externalfigure[lalune.jpg]}
884Here is a movie
885\placefigure
886[]
887[fig:movie]
888{}
889{\externalfigure[movie.jpg]} icon.
891\thinrule
893\subject{Footnotes}
895Here is a footnote reference,
896\footnote{Here is the footnote. It can go anywhere after the footnote
897reference. It need not be placed at the end of the document.}
898and another.
899\footnote{Here's the long note. This one contains multiple blocks.
901Subsequent blocks are indented to show that they belong to the
902footnote (as with list items).
904\starttyping
905 { <code> }
906\stoptyping
908If you want, you can indent every line, but you can also be lazy
909and just indent the first line of each block.}
910This should {\em not} be a footnote reference, because it contains
911a space.[\letterhat{}my note] Here is an inline note.
912\footnote{This is {\em easier} to type. Inline notes may contain
913\useURL[31][http://google.com][][links]\from[31] and \type{]}
914verbatim characters, as well as [bracketed text].}
916\startblockquote
917Notes can go in quotes.
918\footnote{In quote.}
919\stopblockquote
921\startitemize[n][stopper=.]
922\item
923 And in list items.
924 \footnote{In list.}
925\stopitemize
927This paragraph should not be part of the note, as it is not
928indented.
930\stoptext