{-# OPTIONS_HADDOCK prune, ignore-exports #-} {-# LANGUAGE ViewPatterns, PatternGuards, PatternSynonyms #-} import Text.Pandoc.JSON import Text.Pandoc.Walk (walk) import Text.Pandoc.Shared (stringify) import Text.Pandoc.XML (escapeStringForXML) import qualified Data.Map as M import Data.String.Utils (replace) import Text.LaTeX.Base.Syntax (protectString) #if MIN_VERSION_pandoc(2,0,0) #define MBPLAIN Plain #else #define MBPLAIN Para #endif pattern Style x <- Math InlineMath x pattern Alt x <- (dropWhile (== Space) -> x) type MMap = M.Map String MetaValue type PureInlineParams = ([Inline], Target) -- style:(alt, target) type InlineParams = (Inline, [Inline], Target) -- (style:alt, target) type InlineCons = [Inline] -> Target -> Inline -- Image or Link -- | Applies style found in the metadata of the document for various objects -- -- Styling is supported for following types of objects: -- -- * Standalone images -- -- * Inline images -- -- * Links -- -- * Paragraphs (with restrictions, see below) -- -- Styles are read from the metadata of the document: they may reside inside -- the document or in a separate YAML file. For example -- -- > --- -- > img_style : -- > html : | -- >