pandoc-citeproc-0.17: 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 :: (Text -> 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 #

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

toConstr :: Reference -> Constr #

dataTypeOf :: Reference -> DataType #

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

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

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

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

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

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

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

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

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

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

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 #

FromJSON Reference Source # 
Instance details

Defined in Text.CSL.Reference

ToJSON 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.17-C8O1IjUyq0FL1XS6eyOYCQ" 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 Text -> FilePath -> IO Style Source #

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

parseCSL :: Text -> Style Source #

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

localizeCSL :: Maybe Text -> 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 #

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

toConstr :: Style -> Constr #

dataTypeOf :: Style -> DataType #

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

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

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

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

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

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

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

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

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

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

Read Style Source # 
Instance details

Defined in Text.CSL.Style

Show Style Source # 
Instance details

Defined in Text.CSL.Style

Methods

showsPrec :: Int -> Style -> ShowS #

show :: Style -> String #

showList :: [Style] -> ShowS #

Generic Style Source # 
Instance details

Defined in Text.CSL.Style

Associated Types

type Rep Style :: Type -> Type #

Methods

from :: Style -> Rep Style x #

to :: Rep Style x -> Style #

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 #

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

toConstr :: Citation -> Constr #

dataTypeOf :: Citation -> DataType #

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

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

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

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

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

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

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

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

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

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

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 #

Methods

from :: Citation -> Rep Citation x #

to :: Rep Citation x -> Citation #

type Rep Citation Source # 
Instance details

Defined in Text.CSL.Style

type Rep Citation = D1 (MetaData "Citation" "Text.CSL.Style" "pandoc-citeproc-0.17-C8O1IjUyq0FL1XS6eyOYCQ" 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 #

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

toConstr :: Bibliography -> Constr #

dataTypeOf :: Bibliography -> DataType #

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

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

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

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

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

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

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

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

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

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

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 #

type Rep Bibliography Source # 
Instance details

Defined in Text.CSL.Style

type Rep Bibliography = D1 (MetaData "Bibliography" "Text.CSL.Style" "pandoc-citeproc-0.17-C8O1IjUyq0FL1XS6eyOYCQ" 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 #

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

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 #

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

toConstr :: Cite -> Constr #

dataTypeOf :: Cite -> DataType #

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

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

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

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

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

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

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

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

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

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

Show Cite Source # 
Instance details

Defined in Text.CSL.Style

Methods

showsPrec :: Int -> Cite -> ShowS #

show :: Cite -> String #

showList :: [Cite] -> ShowS #

Generic Cite Source # 
Instance details

Defined in Text.CSL.Style

Associated Types

type Rep Cite :: Type -> Type #

Methods

from :: Cite -> Rep Cite x #

to :: Rep Cite x -> Cite #

FromJSON Cite Source # 
Instance details

Defined in Text.CSL.Style

FromJSON [[Cite]] Source # 
Instance details

Defined in Text.CSL.Style

Methods

parseJSON :: Value -> Parser [[Cite]] #

parseJSONList :: Value -> Parser [[[Cite]]] #

type Rep Cite Source # 
Instance details

Defined in Text.CSL.Style

newtype Abbreviations Source #

Constructors

Abbreviations 
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 #

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

toConstr :: Abbreviations -> Constr #

dataTypeOf :: Abbreviations -> DataType #

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

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

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

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

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

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

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

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

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

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

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 #

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.17-C8O1IjUyq0FL1XS6eyOYCQ" True) (C1 (MetaCons "Abbreviations" PrefixI True) (S1 (MetaSel (Just "unAbbreviations") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Map Text (Map Text (Map Text Text))))))

High Level Processing

data ProcOpts Source #

Constructors

ProcOpts 
Instances
Eq ProcOpts Source # 
Instance details

Defined in Text.CSL.Proc

Read ProcOpts Source # 
Instance details

Defined in Text.CSL.Proc

Show ProcOpts Source # 
Instance details

Defined in Text.CSL.Proc

data BibOpts Source #

Constructors

Select [(Text, Text)] [(Text, Text)] 
Include [(Text, Text)] [(Text, Text)] 
Exclude [(Text, Text)] [(Text, Text)] 
Instances
Eq BibOpts Source # 
Instance details

Defined in Text.CSL.Proc

Methods

(==) :: BibOpts -> BibOpts -> Bool #

(/=) :: BibOpts -> BibOpts -> Bool #

Read BibOpts Source # 
Instance details

Defined in Text.CSL.Proc

Show BibOpts Source # 
Instance details

Defined in Text.CSL.Proc

FromJSON BibOpts Source # 
Instance details

Defined in Text.CSL.Proc

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 #

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

toConstr :: BiblioData -> Constr #

dataTypeOf :: BiblioData -> DataType #

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

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

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

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

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

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

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

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

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

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

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 #

type Rep BiblioData Source # 
Instance details

Defined in Text.CSL.Style

type Rep BiblioData = D1 (MetaData "BiblioData" "Text.CSL.Style" "pandoc-citeproc-0.17-C8O1IjUyq0FL1XS6eyOYCQ" 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 [Text]))))

The output and the rendering functions

renderPlain :: Formatted -> Text Source #

Render the Formatted into a plain text string.