aboutsummaryrefslogtreecommitdiff
path: root/test/haddock-reader.haddock
blob: c3ef0c9fcb8df85a70e49c2a66d1aef663b73c03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
This file tests the Pandoc reader for Haddock.
We've borrowed examples from Haddock's documentation: <http://www.haskell.org/haddock/doc/html/ch03s08.html>.

The following characters have special meanings in Haddock, \/, \', \`, \", \@, \<, so they must be escaped.

\* This is a paragraph, not a list item.
\> This sentence is not code.
\>\>\> This is not an example.

The references &#x3BB;, &#x3bb; and &#955; all represent the lower-case letter lambda.

This is a code block:

> map :: (a -> b) -> [a] -> [b]
> map _ []     = []
> map f (x:xs) = f x : map f xs

This is another code block:

@
f x = x + x.
The \@...\@ code block /interprets markup normally/.
"Module.Foo"
\"Hello World\"
@

Haddock supports REPL examples:

>>> fib 10
55
>>> putStrLn "foo\nbar"
foo
bar

That was /really cool/!
I had no idea @fib 10 = 55@.

This module defines the type 'T'.
The identifier 'M.T' is not in scope
I don't have to escape my apostrophes; great, isn't it?
This is a reference to the "Foo" module.

This is a bulleted list:

  * first item

  * second item

This is an enumerated list:

  (1) first item

  2. second item

This is a definition list:

  [@foo@] The description of @foo@.

  [@bar@] The description of @bar@.

Here is a link: <http://haskell.org>

<http://haskell.org Haskell> is a fun language!

<http://example.com Click Here!>