citeproc-hs-0.3.9: 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]Source

readJsonInputString :: String -> [Reference]Source

readJsonFile :: FilePath -> IO JSValue Source

readJsonString :: String -> JSValue Source

readJsonAbbrevFile :: FilePath -> IO [Abbrev]Source

readJsonAbbrev :: JSValue -> [Abbrev]Source

readJsonCitations :: JSValue -> [Cite]Source

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

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

toString :: JSValue -> JSValue Source

toJSBool :: JSValue -> JSValue Source

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

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

isRefDate :: String -> Bool Source

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

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

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]Source

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

fromJString :: JSValue -> String Source

defaultJson :: [(String, JSValue)]Source