-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Pandoc filter for cross-references
--   
--   pandoc-crossref is a pandoc filter for numbering figures, equations,
--   tables and cross-references to them.
@package pandoc-crossref
@version 0.2.0.1


-- | Public interface to pandoc-crossref library
--   
--   Example of use:
--   
--   <pre>
--   import Text.Pandoc
--   import Text.Pandoc.JSON
--   
--   import Text.Pandoc.CrossRef
--   
--   main :: IO ()
--   main = toJSONFilter go
--     where
--       go fmt p@(Pandoc meta _) = runCrossRefIO meta fmt action p
--         where
--           action (Pandoc _ bs) = do
--             meta' &lt;- crossRefMeta
--             bs' &lt;- crossRefBlocks bs
--             return $ Pandoc meta' bs'
--   </pre>
--   
--   This module also exports utility functions for setting up
--   meta-settings for pandoc-crossref. Refer to documentation for a
--   complete list of metadata field names. All functions accept a single
--   argument of type, returned by <a>Text.Pandoc.Builder</a> functions,
--   and return <a>Meta</a>.
--   
--   Example:
--   
--   <pre>
--   runCrossRefIO meta fmt crossRefBlocks blocks
--     where
--       meta =
--            figureTitle (str "Figura")
--         &lt;&gt; tableTitle (str "Tabla")
--         &lt;&gt; figPrefix (str "fig.")
--         &lt;&gt; eqnPrefix (str "ec.")
--         &lt;&gt; tblPrefix (str "tbl.")
--         &lt;&gt; loftitle (header 1 $ text "Lista de figuras")
--         &lt;&gt; lotTitle (header 1 $ text "Lista de tablas")
--         &lt;&gt; chaptersDepth (MetaString "2")
--   </pre>
module Text.Pandoc.CrossRef

-- | Walk over blocks, while inserting cross-references, list-of, etc.
--   
--   Works in <a>CrossRefM</a> monad.
crossRefBlocks :: [Block] -> CrossRefM [Block]

-- | Modifies metadata for LaTeX output, adding header-includes
--   instructions to setup custom and builtin environments.
--   
--   Note, that if output format is not "latex", this function does
--   nothing.
--   
--   Works in <a>CrossRefM</a> monad.
crossRefMeta :: CrossRefM Meta

-- | Combines <a>crossRefMeta</a> and <a>crossRefBlocks</a>
--   
--   Works in <a>CrossRefM</a> monad.
defaultCrossRefAction :: Pandoc -> CrossRefM Pandoc

-- | Run an action in <a>CrossRefM</a> monad with argument, and return pure
--   result.
--   
--   This is primary function to work with <a>CrossRefM</a>
runCrossRef :: Meta -> Maybe Format -> (a -> CrossRefM b) -> a -> b

-- | Run an action in <a>CrossRefM</a> monad with argument, and return
--   <a>IO</a> result.
--   
--   This function will attempt to read pandoc-crossref settings from
--   settings file specified by crossrefYaml metadata field.
runCrossRefIO :: Meta -> Maybe Format -> (a -> CrossRefM b) -> a -> IO b

-- | Essentially a reader monad for basic pandoc-crossref environment
type CrossRefM a = Reader CrossRefEnv a

-- | Enviromnent for <a>CrossRefM</a>
data CrossRefEnv
CrossRefEnv :: Meta -> Options -> CrossRefEnv

-- | Metadata settings
[creSettings] :: CrossRefEnv -> Meta

-- | Internal pandoc-crossref options
[creOptions] :: CrossRefEnv -> Options
