1
1
# Haddock, a Haskell Documentation Tool [ ![ Build Status] ( https://travis-ci.org/haskell/haddock.svg?branch=master )] ( https://travis-ci.org/haskell/haddock )
2
2
3
3
4
- #### About haddock
4
+ ## About haddock
5
5
6
- This is Haddock, a tool for automatically generating documentation
7
- from annotated Haskell source code. It is primary intended for
8
- documenting library interfaces, but it should be useful for any kind
9
- of Haskell code.
6
+ See [ Description on Hackage] ( https://hackage.haskell.org/package/haddock ) .
10
7
11
- Haddock lets you write documentation annotations next to the
12
- definitions of functions and types in the source code, in a syntax
13
- that is easy on the eye when writing the source code (no heavyweight
14
- mark-up). The documentation generated by Haddock is fully hyperlinked
15
- - click on a type name in a type signature to go straight to the
16
- definition, and documentation, for that type.
8
+ ## Source code documentation
17
9
18
- Haddock understands Haskell's module system, so you can structure your
19
- code however you like without worrying that internal structure will be
20
- exposed in the generated documentation. For example, it is common to
21
- implement a library in several modules, but define the external API by
22
- having a single module which re-exports parts of these implementation
23
- modules. Using Haddock, you can still write documentation annotations
24
- next to the actual definitions of the functions and types in the
25
- library, but the documentation annotations from the implementation
26
- will be propagated to the external API when the documentation is
27
- generated. Abstract types and classes are handled correctly. In
28
- fact, even without any documentation annotations, Haddock can generate
29
- useful documentation from your source code.
30
-
31
-
32
- #### Documentation formats
33
-
34
- Haddock can generate documentation in multiple formats; currently HTML
35
- is implemented, and there is partial support for generating LaTeX and
36
- Hoogle.
37
-
38
-
39
- #### Source code documentation
40
-
41
- Full documentation can be found in the doc/ subdirectory, in DocBook
10
+ Full documentation can be found in the ` doc/ ` subdirectory, in
11
+ [ reStructedText format] ( http://www.sphinx-doc.org/en/stable/rest.html )
42
12
format.
43
13
44
-
45
- #### Contributing
14
+ ## Contributing
46
15
47
16
Please create issues when you have any problems and pull requests if you have some code.
48
17
49
- ##### Hacking
18
+ ## Hacking
50
19
51
20
To get started you'll need a latest GHC release installed.
52
21
@@ -59,15 +28,15 @@ Clone the repository:
59
28
60
29
and then proceed using your favourite build tool.
61
30
62
- ###### Using [ ` cabal new-build ` ] ( http://cabal.readthedocs.io/en/latest/nix-local-build-overview.html )
31
+ #### Using [ ` cabal new-build ` ] ( http://cabal.readthedocs.io/en/latest/nix-local-build-overview.html )
63
32
64
33
``` bash
65
34
cabal new-build -w ghc-8.2.1
66
35
# build & run the test suite
67
36
cabal new-test -w ghc-8.2.1
68
37
```
69
38
70
- ###### Using Cabal sandboxes
39
+ #### Using Cabal sandboxes
71
40
72
41
``` bash
73
42
cabal sandbox init
@@ -83,7 +52,7 @@ export HADDOCK_PATH="dist/build/haddock/haddock"
83
52
cabal test
84
53
```
85
54
86
- ###### Using Stack
55
+ #### Using Stack
87
56
88
57
``` bash
89
58
stack init
@@ -93,9 +62,14 @@ export HADDOCK_PATH="$HOME/.local/bin/haddock"
93
62
stack test
94
63
```
95
64
65
+ ### Git Branches
96
66
97
67
If you're a GHC developer and want to update Haddock to work with your
98
- changes, you should be working on ` ghc-head ` branch instead of master.
68
+ changes, you should be working on ` ghc-head ` branch instead of ` master ` .
99
69
See instructions at
100
70
https://ghc.haskell.org/trac/ghc/wiki/WorkingConventions/Git/Submodules
101
71
for an example workflow.
72
+
73
+ The ` master ` branch usually requires a GHC from the latest GHC stable
74
+ branch. The required GHC version can be inferred from the version
75
+ bounds on ` ghc ` in the respective ` .cabal ` files.
0 commit comments