aboutsummaryrefslogtreecommitdiff
path: root/haddock-library/fixtures/examples
diff options
context:
space:
mode:
Diffstat (limited to 'haddock-library/fixtures/examples')
-rw-r--r--haddock-library/fixtures/examples/definitionList.input1
-rw-r--r--haddock-library/fixtures/examples/definitionList.parsed1
-rw-r--r--haddock-library/fixtures/examples/identifier.input1
-rw-r--r--haddock-library/fixtures/examples/identifier.parsed1
-rw-r--r--haddock-library/fixtures/examples/identifierBackticks.input1
-rw-r--r--haddock-library/fixtures/examples/identifierBackticks.parsed1
-rw-r--r--haddock-library/fixtures/examples/link.input1
-rw-r--r--haddock-library/fixtures/examples/link.parsed5
-rw-r--r--haddock-library/fixtures/examples/linkInline.input1
-rw-r--r--haddock-library/fixtures/examples/linkInline.parsed6
-rw-r--r--haddock-library/fixtures/examples/table-simple.input7
-rw-r--r--haddock-library/fixtures/examples/table-simple.parsed52
-rw-r--r--haddock-library/fixtures/examples/table1.input12
-rw-r--r--haddock-library/fixtures/examples/table1.parsed81
-rw-r--r--haddock-library/fixtures/examples/table2.input7
-rw-r--r--haddock-library/fixtures/examples/table2.parsed46
-rw-r--r--haddock-library/fixtures/examples/table3.input7
-rw-r--r--haddock-library/fixtures/examples/table3.parsed50
-rw-r--r--haddock-library/fixtures/examples/table4.input17
-rw-r--r--haddock-library/fixtures/examples/table4.parsed26
-rw-r--r--haddock-library/fixtures/examples/table5.input8
-rw-r--r--haddock-library/fixtures/examples/table5.parsed53
-rw-r--r--haddock-library/fixtures/examples/url.input1
-rw-r--r--haddock-library/fixtures/examples/url.parsed4
-rw-r--r--haddock-library/fixtures/examples/urlLabel.input1
-rw-r--r--haddock-library/fixtures/examples/urlLabel.parsed5
26 files changed, 396 insertions, 0 deletions
diff --git a/haddock-library/fixtures/examples/definitionList.input b/haddock-library/fixtures/examples/definitionList.input
new file mode 100644
index 00000000..e1bffb21
--- /dev/null
+++ b/haddock-library/fixtures/examples/definitionList.input
@@ -0,0 +1 @@
+[foo]: bar
diff --git a/haddock-library/fixtures/examples/definitionList.parsed b/haddock-library/fixtures/examples/definitionList.parsed
new file mode 100644
index 00000000..048aa141
--- /dev/null
+++ b/haddock-library/fixtures/examples/definitionList.parsed
@@ -0,0 +1 @@
+DocDefList [_×_ (DocString "foo") (DocString "bar")]
diff --git a/haddock-library/fixtures/examples/identifier.input b/haddock-library/fixtures/examples/identifier.input
new file mode 100644
index 00000000..c2c4af01
--- /dev/null
+++ b/haddock-library/fixtures/examples/identifier.input
@@ -0,0 +1 @@
+'foo'
diff --git a/haddock-library/fixtures/examples/identifier.parsed b/haddock-library/fixtures/examples/identifier.parsed
new file mode 100644
index 00000000..3405a5c9
--- /dev/null
+++ b/haddock-library/fixtures/examples/identifier.parsed
@@ -0,0 +1 @@
+DocParagraph (DocIdentifier "foo")
diff --git a/haddock-library/fixtures/examples/identifierBackticks.input b/haddock-library/fixtures/examples/identifierBackticks.input
new file mode 100644
index 00000000..347253a0
--- /dev/null
+++ b/haddock-library/fixtures/examples/identifierBackticks.input
@@ -0,0 +1 @@
+`foo`
diff --git a/haddock-library/fixtures/examples/identifierBackticks.parsed b/haddock-library/fixtures/examples/identifierBackticks.parsed
new file mode 100644
index 00000000..3405a5c9
--- /dev/null
+++ b/haddock-library/fixtures/examples/identifierBackticks.parsed
@@ -0,0 +1 @@
+DocParagraph (DocIdentifier "foo")
diff --git a/haddock-library/fixtures/examples/link.input b/haddock-library/fixtures/examples/link.input
new file mode 100644
index 00000000..a55c05a6
--- /dev/null
+++ b/haddock-library/fixtures/examples/link.input
@@ -0,0 +1 @@
+[link](http://example.com)
diff --git a/haddock-library/fixtures/examples/link.parsed b/haddock-library/fixtures/examples/link.parsed
new file mode 100644
index 00000000..0e85338c
--- /dev/null
+++ b/haddock-library/fixtures/examples/link.parsed
@@ -0,0 +1,5 @@
+DocParagraph
+ (DocHyperlink
+ Hyperlink
+ {hyperlinkLabel = Just "link",
+ hyperlinkUrl = "http://example.com"})
diff --git a/haddock-library/fixtures/examples/linkInline.input b/haddock-library/fixtures/examples/linkInline.input
new file mode 100644
index 00000000..eeca5a07
--- /dev/null
+++ b/haddock-library/fixtures/examples/linkInline.input
@@ -0,0 +1 @@
+Bla [link](http://example.com)
diff --git a/haddock-library/fixtures/examples/linkInline.parsed b/haddock-library/fixtures/examples/linkInline.parsed
new file mode 100644
index 00000000..43470d7b
--- /dev/null
+++ b/haddock-library/fixtures/examples/linkInline.parsed
@@ -0,0 +1,6 @@
+DocParagraph
+ (DocAppend
+ (DocString "Bla ")
+ (DocHyperlink
+ Hyperlink
+ {hyperlinkLabel = Just "link", hyperlinkUrl = "http://example.com"}))
diff --git a/haddock-library/fixtures/examples/table-simple.input b/haddock-library/fixtures/examples/table-simple.input
new file mode 100644
index 00000000..d9c49f87
--- /dev/null
+++ b/haddock-library/fixtures/examples/table-simple.input
@@ -0,0 +1,7 @@
++------+--------------+------------------------------------------+
+| code | message | description |
++======+==============+==========================================+
+| 200 | @OK@ | operation successful |
++------+--------------+------------------------------------------+
+| 204 | @No Content@ | operation successful, no body returned |
++------+--------------+------------------------------------------+
diff --git a/haddock-library/fixtures/examples/table-simple.parsed b/haddock-library/fixtures/examples/table-simple.parsed
new file mode 100644
index 00000000..b5e62453
--- /dev/null
+++ b/haddock-library/fixtures/examples/table-simple.parsed
@@ -0,0 +1,52 @@
+DocTable
+ Table
+ {tableBodyRows = [TableRow
+ [TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString " 200 ",
+ tableCellRowspan = 1},
+ TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocAppend
+ (DocString " ")
+ (DocAppend
+ (DocMonospaced (DocString "OK"))
+ (DocString " ")),
+ tableCellRowspan = 1},
+ TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString
+ " operation successful ",
+ tableCellRowspan = 1}],
+ TableRow
+ [TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString " 204 ",
+ tableCellRowspan = 1},
+ TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocAppend
+ (DocString " ")
+ (DocAppend
+ (DocMonospaced (DocString "No Content"))
+ (DocString " ")),
+ tableCellRowspan = 1},
+ TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString
+ " operation successful, no body returned ",
+ tableCellRowspan = 1}]],
+ tableHeaderRows = [TableRow
+ [TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString " code ",
+ tableCellRowspan = 1},
+ TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString " message ",
+ tableCellRowspan = 1},
+ TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString
+ " description ",
+ tableCellRowspan = 1}]]}
diff --git a/haddock-library/fixtures/examples/table1.input b/haddock-library/fixtures/examples/table1.input
new file mode 100644
index 00000000..a007020c
--- /dev/null
+++ b/haddock-library/fixtures/examples/table1.input
@@ -0,0 +1,12 @@
++------------------------+------------+----------+----------+
+| Header row, column 1 | Header 2 | Header 3 | Header 4 |
+| (header rows optional) | | | |
++========================+============+==========+==========+
+| body row 1, column 1 | column 2 | column 3 | column 4 |
++------------------------+------------+----------+----------+
+| body row 2 | Cells may span columns. |
++------------------------+------------+---------------------+
+| body row 3 | Cells may | \[ |
++------------------------+ span rows. | f(n) = \sum_{i=1} |
+| body row 4 | | \] |
++------------------------+------------+---------------------+
diff --git a/haddock-library/fixtures/examples/table1.parsed b/haddock-library/fixtures/examples/table1.parsed
new file mode 100644
index 00000000..2fa58fd8
--- /dev/null
+++ b/haddock-library/fixtures/examples/table1.parsed
@@ -0,0 +1,81 @@
+DocTable
+ Table
+ {tableBodyRows = [TableRow
+ [TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString " body row 1, column 1 ",
+ tableCellRowspan = 1},
+ TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString " column 2 ",
+ tableCellRowspan = 1},
+ TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString " column 3 ",
+ tableCellRowspan = 1},
+ TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString " column 4 ",
+ tableCellRowspan = 1}],
+ TableRow
+ [TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString " body row 2 ",
+ tableCellRowspan = 1},
+ TableCell
+ {tableCellColspan = 3,
+ tableCellContents = DocString " Cells may span columns. ",
+ tableCellRowspan = 1}],
+ TableRow
+ [TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString " body row 3 ",
+ tableCellRowspan = 1},
+ TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString
+ (concat
+ [" Cells may \n",
+ " span rows. \n",
+ " "]),
+ tableCellRowspan = 2},
+ TableCell
+ {tableCellColspan = 2,
+ tableCellContents = DocAppend
+ (DocString " ")
+ (DocAppend
+ (DocMathDisplay
+ (concat
+ [" \n",
+ " f(n) = \\sum_{i=1} \n",
+ " "]))
+ (DocString " ")),
+ tableCellRowspan = 2}],
+ TableRow
+ [TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString " body row 4 ",
+ tableCellRowspan = 1}]],
+ tableHeaderRows = [TableRow
+ [TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString
+ (concat
+ [" Header row, column 1 \n",
+ " (header rows optional) "]),
+ tableCellRowspan = 1},
+ TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString
+ (concat [" Header 2 \n", " "]),
+ tableCellRowspan = 1},
+ TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString
+ (concat [" Header 3 \n", " "]),
+ tableCellRowspan = 1},
+ TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString
+ (concat [" Header 4 \n", " "]),
+ tableCellRowspan = 1}]]}
diff --git a/haddock-library/fixtures/examples/table2.input b/haddock-library/fixtures/examples/table2.input
new file mode 100644
index 00000000..aa5d0862
--- /dev/null
+++ b/haddock-library/fixtures/examples/table2.input
@@ -0,0 +1,7 @@
++--------------+----------+-----------+-----------+
+| row 1, col 1 | column 2 | column 3 | column 4 |
++--------------+----------+-----------+-----------+
+| row 2 | |
++--------------+----------+-----------+-----------+
+| row 3 | | | |
++--------------+----------+-----------+-----------+
diff --git a/haddock-library/fixtures/examples/table2.parsed b/haddock-library/fixtures/examples/table2.parsed
new file mode 100644
index 00000000..e3dbf0b4
--- /dev/null
+++ b/haddock-library/fixtures/examples/table2.parsed
@@ -0,0 +1,46 @@
+DocTable
+ Table
+ {tableBodyRows = [TableRow
+ [TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString " row 1, col 1 ",
+ tableCellRowspan = 1},
+ TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString " column 2 ",
+ tableCellRowspan = 1},
+ TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString " column 3 ",
+ tableCellRowspan = 1},
+ TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString " column 4 ",
+ tableCellRowspan = 1}],
+ TableRow
+ [TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString " row 2 ",
+ tableCellRowspan = 1},
+ TableCell
+ {tableCellColspan = 3,
+ tableCellContents = DocString " ",
+ tableCellRowspan = 1}],
+ TableRow
+ [TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString " row 3 ",
+ tableCellRowspan = 1},
+ TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString " ",
+ tableCellRowspan = 1},
+ TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString " ",
+ tableCellRowspan = 1},
+ TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString " ",
+ tableCellRowspan = 1}]],
+ tableHeaderRows = []}
diff --git a/haddock-library/fixtures/examples/table3.input b/haddock-library/fixtures/examples/table3.input
new file mode 100644
index 00000000..a6ca84ca
--- /dev/null
+++ b/haddock-library/fixtures/examples/table3.input
@@ -0,0 +1,7 @@
++--------------+----------+-----------+-----------+
+| row 1, col 1 | column 2 | column 3 | column 4 |
++--------------+----------+-----------+-----------+
+| row 2 | Use the command ``ls | more``. |
++--------------+----------+-----------+-----------+
+| row 3 | | | |
++--------------+----------+-----------+-----------+
diff --git a/haddock-library/fixtures/examples/table3.parsed b/haddock-library/fixtures/examples/table3.parsed
new file mode 100644
index 00000000..cabff9cb
--- /dev/null
+++ b/haddock-library/fixtures/examples/table3.parsed
@@ -0,0 +1,50 @@
+DocTable
+ Table
+ {tableBodyRows = [TableRow
+ [TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString " row 1, col 1 ",
+ tableCellRowspan = 1},
+ TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString " column 2 ",
+ tableCellRowspan = 1},
+ TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString " column 3 ",
+ tableCellRowspan = 1},
+ TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString " column 4 ",
+ tableCellRowspan = 1}],
+ TableRow
+ [TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString " row 2 ",
+ tableCellRowspan = 1},
+ TableCell
+ {tableCellColspan = 2,
+ tableCellContents = DocString " Use the command ``ls ",
+ tableCellRowspan = 1},
+ TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString " more``. ",
+ tableCellRowspan = 1}],
+ TableRow
+ [TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString " row 3 ",
+ tableCellRowspan = 1},
+ TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString " ",
+ tableCellRowspan = 1},
+ TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString " ",
+ tableCellRowspan = 1},
+ TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString " ",
+ tableCellRowspan = 1}]],
+ tableHeaderRows = []}
diff --git a/haddock-library/fixtures/examples/table4.input b/haddock-library/fixtures/examples/table4.input
new file mode 100644
index 00000000..2c5611c8
--- /dev/null
+++ b/haddock-library/fixtures/examples/table4.input
@@ -0,0 +1,17 @@
+Single outer cell:
+
++-------------+
+| outer |
+| |
++-------+ |
+| inner | |
++-------+-----+
+
+Broken (only inner cell is rendered):
+
++-------+-----+
+| inner | |
++-------+ |
+| |
+| outer |
++-------------+
diff --git a/haddock-library/fixtures/examples/table4.parsed b/haddock-library/fixtures/examples/table4.parsed
new file mode 100644
index 00000000..cfdd6f0f
--- /dev/null
+++ b/haddock-library/fixtures/examples/table4.parsed
@@ -0,0 +1,26 @@
+DocAppend
+ (DocParagraph (DocString "Single outer cell:"))
+ (DocAppend
+ (DocTable
+ Table
+ {tableBodyRows = [TableRow
+ [TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString
+ (concat
+ [" outer \n",
+ " \n",
+ "-------+ \n",
+ " inner | "]),
+ tableCellRowspan = 1}]],
+ tableHeaderRows = []})
+ (DocAppend
+ (DocParagraph (DocString "Broken (only inner cell is rendered):"))
+ (DocTable
+ Table
+ {tableBodyRows = [TableRow
+ [TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString " inner ",
+ tableCellRowspan = 1}]],
+ tableHeaderRows = []})))
diff --git a/haddock-library/fixtures/examples/table5.input b/haddock-library/fixtures/examples/table5.input
new file mode 100644
index 00000000..7cf26512
--- /dev/null
+++ b/haddock-library/fixtures/examples/table5.input
@@ -0,0 +1,8 @@
++--------------+----------+-----------+-----------+
+| row 1, col 1 | column 2 | column 3 | column 4 |
++==============+==========+===========+===========+
+| row 2 | Use the command @ls | more@. |
+| | |
+| +----------+-----------+-----------+
+| row 3 | | | |
++--------------+----------+-----------+-----------+
diff --git a/haddock-library/fixtures/examples/table5.parsed b/haddock-library/fixtures/examples/table5.parsed
new file mode 100644
index 00000000..9a547ad3
--- /dev/null
+++ b/haddock-library/fixtures/examples/table5.parsed
@@ -0,0 +1,53 @@
+DocTable
+ Table
+ {tableBodyRows = [TableRow
+ [TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString
+ (concat
+ [" row 2 \n",
+ " \n",
+ " \n",
+ " row 3 "]),
+ tableCellRowspan = 2},
+ TableCell
+ {tableCellColspan = 3,
+ tableCellContents = DocAppend
+ (DocString " Use the command ")
+ (DocAppend
+ (DocMonospaced (DocString "ls | more"))
+ (DocString
+ (concat
+ [". \n",
+ " "]))),
+ tableCellRowspan = 1}],
+ TableRow
+ [TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString " ",
+ tableCellRowspan = 1},
+ TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString " ",
+ tableCellRowspan = 1},
+ TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString " ",
+ tableCellRowspan = 1}]],
+ tableHeaderRows = [TableRow
+ [TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString " row 1, col 1 ",
+ tableCellRowspan = 1},
+ TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString " column 2 ",
+ tableCellRowspan = 1},
+ TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString " column 3 ",
+ tableCellRowspan = 1},
+ TableCell
+ {tableCellColspan = 1,
+ tableCellContents = DocString " column 4 ",
+ tableCellRowspan = 1}]]}
diff --git a/haddock-library/fixtures/examples/url.input b/haddock-library/fixtures/examples/url.input
new file mode 100644
index 00000000..5bfed0a1
--- /dev/null
+++ b/haddock-library/fixtures/examples/url.input
@@ -0,0 +1 @@
+<http://example.com/>
diff --git a/haddock-library/fixtures/examples/url.parsed b/haddock-library/fixtures/examples/url.parsed
new file mode 100644
index 00000000..0fbbbb30
--- /dev/null
+++ b/haddock-library/fixtures/examples/url.parsed
@@ -0,0 +1,4 @@
+DocParagraph
+ (DocHyperlink
+ Hyperlink
+ {hyperlinkLabel = Nothing, hyperlinkUrl = "http://example.com/"})
diff --git a/haddock-library/fixtures/examples/urlLabel.input b/haddock-library/fixtures/examples/urlLabel.input
new file mode 100644
index 00000000..729812e8
--- /dev/null
+++ b/haddock-library/fixtures/examples/urlLabel.input
@@ -0,0 +1 @@
+<http://example.com/ some link>
diff --git a/haddock-library/fixtures/examples/urlLabel.parsed b/haddock-library/fixtures/examples/urlLabel.parsed
new file mode 100644
index 00000000..d7e3a76c
--- /dev/null
+++ b/haddock-library/fixtures/examples/urlLabel.parsed
@@ -0,0 +1,5 @@
+DocParagraph
+ (DocHyperlink
+ Hyperlink
+ {hyperlinkLabel = Just "some link",
+ hyperlinkUrl = "http://example.com/"})