git.iko.soy/typeable/pandoc
on 2.0 help sign in
typeable/pandoc/test/writer.rst
894 lines 11 kB history raw
1=================
2Pandoc Test Suite
3=================
5:Author: John MacFarlane
6:Author: Anonymous
7:Date: July 17, 2006
9.. role:: math(raw)
10 :format: html latex
11..
13.. role:: raw-latex(raw)
14 :format: latex
15..
17This is a set of tests for pandoc. Most of them are adapted from John Gruber’s
18markdown test suite.
20--------------
22Headers
23=======
25Level 2 with an `embedded link </url>`__
26----------------------------------------
28Level 3 with *emphasis*
29~~~~~~~~~~~~~~~~~~~~~~~
31Level 4
32^^^^^^^
34Level 5
35'''''''
37Level 1
38=======
40Level 2 with *emphasis*
41-----------------------
43Level 3
44~~~~~~~
46with no blank line
48Level 2
49-------
51with no blank line
53--------------
55Paragraphs
56==========
58Here’s a regular paragraph.
60In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.
61Because a hard-wrapped line in the middle of a paragraph looked like a list
62item.
64Here’s one with a bullet. \* criminey.
66| There should be a hard line break
67| here.
69--------------
71Block Quotes
72============
74E-mail style:
76 This is a block quote. It is pretty short.
78..
80 Code in a block quote:
82 ::
84 sub status {
85 print "working";
86 }
88 A list:
90 1. item one
91 2. item two
93 Nested block quotes:
95 nested
97 ..
99 nested
101This should not be a block quote: 2 > 1.
103And a following paragraph.
105--------------
107Code Blocks
108===========
110Code:
112::
114 ---- (should be four hyphens)
116 sub status {
117 print "working";
118 }
120 this code block is indented by one tab
122And:
124::
126 this code block is indented by two tabs
128 These should not be escaped: \$ \\ \> \[ \{
130--------------
132Lists
133=====
135Unordered
136---------
138Asterisks tight:
140- asterisk 1
141- asterisk 2
142- asterisk 3
144Asterisks loose:
146- asterisk 1
148- asterisk 2
150- asterisk 3
152Pluses tight:
154- Plus 1
155- Plus 2
156- Plus 3
158Pluses loose:
160- Plus 1
162- Plus 2
164- Plus 3
166Minuses tight:
168- Minus 1
169- Minus 2
170- Minus 3
172Minuses loose:
174- Minus 1
176- Minus 2
178- Minus 3
180Ordered
181-------
183Tight:
1851. First
1862. Second
1873. Third
189and:
1911. One
1922. Two
1933. Three
195Loose using tabs:
1971. First
1992. Second
2013. Third
203and using spaces:
2051. One
2072. Two
2093. Three
211Multiple paragraphs:
2131. Item 1, graf one.
215 Item 1. graf two. The quick brown fox jumped over the lazy dog’s back.
2172. Item 2.
2193. Item 3.
221Nested
222------
224- Tab
226 - Tab
228 - Tab
230Here’s another:
2321. First
2332. Second:
235 - Fee
236 - Fie
237 - Foe
2393. Third
241Same thing but with paragraphs:
2431. First
2452. Second:
247 - Fee
248 - Fie
249 - Foe
2513. Third
253Tabs and spaces
254---------------
256- this is a list item indented with tabs
258- this is a list item indented with spaces
260 - this is an example list item indented with tabs
262 - this is an example list item indented with spaces
264Fancy list markers
265------------------
267(2) begins with 2
268(3) and now 3
270 with a continuation
272 iv. sublist with roman numerals, starting with 4
273 v. more items
275 (A) a subsublist
276 (B) a subsublist
278Nesting:
280A. Upper Alpha
282 I. Upper Roman.
284 (6) Decimal start with 6
286 c) Lower alpha with paren
288Autonumbering:
290#. Autonumber.
291#. More.
293 #. Nested.
295Should not be a list item:
297M.A. 2007
299B. Williams
301--------------
303Definition Lists
304================
306Tight using spaces:
308apple
309 red fruit
310orange
311 orange fruit
312banana
313 yellow fruit
315Tight using tabs:
317apple
318 red fruit
319orange
320 orange fruit
321banana
322 yellow fruit
324Loose:
326apple
327 red fruit
329orange
330 orange fruit
332banana
333 yellow fruit
335Multiple blocks with italics:
337*apple*
338 red fruit
340 contains seeds, crisp, pleasant to taste
342*orange*
343 orange fruit
345 ::
347 { orange code block }
349 ..
351 orange block quote
353Multiple definitions, tight:
355apple
356 red fruit
357 computer
358orange
359 orange fruit
360 bank
362Multiple definitions, loose:
364apple
365 red fruit
367 computer
369orange
370 orange fruit
372 bank
374Blank line after term, indented marker, alternate markers:
376apple
377 red fruit
379 computer
381orange
382 orange fruit
384 1. sublist
385 2. sublist
387HTML Blocks
388===========
390Simple block on one line:
392.. raw:: html
394 <div>
396foo
398.. raw:: html
400 </div>
402And nested without indentation:
404.. raw:: html
406 <div>
408.. raw:: html
410 <div>
412.. raw:: html
414 <div>
416foo
418.. raw:: html
420 </div>
422.. raw:: html
424 </div>
426.. raw:: html
428 <div>
430bar
432.. raw:: html
434 </div>
436.. raw:: html
438 </div>
440Interpreted markdown in a table:
442.. raw:: html
444 <table>
446.. raw:: html
448 <tr>
450.. raw:: html
452 <td>
454This is *emphasized*
456.. raw:: html
458 </td>
460.. raw:: html
462 <td>
464And this is **strong**
466.. raw:: html
468 </td>
470.. raw:: html
472 </tr>
474.. raw:: html
476 </table>
478.. raw:: html
480 <script type="text/javascript">document.write('This *should not* be interpreted as markdown');</script>
482Here’s a simple block:
484.. raw:: html
486 <div>
488foo
490.. raw:: html
492 </div>
494This should be a code block, though:
496::
498 <div>
499 foo
500 </div>
502As should this:
504::
506 <div>foo</div>
508Now, nested:
510.. raw:: html
512 <div>
514.. raw:: html
516 <div>
518.. raw:: html
520 <div>
522foo
524.. raw:: html
526 </div>
528.. raw:: html
530 </div>
532.. raw:: html
534 </div>
536This should just be an HTML comment:
538.. raw:: html
540 <!-- Comment -->
542Multiline:
544.. raw:: html
546 <!--
547 Blah
548 Blah
549 -->
551.. raw:: html
553 <!--
554 This is another comment.
555 -->
557Code block:
559::
561 <!-- Comment -->
563Just plain comment, with trailing spaces on the line:
565.. raw:: html
567 <!-- foo -->
569Code:
571::
573 <hr />
575Hr’s:
577.. raw:: html
579 <hr>
581.. raw:: html
583 <hr />
585.. raw:: html
587 <hr />
589.. raw:: html
591 <hr>
593.. raw:: html
595 <hr />
597.. raw:: html
599 <hr />
601.. raw:: html
603 <hr class="foo" id="bar" />
605.. raw:: html
607 <hr class="foo" id="bar" />
609.. raw:: html
611 <hr class="foo" id="bar">
613--------------
615Inline Markup
616=============
618This is *emphasized*, and so *is this*.
620This is **strong**, and so **is this**.
622An *`emphasized link </url>`__*.
624***This is strong and em.***
626So is ***this*** word.
628***This is strong and em.***
630So is ***this*** word.
632This is code: ``>``, ``$``, ``\``, ``\$``, ``<html>``.
634[STRIKEOUT:This is *strikeout*.]
636Superscripts: a\ :sup:`bc`\ d a\ :sup:`*hello*` a\ :sup:`hello there`.
638Subscripts: H\ :sub:`2`\ O, H\ :sub:`23`\ O, H\ :sub:`many of them`\ O.
640These should not be superscripts or subscripts, because of the unescaped
641spaces: a^b c^d, a~b c~d.
643--------------
645Smart quotes, ellipses, dashes
646==============================
648“Hello,” said the spider. “‘Shelob’ is my name.”
650‘A’, ‘B’, and ‘C’ are letters.
652‘Oak,’ ‘elm,’ and ‘beech’ are names of trees. So is ‘pine.’
654‘He said, “I want to go.”’ Were you alive in the 70’s?
656Here is some quoted ‘``code``’ and a “`quoted
657link <http://example.com/?foo=1&bar=2>`__”.
659Some dashes: one—two — three—four — five.
661Dashes between numbers: 5–7, 255–66, 1987–1999.
663Ellipses…and…and….
665--------------
667LaTeX
668=====
670- :raw-latex:`\cite[22-23]{smith.1899}`
671- :math:`2+2=4`
672- :math:`x \in y`
673- :math:`\alpha \wedge \omega`
674- :math:`223`
675- :math:`p`-Tree
676- Here’s some display math:
678 .. math:: \frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}
680- Here’s one that has a line break in it: :math:`\alpha + \omega \times x^2`.
682These shouldn’t be math:
684- To get the famous equation, write ``$e = mc^2$``.
685- $22,000 is a *lot* of money. So is $34,000. (It worked if “lot” is
686 emphasized.)
687- Shoes ($20) and socks ($5).
688- Escaped ``$``: $73 *this should be emphasized* 23$.
690Here’s a LaTeX table:
692.. raw:: latex
694 \begin{tabular}{|l|l|}\hline
695 Animal & Number \\ \hline
696 Dog & 2 \\
697 Cat & 1 \\ \hline
698 \end{tabular}
700--------------
702Special Characters
703==================
705Here is some unicode:
707- I hat: Î
708- o umlaut: ö
709- section: §
710- set membership: ∈
711- copyright: ©
713AT&T has an ampersand in their name.
715AT&T is another way to write it.
717This & that.
7194 < 5.
7216 > 5.
723Backslash: \\
725Backtick: \`
727Asterisk: \*
729Underscore: \_
731Left brace: {
733Right brace: }
735Left bracket: [
737Right bracket: ]
739Left paren: (
741Right paren: )
743Greater-than: >
745Hash: #
747Period: .
749Bang: !
751Plus: +
753Minus: -
755--------------
757Links
758=====
760Explicit
761--------
763Just a `URL </url/>`__.
765`URL and title </url/>`__.
767`URL and title </url/>`__.
769`URL and title </url/>`__.
771`URL and title </url/>`__
773`URL and title </url/>`__
775`with_underscore </url/with_underscore>`__
777`Email link <mailto:nobody@nowhere.net>`__
779`Empty <>`__.
781Reference
782---------
784Foo `bar </url/>`__.
786With `embedded [brackets] </url/>`__.
788`b </url/>`__ by itself should be a link.
790Indented `once </url>`__.
792Indented `twice </url>`__.
794Indented `thrice </url>`__.
796This should [not][] be a link.
798::
800 [not]: /url
802Foo `bar </url/>`__.
804Foo `biz </url/>`__.
806With ampersands
807---------------
809Here’s a `link with an ampersand in the
810URL <http://example.com/?foo=1&bar=2>`__.
812Here’s a link with an amersand in the link text: `AT&T <http://att.com/>`__.
814Here’s an `inline link </script?foo=1&bar=2>`__.
816Here’s an `inline link in pointy braces </script?foo=1&bar=2>`__.
818Autolinks
819---------
821With an ampersand: http://example.com/?foo=1&bar=2
823- In a list?
824- http://example.com/
825- It should.
827An e-mail address: nobody@nowhere.net
829 Blockquoted: http://example.com/
831Auto-links should not occur here: ``<http://example.com/>``
833::
835 or here: <http://example.com/>
837--------------
839Images
840======
842From “Voyage dans la Lune” by Georges Melies (1902):
844.. figure:: lalune.jpg
845 :alt: Voyage dans la Lune
847 lalune
849Here is a movie |movie| icon.
851--------------
853Footnotes
854=========
856Here is a footnote reference, [1]_ and another. [2]_ This should *not* be a
857footnote reference, because it contains a space.[^my note] Here is an inline
858note. [3]_
860 Notes can go in quotes. [4]_
8621. And in list items. [5]_
864This paragraph should not be part of the note, as it is not indented.
866.. [1]
867 Here is the footnote. It can go anywhere after the footnote reference. It
868 need not be placed at the end of the document.
870.. [2]
871 Here’s the long note. This one contains multiple blocks.
873 Subsequent blocks are indented to show that they belong to the footnote (as
874 with list items).
876 ::
878 { <code> }
880 If you want, you can indent every line, but you can also be lazy and just
881 indent the first line of each block.
883.. [3]
884 This is *easier* to type. Inline notes may contain
885 `links <http://google.com>`__ and ``]`` verbatim characters, as well as
886 [bracketed text].
888.. [4]
889 In quote.
891.. [5]
892 In list.
894.. |movie| image:: movie.jpg