| Copyright | (c) Andrea Rossato |
|---|---|
| License | BSD-style (see LICENSE) |
| Maintainer | Andrea Rossato <andrea.rossato@unitn.it> |
| Stability | unstable |
| Portability | unportable |
| Safe Haskell | None |
| Language | Haskell2010 |
Text.CSL
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
- readBiblioFile :: (Text -> Bool) -> FilePath -> IO [Reference]
- data BibFormat
- readBiblioString :: (Text -> Bool) -> BibFormat -> Text -> IO [Reference]
- data Reference = Reference {
- refId :: Literal
- refOtherIds :: [Literal]
- refType :: RefType
- author :: [Agent]
- editor :: [Agent]
- translator :: [Agent]
- recipient :: [Agent]
- interviewer :: [Agent]
- composer :: [Agent]
- director :: [Agent]
- illustrator :: [Agent]
- originalAuthor :: [Agent]
- containerAuthor :: [Agent]
- collectionEditor :: [Agent]
- editorialDirector :: [Agent]
- reviewedAuthor :: [Agent]
- issued :: [RefDate]
- eventDate :: [RefDate]
- accessed :: [RefDate]
- container :: [RefDate]
- originalDate :: [RefDate]
- submitted :: [RefDate]
- title :: Formatted
- titleShort :: Formatted
- reviewedTitle :: Formatted
- containerTitle :: Formatted
- volumeTitle :: Formatted
- collectionTitle :: Formatted
- containerTitleShort :: Formatted
- collectionNumber :: Formatted
- originalTitle :: Formatted
- publisher :: Formatted
- originalPublisher :: Formatted
- publisherPlace :: Formatted
- originalPublisherPlace :: Formatted
- authority :: Formatted
- jurisdiction :: Formatted
- archive :: Formatted
- archivePlace :: Formatted
- archiveLocation :: Formatted
- event :: Formatted
- eventPlace :: Formatted
- page :: Formatted
- pageFirst :: Formatted
- numberOfPages :: Formatted
- version :: Formatted
- volume :: Formatted
- numberOfVolumes :: Formatted
- issue :: Formatted
- chapterNumber :: Formatted
- medium :: Formatted
- status :: Formatted
- edition :: Formatted
- section :: Formatted
- source :: Formatted
- genre :: Formatted
- note :: Formatted
- annote :: Formatted
- abstract :: Formatted
- keyword :: Formatted
- number :: Formatted
- references :: Formatted
- url :: Literal
- doi :: Literal
- isbn :: Literal
- issn :: Literal
- pmcid :: Literal
- pmid :: Literal
- callNumber :: Literal
- dimensions :: Literal
- scale :: Literal
- categories :: [Literal]
- language :: Literal
- citationNumber :: CNum
- firstReferenceNoteNumber :: Int
- citationLabel :: CLabel
- getReference :: [Reference] -> Cite -> Maybe Reference
- setNearNote :: Style -> [[Cite]] -> [[Cite]]
- readCSLFile :: Maybe Text -> FilePath -> IO Style
- parseCSL :: Text -> Style
- parseCSL' :: ByteString -> Style
- localizeCSL :: Maybe Text -> Style -> IO Style
- data Style = Style {
- styleVersion :: Text
- styleClass :: Text
- styleInfo :: Maybe CSInfo
- styleDefaultLocale :: Text
- styleLocale :: [Locale]
- styleAbbrevs :: Abbreviations
- csOptions :: [Option]
- csMacros :: [MacroMap]
- citation :: Citation
- biblio :: Maybe Bibliography
- data Citation = Citation {}
- data Bibliography = Bibliography {}
- data Cite = Cite {
- citeId :: Text
- citePrefix :: Formatted
- citeSuffix :: Formatted
- citeLabel :: Text
- citeLocator :: Text
- citeNoteNumber :: Text
- citePosition :: Text
- nearNote :: Bool
- authorInText :: Bool
- suppressAuthor :: Bool
- citeHash :: Int
- newtype Abbreviations = Abbreviations {
- unAbbreviations :: Map Text (Map Text (Map Text Text))
- emptyCite :: Cite
- data ProcOpts = ProcOpts {
- bibOpts :: BibOpts
- linkCitations :: Bool
- procOpts :: ProcOpts
- data BibOpts
- citeproc :: ProcOpts -> Style -> [Reference] -> Citations -> BiblioData
- processCitations :: ProcOpts -> Style -> [Reference] -> Citations -> [Formatted]
- processBibliography :: ProcOpts -> Style -> [Reference] -> [Formatted]
- data BiblioData = BD {
- citations :: [Formatted]
- bibliography :: [Formatted]
- citationIds :: [Text]
- renderPlain :: Formatted -> Text
- renderPandoc :: Style -> Formatted -> [Inline]
- renderPandoc' :: Style -> (Formatted, Text) -> Block
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 $ resultThe 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.
readBiblioString :: (Text -> Bool) -> BibFormat -> Text -> IO [Reference] Source #
Reference Representation
The Reference record.
Constructors
Instances
| Eq Reference Source # | |
| Data Reference Source # | |
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 :: forall r r'. (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 # | |
| Show Reference Source # | |
| Generic Reference Source # | |
| FromJSON Reference Source # | |
Defined in Text.CSL.Reference | |
| ToJSON Reference Source # | |
Defined in Text.CSL.Reference Methods toEncoding :: Reference -> Encoding toJSONList :: [Reference] -> Value toEncodingList :: [Reference] -> Encoding | |
| ToYaml Reference Source # | |
Defined in Text.CSL.Reference | |
| type Rep Reference Source # | |
Defined in Text.CSL.Reference type Rep Reference = D1 ('MetaData "Reference" "Text.CSL.Reference" "pandoc-citeproc-0.17.0.1-J8iSDmxo6419hQFJDEoalT" '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))))))))) | |
CSL Parser, Representation, and Processing
readCSLFile :: Maybe Text -> FilePath -> IO Style Source #
Read and parse a CSL style file into a localized sytle.
localizeCSL :: Maybe Text -> Style -> IO Style Source #
Merge locale into a CSL style.
The Style Types
The representation of a parsed CSL style.
Constructors
| Style | |
Fields
| |
Instances
| Data Style Source # | |
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 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 :: forall r r'. (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 # | |
| Show Style Source # | |
| Generic Style Source # | |
| type Rep Style Source # | |
Defined in Text.CSL.Style type Rep Style = D1 ('MetaData "Style" "Text.CSL.Style" "pandoc-citeproc-0.17.0.1-J8iSDmxo6419hQFJDEoalT" 'False) (C1 ('MetaCons "Style" 'PrefixI 'True) (((S1 ('MetaSel ('Just "styleVersion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "styleClass") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "styleInfo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe CSInfo)) :*: (S1 ('MetaSel ('Just "styleDefaultLocale") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "styleLocale") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Locale])))) :*: ((S1 ('MetaSel ('Just "styleAbbrevs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Abbreviations) :*: S1 ('MetaSel ('Just "csOptions") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Option])) :*: (S1 ('MetaSel ('Just "csMacros") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [MacroMap]) :*: (S1 ('MetaSel ('Just "citation") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Citation) :*: S1 ('MetaSel ('Just "biblio") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bibliography))))))) | |
Instances
| Data Citation Source # | |
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 :: forall r r'. (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 # | |
| Show Citation Source # | |
| Generic Citation Source # | |
| type Rep Citation Source # | |
Defined in Text.CSL.Style type Rep Citation = D1 ('MetaData "Citation" "Text.CSL.Style" "pandoc-citeproc-0.17.0.1-J8iSDmxo6419hQFJDEoalT" '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 | |
Instances
| Data Bibliography Source # | |
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 :: forall r r'. (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 # | |
Defined in Text.CSL.Style Methods readsPrec :: Int -> ReadS Bibliography # readList :: ReadS [Bibliography] # readPrec :: ReadPrec Bibliography # readListPrec :: ReadPrec [Bibliography] # | |
| Show Bibliography Source # | |
Defined in Text.CSL.Style Methods showsPrec :: Int -> Bibliography -> ShowS show :: Bibliography -> String showList :: [Bibliography] -> ShowS | |
| Generic Bibliography Source # | |
Defined in Text.CSL.Style Associated Types type Rep Bibliography :: Type -> Type | |
| type Rep Bibliography Source # | |
Defined in Text.CSL.Style type Rep Bibliography = D1 ('MetaData "Bibliography" "Text.CSL.Style" "pandoc-citeproc-0.17.0.1-J8iSDmxo6419hQFJDEoalT" '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)))) | |
Constructors
| Cite | |
Fields
| |
Instances
| Eq Cite Source # | |
| Data Cite Source # | |
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 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 :: forall r r'. (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 # | |
| Generic Cite Source # | |
| FromJSON Cite Source # | |
Defined in Text.CSL.Style | |
| FromJSON [[Cite]] Source # | |
Defined in Text.CSL.Style | |
| type Rep Cite Source # | |
Defined in Text.CSL.Style type Rep Cite = D1 ('MetaData "Cite" "Text.CSL.Style" "pandoc-citeproc-0.17.0.1-J8iSDmxo6419hQFJDEoalT" 'False) (C1 ('MetaCons "Cite" 'PrefixI 'True) (((S1 ('MetaSel ('Just "citeId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "citePrefix") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Formatted)) :*: (S1 ('MetaSel ('Just "citeSuffix") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Formatted) :*: (S1 ('MetaSel ('Just "citeLabel") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "citeLocator") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))) :*: ((S1 ('MetaSel ('Just "citeNoteNumber") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "citePosition") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "nearNote") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool))) :*: (S1 ('MetaSel ('Just "authorInText") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: (S1 ('MetaSel ('Just "suppressAuthor") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "citeHash") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))))) | |
newtype Abbreviations Source #
Constructors
| Abbreviations | |
Fields
| |
Instances
| Data Abbreviations Source # | |
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 :: forall r r'. (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 # | |
Defined in Text.CSL.Style Methods readsPrec :: Int -> ReadS Abbreviations # readList :: ReadS [Abbreviations] # readPrec :: ReadPrec Abbreviations # readListPrec :: ReadPrec [Abbreviations] # | |
| Show Abbreviations Source # | |
Defined in Text.CSL.Style Methods showsPrec :: Int -> Abbreviations -> ShowS show :: Abbreviations -> String showList :: [Abbreviations] -> ShowS | |
| Generic Abbreviations Source # | |
Defined in Text.CSL.Style Associated Types type Rep Abbreviations :: Type -> Type | |
| FromJSON Abbreviations Source # | |
Defined in Text.CSL.Style | |
| type Rep Abbreviations Source # | |
Defined in Text.CSL.Style type Rep Abbreviations = D1 ('MetaData "Abbreviations" "Text.CSL.Style" "pandoc-citeproc-0.17.0.1-J8iSDmxo6419hQFJDEoalT" 'True) (C1 ('MetaCons "Abbreviations" 'PrefixI 'True) (S1 ('MetaSel ('Just "unAbbreviations") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map Text (Map Text (Map Text Text)))))) | |
High Level Processing
Constructors
| ProcOpts | |
Fields
| |
Constructors
| Select [(Text, Text)] [(Text, Text)] | |
| Include [(Text, Text)] [(Text, Text)] | |
| Exclude [(Text, Text)] [(Text, Text)] |
data BiblioData Source #
Constructors
| BD | |
Fields
| |
Instances
| Data BiblioData Source # | |
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 :: forall r r'. (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 # | |
Defined in Text.CSL.Style Methods showsPrec :: Int -> BiblioData -> ShowS show :: BiblioData -> String showList :: [BiblioData] -> ShowS | |
| Generic BiblioData Source # | |
Defined in Text.CSL.Style Associated Types type Rep BiblioData :: Type -> Type | |
| type Rep BiblioData Source # | |
Defined in Text.CSL.Style type Rep BiblioData = D1 ('MetaData "BiblioData" "Text.CSL.Style" "pandoc-citeproc-0.17.0.1-J8iSDmxo6419hQFJDEoalT" '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.
renderPandoc :: Style -> Formatted -> [Inline] Source #
renderPandoc' :: Style -> (Formatted, Text) -> Block Source #