Text.CSL.Reference

pandoc-citeproc-0.9: Supports using pandoc with citeproc

Copyright | (c) Andrea Rossato
License | BSD-style (see LICENSE)
Maintainer | Andrea Rossato <andrea.rossato@unitn.it>
Stability | unstable
Portability | unportable
Safe Haskell | None
Language | Haskell98

Text.CSL.Reference

Description

The Reference type

Synopsis

- newtype Literal = Literal {
  - unLiteral :: String
  }
- data Value = forall a . Data a => Value a
- type ReferenceMap = [(String, Value)]
- mkRefMap :: Maybe Reference -> ReferenceMap
- fromValue :: Data a => Value -> Maybe a
- isValueSet :: Value -> Bool
- data Empty = Empty
- data RefDate = RefDate {
  - year :: Literal
  - month :: Literal
  - season :: Literal
  - day :: Literal
  - other :: Literal
  - circa :: Bool
  }
- handleLiteral :: RefDate -> [RefDate]
- toDatePart :: RefDate -> [Int]
- setCirca :: Bool -> RefDate -> RefDate
- mkRefDate :: Literal -> Parser [RefDate]
- data RefType
  - = NoType
  - | Article
  - | ArticleMagazine
  - | ArticleNewspaper
  - | ArticleJournal
  - | Bill
  - | Book
  - | Broadcast
  - | Chapter
  - | Dataset
  - | Entry
  - | EntryDictionary
  - | EntryEncyclopedia
  - | Figure
  - | Graphic
  - | Interview
  - | Legislation
  - | LegalCase
  - | Manuscript
  - | Map
  - | MotionPicture
  - | MusicalScore
  - | Pamphlet
  - | PaperConference
  - | Patent
  - | Post
  - | PostWeblog
  - | PersonalCommunication
  - | Report
  - | Review
  - | ReviewBook
  - | Song
  - | Speech
  - | Thesis
  - | Treaty
  - | Webpage
- newtype CNum = CNum {
  - unCNum :: Int
  }
- data Reference = Reference {
  - refId :: Literal
  - refType :: RefType
  - author :: [Agent]
  - editor :: [Agent]
  - translator :: [Agent]
  - recipient :: [Agent]
  - interviewer :: [Agent]
  - composer :: [Agent]
  - director :: [Agent]
  - illustrator :: [Agent]
  - originalAuthor :: [Agent]
  - containerAuthor :: [Agent]
  - collectionEditor :: [Agent]
  - editorialDirector :: [Agent]
  - reviewedAuthor :: [Agent]
  - issued :: [RefDate]
  - eventDate :: [RefDate]
  - accessed :: [RefDate]
  - container :: [RefDate]
  - originalDate :: [RefDate]
  - submitted :: [RefDate]
  - title :: Formatted
  - titleShort :: Formatted
  - reviewedTitle :: Formatted
  - containerTitle :: Formatted
  - volumeTitle :: Formatted
  - collectionTitle :: Formatted
  - containerTitleShort :: Formatted
  - collectionNumber :: Formatted
  - originalTitle :: Formatted
  - publisher :: Formatted
  - originalPublisher :: Formatted
  - publisherPlace :: Formatted
  - originalPublisherPlace :: Formatted
  - authority :: Formatted
  - jurisdiction :: Formatted
  - archive :: Formatted
  - archivePlace :: Formatted
  - archiveLocation :: Formatted
  - event :: Formatted
  - eventPlace :: Formatted
  - page :: Formatted
  - pageFirst :: Formatted
  - numberOfPages :: Formatted
  - version :: Formatted
  - volume :: Formatted
  - numberOfVolumes :: Formatted
  - issue :: Formatted
  - chapterNumber :: Formatted
  - medium :: Formatted
  - status :: Formatted
  - edition :: Formatted
  - section :: Formatted
  - source :: Formatted
  - genre :: Formatted
  - note :: Formatted
  - annote :: Formatted
  - abstract :: Formatted
  - keyword :: Formatted
  - number :: Formatted
  - references :: Formatted
  - url :: Literal
  - doi :: Literal
  - isbn :: Literal
  - issn :: Literal
  - pmcid :: Literal
  - pmid :: Literal
  - callNumber :: Literal
  - dimensions :: Literal
  - scale :: Literal
  - categories :: [Literal]
  - language :: Literal
  - citationNumber :: CNum
  - firstReferenceNoteNumber :: Int
  - citationLabel :: Literal
  }
- emptyReference :: Reference
- numericVars :: [String]
- getReference :: [Reference] -> Cite -> Maybe Reference
- processCites :: [Reference] -> [[Cite]] -> [[(Cite, Maybe Reference)]]
- setPageFirst :: Reference -> Reference
- setNearNote :: Style -> [[Cite]] -> [[Cite]]

# Documentation

newtype Literal

Constructors

Literal |
Fields unLiteral :: String

Instances

Eq Literal |
Data Literal |
Read Literal |
Show Literal |
IsString Literal |
Generic Literal |
ToJSON Literal |
FromJSON Literal |
Monoid Literal |
ToYaml Literal |
type Rep Literal |

data Value

An existential type to wrap the different types a `Reference` is made of. This way we can create a map to make queries easier.

Constructors

forall a . Data a => Value a |

Instances

Show Value |

type ReferenceMap = [(String, Value)]

mkRefMap :: Maybe Reference -> ReferenceMap

fromValue :: Data a => Value -> Maybe a

isValueSet :: Value -> Bool

data Empty

Constructors

Empty |

Instances

Data Empty |
Generic Empty |
type Rep Empty |

data RefDate

Constructors

RefDate |
Fields year :: Literal month :: Literal season :: Literal day :: Literal other :: Literal circa :: Bool

Instances

Eq RefDate |
Data RefDate |
Read RefDate |
Show RefDate |
Generic RefDate |
FromJSON RefDate |
ToYaml RefDate |
ToJSON [RefDate] |
FromJSON [RefDate] |
type Rep RefDate |

handleLiteral :: RefDate -> [RefDate]

toDatePart :: RefDate -> [Int]

setCirca :: Bool -> RefDate -> RefDate

mkRefDate :: Literal -> Parser [RefDate]

data RefType

Constructors

NoType |
Article |
ArticleMagazine |
ArticleNewspaper |
ArticleJournal |
Bill |
Book |
Broadcast |
Chapter |
Dataset |
Entry |
EntryDictionary |
EntryEncyclopedia |
Figure |
Graphic |
Interview |
Legislation |
LegalCase |
Manuscript |
Map |
MotionPicture |
MusicalScore |
Pamphlet |
PaperConference |
Patent |
Post |
PostWeblog |
PersonalCommunication |
Report |
Review |
ReviewBook |
Song |
Speech |
Thesis |
Treaty |
Webpage |

Instances

Eq RefType |
Data RefType |
Read RefType |
Show RefType |
Generic RefType |
ToJSON RefType |
FromJSON RefType |
ToYaml RefType |
type Rep RefType |

newtype CNum

Constructors

CNum |
Fields unCNum :: Int

Instances

Eq CNum |
Data CNum |
Num CNum |
Read CNum |
Show CNum |
Generic CNum |
ToJSON CNum |
FromJSON CNum |
ToYaml CNum |
type Rep CNum |

data Reference

The `Reference` record.

Constructors

Reference |
Fields refId :: Literal refType :: RefType author :: [Agent] editor :: [Agent] translator :: [Agent] recipient :: [Agent] interviewer :: [Agent] composer :: [Agent] director :: [Agent] illustrator :: [Agent] originalAuthor :: [Agent] containerAuthor :: [Agent] collectionEditor :: [Agent] editorialDirector :: [Agent] reviewedAuthor :: [Agent] issued :: [RefDate] eventDate :: [RefDate] accessed :: [RefDate] container :: [RefDate] originalDate :: [RefDate] submitted :: [RefDate] title :: Formatted titleShort :: Formatted reviewedTitle :: Formatted containerTitle :: Formatted volumeTitle :: Formatted collectionTitle :: Formatted containerTitleShort :: Formatted collectionNumber :: Formatted originalTitle :: Formatted publisher :: Formatted originalPublisher :: Formatted publisherPlace :: Formatted originalPublisherPlace :: Formatted authority :: Formatted jurisdiction :: Formatted archive :: Formatted archivePlace :: Formatted archiveLocation :: Formatted event :: Formatted eventPlace :: Formatted page :: Formatted pageFirst :: Formatted numberOfPages :: Formatted version :: Formatted volume :: Formatted numberOfVolumes :: Formatted issue :: Formatted chapterNumber :: Formatted medium :: Formatted status :: Formatted edition :: Formatted section :: Formatted source :: Formatted genre :: Formatted note :: Formatted annote :: Formatted abstract :: Formatted keyword :: Formatted number :: Formatted references :: Formatted url :: Literal doi :: Literal isbn :: Literal issn :: Literal pmcid :: Literal pmid :: Literal callNumber :: Literal dimensions :: Literal scale :: Literal categories :: [Literal] language :: Literal citationNumber :: CNum firstReferenceNoteNumber :: Int citationLabel :: Literal

Instances

Eq Reference |
Data Reference |
Read Reference |
Show Reference |
Generic Reference |
ToJSON Reference |
FromJSON Reference |
ToYaml Reference |
type Rep Reference |

emptyReference :: Reference

numericVars :: [String]

getReference :: [Reference] -> Cite -> Maybe Reference

processCites :: [Reference] -> [[Cite]] -> [[(Cite, Maybe Reference)]]

setPageFirst :: Reference -> Reference

setNearNote :: Style -> [[Cite]] -> [[Cite]]