aboutsummaryrefslogtreecommitdiff
path: root/doc/cheatsheet/haddocks.md
diff options
context:
space:
mode:
authoralexbiehl <alex.biehl@gmail.com>2017-08-21 20:05:42 +0200
committeralexbiehl <alex.biehl@gmail.com>2017-08-21 20:05:42 +0200
commit7a71af839bd71992a36d97650004c73bf11fa436 (patch)
treee64afbc9df5c97fde6ac6433e42f28df8a4acf49 /doc/cheatsheet/haddocks.md
parentc8a01b83be52e45d3890db173ffe7b09ccd4f351 (diff)
parent740458ac4d2acf197f2ef8dc94a66f9b160b9c3c (diff)
Merge remote-tracking branch 'origin/master' into ghc-head
Diffstat (limited to 'doc/cheatsheet/haddocks.md')
-rw-r--r--doc/cheatsheet/haddocks.md120
1 files changed, 120 insertions, 0 deletions
diff --git a/doc/cheatsheet/haddocks.md b/doc/cheatsheet/haddocks.md
new file mode 100644
index 00000000..fbe71392
--- /dev/null
+++ b/doc/cheatsheet/haddocks.md
@@ -0,0 +1,120 @@
+# Code Sections
+
+```
+ -- * Section
+ -- ** Sub-section
+ -- *** Sub-sub-section
+ -- et cetera
+```
+
+# Named Documentation Chunks
+
+```
+ -- $name
+[...]
+ -- $name
+ -- Here is the documentation text
+ -- which is embedded elsewhere
+```
+
+# Code Blocks
+
+```
+With internal markup:
+ -- @
+ -- fact n = product [1..n]
+ -- @
+With literal text:
+ -- > fact n = product [1..n]
+```
+
+# REPL Examples
+
+```
+ -- >>> fact 5
+ -- 120
+```
+
+# Properties
+
+```
+ -- prop> a + b = b + a
+```
+
+# Hyperlinked Identifiers
+
+```
+ -- The value 'x' of type 'T'
+ -- The out-of-scope 'MyModule.x'
+ -- The "MyModule" module
+```
+
+# Textual Markup
+
+```
+ -- Emphasis: /forward slashes/.
+ -- Bolding: __underscores__.
+ -- Monospaced text: @ampersands@.
+```
+
+# Links and Images
+
+```
+ -- A raw link <http://example.com>
+ -- [a link](http://example.com)
+ -- ![description](imagepath.png)
+```
+
+# Lists
+
+```
+itemized with "*" or "-"
+ -- * first item
+ -- * second item
+numbered with "(n)" or "n."
+ -- 1. first item
+ -- 2. second item
+definitions with "[thing]"
+ -- [one] first item
+ -- [two] second item
+```
+
+# Mathematics/LaTeX
+
+```
+ -- \[
+ -- f(n) = \Sum_{i=1}^{n} i
+ -- \]
+ \\ when \(n > 0\)
+```
+
+# Headings in Documentation
+
+```
+ -- = Heading
+ -- == Sub-heading
+ -- === Sub-sub-heading
+```
+
+# Metadata
+
+```
+ -- @since 1.2.3
+```
+
+# Module Attributes
+
+```
+{-# OPTIONS_HADDOCK hide #-}
+ Omit this module from the docs
+{-# OPTIONS_HADDOCK prune #-}
+ Omit definitions without docs
+{-# OPTIONS_HADDOCK ignore-exports #-}
+ Treat this module as though all
+ top-level items are exported
+{-# OPTIONS_HADDOCK not-home #-}
+ Do not treat this module as the
+ "home" of identifiers it exports
+{-# OPTIONS_HADDOCK show-extensions #-}
+ Show all enabled LANGUAGE extensions
+```