Hoogle Search
Within LTS Haskell 23.26 (ghc-9.8.4)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
Functions for serializing the Pandoc AST to JSON and deserializing from JSON. Example of use: The following script (capitalize.hs) reads reads a JSON representation of a Pandoc document from stdin, and writes a JSON representation of a Pandoc document to stdout. It changes all regular text in the document to uppercase, without affecting URLs, code, tags, etc. Run the script with
pandoc -t json | runghc capitalize.hs | pandoc -f json
or (making capitalize.hs executable)pandoc --filter ./capitalize.hs
#!/usr/bin/env runghc import Text.Pandoc.JSON import Data.Char (toUpper) main :: IO () main = toJSONFilter capitalizeStrings capitalizeStrings :: Inline -> Inline capitalizeStrings (Str s) = Str $ map toUpper s capitalizeStrings x = x
JSONFilter :: FilePath -> Filterpandoc Text.Pandoc.App No documentation available.
JSONFilter :: FilePath -> Filterpandoc Text.Pandoc.Filter No documentation available.
class
ToJSONFilter (m :: Type -> Type) apandoc-types Text.Pandoc.JSON toJSONFilter convert a function into a filter that reads pandoc's JSON serialized output from stdin, transforms it by walking the AST and applying the specified function, and serializes the result as JSON to stdout. For a straight transformation, use a function of type a -> a or a -> IO a where a = Block, Inline, Pandoc, Meta, or MetaValue. If your transformation needs to be sensitive to the script's arguments, use a function of type [String] -> a -> a (with a constrained as above). The [String] will be populated with the script's arguments. An alternative is to use the type Maybe Format -> a -> a. This is appropriate when the first argument of the script (if present) will be the target format, and allows scripts to behave differently depending on the target format. The pandoc executable automatically provides the target format as argument when scripts are called using the `--filter` option.
toJSONFilter :: ToJSONFilter m a => a -> m ()pandoc-types Text.Pandoc.JSON No documentation available.
applyJSONFilter :: MonadIO m => Environment -> [String] -> FilePath -> Pandoc -> m Pandocpandoc Text.Pandoc.Filter No documentation available.
readCslJson :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandocpandoc Text.Pandoc.Readers Read CSL JSON from an input string and return a Pandoc document. The document will have only metadata, with an empty body. The metadata will contain a references field with the bibliography entries, and a nocite field with the wildcard `[@*]`.
readJSON :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandocpandoc Text.Pandoc.Readers Read pandoc document from JSON format.
module Text.Pandoc.Readers.
CslJson Parses CSL JSON bibliographies into a Pandoc document with empty body and references and nocite fields in the metadata. A wildcard nocite is used so that if the document is rendered in another format, the entire bibliography will be printed. https://citeproc-js.readthedocs.io/en/latest/csl-json/markup.html.
readCslJson :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandocpandoc Text.Pandoc.Readers.CslJson Read CSL JSON from an input string and return a Pandoc document. The document will have only metadata, with an empty body. The metadata will contain a references field with the bibliography entries, and a nocite field with the wildcard `[@*]`.
Page 1 of 2 | Next