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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
|
Pandoc
Meta { unMeta = fromList [] }
[ Para
[ Str "This file tests the Pandoc reader for Haddock."
, SoftBreak
, Str
"We've borrowed examples from Haddock's documentation: "
, Link
( "" , [] , [] )
[ Str "http://www.haskell.org/haddock/doc/html/ch03s08.html"
]
( "http://www.haskell.org/haddock/doc/html/ch03s08.html"
, "http://www.haskell.org/haddock/doc/html/ch03s08.html"
)
, Str "."
]
, Para
[ Str
"The following characters have special meanings in Haddock, /, ', `, \", @, <, so they must be escaped."
]
, Para
[ Str "* This is a paragraph, not a list item."
, SoftBreak
, Str "> This sentence is not code."
, SoftBreak
, Str ">>> This is not an example."
]
, Para
[ Str
"The references \955, \955 and \955 all represent the lower-case letter lambda."
]
, Para [ Str "This is a code block:" ]
, CodeBlock
( "" , [] , [] )
"map :: (a -> b) -> [a] -> [b]\nmap _ [] = []\nmap f (x:xs) = f x : map f xs"
, Para [ Str "This is another code block:" ]
, Para
[ Code ( "" , [] , [] ) "f x = x + x."
, LineBreak
, Code ( "" , [] , [] ) "The @...@ code block "
, Emph
[ Code ( "" , [] , [] ) "interprets markup normally" ]
, Code ( "" , [] , [] ) "."
, Code ( "" , [ "haskell" , "module" ] , [] ) "Module.Foo"
, Code ( "" , [] , [] ) ""
, LineBreak
, Code ( "" , [] , [] ) "\"Hello World\""
]
, Para [ Str "Haddock supports REPL examples:" ]
, Para
[ Code ( "" , [ "prompt" ] , [] ) ">>>"
, Str " "
, Code ( "" , [ "haskell" , "expr" ] , [] ) "fib 10"
, LineBreak
, Code ( "" , [ "result" ] , [] ) "55"
]
, Para
[ Code ( "" , [ "prompt" ] , [] ) ">>>"
, Str " "
, Code
( "" , [ "haskell" , "expr" ] , [] )
"putStrLn \"foo\\nbar\""
, LineBreak
, Code ( "" , [ "result" ] , [] ) "foo"
, LineBreak
, Code ( "" , [ "result" ] , [] ) "bar"
]
, Para
[ Str "That was "
, Emph [ Str "really cool" ]
, Str "!"
, SoftBreak
, Str "I had no idea "
, Code ( "" , [] , [] ) "fib 10 = 55"
, Str "."
]
, Para
[ Str "This module defines the type "
, Code ( "" , [ "haskell" , "identifier" ] , [] ) "T"
, Str "."
, SoftBreak
, Str "The identifier "
, Code ( "" , [ "haskell" , "identifier" ] , [] ) "M.T"
, Str " is not in scope"
, SoftBreak
, Str
"I don't have to escape my apostrophes; great, isn't it?"
, SoftBreak
, Str "This is a reference to the "
, Code ( "" , [ "haskell" , "module" ] , [] ) "Foo"
, Str " module."
]
, Para [ Str "This is a bulleted list:" ]
, BulletList
[ [ Para [ Str "first item" ] ]
, [ Para [ Str "second item" ] ]
]
, Para [ Str "This is an enumerated list:" ]
, OrderedList
( 1 , DefaultStyle , DefaultDelim )
[ [ Para [ Str "first item" ] ]
, [ Para [ Str "second item" ] ]
]
, Para [ Str "This is a definition list:" ]
, DefinitionList
[ ( [ Code ( "" , [] , [] ) "foo" ]
, [ [ Para
[ Str "The description of "
, Code ( "" , [] , [] ) "foo"
, Str "."
]
]
]
)
, ( [ Code ( "" , [] , [] ) "bar" ]
, [ [ Para
[ Str "The description of "
, Code ( "" , [] , [] ) "bar"
, Str "."
]
]
]
)
]
, Para
[ Str "Here is a link: "
, Link
( "" , [] , [] )
[ Str "http://haskell.org" ]
( "http://haskell.org" , "http://haskell.org" )
]
, Para
[ Link
( "" , [] , [] )
[ Str "Haskell" ]
( "http://haskell.org" , "http://haskell.org" )
, Str " is a fun language!"
]
, Para
[ Link
( "" , [] , [] )
[ Str "Click Here!" ]
( "http://example.com" , "http://example.com" )
]
]
|