git.iko.soy/typeable/pandoc
on bbb60a2 help sign in
typeable/pandoc/tests/writer.context
908 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 descr (for definition lists)
18\definedescription[descr][
19 headstyle=bold,style=normal,align=left,location=hanging,
20 width=broad,margin=1cm]
22% prevent orphaned list intros
23\setupitemize[autointro]
25% define defaults for bulleted lists
26\setupitemize[1][symbol=1][indentnext=no]
27\setupitemize[2][symbol=2][indentnext=no]
28\setupitemize[3][symbol=3][indentnext=no]
29\setupitemize[4][symbol=4][indentnext=no]
31\setupthinrules[width=15em] % width of horizontal rules
33% for block quotations
34\unprotect
36\startvariables all
37blockquote: blockquote
38\stopvariables
40\definedelimitedtext
41[\v!blockquote][\v!quotation]
43\setupdelimitedtext
44[\v!blockquote]
45[\c!left=,
46\c!right=,
47before={\blank[medium]},
48after={\blank[medium]},
51\protect
53\starttext
54\startalignment[center]
55 \blank[2*big]
56 {\tfd Pandoc Test Suite}
57 \blank[3*medium]
58 {\tfa John MacFarlane\crlf Anonymous}
59 \blank[2*medium]
60 {\tfa July 17, 2006}
61 \blank[3*medium]
62\stopalignment
64This is a set of tests for pandoc. Most of them are adapted from
65John Gruber's markdown test suite.
67\thinrule
69\subject{Headers}
71\subsubject{Level 2 with an \useURL[1][/url][][embedded link]\from[1]}
73\subsubsubject{Level 3 with {\em emphasis}}
75\subsubsubsubject{Level 4}
77\subsubsubsubsubject{Level 5}
79\subject{Level 1}
81\subsubject{Level 2 with {\em emphasis}}
83\subsubsubject{Level 3}
85with no blank line
87\subsubject{Level 2}
89with no blank line
91\thinrule
93\subject{Paragraphs}
95Here's a regular paragraph.
97In Markdown 1.0.0 and earlier. Version 8. This line turns into a
98list item. Because a hard-wrapped line in the middle of a paragraph
99looked like a list item.
101Here's one with a bullet. * criminey.
103There should be a hard line break\crlf
104here.
106\thinrule
108\subject{Block Quotes}
110E-mail style:
112\startblockquote
113This is a block quote. It is pretty short.
114\stopblockquote
116\startblockquote
117Code in a block quote:
119\starttyping
120sub status {
121 print "working";
123\stoptyping
125A list:
127\startitemize[n][stopper=.]
128\item
129 item one
130\item
131 item two
132\stopitemize
134Nested block quotes:
136\startblockquote
137nested
138\stopblockquote
140\startblockquote
141nested
142\stopblockquote
143\stopblockquote
145This should not be a block quote: 2 \lettermore{} 1.
147And a following paragraph.
149\thinrule
151\subject{Code Blocks}
153Code:
155\starttyping
156---- (should be four hyphens)
158sub status {
159 print "working";
162this code block is indented by one tab
163\stoptyping
165And:
167\starttyping
168 this code block is indented by two tabs
170These should not be escaped: \$ \\ \> \[ \{
171\stoptyping
173\thinrule
175\subject{Lists}
177\subsubject{Unordered}
179Asterisks tight:
181\startitemize
182\item
183 asterisk 1
184\item
185 asterisk 2
186\item
187 asterisk 3
188\stopitemize
190Asterisks loose:
192\startitemize
193\item
194 asterisk 1
195\item
196 asterisk 2
197\item
198 asterisk 3
199\stopitemize
201Pluses tight:
203\startitemize
204\item
205 Plus 1
206\item
207 Plus 2
208\item
209 Plus 3
210\stopitemize
212Pluses loose:
214\startitemize
215\item
216 Plus 1
217\item
218 Plus 2
219\item
220 Plus 3
221\stopitemize
223Minuses tight:
225\startitemize
226\item
227 Minus 1
228\item
229 Minus 2
230\item
231 Minus 3
232\stopitemize
234Minuses loose:
236\startitemize
237\item
238 Minus 1
239\item
240 Minus 2
241\item
242 Minus 3
243\stopitemize
245\subsubject{Ordered}
247Tight:
249\startitemize[n][stopper=.]
250\item
251 First
252\item
253 Second
254\item
255 Third
256\stopitemize
258and:
260\startitemize[n][stopper=.]
261\item
262 One
263\item
264 Two
265\item
266 Three
267\stopitemize
269Loose using tabs:
271\startitemize[n][stopper=.]
272\item
273 First
274\item
275 Second
276\item
277 Third
278\stopitemize
280and using spaces:
282\startitemize[n][stopper=.]
283\item
284 One
285\item
286 Two
287\item
288 Three
289\stopitemize
291Multiple paragraphs:
293\startitemize[n][stopper=.]
294\item
295 Item 1, graf one.
297 Item 1. graf two. The quick brown fox jumped over the lazy dog's
298 back.
299\item
300 Item 2.
301\item
302 Item 3.
303\stopitemize
305\subsubject{Nested}
307\startitemize
308\item
309 Tab
310 \startitemize
311 \item
312 Tab
313 \startitemize
314 \item
315 Tab
316 \stopitemize
317 \stopitemize
318\stopitemize
320Here's another:
322\startitemize[n][stopper=.]
323\item
324 First
325\item
326 Second:
327 \startitemize
328 \item
329 Fee
330 \item
331 Fie
332 \item
333 Foe
334 \stopitemize
335\item
336 Third
337\stopitemize
339Same thing but with paragraphs:
341\startitemize[n][stopper=.]
342\item
343 First
344\item
345 Second:
347 \startitemize
348 \item
349 Fee
350 \item
351 Fie
352 \item
353 Foe
354 \stopitemize
355\item
356 Third
357\stopitemize
359\subsubject{Tabs and spaces}
361\startitemize
362\item
363 this is a list item indented with tabs
364\item
365 this is a list item indented with spaces
367 \startitemize
368 \item
369 this is an example list item indented with tabs
370 \item
371 this is an example list item indented with spaces
372 \stopitemize
373\stopitemize
375\subsubject{Fancy list markers}
377\startitemize[n][start=2,left=(,stopper=),width=2.0em]
378\item
379 begins with 2
380\item
381 and now 3
383 with a continuation
385 \startitemize[r][start=4,stopper=.,width=2.0em]
386 \item
387 sublist with roman numerals, starting with 4
388 \item
389 more items
390 \startitemize[A][left=(,stopper=),width=2.0em]
391 \item
392 a subsublist
393 \item
394 a subsublist
395 \stopitemize
396 \stopitemize
397\stopitemize
399Nesting:
401\startitemize[A][stopper=.]
402\item
403 Upper Alpha
404 \startitemize[R][stopper=.]
405 \item
406 Upper Roman.
407 \startitemize[n][start=6,left=(,stopper=),width=2.0em]
408 \item
409 Decimal start with 6
410 \startitemize[a][start=3,stopper=)]
411 \item
412 Lower alpha with paren
413 \stopitemize
414 \stopitemize
415 \stopitemize
416\stopitemize
418Autonumbering:
420\startitemize[n]
421\item
422 Autonumber.
423\item
424 More.
425 \startitemize[a]
426 \item
427 Nested.
428 \stopitemize
429\stopitemize
431Should not be a list item:
433M.A.~2007
435B. Williams
437\thinrule
439\subject{Definition Lists}
441Tight using spaces:
443\startdescr{apple}
444red fruit
445\stopdescr
447\startdescr{orange}
448orange fruit
449\stopdescr
451\startdescr{banana}
452yellow fruit
453\stopdescr
455Tight using tabs:
457\startdescr{apple}
458red fruit
459\stopdescr
461\startdescr{orange}
462orange fruit
463\stopdescr
465\startdescr{banana}
466yellow fruit
467\stopdescr
469Loose:
471\startdescr{apple}
472red fruit
473\stopdescr
475\startdescr{orange}
476orange fruit
477\stopdescr
479\startdescr{banana}
480yellow fruit
481\stopdescr
483Multiple blocks with italics:
485\startdescr{{\em apple}}
486red fruit
488contains seeds, crisp, pleasant to taste
489\stopdescr
491\startdescr{{\em orange}}
492orange fruit
494\starttyping
495{ orange code block }
496\stoptyping
498\startblockquote
499orange block quote
500\stopblockquote
501\stopdescr
503Multiple definitions, tight:
505\startdescr{apple}
506red fruit
508computer
509\stopdescr
511\startdescr{orange}
512orange fruit
514bank
515\stopdescr
517Multiple definitions, loose:
519\startdescr{apple}
520red fruit
522computer
523\stopdescr
525\startdescr{orange}
526orange fruit
528bank
529\stopdescr
531Blank line after term, indented marker, alternate markers:
533\startdescr{apple}
534red fruit
536computer
537\stopdescr
539\startdescr{orange}
540orange fruit
542\startitemize[n][stopper=.]
543\item
544 sublist
545\item
546 sublist
547\stopitemize
548\stopdescr
550\subject{HTML Blocks}
552Simple block on one line:
554foo
555And nested without indentation:
557foo
558bar
559Interpreted markdown in a table:
561This is {\em emphasized}
562And this is {\bf strong}
563Here's a simple block:
565foo
566This should be a code block, though:
568\starttyping
569<div>
570 foo
571</div>
572\stoptyping
574As should this:
576\starttyping
577<div>foo</div>
578\stoptyping
580Now, nested:
582foo
583This should just be an HTML comment:
585Multiline:
587Code block:
589\starttyping
590<!-- Comment -->
591\stoptyping
593Just plain comment, with trailing spaces on the line:
595Code:
597\starttyping
598<hr />
599\stoptyping
601Hr's:
603\thinrule
605\subject{Inline Markup}
607This is {\em emphasized}, and so {\em is this}.
609This is {\bf strong}, and so {\bf is this}.
611An {\em \useURL[2][/url][][emphasized link]\from[2]}.
613{\bf {\em This is strong and em.}}
615So is {\bf {\em this}} word.
617{\bf {\em This is strong and em.}}
619So is {\bf {\em this}} word.
621This is code: \type{>}, \type{$}, \type{\}, \type{\$},
622\type{<html>}.
624\overstrikes{This is {\em strikeout}.}
626Superscripts: a\high{bc}d a\high{{\em hello}} a\high{hello~there}.
628Subscripts: H\low{2}O, H\low{23}O, H\low{many~of~them}O.
630These should not be superscripts or subscripts, because of the
631unescaped spaces: a\letterhat{}b c\letterhat{}d, a\lettertilde{}b
632c\lettertilde{}d.
634\thinrule
636\subject{Smart quotes, ellipses, dashes}
638\quotation{Hello,} said the spider.
639\quotation{\quote{Shelob} is my name.}
641\quote{A}, \quote{B}, and \quote{C} are letters.
643\quote{Oak,} \quote{elm,} and \quote{beech} are names of trees. So
644is \quote{pine.}
646\quote{He said, \quotation{I want to go.}} Were you alive in the
64770's?
649Here is some quoted \quote{\type{code}} and a
650\quotation{\useURL[3][http://example.com/?foo=1&bar=2][][quoted link]\from[3]}.
652Some dashes: one---two --- three---four --- five.
654Dashes between numbers: 5--7, 255--66, 1987--1999.
656Ellipses\ldots{}and\ldots{}and\ldots{}.
658\thinrule
660\subject{LaTeX}
662\startitemize
663\item
664 \cite[22-23]{smith.1899}
665\item
666 $2+2=4$
667\item
668 $x \in y$
669\item
670 $\alpha \wedge \omega$
671\item
672 $223$
673\item
674 $p$-Tree
675\item
676 Here's some display math:
677 \startformula \frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h} \stopformula
678\item
679 Here's one that has a line break in it:
680 $\alpha + \omega \times x^2$.
681\stopitemize
683These shouldn't be math:
685\startitemize
686\item
687 To get the famous equation, write \type{$e = mc^2$}.
688\item
689 \$22,000 is a {\em lot} of money. So is \$34,000. (It worked if
690 \quotation{lot} is emphasized.)
691\item
692 Shoes (\$20) and socks (\$5).
693\item
694 Escaped \type{$}: \$73 {\em this should be emphasized} 23\$.
695\stopitemize
697Here's a LaTeX table:
699\begin{tabular}{|l|l|}\hline
700Animal & Number \\ \hline
701Dog & 2 \\
702Cat & 1 \\ \hline
703\end{tabular}
705\thinrule
707\subject{Special Characters}
709Here is some unicode:
711\startitemize
712\item
713 I hat: Î
714\item
715 o umlaut: ö
716\item
717 section: §
718\item
719 set membership: ∈
720\item
721 copyright: ©
722\stopitemize
724AT\&T has an ampersand in their name.
726AT\&T is another way to write it.
728This \& that.
7304 \letterless{} 5.
7326 \lettermore{} 5.
734Backslash: \letterbackslash{}
736Backtick: `
738Asterisk: *
740Underscore: \letterunderscore{}
742Left brace: \letteropenbrace{}
744Right brace: \letterclosebrace{}
746Left bracket: {[}
748Right bracket: {]}
750Left paren: (
752Right paren: )
754Greater-than: \lettermore{}
756Hash: \#
758Period: .
760Bang: !
762Plus: +
764Minus: -
766\thinrule
768\subject{Links}
770\subsubject{Explicit}
772Just a \useURL[4][/url/][][URL]\from[4].
774\useURL[5][/url/][][URL and title]\from[5].
776\useURL[6][/url/][][URL and title]\from[6].
778\useURL[7][/url/][][URL and title]\from[7].
780\useURL[8][/url/][][URL and title]\from[8]
782\useURL[9][/url/][][URL and title]\from[9]
784\useURL[10][/url/with_underscore][][with\letterunderscore{}underscore]\from[10]
786\useURL[11][mailto:nobody@nowhere.net][][Email link]\from[11]
788\useURL[12][][][Empty]\from[12].
790\subsubject{Reference}
792Foo \useURL[13][/url/][][bar]\from[13].
794Foo \useURL[14][/url/][][bar]\from[14].
796Foo \useURL[15][/url/][][bar]\from[15].
798With \useURL[16][/url/][][embedded {[}brackets{]}]\from[16].
800\useURL[17][/url/][][b]\from[17] by itself should be a link.
802Indented \useURL[18][/url][][once]\from[18].
804Indented \useURL[19][/url][][twice]\from[19].
806Indented \useURL[20][/url][][thrice]\from[20].
808This should {[}not{]}{[}{]} be a link.
810\starttyping
811[not]: /url
812\stoptyping
814Foo \useURL[21][/url/][][bar]\from[21].
816Foo \useURL[22][/url/][][biz]\from[22].
818\subsubject{With ampersands}
820Here's a
821\useURL[23][http://example.com/?foo=1&bar=2][][link with an ampersand in the URL]\from[23].
823Here's a link with an amersand in the link text:
824\useURL[24][http://att.com/][][AT\&T]\from[24].
826Here's an \useURL[25][/script?foo=1&bar=2][][inline link]\from[25].
828Here's an
829\useURL[26][/script?foo=1&bar=2][][inline link in pointy braces]\from[26].
831\subsubject{Autolinks}
833With an ampersand:
834\useURL[27][http://example.com/?foo=1&bar=2][][http://example.com/?foo=1\&bar=2]\from[27]
836\startitemize
837\item
838 In a list?
839\item
840 \useURL[28][http://example.com/][][http://example.com/]\from[28]
841\item
842 It should.
843\stopitemize
845An e-mail address:
846\useURL[29][mailto:nobody@nowhere.net][][nobody@nowhere.net]\from[29]
848\startblockquote
849Blockquoted:
850\useURL[30][http://example.com/][][http://example.com/]\from[30]
851\stopblockquote
853Auto-links should not occur here: \type{<http://example.com/>}
855\starttyping
856or here: <http://example.com/>
857\stoptyping
859\thinrule
861\subject{Images}
863From \quotation{Voyage dans la Lune} by Georges Melies (1902):
865\placefigure[here,nonumber]{lalune}{\externalfigure[lalune.jpg]}
867Here is a movie {\externalfigure[movie.jpg]} icon.
869\thinrule
871\subject{Footnotes}
873Here is a footnote reference,
874\footnote{Here is the footnote. It can go anywhere after the footnote
875reference. It need not be placed at the end of the document.}
876and another.
877\footnote{Here's the long note. This one contains multiple blocks.
879Subsequent blocks are indented to show that they belong to the
880footnote (as with list items).
882\starttyping
883 { <code> }
884\stoptyping
886If you want, you can indent every line, but you can also be lazy
887and just indent the first line of each block.}
888This should {\em not} be a footnote reference, because it contains
889a space.{[}\letterhat{}my note{]} Here is an inline note.
890\footnote{This is {\em easier} to type. Inline notes may contain
891\useURL[31][http://google.com][][links]\from[31] and \type{]}
892verbatim characters, as well as {[}bracketed text{]}.}
894\startblockquote
895Notes can go in quotes.
896\footnote{In quote.}
897\stopblockquote
899\startitemize[n][stopper=.]
900\item
901 And in list items.
902 \footnote{In list.}
903\stopitemize
905This paragraph should not be part of the note, as it is not
906indented.
908\stoptext