pandoc-citeproc-0.15.0.1: Supports using pandoc with citeproc

Copyright(c) Andrea Rossato
LicenseBSD-style (see LICENSE)
MaintainerAndrea Rossato <andrea.rossato@unitn.it>
Stabilityunstable
Portabilityunportable
Safe HaskellNone
LanguageHaskell2010

Text.CSL

Contents

Description

citeproc-hs is a library for automatically formatting bibliographic reference citations into a variety of styles using a macro language called Citation Style Language (CSL). More details on CSL can be found here: http://citationstyles.org/.

This module documents and exports the library API.

Synopsis

Introduction

citeproc-hs provides functions for reading bibliographic databases, for reading and parsing CSL files and for generating citations in an internal format, Formatted, that can be easily rendered into different final formats. At the present time only Pandoc and plain text rendering functions are provided by the library.

The library also provides a wrapper around hs-bibutils, the Haskell bindings to Chris Putnam's bibutils, a library that interconverts between various bibliography formats using a common MODS-format XML intermediate. For more information about hs-bibutils see here: http://hackage.haskell.org/package/hs-bibutils.

citeproc-hs can natively read MODS and JSON formatted bibliographic databases. The JSON format is only partially documented. It is used by citeproc-js, by the CSL processor test-suite and is derived by the CSL scheme. More information can be read here: http://citationstyles.org/.

A (git) repository of styles can be found here: https://github.com/citation-style-language/styles.

Overview: A Simple Example

The following example assumes you have installed citeproc-hs with hs-bibutils support (which is the default).

Suppose you have a small bibliographic database, like this one:

@Book{Rossato2006,
author="Andrea Rossato",
title="My Second Book",
year="2006"
}

@Book{Caso2007,
author="Roberto Caso",
title="Roberto's Book",
year="2007"
}

Save it as mybibdb.bib.

Then you can grab one of the CSL styles that come with the test-suite for CSL processors. Suppose this one:

https://bitbucket.org/bdarcus/citeproc-test/raw/18141149d1d3/styles/apa-x.csl

saved locally as apa-x.csl.

This would be a simple program that formats a list of citations according to that style:

import Text.CSL

cites :: [Cite]
cites = [emptyCite { citeId = "Caso2007"
                   , citeLabel = "page"
                   , citeLocator = "15"}
        ,emptyCite { citeId = "Rossato2006"
                   , citeLabel = "page"
                   , citeLocator = "10"}
        ]

main :: IO ()
main = do
  m <- readBiblioFile "mybibdb.bib"
  s <- readCSLFile Nothing "apa-x.csl"
  let result = citeproc procOpts s m $ [cites]
  putStrLn . unlines . map renderPlain . citations $ result

The result would be:

(Caso, 2007, p. 15; Rossato, 2006, p. 10)

Reading Bibliographic Databases

readBiblioFile :: (String -> Bool) -> FilePath -> IO [Reference] Source #

Read a file with a bibliographic database. The database format is recognized by the file extension. The first argument is a predicate to filter citation identifiers.

Supported formats are: json, mods, bibtex, biblatex, ris, endnote, endnotexml, isi, medline, copac, and nbib.

Reference Representation

data Reference Source #

The Reference record.

Constructors

Reference 

Fields

Instances
Eq Reference Source # 
Instance details

Defined in Text.CSL.Reference

Data Reference Source # 
Instance details

Defined in Text.CSL.Reference

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Reference -> c Reference Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Reference Source #

toConstr :: Reference -> Constr Source #

dataTypeOf :: Reference -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Reference) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Reference) Source #

gmapT :: (forall b. Data b => b -> b) -> Reference -> Reference Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Reference -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Reference -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Reference -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Reference -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Reference -> m Reference Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Reference -> m Reference Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Reference -> m Reference Source #

Read Reference Source # 
Instance details

Defined in Text.CSL.Reference

Show Reference Source # 
Instance details

Defined in Text.CSL.Reference

Generic Reference Source # 
Instance details

Defined in Text.CSL.Reference

Associated Types

type Rep Reference :: Type -> Type Source #

ToJSON Reference Source # 
Instance details

Defined in Text.CSL.Reference

FromJSON Reference Source # 
Instance details

Defined in Text.CSL.Reference

ToYaml Reference Source # 
Instance details

Defined in Text.CSL.Reference

type Rep Reference Source # 
Instance details

Defined in Text.CSL.Reference

type Rep Reference = D1 (MetaData "Reference" "Text.CSL.Reference" "pandoc-citeproc-0.15.0.1-JmIKT1H3eQpAqEtBoYsGrD" False) (C1 (MetaCons "Reference" PrefixI True) ((((((S1 (MetaSel (Just "refId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Literal) :*: S1 (MetaSel (Just "refOtherIds") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Literal])) :*: (S1 (MetaSel (Just "refType") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 RefType) :*: S1 (MetaSel (Just "author") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Agent]))) :*: ((S1 (MetaSel (Just "editor") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Agent]) :*: S1 (MetaSel (Just "translator") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Agent])) :*: (S1 (MetaSel (Just "recipient") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Agent]) :*: (S1 (MetaSel (Just "interviewer") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Agent]) :*: S1 (MetaSel (Just "composer") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Agent]))))) :*: (((S1 (MetaSel (Just "director") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Agent]) :*: S1 (MetaSel (Just "illustrator") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Agent])) :*: (S1 (MetaSel (Just "originalAuthor") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Agent]) :*: (S1 (MetaSel (Just "containerAuthor") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Agent]) :*: S1 (MetaSel (Just "collectionEditor") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Agent])))) :*: ((S1 (MetaSel (Just "editorialDirector") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Agent]) :*: S1 (MetaSel (Just "reviewedAuthor") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Agent])) :*: (S1 (MetaSel (Just "issued") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [RefDate]) :*: (S1 (MetaSel (Just "eventDate") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [RefDate]) :*: S1 (MetaSel (Just "accessed") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [RefDate])))))) :*: ((((S1 (MetaSel (Just "container") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [RefDate]) :*: S1 (MetaSel (Just "originalDate") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [RefDate])) :*: (S1 (MetaSel (Just "submitted") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [RefDate]) :*: S1 (MetaSel (Just "title") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Formatted))) :*: ((S1 (MetaSel (Just "titleShort") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Formatted) :*: S1 (MetaSel (Just "reviewedTitle") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Formatted)) :*: (S1 (MetaSel (Just "containerTitle") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Formatted) :*: (S1 (MetaSel (Just "volumeTitle") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Formatted) :*: S1 (MetaSel (Just "collectionTitle") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Formatted))))) :*: (((S1 (MetaSel (Just "containerTitleShort") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Formatted) :*: S1 (MetaSel (Just "collectionNumber") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Formatted)) :*: (S1 (MetaSel (Just "originalTitle") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Formatted) :*: (S1 (MetaSel (Just "publisher") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Formatted) :*: S1 (MetaSel (Just "originalPublisher") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Formatted)))) :*: ((S1 (MetaSel (Just "publisherPlace") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Formatted) :*: S1 (MetaSel (Just "originalPublisherPlace") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Formatted)) :*: (S1 (MetaSel (Just "authority") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Formatted) :*: (S1 (MetaSel (Just "jurisdiction") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Formatted) :*: S1 (MetaSel (Just "archive") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Formatted))))))) :*: (((((S1 (MetaSel (Just "archivePlace") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Formatted) :*: S1 (MetaSel (Just "archiveLocation") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Formatted)) :*: (S1 (MetaSel (Just "event") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Formatted) :*: S1 (MetaSel (Just "eventPlace") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Formatted))) :*: ((S1 (MetaSel (Just "page") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Formatted) :*: S1 (MetaSel (Just "pageFirst") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Formatted)) :*: (S1 (MetaSel (Just "numberOfPages") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Formatted) :*: (S1 (MetaSel (Just "version") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Formatted) :*: S1 (MetaSel (Just "volume") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Formatted))))) :*: (((S1 (MetaSel (Just "numberOfVolumes") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Formatted) :*: S1 (MetaSel (Just "issue") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Formatted)) :*: (S1 (MetaSel (Just "chapterNumber") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Formatted) :*: (S1 (MetaSel (Just "medium") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Formatted) :*: S1 (MetaSel (Just "status") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Formatted)))) :*: ((S1 (MetaSel (Just "edition") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Formatted) :*: S1 (MetaSel (Just "section") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Formatted)) :*: (S1 (MetaSel (Just "source") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Formatted) :*: (S1 (MetaSel (Just "genre") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Formatted) :*: S1 (MetaSel (Just "note") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Formatted)))))) :*: ((((S1 (MetaSel (Just "annote") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Formatted) :*: S1 (MetaSel (Just "abstract") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Formatted)) :*: (S1 (MetaSel (Just "keyword") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Formatted) :*: S1 (MetaSel (Just "number") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Formatted))) :*: ((S1 (MetaSel (Just "references") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Formatted) :*: S1 (MetaSel (Just "url") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Literal)) :*: (S1 (MetaSel (Just "doi") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Literal) :*: (S1 (MetaSel (Just "isbn") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Literal) :*: S1 (MetaSel (Just "issn") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Literal))))) :*: (((S1 (MetaSel (Just "pmcid") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Literal) :*: S1 (MetaSel (Just "pmid") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Literal)) :*: (S1 (MetaSel (Just "callNumber") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Literal) :*: (S1 (MetaSel (Just "dimensions") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Literal) :*: S1 (MetaSel (Just "scale") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Literal)))) :*: ((S1 (MetaSel (Just "categories") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Literal]) :*: S1 (MetaSel (Just "language") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Literal)) :*: (S1 (MetaSel (Just "citationNumber") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 CNum) :*: (S1 (MetaSel (Just "firstReferenceNoteNumber") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int) :*: S1 (MetaSel (Just "citationLabel") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 CLabel)))))))))

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

CSL Parser, Representation, and Processing

readCSLFile :: Maybe String -> FilePath -> IO Style Source #

Read and parse a CSL style file into a localized sytle.

parseCSL :: String -> Style Source #

Parse a String into a Style (with default locale).

localizeCSL :: Maybe String -> Style -> IO Style Source #

Merge locale into a CSL style.

The Style Types

data Style Source #

The representation of a parsed CSL style.

Instances
Data Style Source # 
Instance details

Defined in Text.CSL.Style

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Style -> c Style Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Style Source #

toConstr :: Style -> Constr Source #

dataTypeOf :: Style -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Style) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Style) Source #

gmapT :: (forall b. Data b => b -> b) -> Style -> Style Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Style -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Style -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Style -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Style -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Style -> m Style Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Style -> m Style Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Style -> m Style Source #

Read Style Source # 
Instance details

Defined in Text.CSL.Style

Show Style Source # 
Instance details

Defined in Text.CSL.Style

Generic Style Source # 
Instance details

Defined in Text.CSL.Style

Associated Types

type Rep Style :: Type -> Type Source #

Methods

from :: Style -> Rep Style x Source #

to :: Rep Style x -> Style Source #

type Rep Style Source # 
Instance details

Defined in Text.CSL.Style

data Citation Source #

Constructors

Citation 

Fields

Instances
Data Citation Source # 
Instance details

Defined in Text.CSL.Style

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Citation -> c Citation Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Citation Source #

toConstr :: Citation -> Constr Source #

dataTypeOf :: Citation -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Citation) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Citation) Source #

gmapT :: (forall b. Data b => b -> b) -> Citation -> Citation Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Citation -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Citation -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Citation -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Citation -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Citation -> m Citation Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Citation -> m Citation Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Citation -> m Citation Source #

Read Citation Source # 
Instance details

Defined in Text.CSL.Style

Show Citation Source # 
Instance details

Defined in Text.CSL.Style

Generic Citation Source # 
Instance details

Defined in Text.CSL.Style

Associated Types

type Rep Citation :: Type -> Type Source #

type Rep Citation Source # 
Instance details

Defined in Text.CSL.Style

type Rep Citation = D1 (MetaData "Citation" "Text.CSL.Style" "pandoc-citeproc-0.15.0.1-JmIKT1H3eQpAqEtBoYsGrD" False) (C1 (MetaCons "Citation" PrefixI True) (S1 (MetaSel (Just "citOptions") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Option]) :*: (S1 (MetaSel (Just "citSort") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Sort]) :*: S1 (MetaSel (Just "citLayout") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Layout))))

data Bibliography Source #

Constructors

Bibliography 

Fields

Instances
Data Bibliography Source # 
Instance details

Defined in Text.CSL.Style

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Bibliography -> c Bibliography Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Bibliography Source #

toConstr :: Bibliography -> Constr Source #

dataTypeOf :: Bibliography -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Bibliography) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Bibliography) Source #

gmapT :: (forall b. Data b => b -> b) -> Bibliography -> Bibliography Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Bibliography -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Bibliography -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Bibliography -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Bibliography -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Bibliography -> m Bibliography Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Bibliography -> m Bibliography Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Bibliography -> m Bibliography Source #

Read Bibliography Source # 
Instance details

Defined in Text.CSL.Style

Show Bibliography Source # 
Instance details

Defined in Text.CSL.Style

Generic Bibliography Source # 
Instance details

Defined in Text.CSL.Style

Associated Types

type Rep Bibliography :: Type -> Type Source #

type Rep Bibliography Source # 
Instance details

Defined in Text.CSL.Style

type Rep Bibliography = D1 (MetaData "Bibliography" "Text.CSL.Style" "pandoc-citeproc-0.15.0.1-JmIKT1H3eQpAqEtBoYsGrD" False) (C1 (MetaCons "Bibliography" PrefixI True) (S1 (MetaSel (Just "bibOptions") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Option]) :*: (S1 (MetaSel (Just "bibSort") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Sort]) :*: S1 (MetaSel (Just "bibLayout") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Layout))))

data Cite Source #

Instances
Eq Cite Source # 
Instance details

Defined in Text.CSL.Style

Methods

(==) :: Cite -> Cite -> Bool Source #

(/=) :: Cite -> Cite -> Bool Source #

Data Cite Source # 
Instance details

Defined in Text.CSL.Style

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Cite -> c Cite Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Cite Source #

toConstr :: Cite -> Constr Source #

dataTypeOf :: Cite -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Cite) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Cite) Source #

gmapT :: (forall b. Data b => b -> b) -> Cite -> Cite Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Cite -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Cite -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Cite -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Cite -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Cite -> m Cite Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Cite -> m Cite Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Cite -> m Cite Source #

Show Cite Source # 
Instance details

Defined in Text.CSL.Style

Generic Cite Source # 
Instance details

Defined in Text.CSL.Style

Associated Types

type Rep Cite :: Type -> Type Source #

Methods

from :: Cite -> Rep Cite x Source #

to :: Rep Cite x -> Cite Source #

FromJSON Cite Source # 
Instance details

Defined in Text.CSL.Style

FromJSON [[Cite]] Source # 
Instance details

Defined in Text.CSL.Style

type Rep Cite Source # 
Instance details

Defined in Text.CSL.Style

newtype Abbreviations Source #

Instances
Data Abbreviations Source # 
Instance details

Defined in Text.CSL.Style

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Abbreviations -> c Abbreviations Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Abbreviations Source #

toConstr :: Abbreviations -> Constr Source #

dataTypeOf :: Abbreviations -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Abbreviations) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Abbreviations) Source #

gmapT :: (forall b. Data b => b -> b) -> Abbreviations -> Abbreviations Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Abbreviations -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Abbreviations -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Abbreviations -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Abbreviations -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Abbreviations -> m Abbreviations Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Abbreviations -> m Abbreviations Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Abbreviations -> m Abbreviations Source #

Read Abbreviations Source # 
Instance details

Defined in Text.CSL.Style

Show Abbreviations Source # 
Instance details

Defined in Text.CSL.Style

Generic Abbreviations Source # 
Instance details

Defined in Text.CSL.Style

Associated Types

type Rep Abbreviations :: Type -> Type Source #

FromJSON Abbreviations Source # 
Instance details

Defined in Text.CSL.Style

type Rep Abbreviations Source # 
Instance details

Defined in Text.CSL.Style

type Rep Abbreviations = D1 (MetaData "Abbreviations" "Text.CSL.Style" "pandoc-citeproc-0.15.0.1-JmIKT1H3eQpAqEtBoYsGrD" True) (C1 (MetaCons "Abbreviations" PrefixI True) (S1 (MetaSel (Just "unAbbreviations") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Map String (Map String (Map String String))))))

High Level Processing

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

With a Style, a list of References and the list of Citations, produce the Formatted for each citation group and the bibliography.

processCitations :: ProcOpts -> Style -> [Reference] -> Citations -> [Formatted] Source #

With a Style, a list of References and the list of citation groups (the list of citations with their locator), produce the Formatted for each citation group.

processBibliography :: ProcOpts -> Style -> [Reference] -> [Formatted] Source #

With a Style and the list of References produce the Formatted for the bibliography.

data BiblioData Source #

Constructors

BD 
Instances
Data BiblioData Source # 
Instance details

Defined in Text.CSL.Style

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> BiblioData -> c BiblioData Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c BiblioData Source #

toConstr :: BiblioData -> Constr Source #

dataTypeOf :: BiblioData -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c BiblioData) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BiblioData) Source #

gmapT :: (forall b. Data b => b -> b) -> BiblioData -> BiblioData Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> BiblioData -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> BiblioData -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> BiblioData -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> BiblioData -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> BiblioData -> m BiblioData Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> BiblioData -> m BiblioData Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> BiblioData -> m BiblioData Source #

Show BiblioData Source # 
Instance details

Defined in Text.CSL.Style

Generic BiblioData Source # 
Instance details

Defined in Text.CSL.Style

Associated Types

type Rep BiblioData :: Type -> Type Source #

type Rep BiblioData Source # 
Instance details

Defined in Text.CSL.Style

type Rep BiblioData = D1 (MetaData "BiblioData" "Text.CSL.Style" "pandoc-citeproc-0.15.0.1-JmIKT1H3eQpAqEtBoYsGrD" False) (C1 (MetaCons "BD" PrefixI True) (S1 (MetaSel (Just "citations") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Formatted]) :*: (S1 (MetaSel (Just "bibliography") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Formatted]) :*: S1 (MetaSel (Just "citationIds") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [String]))))

The output and the rendering functions

renderPlain :: Formatted -> String Source #

Render the Formatted into a plain text string.