citeproc-hs-0.3.8: A Citation Style Language implementation in Haskell

Portability | unportable
Stability | unstable
Maintainer | Andrea Rossato <andrea.rossato@unitn.it>
Safe Haskell | None

Text.CSL.Input.Json

Description

A module for reading Json CSL data.

Synopsis

- readJsonInput :: FilePath -> IO [Reference]
- readJsonInputString :: String -> [Reference]
- readJsonFile :: FilePath -> IO JSValue
- readJsonString :: String -> JSValue
- readJsonAbbrevFile :: FilePath -> IO [Abbrev]
- readJsonAbbrev :: JSValue -> [Abbrev]
- readJsonCitations :: JSValue -> [Cite]
- editJsonCiteItems :: (String, JSValue) -> (String, JSValue)
- editJsonInput :: (String, JSValue) -> (String, JSValue)
- toString :: JSValue -> JSValue
- toJSBool :: JSValue -> JSValue
- procJSObject :: ((String, JSValue) -> (String, JSValue)) -> JSValue -> JSValue
- mapJSArray :: (JSValue -> JSValue) -> JSValue -> JSValue
- isRefDate :: String -> Bool
- readJSData :: Data a => JSValue -> Result a
- readType :: Data a => JSValue -> Result a
- selectFields :: [(String, JSValue)] -> [String] -> Result [JSValue]
- fromObj :: JSValue -> [(String, JSValue)]
- fromJString :: JSValue -> String
- defaultJson :: [(String, JSValue)]

# Documentation

readJsonInput :: FilePath -> IO [Reference]

readJsonInputString :: String -> [Reference]

readJsonFile :: FilePath -> IO JSValue

readJsonString :: String -> JSValue

readJsonAbbrevFile :: FilePath -> IO [Abbrev]

readJsonAbbrev :: JSValue -> [Abbrev]

readJsonCitations :: JSValue -> [Cite]

editJsonCiteItems :: (String, JSValue) -> (String, JSValue)

editJsonInput :: (String, JSValue) -> (String, JSValue)

toString :: JSValue -> JSValue

toJSBool :: JSValue -> JSValue

procJSObject :: ((String, JSValue) -> (String, JSValue)) -> JSValue -> JSValue

mapJSArray :: (JSValue -> JSValue) -> JSValue -> JSValue

isRefDate :: String -> Bool

readJSData :: Data a => JSValue -> Result a

readType :: Data a => JSValue -> Result a

Build a datatype from a JSON object. Uses selectFields which allows to provied default values for fields not present in the JSON object. Useble with non algebraic datatype with record fields.

selectFields :: [(String, JSValue)] -> [String] -> Result [JSValue]

fromObj :: JSValue -> [(String, JSValue)]

fromJString :: JSValue -> String

defaultJson :: [(String, JSValue)]