git.iko.soy/typeable/pandoc
on 2.2.2 help sign in
typeable/pandoc/test/writer.rst
890 lines 11 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.. raw:: html
390 <div>
392foo
394.. raw:: html
396 </div>
398And nested without indentation:
400.. raw:: html
402 <div>
404.. raw:: html
406 <div>
408.. raw:: html
410 <div>
412foo
414.. raw:: html
416 </div>
418.. raw:: html
420 </div>
422.. raw:: html
424 <div>
426bar
428.. raw:: html
430 </div>
432.. raw:: html
434 </div>
436Interpreted markdown in a table:
438.. raw:: html
440 <table>
442.. raw:: html
444 <tr>
446.. raw:: html
448 <td>
450This is *emphasized*
452.. raw:: html
454 </td>
456.. raw:: html
458 <td>
460And this is **strong**
462.. raw:: html
464 </td>
466.. raw:: html
468 </tr>
470.. raw:: html
472 </table>
474.. raw:: html
476 <script type="text/javascript">document.write('This *should not* be interpreted as markdown');</script>
478Here’s a simple block:
480.. raw:: html
482 <div>
484foo
486.. raw:: html
488 </div>
490This should be a code block, though:
492::
494 <div>
495 foo
496 </div>
498As should this:
500::
502 <div>foo</div>
504Now, nested:
506.. raw:: html
508 <div>
510.. raw:: html
512 <div>
514.. raw:: html
516 <div>
518foo
520.. raw:: html
522 </div>
524.. raw:: html
526 </div>
528.. raw:: html
530 </div>
532This should just be an HTML comment:
534.. raw:: html
536 <!-- Comment -->
538Multiline:
540.. raw:: html
542 <!--
543 Blah
544 Blah
545 -->
547.. raw:: html
549 <!--
550 This is another comment.
551 -->
553Code block:
555::
557 <!-- Comment -->
559Just plain comment, with trailing spaces on the line:
561.. raw:: html
563 <!-- foo -->
565Code:
567::
569 <hr />
571Hr’s:
573.. raw:: html
575 <hr>
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 class="foo" id="bar" />
601.. raw:: html
603 <hr class="foo" id="bar" />
605.. raw:: html
607 <hr class="foo" id="bar">
609--------------
611Inline Markup
612=============
614This is *emphasized*, and so *is this*.
616This is **strong**, and so **is this**.
618An `emphasized link </url>`__.
620**This is strong and em.**
622So is **this** word.
624**This is strong and em.**
626So is **this** word.
628This is code: ``>``, ``$``, ``\``, ``\$``, ``<html>``.
630[STRIKEOUT:This is strikeout.]
632Superscripts: a\ :sup:`bc`\ d a\ :sup:`hello` a\ :sup:`hello there`.
634Subscripts: H\ :sub:`2`\ O, H\ :sub:`23`\ O, H\ :sub:`many of them`\ O.
636These should not be superscripts or subscripts, because of the unescaped
637spaces: a^b c^d, a~b c~d.
639--------------
641Smart quotes, ellipses, dashes
642==============================
644“Hello,” said the spider. “‘Shelob’ is my name.”
646‘A’, ‘B’, and ‘C’ are letters.
648‘Oak,’ ‘elm,’ and ‘beech’ are names of trees. So is ‘pine.’
650‘He said, “I want to go.”’ Were you alive in the 70’s?
652Here is some quoted ‘``code``’ and a “`quoted
653link <http://example.com/?foo=1&bar=2>`__”.
655Some dashes: one—two — three—four — five.
657Dashes between numbers: 5–7, 255–66, 1987–1999.
659Ellipses…and…and….
661--------------
663LaTeX
664=====
666- :raw-latex:`\cite[22-23]{smith.1899}`
667- :math:`2+2=4`
668- :math:`x \in y`
669- :math:`\alpha \wedge \omega`
670- :math:`223`
671- :math:`p`-Tree
672- Here’s some display math:
674 .. math:: \frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}
676- Here’s one that has a line break in it: :math:`\alpha + \omega \times x^2`.
678These shouldn’t be math:
680- To get the famous equation, write ``$e = mc^2$``.
681- $22,000 is a *lot* of money. So is $34,000. (It worked if “lot” is
682 emphasized.)
683- Shoes ($20) and socks ($5).
684- Escaped ``$``: $73 *this should be emphasized* 23$.
686Here’s a LaTeX table:
688.. raw:: latex
690 \begin{tabular}{|l|l|}\hline
691 Animal & Number \\ \hline
692 Dog & 2 \\
693 Cat & 1 \\ \hline
694 \end{tabular}
696--------------
698Special Characters
699==================
701Here is some unicode:
703- I hat: Î
704- o umlaut: ö
705- section: §
706- set membership: ∈
707- copyright: ©
709AT&T has an ampersand in their name.
711AT&T is another way to write it.
713This & that.
7154 < 5.
7176 > 5.
719Backslash: \\
721Backtick: \`
723Asterisk: \*
725Underscore: \_
727Left brace: {
729Right brace: }
731Left bracket: [
733Right bracket: ]
735Left paren: (
737Right paren: )
739Greater-than: >
741Hash: #
743Period: .
745Bang: !
747Plus: +
749Minus: -
751--------------
753Links
754=====
756Explicit
757--------
759Just a `URL </url/>`__.
761`URL and title </url/>`__.
763`URL and title </url/>`__.
765`URL and title </url/>`__.
767`URL and title </url/>`__
769`URL and title </url/>`__
771`with_underscore </url/with_underscore>`__
773`Email link <mailto:nobody@nowhere.net>`__
775`Empty <>`__.
777Reference
778---------
780Foo `bar </url/>`__.
782With `embedded [brackets] </url/>`__.
784`b </url/>`__ by itself should be a link.
786Indented `once </url>`__.
788Indented `twice </url>`__.
790Indented `thrice </url>`__.
792This should [not][] be a link.
794::
796 [not]: /url
798Foo `bar </url/>`__.
800Foo `biz </url/>`__.
802With ampersands
803---------------
805Here’s a `link with an ampersand in the
806URL <http://example.com/?foo=1&bar=2>`__.
808Here’s a link with an amersand in the link text: `AT&T <http://att.com/>`__.
810Here’s an `inline link </script?foo=1&bar=2>`__.
812Here’s an `inline link in pointy braces </script?foo=1&bar=2>`__.
814Autolinks
815---------
817With an ampersand: http://example.com/?foo=1&bar=2
819- In a list?
820- http://example.com/
821- It should.
823An e-mail address: nobody@nowhere.net
825 Blockquoted: http://example.com/
827Auto-links should not occur here: ``<http://example.com/>``
829::
831 or here: <http://example.com/>
833--------------
835Images
836======
838From “Voyage dans la Lune” by Georges Melies (1902):
840.. figure:: lalune.jpg
841 :alt: Voyage dans la Lune
843 lalune
845Here is a movie |movie| icon.
847--------------
849Footnotes
850=========
852Here is a footnote reference, [1]_ and another. [2]_ This should *not* be a
853footnote reference, because it contains a space.[^my note] Here is an inline
854note. [3]_
856 Notes can go in quotes. [4]_
8581. And in list items. [5]_
860This paragraph should not be part of the note, as it is not indented.
862.. [1]
863 Here is the footnote. It can go anywhere after the footnote reference. It
864 need not be placed at the end of the document.
866.. [2]
867 Here’s the long note. This one contains multiple blocks.
869 Subsequent blocks are indented to show that they belong to the footnote (as
870 with list items).
872 ::
874 { <code> }
876 If you want, you can indent every line, but you can also be lazy and just
877 indent the first line of each block.
879.. [3]
880 This is *easier* to type. Inline notes may contain
881 `links <http://google.com>`__ and ``]`` verbatim characters, as well as
882 [bracketed text].
884.. [4]
885 In quote.
887.. [5]
888 In list.
890.. |movie| image:: movie.jpg