git.iko.soy/typeable/pandoc
on 2.4 help sign in
typeable/pandoc/test/writer.rst
836 lines 10 kB history raw
1=================
2Pandoc Test Suite
3=================
5:Author: John MacFarlane
6:Author: Anonymous
7:Date: July 17, 2006
9.. role:: raw-latex(raw)
10 :format: latex
11..
13This is a set of tests for pandoc. Most of them are adapted from John Gruber’s
14markdown test suite.
16--------------
18Headers
19=======
21Level 2 with an `embedded link </url>`__
22----------------------------------------
24Level 3 with *emphasis*
25~~~~~~~~~~~~~~~~~~~~~~~
27Level 4
28^^^^^^^
30Level 5
31'''''''
33Level 1
34=======
36Level 2 with *emphasis*
37-----------------------
39Level 3
40~~~~~~~
42with no blank line
44Level 2
45-------
47with no blank line
49--------------
51Paragraphs
52==========
54Here’s a regular paragraph.
56In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.
57Because a hard-wrapped line in the middle of a paragraph looked like a list
58item.
60Here’s one with a bullet. \* criminey.
62| There should be a hard line break
63| here.
65--------------
67Block Quotes
68============
70E-mail style:
72 This is a block quote. It is pretty short.
74..
76 Code in a block quote:
78 ::
80 sub status {
81 print "working";
82 }
84 A list:
86 1. item one
87 2. item two
89 Nested block quotes:
91 nested
93 ..
95 nested
97This should not be a block quote: 2 > 1.
99And a following paragraph.
101--------------
103Code Blocks
104===========
106Code:
108::
110 ---- (should be four hyphens)
112 sub status {
113 print "working";
114 }
116 this code block is indented by one tab
118And:
120::
122 this code block is indented by two tabs
124 These should not be escaped: \$ \\ \> \[ \{
126--------------
128Lists
129=====
131Unordered
132---------
134Asterisks tight:
136- asterisk 1
137- asterisk 2
138- asterisk 3
140Asterisks loose:
142- asterisk 1
144- asterisk 2
146- asterisk 3
148Pluses tight:
150- Plus 1
151- Plus 2
152- Plus 3
154Pluses loose:
156- Plus 1
158- Plus 2
160- Plus 3
162Minuses tight:
164- Minus 1
165- Minus 2
166- Minus 3
168Minuses loose:
170- Minus 1
172- Minus 2
174- Minus 3
176Ordered
177-------
179Tight:
1811. First
1822. Second
1833. Third
185and:
1871. One
1882. Two
1893. Three
191Loose using tabs:
1931. First
1952. Second
1973. Third
199and using spaces:
2011. One
2032. Two
2053. Three
207Multiple paragraphs:
2091. Item 1, graf one.
211 Item 1. graf two. The quick brown fox jumped over the lazy dog’s back.
2132. Item 2.
2153. Item 3.
217Nested
218------
220- Tab
222 - Tab
224 - Tab
226Here’s another:
2281. First
2292. Second:
231 - Fee
232 - Fie
233 - Foe
2353. Third
237Same thing but with paragraphs:
2391. First
2412. Second:
243 - Fee
244 - Fie
245 - Foe
2473. Third
249Tabs and spaces
250---------------
252- this is a list item indented with tabs
254- this is a list item indented with spaces
256 - this is an example list item indented with tabs
258 - this is an example list item indented with spaces
260Fancy list markers
261------------------
263(2) begins with 2
264(3) and now 3
266 with a continuation
268 iv. sublist with roman numerals, starting with 4
269 v. more items
271 (A) a subsublist
272 (B) a subsublist
274Nesting:
276A. Upper Alpha
278 I. Upper Roman.
280 (6) Decimal start with 6
282 c) Lower alpha with paren
284Autonumbering:
286#. Autonumber.
287#. More.
289 #. Nested.
291Should not be a list item:
293M.A. 2007
295B. Williams
297--------------
299Definition Lists
300================
302Tight using spaces:
304apple
305 red fruit
306orange
307 orange fruit
308banana
309 yellow fruit
311Tight using tabs:
313apple
314 red fruit
315orange
316 orange fruit
317banana
318 yellow fruit
320Loose:
322apple
323 red fruit
325orange
326 orange fruit
328banana
329 yellow fruit
331Multiple blocks with italics:
333*apple*
334 red fruit
336 contains seeds, crisp, pleasant to taste
338*orange*
339 orange fruit
341 ::
343 { orange code block }
345 ..
347 orange block quote
349Multiple definitions, tight:
351apple
352 red fruit
353 computer
354orange
355 orange fruit
356 bank
358Multiple definitions, loose:
360apple
361 red fruit
363 computer
365orange
366 orange fruit
368 bank
370Blank line after term, indented marker, alternate markers:
372apple
373 red fruit
375 computer
377orange
378 orange fruit
380 1. sublist
381 2. sublist
383HTML Blocks
384===========
386Simple block on one line:
388.. container::
390 foo
392And nested without indentation:
394.. container::
396 .. container::
398 .. container::
400 foo
402 .. container::
404 bar
406Interpreted markdown in a table:
408.. raw:: html
410 <table>
412.. raw:: html
414 <tr>
416.. raw:: html
418 <td>
420This is *emphasized*
422.. raw:: html
424 </td>
426.. raw:: html
428 <td>
430And this is **strong**
432.. raw:: html
434 </td>
436.. raw:: html
438 </tr>
440.. raw:: html
442 </table>
444.. raw:: html
446 <script type="text/javascript">document.write('This *should not* be interpreted as markdown');</script>
448Here’s a simple block:
450.. container::
452 foo
454This should be a code block, though:
456::
458 <div>
459 foo
460 </div>
462As should this:
464::
466 <div>foo</div>
468Now, nested:
470.. container::
472 .. container::
474 .. container::
476 foo
478This should just be an HTML comment:
480.. raw:: html
482 <!-- Comment -->
484Multiline:
486.. raw:: html
488 <!--
489 Blah
490 Blah
491 -->
493.. raw:: html
495 <!--
496 This is another comment.
497 -->
499Code block:
501::
503 <!-- Comment -->
505Just plain comment, with trailing spaces on the line:
507.. raw:: html
509 <!-- foo -->
511Code:
513::
515 <hr />
517Hr’s:
519.. raw:: html
521 <hr>
523.. raw:: html
525 <hr />
527.. raw:: html
529 <hr />
531.. raw:: html
533 <hr>
535.. raw:: html
537 <hr />
539.. raw:: html
541 <hr />
543.. raw:: html
545 <hr class="foo" id="bar" />
547.. raw:: html
549 <hr class="foo" id="bar" />
551.. raw:: html
553 <hr class="foo" id="bar">
555--------------
557Inline Markup
558=============
560This is *emphasized*, and so *is this*.
562This is **strong**, and so **is this**.
564An `emphasized link </url>`__.
566**This is strong and em.**
568So is **this** word.
570**This is strong and em.**
572So is **this** word.
574This is code: ``>``, ``$``, ``\``, ``\$``, ``<html>``.
576[STRIKEOUT:This is strikeout.]
578Superscripts: a\ :sup:`bc`\ d a\ :sup:`hello` a\ :sup:`hello there`.
580Subscripts: H\ :sub:`2`\ O, H\ :sub:`23`\ O, H\ :sub:`many of them`\ O.
582These should not be superscripts or subscripts, because of the unescaped
583spaces: a^b c^d, a~b c~d.
585--------------
587Smart quotes, ellipses, dashes
588==============================
590“Hello,” said the spider. “‘Shelob’ is my name.”
592‘A’, ‘B’, and ‘C’ are letters.
594‘Oak,’ ‘elm,’ and ‘beech’ are names of trees. So is ‘pine.’
596‘He said, “I want to go.”’ Were you alive in the 70’s?
598Here is some quoted ‘``code``’ and a “`quoted
599link <http://example.com/?foo=1&bar=2>`__”.
601Some dashes: one—two — three—four — five.
603Dashes between numbers: 5–7, 255–66, 1987–1999.
605Ellipses…and…and….
607--------------
609LaTeX
610=====
612- :raw-latex:`\cite[22-23]{smith.1899}`
613- :math:`2+2=4`
614- :math:`x \in y`
615- :math:`\alpha \wedge \omega`
616- :math:`223`
617- :math:`p`-Tree
618- Here’s some display math:
620 .. math:: \frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}
622- Here’s one that has a line break in it: :math:`\alpha + \omega \times x^2`.
624These shouldn’t be math:
626- To get the famous equation, write ``$e = mc^2$``.
627- $22,000 is a *lot* of money. So is $34,000. (It worked if “lot” is
628 emphasized.)
629- Shoes ($20) and socks ($5).
630- Escaped ``$``: $73 *this should be emphasized* 23$.
632Here’s a LaTeX table:
634.. raw:: latex
636 \begin{tabular}{|l|l|}\hline
637 Animal & Number \\ \hline
638 Dog & 2 \\
639 Cat & 1 \\ \hline
640 \end{tabular}
642--------------
644Special Characters
645==================
647Here is some unicode:
649- I hat: Î
650- o umlaut: ö
651- section: §
652- set membership: ∈
653- copyright: ©
655AT&T has an ampersand in their name.
657AT&T is another way to write it.
659This & that.
6614 < 5.
6636 > 5.
665Backslash: \\
667Backtick: \`
669Asterisk: \*
671Underscore: \_
673Left brace: {
675Right brace: }
677Left bracket: [
679Right bracket: ]
681Left paren: (
683Right paren: )
685Greater-than: >
687Hash: #
689Period: .
691Bang: !
693Plus: +
695Minus: -
697--------------
699Links
700=====
702Explicit
703--------
705Just a `URL </url/>`__.
707`URL and title </url/>`__.
709`URL and title </url/>`__.
711`URL and title </url/>`__.
713`URL and title </url/>`__
715`URL and title </url/>`__
717`with_underscore </url/with_underscore>`__
719`Email link <mailto:nobody@nowhere.net>`__
721`Empty <>`__.
723Reference
724---------
726Foo `bar </url/>`__.
728With `embedded [brackets] </url/>`__.
730`b </url/>`__ by itself should be a link.
732Indented `once </url>`__.
734Indented `twice </url>`__.
736Indented `thrice </url>`__.
738This should [not][] be a link.
740::
742 [not]: /url
744Foo `bar </url/>`__.
746Foo `biz </url/>`__.
748With ampersands
749---------------
751Here’s a `link with an ampersand in the
752URL <http://example.com/?foo=1&bar=2>`__.
754Here’s a link with an amersand in the link text: `AT&T <http://att.com/>`__.
756Here’s an `inline link </script?foo=1&bar=2>`__.
758Here’s an `inline link in pointy braces </script?foo=1&bar=2>`__.
760Autolinks
761---------
763With an ampersand: http://example.com/?foo=1&bar=2
765- In a list?
766- http://example.com/
767- It should.
769An e-mail address: nobody@nowhere.net
771 Blockquoted: http://example.com/
773Auto-links should not occur here: ``<http://example.com/>``
775::
777 or here: <http://example.com/>
779--------------
781Images
782======
784From “Voyage dans la Lune” by Georges Melies (1902):
786.. figure:: lalune.jpg
787 :alt: Voyage dans la Lune
789 lalune
791Here is a movie |movie| icon.
793--------------
795Footnotes
796=========
798Here is a footnote reference, [1]_ and another. [2]_ This should *not* be a
799footnote reference, because it contains a space.[^my note] Here is an inline
800note. [3]_
802 Notes can go in quotes. [4]_
8041. And in list items. [5]_
806This paragraph should not be part of the note, as it is not indented.
808.. [1]
809 Here is the footnote. It can go anywhere after the footnote reference. It
810 need not be placed at the end of the document.
812.. [2]
813 Here’s the long note. This one contains multiple blocks.
815 Subsequent blocks are indented to show that they belong to the footnote (as
816 with list items).
818 ::
820 { <code> }
822 If you want, you can indent every line, but you can also be lazy and just
823 indent the first line of each block.
825.. [3]
826 This is *easier* to type. Inline notes may contain
827 `links <http://google.com>`__ and ``]`` verbatim characters, as well as
828 [bracketed text].
830.. [4]
831 In quote.
833.. [5]
834 In list.
836.. |movie| image:: movie.jpg