citeproc-hs-0.3.2: A Citation Style Language implementation in Haskell

Portabilityunportable
Stabilityunstable
MaintainerAndrea Rossato <andrea.rossato@unitn.it>

Text.CSL.Style

Description

The Style types

Synopsis

Documentation

data Style

The representation of a parsed CSL style.

mergeLocales :: String -> Locale -> [Locale] -> [Locale]

With the defaultLocale, the locales-xx-XX.xml loaded file and the parsed Style cs:locale elements, produce the final Locale as the only element of a list, taking into account CSL locale prioritization.

type TermMap = ((String, Form), (String, String))

type MacroMap = (String, [Element])

data Citation

Constructors

Citation 

Fields

citOptions :: [Option]
 
citSort :: [Sort]
 
citLayout :: Layout
 

type Option = (String, String)

match :: Match -> [Bool] -> Bool

type NameAttrs = [(String, String)]

hasEtAl :: [Name] -> Bool

data FormattedOutput

The formatted output, produced after post-processing the evaluated citations.

data Output

The Output generated by the evaluation of a style. Must be further processed for disambiguation and collapsing.

Constructors

ONull 
OSpace 
OPan [Inline] 
ODel String

A delimiter string.

OStr String Formatting

A simple String

ONum Int Formatting

A number (used to count contributors)

OCitNum Int Formatting

The citation number

OYear String String Formatting

The year and the citeId

OYearSuf String String [Output] Formatting

The year suffix, the citeId and a holder for collision data

OName String [Output] [[Output]] Formatting

A (family) name with the list of given names.

OContrib String String [Output] [Output] [[Output]]

The citation key, the role (author, editor, etc.), the contributor(s), the output needed for year suf. disambiguation, and everything used for name disambiguation.

Output [Output] Formatting

Some nested Output

data Affix

Instances

Eq Affix 
Data Affix 
Ord Affix 
Read Affix 
Show Affix 
Typeable Affix 
JSON Affix

Needed for the test-suite.

type Citations = [[Cite]]

data CitationGroup

A citation group: a list of evaluated citations, the Formatting to be applied to them, and the Delimiter between individual citations.

Constructors

CG [(Cite, Output)] Formatting Delimiter [(Cite, Output)] 

data BiblioData

Constructors

BD 

Instances

data CiteData

A record with all the data to produce the FormattedOutput of a citation: the citation key, the part of the citation that may be colliding with other citations (the list of contributors for the same year), the data to disambiguate it (all possible contributors and all possible given names), and the disambiguated citation and its year.

Constructors

CD 

formatOutput :: Output -> FormattedOutput

Convert evaluated Output into FormattedOutput, ready for the output filters.

mapGroupOutput :: (Output -> [a]) -> CitationGroup -> [a]

Map the evaluated output of a citation group.

proc :: (Typeable a, Data b) => (a -> a) -> b -> b

A generic processing function.

proc' :: (Typeable a, Data b) => (a -> a) -> b -> b

A generic processing function: process a data structure in top-down manner.

query :: (Typeable a, Data b) => (a -> [c]) -> b -> [c]

A generic query function.

rmGivenNames :: Output -> Output

Removes all given names form a OName element with proc.

rmContribs :: Output -> Output

Removes all contributors' names.

addGivenNames :: [Output] -> [Output]

Add, with proc, a give name to the family name. Needed for disambiguation.

addYearSuffix :: Output -> Output

Add the year suffix to the year. Needed for disambiguation.

betterThen :: Eq a => [a] -> [a] -> [a]