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

Copyright | (c) Andrea Rossato
License | BSD-style (see LICENSE)
Maintainer | Andrea Rossato <andrea.rossato@unitn.it>
Stability | unstable
Portability | unportable
Safe Haskell | None
Language | Haskell98

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