haddock-library-1.2.1: Library exposing some functionality of Haddock.

Copyright | (c) Simon Marlow 2003-2006, David Waern 2006-2009, Mateusz Kowalczyk 2013
License | BSD-like
Maintainer | haddock@projects.haskellorg
Stability | experimental
Portability | portable
Safe Haskell | Safe
Language | Haskell2010

Documentation.Haddock.Types

Description

Exposes documentation data types used for (some) of Haddock.

Synopsis

- newtype Meta = Meta {
  - _version :: Maybe Version
  }
- data MetaDoc mod id = MetaDoc {
  - _meta :: Meta
  - _doc :: DocH mod id
  }
- overDoc :: (DocH a b -> DocH c d) -> MetaDoc a b -> MetaDoc c d
- type Version = [Int]
- data Hyperlink = Hyperlink {
  - hyperlinkUrl :: String
  - hyperlinkLabel :: Maybe String
  }
- data Picture = Picture {
  - pictureUri :: String
  - pictureTitle :: Maybe String
  }
- data Header id = Header {
  - headerLevel :: Int
  - headerTitle :: id
  }
- data Example = Example {
  - exampleExpression :: String
  - exampleResult :: [String]
  }
- data DocH mod id
  - = DocEmpty
  - | DocAppend (DocH mod id) (DocH mod id)
  - | DocString String
  - | DocParagraph (DocH mod id)
  - | DocIdentifier id
  - | DocIdentifierUnchecked mod
  - | DocModule String
  - | DocWarning (DocH mod id)
  - | DocEmphasis (DocH mod id)
  - | DocMonospaced (DocH mod id)
  - | DocBold (DocH mod id)
  - | DocUnorderedList [DocH mod id]
  - | DocOrderedList [DocH mod id]
  - | DocDefList [(DocH mod id, DocH mod id)]
  - | DocCodeBlock (DocH mod id)
  - | DocHyperlink Hyperlink
  - | DocPic Picture
  - | DocAName String
  - | DocProperty String
  - | DocExamples [Example]
  - | DocHeader (Header (DocH mod id))

# Documentation

newtype Meta

With the advent of `Version`, we may want to start attaching more meta-data to comments. We make a structure for this ahead of time so we don't have to gut half the core each time we want to add such info.

Constructors

Meta |
Fields _version :: Maybe Version

Instances

Eq Meta |
Show Meta |

data MetaDoc mod id

Constructors

MetaDoc |
Fields _meta :: Meta _doc :: DocH mod id

Instances

Functor (MetaDoc mod) |
Foldable (MetaDoc mod) |
Traversable (MetaDoc mod) |
(Eq mod, Eq id) => Eq (MetaDoc mod id) |
(Show mod, Show id) => Show (MetaDoc mod id) |

overDoc :: (DocH a b -> DocH c d) -> MetaDoc a b -> MetaDoc c d

type Version = [Int]

data Hyperlink

Constructors

Hyperlink |
Fields hyperlinkUrl :: String hyperlinkLabel :: Maybe String

Instances

Eq Hyperlink |
Show Hyperlink |

data Picture

Constructors

Picture |
Fields pictureUri :: String pictureTitle :: Maybe String

Instances

Eq Picture |
Show Picture |

data Header id

Constructors

Header |
Fields headerLevel :: Int headerTitle :: id

Instances

Functor Header |
Foldable Header |
Traversable Header |
Eq id => Eq (Header id) |
Show id => Show (Header id) |

data Example

Constructors

Example |
Fields exampleExpression :: String exampleResult :: [String]

Instances

Eq Example |
Show Example |

data DocH mod id

Constructors

DocEmpty |
DocAppend (DocH mod id) (DocH mod id) |
DocString String |
DocParagraph (DocH mod id) |
DocIdentifier id |
DocIdentifierUnchecked mod |
DocModule String |
DocWarning (DocH mod id) |
DocEmphasis (DocH mod id) |
DocMonospaced (DocH mod id) |
DocBold (DocH mod id) |
DocUnorderedList [DocH mod id] |
DocOrderedList [DocH mod id] |
DocDefList [(DocH mod id, DocH mod id)] |
DocCodeBlock (DocH mod id) |
DocHyperlink Hyperlink |
DocPic Picture |
DocAName String |
DocProperty String |
DocExamples [Example] |
DocHeader (Header (DocH mod id)) |

Instances

Functor (DocH mod) |
Foldable (DocH mod) |
Traversable (DocH mod) |
(Eq mod, Eq id) => Eq (DocH mod id) |
(Show mod, Show id) => Show (DocH mod id) |