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

Portability | unportable
Stability | unstable
Maintainer | Andrea Rossato <andrea.rossato@unitn.it>
Safe Haskell | None

Text.CSL.Proc

Description

This module provides functions for processing the evaluated `Output` for disambiguation and citation collapsing.

Synopsis

- data ProcOpts = ProcOpts {
  - bibOpts :: BibOpts
  }
- data BibOpts
  - = Select [(String, String)] [(String, String)]
  - | Include [(String, String)] [(String, String)]
  - | Exclude [(String, String)] [(String, String)]
- procOpts :: ProcOpts
- processCitations :: ProcOpts -> Style -> [Reference] -> Citations -> [[FormattedOutput]]
- processBibliography :: ProcOpts -> Style -> [Reference] -> [[FormattedOutput]]
- citeproc :: ProcOpts -> Style -> [Reference] -> Citations -> BiblioData
- procRefs :: Style -> [Reference] -> [Reference]
- sortItems :: Show a => [(a, [Sorting])] -> [a]
- procBiblio :: BibOpts -> Style -> [Reference] -> [[Output]]
- subsequentAuthorSubstitute :: Bibliography -> [[Output]] -> [[Output]]
- filterRefs :: BibOpts -> [Reference] -> [Reference]
- procGroup :: Style -> [(Cite, Reference)] -> CitationGroup
- formatBiblioLayout :: Formatting -> Delimiter -> [Output] -> [Output]
- formatCitLayout :: Style -> CitationGroup -> [FormattedOutput]
- addAffixes :: Formatting -> [Output] -> [Output]
- localModifiers :: Style -> Bool -> Cite -> Output -> Output
- contribOnly :: Style -> Output -> Output

# Documentation

data ProcOpts Source

Constructors

ProcOpts |

Fields

bibOpts :: BibOpts

Instances

Eq ProcOpts |
Read ProcOpts |
Show ProcOpts |

data BibOpts Source

Constructors

Select [(String, String)] [(String, String)] |
Include [(String, String)] [(String, String)] |
Exclude [(String, String)] [(String, String)] |

Instances

Eq BibOpts |
Read BibOpts |
Show BibOpts |

procOpts :: ProcOpts Source

processCitations :: ProcOpts -> Style -> [Reference] -> Citations -> [[FormattedOutput]]Source

With a `Style`, a list of `Reference`s and the list of citation groups (the list of citations with their locator), produce the `FormattedOutput` for each citation group.

processBibliography :: ProcOpts -> Style -> [Reference] -> [[FormattedOutput]]Source

With a `Style` and the list of `Reference`s produce the `FormattedOutput` for the bibliography.

citeproc :: ProcOpts -> Style -> [Reference] -> Citations -> BiblioData Source

With a `Style`, a list of `Reference`s and the list of `Citations`, produce the `FormattedOutput` for each citation group and the bibliography.

procRefs :: Style -> [Reference] -> [Reference]Source

Given the CSL `Style` and the list of `Reference`s sort the list according to the `Style` and assign the citation number to each `Reference`.

sortItems :: Show a => [(a, [Sorting])] -> [a]Source

procBiblio :: BibOpts -> Style -> [Reference] -> [[Output]]Source

With a `Style` and a sorted list of `Reference`s produce the evaluated output for the bibliography.

subsequentAuthorSubstitute :: Bibliography -> [[Output]] -> [[Output]]Source

filterRefs :: BibOpts -> [Reference] -> [Reference]Source

procGroup :: Style -> [(Cite, Reference)] -> CitationGroup Source

Given the CSL `Style` and the list of `Cite`s coupled with their `Reference`s, generate a `CitationGroup`. The citations are sorted according to the `Style`.

formatBiblioLayout :: Formatting -> Delimiter -> [Output] -> [Output]Source

formatCitLayout :: Style -> CitationGroup -> [FormattedOutput]Source

addAffixes :: Formatting -> [Output] -> [Output]Source

localModifiers :: Style -> Bool -> Cite -> Output -> Output Source

The `Bool` is `True` if we are formatting a textual citation (in pandoc terminology).

contribOnly :: Style -> Output -> Output Source