citeproc-0.8.1: Generates citations and bibliography from CSL styles.

Safe Haskell | None
Language | Haskell2010

Citeproc

Description

Process citations using the formatting instructions encoded in a CSL stylesheet. The library targets version 1.0.1 of the CSL spec: https://docs.citationstyles.org/en/stable/specification.html

Synopsis

- module Citeproc.Types
- module Citeproc.Style
- module Citeproc.Locale
- citeproc :: CiteprocOutput a => CiteprocOptions -> Style a -> Maybe Lang -> [Reference a] -> [Citation a] -> Result a
- data Result a = Result {
  - resultCitations :: [a]
  - resultBibliography :: [(Text, a)]
  - resultWarnings :: [Text]
  }

# Documentation

module Citeproc.Types

module Citeproc.Style

module Citeproc.Locale

citeproc #

Arguments

:: CiteprocOutput a |
=> CiteprocOptions | Rendering options
-> Style a | Parsed CSL style
-> Maybe Lang | Overrides default locale for style
-> [Reference a] | List of references (bibliographic data)
-> [Citation a] | List of citations to process
-> Result a |

Process a list of `Citation`s, producing formatted citations and a bibliography according to the rules of a CSL `Style`. If a `Lang` is specified, override the style's default locale. To obtain a `Style` from an XML stylesheet, use `parseStyle` from Citeproc.Style.

data Result a #

Result of citation processing.

Constructors

Result |

Fields

- resultCitations :: [a]

  List of formatted citations corresponding to the citations given to `citeproc`

- resultBibliography :: [(Text, a)]

  List of formatted bibliography entries (if the style calls for a bibliography), each a pair consisting of the item identifier and the formatted entry

- resultWarnings :: [Text]

  Warnings from citation processing

#### Instances

Instances details

Foldable Result # |

Instance details

Defined in Citeproc.Types

Methods

fold :: Monoid m => Result m -> m #

foldMap :: Monoid m => (a -> m) -> Result a -> m #

foldMap' :: Monoid m => (a -> m) -> Result a -> m #

foldr :: (a -> b -> b) -> b -> Result a -> b #

foldr' :: (a -> b -> b) -> b -> Result a -> b #

foldl :: (b -> a -> b) -> b -> Result a -> b #

foldl' :: (b -> a -> b) -> b -> Result a -> b #

foldr1 :: (a -> a -> a) -> Result a -> a #

foldl1 :: (a -> a -> a) -> Result a -> a #

toList :: Result a -> [a] #

null :: Result a -> Bool #

length :: Result a -> Int #

elem :: Eq a => a -> Result a -> Bool #

maximum :: Ord a => Result a -> a #

minimum :: Ord a => Result a -> a #

sum :: Num a => Result a -> a #

product :: Num a => Result a -> a #

Traversable Result # |
Instance details Defined in Citeproc.Types Methods traverse :: Applicative f => (a -> f b) -> Result a -> f (Result b) # sequenceA :: Applicative f => Result (f a) -> f (Result a) # mapM :: Monad m => (a -> m b) -> Result a -> m (Result b) # sequence :: Monad m => Result (m a) -> m (Result a) #
Functor Result # |
Instance details Defined in Citeproc.Types Methods fmap :: (a -> b) -> Result a -> Result b # (<$) :: a -> Result b -> Result a #
FromJSON a => FromJSON (Result a) # |
Instance details Defined in Citeproc.Types Methods parseJSON :: Value -> Parser (Result a) # parseJSONList :: Value -> Parser [Result a] # omittedField :: Maybe (Result a) #
ToJSON a => ToJSON (Result a) # |
Instance details Defined in Citeproc.Types Methods toJSON :: Result a -> Value # toEncoding :: Result a -> Encoding # toJSONList :: [Result a] -> Value # toEncodingList :: [Result a] -> Encoding # omitField :: Result a -> Bool #
Show a => Show (Result a) # |
Instance details Defined in Citeproc.Types Methods showsPrec :: Int -> Result a -> ShowS # show :: Result a -> String # showList :: [Result a] -> ShowS #