Text.CSL.Eval.Common

pandoc-citeproc-0.10.4.1: Supports using pandoc with citeproc

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.Eval.Common

Description

The CSL implementation

Synopsis

- data EvalState = EvalState {
  - ref :: ReferenceMap
  - env :: Environment
  - debug :: [String]
  - mode :: EvalMode
  - disamb :: Bool
  - consume :: Bool
  - authSub :: [String]
  - consumed :: [String]
  - edtrans :: Bool
  - etal :: [[Output]]
  - contNum :: [Agent]
  - lastName :: [Output]
  }
- data Environment = Env {
  - cite :: Cite
  - terms :: [CslTerm]
  - macros :: [MacroMap]
  - dates :: [Element]
  - options :: [Option]
  - names :: [Element]
  - abbrevs :: Abbreviations
  }
- data EvalMode
  - = EvalSorting Cite
  - | EvalCite Cite
  - | EvalBiblio Cite
- isSorting :: EvalMode -> Bool
- getAbbreviation :: Abbreviations -> String -> String -> String
- getTerm :: Bool -> Form -> String -> State EvalState String
- getStringVar :: String -> State EvalState String
- getDateVar :: String -> State EvalState [RefDate]
- getLocVar :: State EvalState (String, String)
- getVar :: a -> (Value -> a) -> String -> State EvalState a
- getAgents :: String -> State EvalState [Agent]
- getAgents' :: String -> State EvalState [Agent]
- getStringValue :: Value -> String
- getOptionVal :: String -> [Option] -> String
- isOptionSet :: String -> [Option] -> Bool
- isTitleVar :: String -> Bool
- isTitleShortVar :: String -> Bool
- getTitleShort :: String -> State EvalState String
- isVarSet :: String -> State EvalState Bool
- withRefMap :: (ReferenceMap -> a) -> State EvalState a
- formatVariable :: String -> String
- consumeVariable :: String -> State EvalState ()
- consuming :: State EvalState a -> State EvalState a
- when' :: Monad m => m Bool -> m [a] -> m [a]
- whenElse :: Monad m => m Bool -> m a -> m a -> m a
- concatMapM :: (Monad m, Functor m, Eq b) => (a -> m [b]) -> [a] -> m [b]

# Documentation

data EvalState #

Constructors

EvalState |
Fields ref :: ReferenceMap env :: Environment debug :: [String] mode :: EvalMode disamb :: Bool consume :: Bool authSub :: [String] consumed :: [String] edtrans :: Bool etal :: [[Output]] contNum :: [Agent] lastName :: [Output]

Instances

Show EvalState # |
Methods showsPrec :: Int -> EvalState -> ShowS # show :: EvalState -> String # showList :: [EvalState] -> ShowS #

data Environment #

Constructors

Env |
Fields cite :: Cite terms :: [CslTerm] macros :: [MacroMap] dates :: [Element] options :: [Option] names :: [Element] abbrevs :: Abbreviations

Instances

Show Environment # |
Methods showsPrec :: Int -> Environment -> ShowS # show :: Environment -> String # showList :: [Environment] -> ShowS #

data EvalMode #

Constructors

EvalSorting Cite |
EvalCite Cite |
EvalBiblio Cite |

Instances

Eq EvalMode # |
Methods (==) :: EvalMode -> EvalMode -> Bool # (/=) :: EvalMode -> EvalMode -> Bool #
Show EvalMode # |
Methods showsPrec :: Int -> EvalMode -> ShowS # show :: EvalMode -> String # showList :: [EvalMode] -> ShowS #

isSorting :: EvalMode -> Bool #

getAbbreviation :: Abbreviations -> String -> String -> String #

With the variable name and the variable value search for an abbreviation or return an empty string.

getTerm :: Bool -> Form -> String -> State EvalState String #

If the first parameter is `True` the plural form will be retrieved.

getStringVar :: String -> State EvalState String #

getDateVar :: String -> State EvalState [RefDate] #

getLocVar :: State EvalState (String, String) #

getVar :: a -> (Value -> a) -> String -> State EvalState a #

getAgents :: String -> State EvalState [Agent] #

getAgents' :: String -> State EvalState [Agent] #

getStringValue :: Value -> String #

getOptionVal :: String -> [Option] -> String #

isOptionSet :: String -> [Option] -> Bool #

isTitleVar :: String -> Bool #

isTitleShortVar :: String -> Bool #

getTitleShort :: String -> State EvalState String #

isVarSet :: String -> State EvalState Bool #

withRefMap :: (ReferenceMap -> a) -> State EvalState a #

formatVariable :: String -> String #

Convert variable to lower case, translating underscores ("_") to dashes ("-")

consumeVariable :: String -> State EvalState () #

consuming :: State EvalState a -> State EvalState a #

when' :: Monad m => m Bool -> m [a] -> m [a] #

whenElse :: Monad m => m Bool -> m a -> m a -> m a #

concatMapM :: (Monad m, Functor m, Eq b) => (a -> m [b]) -> [a] -> m [b] #