git.iko.soy/typeable/pandoc
on 2.14.0.3 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
265(3) and now 3
267 with a continuation
269 iv. sublist with roman numerals, starting with 4
270 v. more items
272 (A) a subsublist
273 (B) a subsublist
275Nesting:
277A. Upper Alpha
279 I. Upper Roman.
281 (6) Decimal start with 6
283 c) Lower alpha with paren
285Autonumbering:
287#. Autonumber.
288#. More.
290 #. Nested.
292Should not be a list item:
294M.A. 2007
296B. Williams
298--------------
300Definition Lists
301================
303Tight using spaces:
305apple
306 red fruit
307orange
308 orange fruit
309banana
310 yellow fruit
312Tight using tabs:
314apple
315 red fruit
316orange
317 orange fruit
318banana
319 yellow fruit
321Loose:
323apple
324 red fruit
326orange
327 orange fruit
329banana
330 yellow fruit
332Multiple blocks with italics:
334*apple*
335 red fruit
337 contains seeds, crisp, pleasant to taste
339*orange*
340 orange fruit
342 ::
344 { orange code block }
346 ..
348 orange block quote
350Multiple definitions, tight:
352apple
353 red fruit
354 computer
355orange
356 orange fruit
357 bank
359Multiple definitions, loose:
361apple
362 red fruit
364 computer
366orange
367 orange fruit
369 bank
371Blank line after term, indented marker, alternate markers:
373apple
374 red fruit
376 computer
378orange
379 orange fruit
381 1. sublist
382 2. sublist
384HTML Blocks
385===========
387Simple block on one line:
389.. container::
391 foo
393And nested without indentation:
395.. container::
397 .. container::
399 .. container::
401 foo
403 .. container::
405 bar
407Interpreted markdown in a table:
409.. raw:: html
411 <table>
413.. raw:: html
415 <tr>
417.. raw:: html
419 <td>
421This is *emphasized*
423.. raw:: html
425 </td>
427.. raw:: html
429 <td>
431And this is **strong**
433.. raw:: html
435 </td>
437.. raw:: html
439 </tr>
441.. raw:: html
443 </table>
445.. raw:: html
447 <script type="text/javascript">document.write('This *should not* be interpreted as markdown');</script>
449Here’s a simple block:
451.. container::
453 foo
455This should be a code block, though:
457::
459 <div>
460 foo
461 </div>
463As should this:
465::
467 <div>foo</div>
469Now, nested:
471.. container::
473 .. container::
475 .. container::
477 foo
479This should just be an HTML comment:
481.. raw:: html
483 <!-- Comment -->
485Multiline:
487.. raw:: html
489 <!--
490 Blah
491 Blah
492 -->
494.. raw:: html
496 <!--
497 This is another comment.
498 -->
500Code block:
502::
504 <!-- Comment -->
506Just plain comment, with trailing spaces on the line:
508.. raw:: html
510 <!-- foo -->
512Code:
514::
516 <hr />
518Hr’s:
520.. raw:: html
522 <hr>
524.. raw:: html
526 <hr />
528.. raw:: html
530 <hr />
532.. raw:: html
534 <hr>
536.. raw:: html
538 <hr />
540.. raw:: html
542 <hr />
544.. raw:: html
546 <hr class="foo" id="bar" />
548.. raw:: html
550 <hr class="foo" id="bar" />
552.. raw:: html
554 <hr class="foo" id="bar">
556--------------
558Inline Markup
559=============
561This is *emphasized*, and so *is this*.
563This is **strong**, and so **is this**.
565An `emphasized link </url>`__.
567**This is strong and em.**
569So is **this** word.
571**This is strong and em.**
573So is **this** word.
575This is code: ``>``, ``$``, ``\``, ``\$``, ``<html>``.
577[STRIKEOUT:This is strikeout.]
579Superscripts: a\ :sup:`bc`\ d a\ :sup:`hello` a\ :sup:`hello there`.
581Subscripts: H\ :sub:`2`\ O, H\ :sub:`23`\ O, H\ :sub:`many of them`\ O.
583These should not be superscripts or subscripts, because of the unescaped
584spaces: a^b c^d, a~b c~d.
586--------------
588Smart quotes, ellipses, dashes
589==============================
591“Hello,” said the spider. “‘Shelob’ is my name.”
593‘A’, ‘B’, and ‘C’ are letters.
595‘Oak,’ ‘elm,’ and ‘beech’ are names of trees. So is ‘pine.’
597‘He said, “I want to go.”’ Were you alive in the 70’s?
599Here is some quoted ‘``code``’ and a “`quoted
600link <http://example.com/?foo=1&bar=2>`__”.
602Some dashes: one—two — three—four — five.
604Dashes between numbers: 5–7, 255–66, 1987–1999.
606Ellipses…and…and….
608--------------
610LaTeX
611=====
613- :raw-latex:`\cite[22-23]{smith.1899}`
614- :math:`2+2=4`
615- :math:`x \in y`
616- :math:`\alpha \wedge \omega`
617- :math:`223`
618- :math:`p`-Tree
619- Here’s some display math:
621 .. 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