git.iko.soy/typeable/pandoc
on 1.0 help sign in
typeable/pandoc/tests/writer.context
884 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
72\doctitle{Pandoc Test Suite}
73\author{John MacFarlane \& Anonymous}
74\date{July 17, 2006}
75\starttext
76\maketitle
78This is a set of tests for pandoc. Most of them are adapted from
79John Gruber's markdown test suite.
81\thinrule
83\subject{Headers}
85\subsubject{Level 2 with an \useURL[1][/url][][embedded link]\from[1]}
87\subsubsubject{Level 3 with {\em emphasis}}
89\subsubsubsubject{Level 4}
91\subsubsubsubsubject{Level 5}
93\subject{Level 1}
95\subsubject{Level 2 with {\em emphasis}}
97\subsubsubject{Level 3}
99with no blank line
101\subsubject{Level 2}
103with no blank line
105\thinrule
107\subject{Paragraphs}
109Here's a regular paragraph.
111In Markdown 1.0.0 and earlier. Version 8. This line turns into a
112list item. Because a hard-wrapped line in the middle of a paragraph
113looked like a list item.
115Here's one with a bullet. * criminey.
117There should be a hard line break\crlf
118here.
120\thinrule
122\subject{Block Quotes}
124E-mail style:
126\startblockquote
127This is a block quote. It is pretty short.
128\stopblockquote
130\startblockquote
131Code in a block quote:
133\starttyping
134sub status {
135 print "working";
137\stoptyping
139A list:
141\startitemize[n][stopper=.]
142\item
143 item one
144\item
145 item two
146\stopitemize
148Nested block quotes:
150\startblockquote
151nested
152\stopblockquote
154\startblockquote
155nested
156\stopblockquote
157\stopblockquote
159This should not be a block quote: 2 \lettermore{} 1.
161And a following paragraph.
163\thinrule
165\subject{Code Blocks}
167Code:
169\starttyping
170---- (should be four hyphens)
172sub status {
173 print "working";
176this code block is indented by one tab
177\stoptyping
179And:
181\starttyping
182 this code block is indented by two tabs
184These should not be escaped: \$ \\ \> \[ \{
185\stoptyping
187\thinrule
189\subject{Lists}
191\subsubject{Unordered}
193Asterisks tight:
195\startitemize
196\item
197 asterisk 1
198\item
199 asterisk 2
200\item
201 asterisk 3
202\stopitemize
204Asterisks loose:
206\startitemize
207\item
208 asterisk 1
209\item
210 asterisk 2
211\item
212 asterisk 3
213\stopitemize
215Pluses tight:
217\startitemize
218\item
219 Plus 1
220\item
221 Plus 2
222\item
223 Plus 3
224\stopitemize
226Pluses loose:
228\startitemize
229\item
230 Plus 1
231\item
232 Plus 2
233\item
234 Plus 3
235\stopitemize
237Minuses tight:
239\startitemize
240\item
241 Minus 1
242\item
243 Minus 2
244\item
245 Minus 3
246\stopitemize
248Minuses loose:
250\startitemize
251\item
252 Minus 1
253\item
254 Minus 2
255\item
256 Minus 3
257\stopitemize
259\subsubject{Ordered}
261Tight:
263\startitemize[n][stopper=.]
264\item
265 First
266\item
267 Second
268\item
269 Third
270\stopitemize
272and:
274\startitemize[n][stopper=.]
275\item
276 One
277\item
278 Two
279\item
280 Three
281\stopitemize
283Loose using tabs:
285\startitemize[n][stopper=.]
286\item
287 First
288\item
289 Second
290\item
291 Third
292\stopitemize
294and using spaces:
296\startitemize[n][stopper=.]
297\item
298 One
299\item
300 Two
301\item
302 Three
303\stopitemize
305Multiple paragraphs:
307\startitemize[n][stopper=.]
308\item
309 Item 1, graf one.
311 Item 1. graf two. The quick brown fox jumped over the lazy dog's
312 back.
313\item
314 Item 2.
315\item
316 Item 3.
317\stopitemize
319\subsubject{Nested}
321\startitemize
322\item
323 Tab
324 \startitemize
325 \item
326 Tab
327 \startitemize
328 \item
329 Tab
330 \stopitemize
331 \stopitemize
332\stopitemize
334Here's another:
336\startitemize[n][stopper=.]
337\item
338 First
339\item
340 Second:
341 \startitemize
342 \item
343 Fee
344 \item
345 Fie
346 \item
347 Foe
348 \stopitemize
349\item
350 Third
351\stopitemize
353Same thing but with paragraphs:
355\startitemize[n][stopper=.]
356\item
357 First
358\item
359 Second:
361 \startitemize
362 \item
363 Fee
364 \item
365 Fie
366 \item
367 Foe
368 \stopitemize
369\item
370 Third
371\stopitemize
373\subsubject{Tabs and spaces}
375\startitemize
376\item
377 this is a list item indented with tabs
378\item
379 this is a list item indented with spaces
381 \startitemize
382 \item
383 this is an example list item indented with tabs
384 \item
385 this is an example list item indented with spaces
386 \stopitemize
387\stopitemize
389\subsubject{Fancy list markers}
391\startitemize[n][start=2,left=(,stopper=),width=2.0em]
392\item
393 begins with 2
394\item
395 and now 3
397 with a continuation
399 \startitemize[r][start=4,stopper=.,width=2.0em]
400 \item
401 sublist with roman numerals, starting with 4
402 \item
403 more items
404 \startitemize[A][left=(,stopper=),width=2.0em]
405 \item
406 a subsublist
407 \item
408 a subsublist
409 \stopitemize
410 \stopitemize
411\stopitemize
413Nesting:
415\startitemize[A][stopper=.]
416\item
417 Upper Alpha
418 \startitemize[R][stopper=.]
419 \item
420 Upper Roman.
421 \startitemize[n][start=6,left=(,stopper=),width=2.0em]
422 \item
423 Decimal start with 6
424 \startitemize[a][start=3,stopper=)]
425 \item
426 Lower alpha with paren
427 \stopitemize
428 \stopitemize
429 \stopitemize
430\stopitemize
432Autonumbering:
434\startitemize[n]
435\item
436 Autonumber.
437\item
438 More.
439 \startitemize[a]
440 \item
441 Nested.
442 \stopitemize
443\stopitemize
445Should not be a list item:
447M.A.~2007
449B. Williams
451\thinrule
453\subject{Definition Lists}
455Tight using spaces:
457\startdescr{apple}
458red fruit
459\stopdescr
461\startdescr{orange}
462orange fruit
463\stopdescr
465\startdescr{banana}
466yellow fruit
467\stopdescr
469Tight using tabs:
471\startdescr{apple}
472red fruit
473\stopdescr
475\startdescr{orange}
476orange fruit
477\stopdescr
479\startdescr{banana}
480yellow fruit
481\stopdescr
483Loose:
485\startdescr{apple}
486red fruit
487\stopdescr
489\startdescr{orange}
490orange fruit
491\stopdescr
493\startdescr{banana}
494yellow fruit
495\stopdescr
497Multiple blocks with italics:
499\startdescr{{\em apple}}
500red fruit
502contains seeds, crisp, pleasant to taste
503\stopdescr
505\startdescr{{\em orange}}
506orange fruit
508\starttyping
509{ orange code block }
510\stoptyping
512\startblockquote
513orange block quote
514\stopblockquote
515\stopdescr
517\subject{HTML Blocks}
519Simple block on one line:
521foo
522And nested without indentation:
524foo
525bar
526Interpreted markdown in a table:
528This is {\em emphasized}
529And this is {\bf strong}
530Here's a simple block:
532foo
533This should be a code block, though:
535\starttyping
536<div>
537 foo
538</div>
539\stoptyping
541As should this:
543\starttyping
544<div>foo</div>
545\stoptyping
547Now, nested:
549foo
550This should just be an HTML comment:
552Multiline:
554Code block:
556\starttyping
557<!-- Comment -->
558\stoptyping
560Just plain comment, with trailing spaces on the line:
562Code:
564\starttyping
565<hr />
566\stoptyping
568Hr's:
570\thinrule
572\subject{Inline Markup}
574This is {\em emphasized}, and so {\em is this}.
576This is {\bf strong}, and so {\bf is this}.
578An {\em \useURL[2][/url][][emphasized link]\from[2]}.
580{\bf {\em This is strong and em.}}
582So is {\bf {\em this}} word.
584{\bf {\em This is strong and em.}}
586So is {\bf {\em this}} word.
588This is code: \type{>}, \type{$}, \type{\}, \type{\$},
589\type{<html>}.
591\overstrikes{This is {\em strikeout}.}
593Superscripts: a\high{bc}d a\high{{\em hello}} a\high{hello~there}.
595Subscripts: H\low{2}O, H\low{23}O, H\low{many~of~them}O.
597These should not be superscripts or subscripts, because of the
598unescaped spaces: a\letterhat{}b c\letterhat{}d, a\lettertilde{}b
599c\lettertilde{}d.
601\thinrule
603\subject{Smart quotes, ellipses, dashes}
605\quotation{Hello,} said the spider.
606\quotation{\quote{Shelob} is my name.}
608\quote{A}, \quote{B}, and \quote{C} are letters.
610\quote{Oak,} \quote{elm,} and \quote{beech} are names of trees. So
611is \quote{pine.}
613\quote{He said, \quotation{I want to go.}} Were you alive in the
61470's?
616Here is some quoted \quote{\type{code}} and a
617\quotation{\useURL[3][http://example.com/?foo=1&bar=2][][quoted link]\from[3]}.
619Some dashes: one---two --- three---four --- five.
621Dashes between numbers: 5--7, 255--66, 1987--1999.
623Ellipses\ldots{}and\ldots{}and\ldots{}.
625\thinrule
627\subject{LaTeX}
629\startitemize
630\item
631 \cite[22-23]{smith.1899}
632\item
633 $2+2=4$
634\item
635 $x \in y$
636\item
637 $\alpha \wedge \omega$
638\item
639 $223$
640\item
641 $p$-Tree
642\item
643 Here's some display math:
644 \startformula \frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h} \stopformula
645\item
646 Here's one that has a line break in it:
647 $\alpha + \omega \times x^2$.
648\stopitemize
650These shouldn't be math:
652\startitemize
653\item
654 To get the famous equation, write \type{$e = mc^2$}.
655\item
656 \$22,000 is a {\em lot} of money. So is \$34,000. (It worked if
657 \quotation{lot} is emphasized.)
658\item
659 Shoes (\$20) and socks (\$5).
660\item
661 Escaped \type{$}: \$73 {\em this should be emphasized} 23\$.
662\stopitemize
664Here's a LaTeX table:
666\begin{tabular}{|l|l|}\hline
667Animal & Number \\ \hline
668Dog & 2 \\
669Cat & 1 \\ \hline
670\end{tabular}
672\thinrule
674\subject{Special Characters}
676Here is some unicode:
678\startitemize
679\item
680 I hat: Î
681\item
682 o umlaut: ö
683\item
684 section: §
685\item
686 set membership: ∈
687\item
688 copyright: ©
689\stopitemize
691AT\&T has an ampersand in their name.
693AT\&T is another way to write it.
695This \& that.
6974 \letterless{} 5.
6996 \lettermore{} 5.
701Backslash: \letterbackslash{}
703Backtick: `
705Asterisk: *
707Underscore: \letterunderscore{}
709Left brace: \letteropenbrace{}
711Right brace: \letterclosebrace{}
713Left bracket: [
715Right bracket: ]
717Left paren: (
719Right paren: )
721Greater-than: \lettermore{}
723Hash: \#
725Period: .
727Bang: !
729Plus: +
731Minus: -
733\thinrule
735\subject{Links}
737\subsubject{Explicit}
739Just a \useURL[4][/url/][][URL]\from[4].
741\useURL[5][/url/][][URL and title]\from[5].
743\useURL[6][/url/][][URL and title]\from[6].
745\useURL[7][/url/][][URL and title]\from[7].
747\useURL[8][/url/][][URL and title]\from[8]
749\useURL[9][/url/][][URL and title]\from[9]
751\useURL[10][/url/with_underscore][][with\letterunderscore{}underscore]\from[10]
753\useURL[11][mailto:nobody@nowhere.net][][Email link]\from[11]
755\useURL[12][][][Empty]\from[12].
757\subsubject{Reference}
759Foo \useURL[13][/url/][][bar]\from[13].
761Foo \useURL[14][/url/][][bar]\from[14].
763Foo \useURL[15][/url/][][bar]\from[15].
765With \useURL[16][/url/][][embedded [brackets]]\from[16].
767\useURL[17][/url/][][b]\from[17] by itself should be a link.
769Indented \useURL[18][/url][][once]\from[18].
771Indented \useURL[19][/url][][twice]\from[19].
773Indented \useURL[20][/url][][thrice]\from[20].
775This should [not][] be a link.
777\starttyping
778[not]: /url
779\stoptyping
781Foo \useURL[21][/url/][][bar]\from[21].
783Foo \useURL[22][/url/][][biz]\from[22].
785\subsubject{With ampersands}
787Here's a
788\useURL[23][http://example.com/?foo=1&bar=2][][link with an ampersand in the URL]\from[23].
790Here's a link with an amersand in the link text:
791\useURL[24][http://att.com/][][AT\&T]\from[24].
793Here's an \useURL[25][/script?foo=1&bar=2][][inline link]\from[25].
795Here's an
796\useURL[26][/script?foo=1&bar=2][][inline link in pointy braces]\from[26].
798\subsubject{Autolinks}
800With an ampersand:
801\useURL[27][http://example.com/?foo=1&bar=2][][http://example.com/?foo=1\&bar=2]\from[27]
803\startitemize
804\item
805 In a list?
806\item
807 \useURL[28][http://example.com/][][http://example.com/]\from[28]
808\item
809 It should.
810\stopitemize
812An e-mail address:
813\useURL[29][mailto:nobody@nowhere.net][][nobody@nowhere.net]\from[29]
815\startblockquote
816Blockquoted:
817\useURL[30][http://example.com/][][http://example.com/]\from[30]
818\stopblockquote
820Auto-links should not occur here: \type{<http://example.com/>}
822\starttyping
823or here: <http://example.com/>
824\stoptyping
826\thinrule
828\subject{Images}
830From \quotation{Voyage dans la Lune} by Georges Melies (1902):
832\placefigure
833[]
834[fig:lalune]
835{Voyage dans la Lune}
836{\externalfigure[lalune.jpg]}
838Here is a movie
839\placefigure
840[]
841[fig:movie]
842{}
843{\externalfigure[movie.jpg]} icon.
845\thinrule
847\subject{Footnotes}
849Here is a footnote reference,
850\footnote{Here is the footnote. It can go anywhere after the footnote
851reference. It need not be placed at the end of the document.}
852and another.
853\footnote{Here's the long note. This one contains multiple blocks.
855Subsequent blocks are indented to show that they belong to the
856footnote (as with list items).
858\starttyping
859 { <code> }
860\stoptyping
862If you want, you can indent every line, but you can also be lazy
863and just indent the first line of each block.}
864This should {\em not} be a footnote reference, because it contains
865a space.[\letterhat{}my note] Here is an inline note.
866\footnote{This is {\em easier} to type. Inline notes may contain
867\useURL[31][http://google.com][][links]\from[31] and \type{]}
868verbatim characters, as well as [bracketed text].}
870\startblockquote
871Notes can go in quotes.
872\footnote{In quote.}
873\stopblockquote
875\startitemize[n][stopper=.]
876\item
877 And in list items.
878 \footnote{In list.}
879\stopitemize
881This paragraph should not be part of the note, as it is not
882indented.
883\stoptext