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


-- | Types for representing a structured document
--   
--   <tt>Text.Pandoc.Definition</tt> defines the <a>Pandoc</a> data
--   structure, which is used by pandoc to represent structured documents.
--   This module used to live in the pandoc package, but starting with
--   pandoc 1.7, it has been split off, so that other packages can use it
--   without drawing in all of pandoc's dependencies, and pandoc itself can
--   depend on packages (like citeproc-hs) that use them.
--   
--   <tt>Text.Pandoc.Builder</tt> provides functions for building up
--   <tt>Pandoc</tt> structures programmatically.
--   
--   <tt>Text.Pandoc.Generic</tt> provides generic functions for
--   manipulating Pandoc documents.
--   
--   <tt>Text.Pandoc.Walk</tt> provides faster, nongeneric functions for
--   manipulating Pandoc documents.
--   
--   <tt>Text.Pandoc.JSON</tt> provides functions for serializing and
--   deserializing a <tt>Pandoc</tt> structure to and from JSON.
@package pandoc-types
@version 1.23.1


-- | Definition of <a>Pandoc</a> data structure for format-neutral
--   representation of documents.
module Text.Pandoc.Definition
data Pandoc
Pandoc :: Meta -> [Block] -> Pandoc

-- | Metadata for the document: title, authors, date.
newtype Meta
Meta :: Map Text MetaValue -> Meta
[unMeta] :: Meta -> Map Text MetaValue
data MetaValue
MetaMap :: Map Text MetaValue -> MetaValue
MetaList :: [MetaValue] -> MetaValue
MetaBool :: Bool -> MetaValue
MetaString :: Text -> MetaValue
MetaInlines :: [Inline] -> MetaValue
MetaBlocks :: [Block] -> MetaValue
nullMeta :: Meta
isNullMeta :: Meta -> Bool

-- | Retrieve the metadata value for a given <tt>key</tt>.
lookupMeta :: Text -> Meta -> Maybe MetaValue

-- | Extract document title from metadata; works just like the old
--   <tt>docTitle</tt>.
docTitle :: Meta -> [Inline]

-- | Extract document authors from metadata; works just like the old
--   <tt>docAuthors</tt>.
docAuthors :: Meta -> [[Inline]]

-- | Extract date from metadata; works just like the old <tt>docDate</tt>.
docDate :: Meta -> [Inline]

-- | Block element.
data Block

-- | Plain text, not a paragraph
Plain :: [Inline] -> Block

-- | Paragraph
Para :: [Inline] -> Block

-- | Multiple non-breaking lines
LineBlock :: [[Inline]] -> Block

-- | Code block (literal) with attributes
CodeBlock :: Attr -> Text -> Block

-- | Raw block
RawBlock :: Format -> Text -> Block

-- | Block quote (list of blocks)
BlockQuote :: [Block] -> Block

-- | Ordered list (attributes and a list of items, each a list of blocks)
OrderedList :: ListAttributes -> [[Block]] -> Block

-- | Bullet list (list of items, each a list of blocks)
BulletList :: [[Block]] -> Block

-- | Definition list. Each list item is a pair consisting of a term (a list
--   of inlines) and one or more definitions (each a list of blocks)
DefinitionList :: [([Inline], [[Block]])] -> Block

-- | Header - level (integer) and text (inlines)
Header :: Int -> Attr -> [Inline] -> Block

-- | Horizontal rule
HorizontalRule :: Block

-- | Table, with attributes, caption, optional short caption, column
--   alignments and widths (required), table head, table bodies, and table
--   foot
Table :: Attr -> Caption -> [ColSpec] -> TableHead -> [TableBody] -> TableFoot -> Block

-- | Figure, with attributes, caption, and content (list of blocks)
Figure :: Attr -> Caption -> [Block] -> Block

-- | Generic block container with attributes
Div :: Attr -> [Block] -> Block

-- | Bidirectional patter synonym
--   
--   It can pass as a Block constructor
--   
--   <pre>
--   &gt;&gt;&gt; SimpleFigure nullAttr [] (T.pack "", T.pack "title")
--   Para [Image ("",[],[]) [] ("","fig:title")]
--   </pre>
--   
--   It can be used to pattern match &gt;&gt;&gt; let img = Para [Image
--   undefined undefined (undefined, T.pack "title")] &gt;&gt;&gt; case img
--   of { SimpleFigure _ _ _ -&gt; True; _ -&gt; False } False &gt;&gt;&gt;
--   let fig = Para [Image undefined undefined (undefined, T.pack
--   "fig:title")] &gt;&gt;&gt; case fig of { SimpleFigure _ _ tit -&gt;
--   snd tit; _ -&gt; T.pack "" } "title"
pattern SimpleFigure :: Attr -> [Inline] -> Target -> Block

-- | Inline elements.
data Inline

-- | Text (string)
Str :: Text -> Inline

-- | Emphasized text (list of inlines)
Emph :: [Inline] -> Inline

-- | Underlined text (list of inlines)
Underline :: [Inline] -> Inline

-- | Strongly emphasized text (list of inlines)
Strong :: [Inline] -> Inline

-- | Strikeout text (list of inlines)
Strikeout :: [Inline] -> Inline

-- | Superscripted text (list of inlines)
Superscript :: [Inline] -> Inline

-- | Subscripted text (list of inlines)
Subscript :: [Inline] -> Inline

-- | Small caps text (list of inlines)
SmallCaps :: [Inline] -> Inline

-- | Quoted text (list of inlines)
Quoted :: QuoteType -> [Inline] -> Inline

-- | Citation (list of inlines)
Cite :: [Citation] -> [Inline] -> Inline

-- | Inline code (literal)
Code :: Attr -> Text -> Inline

-- | Inter-word space
Space :: Inline

-- | Soft line break
SoftBreak :: Inline

-- | Hard line break
LineBreak :: Inline

-- | TeX math (literal)
Math :: MathType -> Text -> Inline

-- | Raw inline
RawInline :: Format -> Text -> Inline

-- | Hyperlink: alt text (list of inlines), target
Link :: Attr -> [Inline] -> Target -> Inline

-- | Image: alt text (list of inlines), target
Image :: Attr -> [Inline] -> Target -> Inline

-- | Footnote or endnote
Note :: [Block] -> Inline

-- | Generic inline container with attributes
Span :: Attr -> [Inline] -> Inline

-- | List attributes. The first element of the triple is the start number
--   of the list.
type ListAttributes = (Int, ListNumberStyle, ListNumberDelim)

-- | Style of list numbers.
data ListNumberStyle
DefaultStyle :: ListNumberStyle
Example :: ListNumberStyle
Decimal :: ListNumberStyle
LowerRoman :: ListNumberStyle
UpperRoman :: ListNumberStyle
LowerAlpha :: ListNumberStyle
UpperAlpha :: ListNumberStyle

-- | Delimiter of list numbers.
data ListNumberDelim
DefaultDelim :: ListNumberDelim
Period :: ListNumberDelim
OneParen :: ListNumberDelim
TwoParens :: ListNumberDelim

-- | Formats for raw blocks
newtype Format
Format :: Text -> Format

-- | Attributes: identifier, classes, key-value pairs
type Attr = (Text, [Text], [(Text, Text)])
nullAttr :: Attr

-- | The caption of a table or figure, with optional short caption.
data Caption
Caption :: Maybe ShortCaption -> [Block] -> Caption

-- | A short caption, for use in, for instance, lists of figures.
type ShortCaption = [Inline]

-- | The number of columns taken up by the row head of each row of a
--   <a>TableBody</a>. The row body takes up the remaining columns.
newtype RowHeadColumns
RowHeadColumns :: Int -> RowHeadColumns

-- | Alignment of a table column.
data Alignment
AlignLeft :: Alignment
AlignRight :: Alignment
AlignCenter :: Alignment
AlignDefault :: Alignment

-- | The width of a table column, as a percentage of the text width.
data ColWidth
ColWidth :: Double -> ColWidth
ColWidthDefault :: ColWidth

-- | The specification for a single table column.
type ColSpec = (Alignment, ColWidth)

-- | A table row.
data Row
Row :: Attr -> [Cell] -> Row

-- | The head of a table.
data TableHead
TableHead :: Attr -> [Row] -> TableHead

-- | A body of a table, with an intermediate head, intermediate body, and
--   the specified number of row header columns in the intermediate body.
data TableBody
TableBody :: Attr -> RowHeadColumns -> [Row] -> [Row] -> TableBody

-- | The foot of a table.
data TableFoot
TableFoot :: Attr -> [Row] -> TableFoot

-- | A table cell.
data Cell
Cell :: Attr -> Alignment -> RowSpan -> ColSpan -> [Block] -> Cell

-- | The number of rows occupied by a cell; the height of a cell.
newtype RowSpan
RowSpan :: Int -> RowSpan

-- | The number of columns occupied by a cell; the width of a cell.
newtype ColSpan
ColSpan :: Int -> ColSpan

-- | Type of quotation marks to use in Quoted inline.
data QuoteType
SingleQuote :: QuoteType
DoubleQuote :: QuoteType

-- | Link target (URL, title).
type Target = (Text, Text)

-- | Type of math element (display or inline).
data MathType
DisplayMath :: MathType
InlineMath :: MathType
data Citation
Citation :: Text -> [Inline] -> [Inline] -> CitationMode -> Int -> Int -> Citation
[citationId] :: Citation -> Text
[citationPrefix] :: Citation -> [Inline]
[citationSuffix] :: Citation -> [Inline]
[citationMode] :: Citation -> CitationMode
[citationNoteNum] :: Citation -> Int
[citationHash] :: Citation -> Int
data CitationMode
AuthorInText :: CitationMode
SuppressAuthor :: CitationMode
NormalCitation :: CitationMode
pandocTypesVersion :: Version
instance Data.Aeson.Types.ToJSON.ToJSON Text.Pandoc.Definition.MetaValue
instance Data.Aeson.Types.FromJSON.FromJSON Text.Pandoc.Definition.MetaValue
instance Data.Aeson.Types.ToJSON.ToJSON Text.Pandoc.Definition.CitationMode
instance Data.Aeson.Types.FromJSON.FromJSON Text.Pandoc.Definition.CitationMode
instance Data.Aeson.Types.ToJSON.ToJSON Text.Pandoc.Definition.Citation
instance Data.Aeson.Types.FromJSON.FromJSON Text.Pandoc.Definition.Citation
instance Data.Aeson.Types.ToJSON.ToJSON Text.Pandoc.Definition.QuoteType
instance Data.Aeson.Types.FromJSON.FromJSON Text.Pandoc.Definition.QuoteType
instance Data.Aeson.Types.ToJSON.ToJSON Text.Pandoc.Definition.MathType
instance Data.Aeson.Types.FromJSON.FromJSON Text.Pandoc.Definition.MathType
instance Data.Aeson.Types.ToJSON.ToJSON Text.Pandoc.Definition.ListNumberStyle
instance Data.Aeson.Types.FromJSON.FromJSON Text.Pandoc.Definition.ListNumberStyle
instance Data.Aeson.Types.ToJSON.ToJSON Text.Pandoc.Definition.ListNumberDelim
instance Data.Aeson.Types.FromJSON.FromJSON Text.Pandoc.Definition.ListNumberDelim
instance Data.Aeson.Types.ToJSON.ToJSON Text.Pandoc.Definition.Alignment
instance Data.Aeson.Types.FromJSON.FromJSON Text.Pandoc.Definition.Alignment
instance Data.Aeson.Types.ToJSON.ToJSON Text.Pandoc.Definition.ColWidth
instance Data.Aeson.Types.FromJSON.FromJSON Text.Pandoc.Definition.ColWidth
instance Data.Aeson.Types.ToJSON.ToJSON Text.Pandoc.Definition.Row
instance Data.Aeson.Types.FromJSON.FromJSON Text.Pandoc.Definition.Row
instance Data.Aeson.Types.ToJSON.ToJSON Text.Pandoc.Definition.Caption
instance Data.Aeson.Types.FromJSON.FromJSON Text.Pandoc.Definition.Caption
instance Data.Aeson.Types.ToJSON.ToJSON Text.Pandoc.Definition.TableHead
instance Data.Aeson.Types.FromJSON.FromJSON Text.Pandoc.Definition.TableHead
instance Data.Aeson.Types.ToJSON.ToJSON Text.Pandoc.Definition.TableBody
instance Data.Aeson.Types.FromJSON.FromJSON Text.Pandoc.Definition.TableBody
instance Data.Aeson.Types.ToJSON.ToJSON Text.Pandoc.Definition.TableFoot
instance Data.Aeson.Types.FromJSON.FromJSON Text.Pandoc.Definition.TableFoot
instance Data.Aeson.Types.ToJSON.ToJSON Text.Pandoc.Definition.Cell
instance Data.Aeson.Types.FromJSON.FromJSON Text.Pandoc.Definition.Cell
instance Data.Aeson.Types.ToJSON.ToJSON Text.Pandoc.Definition.Inline
instance Data.Aeson.Types.FromJSON.FromJSON Text.Pandoc.Definition.Inline
instance Data.Aeson.Types.ToJSON.ToJSON Text.Pandoc.Definition.Block
instance Data.Aeson.Types.FromJSON.FromJSON Text.Pandoc.Definition.Block
instance Data.Aeson.Types.FromJSON.FromJSON Text.Pandoc.Definition.Meta
instance Data.Aeson.Types.ToJSON.ToJSON Text.Pandoc.Definition.Meta
instance Data.Aeson.Types.FromJSON.FromJSON Text.Pandoc.Definition.Pandoc
instance Data.Aeson.Types.ToJSON.ToJSON Text.Pandoc.Definition.Pandoc
instance Control.DeepSeq.NFData Text.Pandoc.Definition.MetaValue
instance Control.DeepSeq.NFData Text.Pandoc.Definition.Meta
instance Control.DeepSeq.NFData Text.Pandoc.Definition.Citation
instance Control.DeepSeq.NFData Text.Pandoc.Definition.Alignment
instance Control.DeepSeq.NFData Text.Pandoc.Definition.RowSpan
instance Control.DeepSeq.NFData Text.Pandoc.Definition.ColSpan
instance Control.DeepSeq.NFData Text.Pandoc.Definition.Cell
instance Control.DeepSeq.NFData Text.Pandoc.Definition.Row
instance Control.DeepSeq.NFData Text.Pandoc.Definition.TableHead
instance Control.DeepSeq.NFData Text.Pandoc.Definition.TableBody
instance Control.DeepSeq.NFData Text.Pandoc.Definition.TableFoot
instance Control.DeepSeq.NFData Text.Pandoc.Definition.Caption
instance Control.DeepSeq.NFData Text.Pandoc.Definition.Inline
instance Control.DeepSeq.NFData Text.Pandoc.Definition.MathType
instance Control.DeepSeq.NFData Text.Pandoc.Definition.Format
instance Control.DeepSeq.NFData Text.Pandoc.Definition.CitationMode
instance Control.DeepSeq.NFData Text.Pandoc.Definition.QuoteType
instance Control.DeepSeq.NFData Text.Pandoc.Definition.ListNumberDelim
instance Control.DeepSeq.NFData Text.Pandoc.Definition.ListNumberStyle
instance Control.DeepSeq.NFData Text.Pandoc.Definition.ColWidth
instance Control.DeepSeq.NFData Text.Pandoc.Definition.RowHeadColumns
instance Control.DeepSeq.NFData Text.Pandoc.Definition.Block
instance Control.DeepSeq.NFData Text.Pandoc.Definition.Pandoc
instance GHC.Generics.Generic Text.Pandoc.Definition.ListNumberStyle
instance Data.Data.Data Text.Pandoc.Definition.ListNumberStyle
instance GHC.Read.Read Text.Pandoc.Definition.ListNumberStyle
instance GHC.Show.Show Text.Pandoc.Definition.ListNumberStyle
instance GHC.Classes.Ord Text.Pandoc.Definition.ListNumberStyle
instance GHC.Classes.Eq Text.Pandoc.Definition.ListNumberStyle
instance GHC.Generics.Generic Text.Pandoc.Definition.ListNumberDelim
instance Data.Data.Data Text.Pandoc.Definition.ListNumberDelim
instance GHC.Read.Read Text.Pandoc.Definition.ListNumberDelim
instance GHC.Show.Show Text.Pandoc.Definition.ListNumberDelim
instance GHC.Classes.Ord Text.Pandoc.Definition.ListNumberDelim
instance GHC.Classes.Eq Text.Pandoc.Definition.ListNumberDelim
instance Data.Aeson.Types.FromJSON.FromJSON Text.Pandoc.Definition.Format
instance Data.Aeson.Types.ToJSON.ToJSON Text.Pandoc.Definition.Format
instance GHC.Generics.Generic Text.Pandoc.Definition.Format
instance Data.Data.Data Text.Pandoc.Definition.Format
instance GHC.Show.Show Text.Pandoc.Definition.Format
instance GHC.Read.Read Text.Pandoc.Definition.Format
instance Data.Aeson.Types.FromJSON.FromJSON Text.Pandoc.Definition.RowHeadColumns
instance Data.Aeson.Types.ToJSON.ToJSON Text.Pandoc.Definition.RowHeadColumns
instance GHC.Enum.Enum Text.Pandoc.Definition.RowHeadColumns
instance GHC.Num.Num Text.Pandoc.Definition.RowHeadColumns
instance GHC.Generics.Generic Text.Pandoc.Definition.RowHeadColumns
instance Data.Data.Data Text.Pandoc.Definition.RowHeadColumns
instance GHC.Read.Read Text.Pandoc.Definition.RowHeadColumns
instance GHC.Show.Show Text.Pandoc.Definition.RowHeadColumns
instance GHC.Classes.Ord Text.Pandoc.Definition.RowHeadColumns
instance GHC.Classes.Eq Text.Pandoc.Definition.RowHeadColumns
instance GHC.Generics.Generic Text.Pandoc.Definition.Alignment
instance Data.Data.Data Text.Pandoc.Definition.Alignment
instance GHC.Read.Read Text.Pandoc.Definition.Alignment
instance GHC.Show.Show Text.Pandoc.Definition.Alignment
instance GHC.Classes.Ord Text.Pandoc.Definition.Alignment
instance GHC.Classes.Eq Text.Pandoc.Definition.Alignment
instance GHC.Generics.Generic Text.Pandoc.Definition.ColWidth
instance Data.Data.Data Text.Pandoc.Definition.ColWidth
instance GHC.Read.Read Text.Pandoc.Definition.ColWidth
instance GHC.Show.Show Text.Pandoc.Definition.ColWidth
instance GHC.Classes.Ord Text.Pandoc.Definition.ColWidth
instance GHC.Classes.Eq Text.Pandoc.Definition.ColWidth
instance Data.Aeson.Types.FromJSON.FromJSON Text.Pandoc.Definition.RowSpan
instance Data.Aeson.Types.ToJSON.ToJSON Text.Pandoc.Definition.RowSpan
instance GHC.Enum.Enum Text.Pandoc.Definition.RowSpan
instance GHC.Num.Num Text.Pandoc.Definition.RowSpan
instance GHC.Generics.Generic Text.Pandoc.Definition.RowSpan
instance Data.Data.Data Text.Pandoc.Definition.RowSpan
instance GHC.Read.Read Text.Pandoc.Definition.RowSpan
instance GHC.Show.Show Text.Pandoc.Definition.RowSpan
instance GHC.Classes.Ord Text.Pandoc.Definition.RowSpan
instance GHC.Classes.Eq Text.Pandoc.Definition.RowSpan
instance Data.Aeson.Types.FromJSON.FromJSON Text.Pandoc.Definition.ColSpan
instance Data.Aeson.Types.ToJSON.ToJSON Text.Pandoc.Definition.ColSpan
instance GHC.Enum.Enum Text.Pandoc.Definition.ColSpan
instance GHC.Num.Num Text.Pandoc.Definition.ColSpan
instance GHC.Generics.Generic Text.Pandoc.Definition.ColSpan
instance Data.Data.Data Text.Pandoc.Definition.ColSpan
instance GHC.Read.Read Text.Pandoc.Definition.ColSpan
instance GHC.Show.Show Text.Pandoc.Definition.ColSpan
instance GHC.Classes.Ord Text.Pandoc.Definition.ColSpan
instance GHC.Classes.Eq Text.Pandoc.Definition.ColSpan
instance GHC.Generics.Generic Text.Pandoc.Definition.QuoteType
instance Data.Data.Data Text.Pandoc.Definition.QuoteType
instance GHC.Read.Read Text.Pandoc.Definition.QuoteType
instance GHC.Classes.Ord Text.Pandoc.Definition.QuoteType
instance GHC.Classes.Eq Text.Pandoc.Definition.QuoteType
instance GHC.Show.Show Text.Pandoc.Definition.QuoteType
instance GHC.Generics.Generic Text.Pandoc.Definition.MathType
instance Data.Data.Data Text.Pandoc.Definition.MathType
instance GHC.Read.Read Text.Pandoc.Definition.MathType
instance GHC.Classes.Ord Text.Pandoc.Definition.MathType
instance GHC.Classes.Eq Text.Pandoc.Definition.MathType
instance GHC.Show.Show Text.Pandoc.Definition.MathType
instance GHC.Generics.Generic Text.Pandoc.Definition.CitationMode
instance Data.Data.Data Text.Pandoc.Definition.CitationMode
instance GHC.Read.Read Text.Pandoc.Definition.CitationMode
instance GHC.Classes.Ord Text.Pandoc.Definition.CitationMode
instance GHC.Classes.Eq Text.Pandoc.Definition.CitationMode
instance GHC.Show.Show Text.Pandoc.Definition.CitationMode
instance GHC.Generics.Generic Text.Pandoc.Definition.TableHead
instance Data.Data.Data Text.Pandoc.Definition.TableHead
instance GHC.Read.Read Text.Pandoc.Definition.TableHead
instance GHC.Show.Show Text.Pandoc.Definition.TableHead
instance GHC.Classes.Ord Text.Pandoc.Definition.TableHead
instance GHC.Classes.Eq Text.Pandoc.Definition.TableHead
instance GHC.Generics.Generic Text.Pandoc.Definition.TableBody
instance Data.Data.Data Text.Pandoc.Definition.TableBody
instance GHC.Read.Read Text.Pandoc.Definition.TableBody
instance GHC.Show.Show Text.Pandoc.Definition.TableBody
instance GHC.Classes.Ord Text.Pandoc.Definition.TableBody
instance GHC.Classes.Eq Text.Pandoc.Definition.TableBody
instance GHC.Generics.Generic Text.Pandoc.Definition.Cell
instance Data.Data.Data Text.Pandoc.Definition.Cell
instance GHC.Read.Read Text.Pandoc.Definition.Cell
instance GHC.Show.Show Text.Pandoc.Definition.Cell
instance GHC.Classes.Ord Text.Pandoc.Definition.Cell
instance GHC.Classes.Eq Text.Pandoc.Definition.Cell
instance GHC.Generics.Generic Text.Pandoc.Definition.Row
instance Data.Data.Data Text.Pandoc.Definition.Row
instance GHC.Read.Read Text.Pandoc.Definition.Row
instance GHC.Show.Show Text.Pandoc.Definition.Row
instance GHC.Classes.Ord Text.Pandoc.Definition.Row
instance GHC.Classes.Eq Text.Pandoc.Definition.Row
instance GHC.Generics.Generic Text.Pandoc.Definition.TableFoot
instance Data.Data.Data Text.Pandoc.Definition.TableFoot
instance GHC.Read.Read Text.Pandoc.Definition.TableFoot
instance GHC.Show.Show Text.Pandoc.Definition.TableFoot
instance GHC.Classes.Ord Text.Pandoc.Definition.TableFoot
instance GHC.Classes.Eq Text.Pandoc.Definition.TableFoot
instance GHC.Generics.Generic Text.Pandoc.Definition.Caption
instance Data.Data.Data Text.Pandoc.Definition.Caption
instance GHC.Read.Read Text.Pandoc.Definition.Caption
instance GHC.Show.Show Text.Pandoc.Definition.Caption
instance GHC.Classes.Ord Text.Pandoc.Definition.Caption
instance GHC.Classes.Eq Text.Pandoc.Definition.Caption
instance GHC.Generics.Generic Text.Pandoc.Definition.Block
instance Data.Data.Data Text.Pandoc.Definition.Block
instance GHC.Show.Show Text.Pandoc.Definition.Block
instance GHC.Read.Read Text.Pandoc.Definition.Block
instance GHC.Classes.Ord Text.Pandoc.Definition.Block
instance GHC.Classes.Eq Text.Pandoc.Definition.Block
instance GHC.Generics.Generic Text.Pandoc.Definition.Inline
instance Data.Data.Data Text.Pandoc.Definition.Inline
instance GHC.Read.Read Text.Pandoc.Definition.Inline
instance GHC.Classes.Ord Text.Pandoc.Definition.Inline
instance GHC.Classes.Eq Text.Pandoc.Definition.Inline
instance GHC.Show.Show Text.Pandoc.Definition.Inline
instance GHC.Generics.Generic Text.Pandoc.Definition.Citation
instance Data.Data.Data Text.Pandoc.Definition.Citation
instance GHC.Read.Read Text.Pandoc.Definition.Citation
instance GHC.Classes.Eq Text.Pandoc.Definition.Citation
instance GHC.Show.Show Text.Pandoc.Definition.Citation
instance GHC.Generics.Generic Text.Pandoc.Definition.MetaValue
instance Data.Data.Data Text.Pandoc.Definition.MetaValue
instance GHC.Read.Read Text.Pandoc.Definition.MetaValue
instance GHC.Show.Show Text.Pandoc.Definition.MetaValue
instance GHC.Classes.Ord Text.Pandoc.Definition.MetaValue
instance GHC.Classes.Eq Text.Pandoc.Definition.MetaValue
instance GHC.Generics.Generic Text.Pandoc.Definition.Meta
instance Data.Data.Data Text.Pandoc.Definition.Meta
instance GHC.Read.Read Text.Pandoc.Definition.Meta
instance GHC.Show.Show Text.Pandoc.Definition.Meta
instance GHC.Classes.Ord Text.Pandoc.Definition.Meta
instance GHC.Classes.Eq Text.Pandoc.Definition.Meta
instance GHC.Generics.Generic Text.Pandoc.Definition.Pandoc
instance Data.Data.Data Text.Pandoc.Definition.Pandoc
instance GHC.Show.Show Text.Pandoc.Definition.Pandoc
instance GHC.Read.Read Text.Pandoc.Definition.Pandoc
instance GHC.Classes.Ord Text.Pandoc.Definition.Pandoc
instance GHC.Classes.Eq Text.Pandoc.Definition.Pandoc
instance GHC.Base.Semigroup Text.Pandoc.Definition.Pandoc
instance GHC.Base.Monoid Text.Pandoc.Definition.Pandoc
instance GHC.Base.Semigroup Text.Pandoc.Definition.Meta
instance GHC.Base.Monoid Text.Pandoc.Definition.Meta
instance GHC.Classes.Ord Text.Pandoc.Definition.Citation
instance Data.String.IsString Text.Pandoc.Definition.Format
instance GHC.Classes.Eq Text.Pandoc.Definition.Format
instance GHC.Classes.Ord Text.Pandoc.Definition.Format


-- | Convenience functions for building pandoc documents programmatically.
--   
--   Example of use (with <tt>OverloadedStrings</tt> pragma):
--   
--   <pre>
--   import Text.Pandoc.Builder
--   
--   myDoc :: Pandoc
--   myDoc = setTitle "My title" $ doc $
--     para "This is the first paragraph" &lt;&gt;
--     para ("And " &lt;&gt; emph "another" &lt;&gt; ".") &lt;&gt;
--     bulletList [ para "item one" &lt;&gt; para "continuation"
--                , plain ("item two and a " &lt;&gt;
--                    link "/url" "go to url" "link")
--                ]
--   </pre>
--   
--   Isn't that nicer than writing the following?
--   
--   <pre>
--   import Text.Pandoc.Definition
--   import Data.Map (fromList)
--   
--   myDoc :: Pandoc
--   myDoc = Pandoc (Meta {unMeta = fromList [("title",
--             MetaInlines [Str "My",Space,Str "title"])]})
--           [Para [Str "This",Space,Str "is",Space,Str "the",Space,Str "first",
--            Space,Str "paragraph"],Para [Str "And",Space,Emph [Str "another"],
--            Str "."]
--           ,BulletList [
--             [Para [Str "item",Space,Str "one"]
--             ,Para [Str "continuation"]]
--            ,[Plain [Str "item",Space,Str "two",Space,Str "and",Space,
--                     Str "a",Space,Link nullAttr [Str "link"] ("/url","go to url")]]]]
--   </pre>
--   
--   And of course, you can use Haskell to define your own builders:
--   
--   <pre>
--   import Text.Pandoc.Builder
--   import Text.JSON
--   import Control.Arrow ((***))
--   import Data.Monoid (mempty)
--   
--   -- | Converts a JSON document into 'Blocks'.
--   json :: String -&gt; Blocks
--   json x =
--     case decode x of
--          Ok y    -&gt; jsValueToBlocks y
--          Error y -&gt; error y
--      where jsValueToBlocks x =
--             case x of
--              JSNull         -&gt; mempty
--              JSBool x       -&gt; plain $ text $ show x
--              JSRational _ x -&gt; plain $ text $ show x
--              JSString x     -&gt; plain $ text $ fromJSString x
--              JSArray xs     -&gt; bulletList $ map jsValueToBlocks xs
--              JSObject x     -&gt; definitionList $
--                                 map (text *** (:[]) . jsValueToBlocks) $
--                                 fromJSObject x
--   </pre>
module Text.Pandoc.Builder
newtype Many a
Many :: Seq a -> Many a
[unMany] :: Many a -> Seq a
type Inlines = Many Inline
type Blocks = Many Block
(<>) :: Semigroup a => a -> a -> a
singleton :: a -> Many a
toList :: Many a -> [a]
fromList :: [a] -> Many a

-- | <i>Deprecated: Use null instead</i>
isNull :: Many a -> Bool
doc :: Blocks -> Pandoc
class ToMetaValue a
toMetaValue :: ToMetaValue a => a -> MetaValue
class HasMeta a
setMeta :: (HasMeta a, ToMetaValue b) => Text -> b -> a -> a
deleteMeta :: HasMeta a => Text -> a -> a
setTitle :: Inlines -> Pandoc -> Pandoc
setAuthors :: [Inlines] -> Pandoc -> Pandoc
setDate :: Inlines -> Pandoc -> Pandoc

-- | Convert a <a>Text</a> to <a>Inlines</a>, treating interword spaces as
--   <a>Space</a>s or <a>SoftBreak</a>s. If you want a <a>Str</a> with
--   literal spaces, use <a>str</a>.
text :: Text -> Inlines
str :: Text -> Inlines
emph :: Inlines -> Inlines
underline :: Inlines -> Inlines
strong :: Inlines -> Inlines
strikeout :: Inlines -> Inlines
superscript :: Inlines -> Inlines
subscript :: Inlines -> Inlines
smallcaps :: Inlines -> Inlines
singleQuoted :: Inlines -> Inlines
doubleQuoted :: Inlines -> Inlines
cite :: [Citation] -> Inlines -> Inlines

-- | Inline code with attributes.
codeWith :: Attr -> Text -> Inlines

-- | Plain inline code.
code :: Text -> Inlines
space :: Inlines
softbreak :: Inlines
linebreak :: Inlines

-- | Inline math
math :: Text -> Inlines

-- | Display math
displayMath :: Text -> Inlines
rawInline :: Text -> Text -> Inlines
link :: Text -> Text -> Inlines -> Inlines
linkWith :: Attr -> Text -> Text -> Inlines -> Inlines
image :: Text -> Text -> Inlines -> Inlines
imageWith :: Attr -> Text -> Text -> Inlines -> Inlines
note :: Blocks -> Inlines
spanWith :: Attr -> Inlines -> Inlines

-- | Trim leading and trailing spaces and softbreaks from an Inlines.
trimInlines :: Inlines -> Inlines
para :: Inlines -> Blocks
plain :: Inlines -> Blocks
lineBlock :: [Inlines] -> Blocks

-- | A code block with attributes.
codeBlockWith :: Attr -> Text -> Blocks

-- | A plain code block.
codeBlock :: Text -> Blocks
rawBlock :: Text -> Text -> Blocks
blockQuote :: Blocks -> Blocks
bulletList :: [Blocks] -> Blocks

-- | Ordered list with attributes.
orderedListWith :: ListAttributes -> [Blocks] -> Blocks

-- | Ordered list with default attributes.
orderedList :: [Blocks] -> Blocks
definitionList :: [(Inlines, [Blocks])] -> Blocks
header :: Int -> Inlines -> Blocks
headerWith :: Attr -> Int -> Inlines -> Blocks
horizontalRule :: Blocks
cell :: Alignment -> RowSpan -> ColSpan -> Blocks -> Cell

-- | A 1×1 cell with default alignment.
simpleCell :: Blocks -> Cell

-- | A 1×1 empty cell.
emptyCell :: Cell
cellWith :: Attr -> Alignment -> RowSpan -> ColSpan -> Blocks -> Cell

-- | Table builder. Performs normalization with <a>normalizeTableHead</a>,
--   <a>normalizeTableBody</a>, and <a>normalizeTableFoot</a>. The number
--   of table columns is given by the length of <tt>[<a>ColSpec</a>]</tt>.
table :: Caption -> [ColSpec] -> TableHead -> [TableBody] -> TableFoot -> Blocks

-- | A simple table without a caption.
simpleTable :: [Blocks] -> [[Blocks]] -> Blocks
tableWith :: Attr -> Caption -> [ColSpec] -> TableHead -> [TableBody] -> TableFoot -> Blocks
figure :: Caption -> Blocks -> Blocks
figureWith :: Attr -> Caption -> Blocks -> Blocks
caption :: Maybe ShortCaption -> Blocks -> Caption
simpleCaption :: Blocks -> Caption
emptyCaption :: Caption

-- | Creates a simple figure from attributes, a figure caption, an image
--   path and image title. The attributes are used as the image attributes.
simpleFigureWith :: Attr -> Inlines -> Text -> Text -> Blocks
simpleFigure :: Inlines -> Text -> Text -> Blocks
divWith :: Attr -> Blocks -> Blocks

-- | Normalize the <a>TableHead</a> with <a>clipRows</a> and
--   <a>placeRowSection</a> so that when placed on a grid with the given
--   width and a height equal to the number of rows in the initial
--   <a>TableHead</a>, there will be no empty spaces or overlapping cells,
--   and the cells will not protrude beyond the grid.
normalizeTableHead :: Int -> TableHead -> TableHead

-- | Normalize the intermediate head and body section of a
--   <a>TableBody</a>, as in <a>normalizeTableHead</a>, but additionally
--   ensure that row head cells do not go beyond the row head inside the
--   intermediate body.
normalizeTableBody :: Int -> TableBody -> TableBody

-- | Normalize the <a>TableFoot</a>, as in <a>normalizeTableHead</a>.
normalizeTableFoot :: Int -> TableFoot -> TableFoot

-- | Normalize the given list of cells so that they fit on a single grid
--   row. The <a>RowSpan</a> values of the cells are assumed to be valid
--   (clamped to lie between 1 and the remaining grid height). The cells in
--   the list are also assumed to be able to fill the entire grid row.
--   These conditions can be met by appending <tt>repeat
--   <a>emptyCell</a></tt> to the <tt>[<a>Cell</a>]</tt> list and using
--   <a>clipRows</a> on the entire table section beforehand.
--   
--   Normalization follows the principle that cells are placed on a grid
--   row in order, each at the first available grid position from the left,
--   having their <a>ColSpan</a> reduced if they would overlap with a
--   previous cell, stopping once the row is filled. Only the dimensions of
--   cells are changed, and only of those cells that fit on the row.
--   
--   Possible overlap is detected using the given
--   <tt>[<a>RowSpan</a>]</tt>, which is the "overhang" of the previous
--   grid row, a list of the heights of cells that descend through the
--   previous row, reckoned <i>only from the previous row</i>. Its length
--   should be the width (number of columns) of the current grid row.
--   
--   For example, the numbers in the following headerless grid table
--   represent the overhang at each grid position for that table:
--   
--   <pre>
--     1   1   1   1
--   +---+---+---+---+
--   | 1 | 2   2 | 3 |
--   +---+       +   +
--   | 1 | 1   1 | 2 |
--   +---+---+---+   +
--   | 1   1 | 1 | 1 |
--   +---+---+---+---+
--   </pre>
--   
--   In any table, the row before the first has an overhang of
--   <tt>replicate tableWidth 1</tt>, since there are no cells to descend
--   into the table from there. The overhang of the first row in the
--   example is <tt>[1, 2, 2, 3]</tt>.
--   
--   So if after <a>clipRows</a> the unnormalized second row of that
--   example table were
--   
--   <pre>
--   r = [("a", 1, 2),("b", 2, 3)] -- the cells displayed as (label, RowSpan, ColSpan) only
--   </pre>
--   
--   a correct invocation of <a>placeRowSection</a> to normalize it would
--   be
--   
--   <pre>
--   &gt;&gt;&gt; placeRowSection [1, 2, 2, 3] $ r ++ repeat emptyCell
--   ([1, 1, 1, 2], [("a", 1, 1)], [("b", 2, 3)] ++ repeat emptyCell) -- wouldn't stop printing, of course
--   </pre>
--   
--   and if the third row were only <tt>[("c", 1, 2)]</tt>, then the
--   expression would be
--   
--   <pre>
--   &gt;&gt;&gt; placeRowSection [1, 1, 1, 2] $ [("c", 1, 2)] ++ repeat emptyCell
--   ([1, 1, 1, 1], [("c", 1, 2), emptyCell], repeat emptyCell)
--   </pre>
placeRowSection :: [RowSpan] -> [Cell] -> ([RowSpan], [Cell], [Cell])

-- | Ensure that the height of each cell in a table section lies between 1
--   and the distance from its row to the end of the section. So if there
--   were four rows in the input list, the cells in the second row would
--   have their height clamped between 1 and 3.
clipRows :: [Row] -> [Row]
instance GHC.Read.Read a => GHC.Read.Read (Text.Pandoc.Builder.Many a)
instance GHC.Show.Show a => GHC.Show.Show (Text.Pandoc.Builder.Many a)
instance GHC.Base.Functor Text.Pandoc.Builder.Many
instance Data.Traversable.Traversable Text.Pandoc.Builder.Many
instance Data.Foldable.Foldable Text.Pandoc.Builder.Many
instance GHC.Classes.Eq a => GHC.Classes.Eq (Text.Pandoc.Builder.Many a)
instance GHC.Classes.Ord a => GHC.Classes.Ord (Text.Pandoc.Builder.Many a)
instance Data.Data.Data a => Data.Data.Data (Text.Pandoc.Builder.Many a)
instance GHC.Generics.Generic (Text.Pandoc.Builder.Many a)
instance GHC.Base.Semigroup Text.Pandoc.Builder.Blocks
instance GHC.Base.Monoid Text.Pandoc.Builder.Blocks
instance Text.Pandoc.Builder.HasMeta Text.Pandoc.Definition.Meta
instance Text.Pandoc.Builder.HasMeta Text.Pandoc.Definition.Pandoc
instance Text.Pandoc.Builder.ToMetaValue Text.Pandoc.Definition.MetaValue
instance Text.Pandoc.Builder.ToMetaValue Text.Pandoc.Builder.Blocks
instance Text.Pandoc.Builder.ToMetaValue Text.Pandoc.Builder.Inlines
instance Text.Pandoc.Builder.ToMetaValue GHC.Types.Bool
instance Text.Pandoc.Builder.ToMetaValue Data.Text.Internal.Text
instance Text.Pandoc.Builder.ToMetaValue GHC.Base.String
instance Text.Pandoc.Builder.ToMetaValue a => Text.Pandoc.Builder.ToMetaValue [a]
instance Text.Pandoc.Builder.ToMetaValue a => Text.Pandoc.Builder.ToMetaValue (Data.Map.Internal.Map Data.Text.Internal.Text a)
instance Text.Pandoc.Builder.ToMetaValue a => Text.Pandoc.Builder.ToMetaValue (Data.Map.Internal.Map GHC.Base.String a)
instance GHC.Base.Semigroup Text.Pandoc.Builder.Inlines
instance GHC.Base.Monoid Text.Pandoc.Builder.Inlines
instance Data.String.IsString Text.Pandoc.Builder.Inlines

module Text.Pandoc.Arbitrary
instance Test.QuickCheck.Arbitrary.Arbitrary Text.Pandoc.Builder.Inlines
instance Test.QuickCheck.Arbitrary.Arbitrary Text.Pandoc.Builder.Blocks
instance Test.QuickCheck.Arbitrary.Arbitrary Text.Pandoc.Definition.Inline
instance Test.QuickCheck.Arbitrary.Arbitrary Text.Pandoc.Definition.Block
instance Test.QuickCheck.Arbitrary.Arbitrary Text.Pandoc.Definition.Pandoc
instance Test.QuickCheck.Arbitrary.Arbitrary Text.Pandoc.Definition.CitationMode
instance Test.QuickCheck.Arbitrary.Arbitrary Text.Pandoc.Definition.Citation
instance Test.QuickCheck.Arbitrary.Arbitrary Text.Pandoc.Definition.Row
instance Test.QuickCheck.Arbitrary.Arbitrary Text.Pandoc.Definition.TableHead
instance Test.QuickCheck.Arbitrary.Arbitrary Text.Pandoc.Definition.TableBody
instance Test.QuickCheck.Arbitrary.Arbitrary Text.Pandoc.Definition.TableFoot
instance Test.QuickCheck.Arbitrary.Arbitrary Text.Pandoc.Definition.Cell
instance Test.QuickCheck.Arbitrary.Arbitrary Text.Pandoc.Definition.Caption
instance Test.QuickCheck.Arbitrary.Arbitrary Text.Pandoc.Definition.MathType
instance Test.QuickCheck.Arbitrary.Arbitrary Text.Pandoc.Definition.QuoteType
instance Test.QuickCheck.Arbitrary.Arbitrary Text.Pandoc.Definition.Meta
instance Test.QuickCheck.Arbitrary.Arbitrary Text.Pandoc.Definition.Alignment
instance Test.QuickCheck.Arbitrary.Arbitrary Text.Pandoc.Definition.ListNumberStyle
instance Test.QuickCheck.Arbitrary.Arbitrary Text.Pandoc.Definition.ListNumberDelim


-- | Generic functions for manipulating <tt>Pandoc</tt> documents. (Note:
--   the functions defined in <tt>Text.Pandoc.Walk</tt> should be used
--   instead, when possible, as they are much faster.)
--   
--   Here's a simple example, defining a function that replaces all the
--   level 3+ headers in a document with regular paragraphs in ALL CAPS:
--   
--   <pre>
--   import Text.Pandoc.Definition
--   import Text.Pandoc.Generic
--   import Data.Char (toUpper)
--   
--   modHeader :: Block -&gt; Block
--   modHeader (Header n _ xs) | n &gt;= 3 = Para $ bottomUp allCaps xs
--   modHeader x = x
--   
--   allCaps :: Inline -&gt; Inline
--   allCaps (Str xs) = Str $ map toUpper xs
--   allCaps x = x
--   
--   changeHeaders :: Pandoc -&gt; Pandoc
--   changeHeaders = bottomUp modHeader
--   </pre>
--   
--   <a>bottomUp</a> is so called because it traverses the <tt>Pandoc</tt>
--   structure from bottom up. <a>topDown</a> goes the other way. The
--   difference between them can be seen from this example:
--   
--   <pre>
--   normal :: [Inline] -&gt; [Inline]
--   normal (Space : Space : xs) = Space : xs
--   normal (Emph xs : Emph ys : zs) = Emph (xs ++ ys) : zs
--   normal xs = xs
--   
--   myDoc :: Pandoc
--   myDoc =  Pandoc nullMeta
--    [ Para [Str "Hi",Space,Emph [Str "world",Space],Emph [Space,Str "emphasized"]]]
--   </pre>
--   
--   Here we want to use <a>topDown</a> to lift <tt>normal</tt> to
--   <tt>Pandoc -&gt; Pandoc</tt>. The top down strategy will collapse the
--   two adjacent <tt>Emph</tt>s first, then collapse the resulting
--   adjacent <tt>Space</tt>s, as desired. If we used <a>bottomUp</a>, we
--   would end up with two adjacent <tt>Space</tt>s, since the contents of
--   the two <tt>Emph</tt> inlines would be processed before the
--   <tt>Emph</tt>s were collapsed into one.
--   
--   <pre>
--   topDown normal myDoc ==
--     Pandoc nullMeta
--      [Para [Str "Hi",Space,Emph [Str "world",Space,Str "emphasized"]]]
--   
--   bottomUp normal myDoc ==
--     Pandoc nullMeta
--      [Para [Str "Hi",Space,Emph [Str "world",Space,Space,Str "emphasized"]]]
--   </pre>
--   
--   <a>bottomUpM</a> is a monadic version of <a>bottomUp</a>. It could be
--   used, for example, to replace the contents of delimited code blocks
--   with attribute <tt>include=FILENAME</tt> with the contents of
--   <tt>FILENAME</tt>:
--   
--   <pre>
--   doInclude :: Block -&gt; IO Block
--   doInclude cb@(CodeBlock (id, classes, namevals) contents) =
--     case lookup "include" namevals of
--          Just f  -&gt; return . (CodeBlock (id, classes, namevals)) =&lt;&lt; readFile f
--          Nothing -&gt; return cb
--   doInclude x = return x
--   
--   processIncludes :: Pandoc -&gt; IO Pandoc
--   processIncludes = bottomUpM doInclude
--   </pre>
--   
--   <a>queryWith</a> can be used, for example, to compile a list of URLs
--   linked to in a document:
--   
--   <pre>
--   extractURL :: Inline -&gt; [String]
--   extractURL (Link _ (u,_)) = [u]
--   extractURL (Image _ _ (u,_)) = [u]
--   extractURL _ = []
--   
--   extractURLs :: Pandoc -&gt; [String]
--   extractURLs = queryWith extractURL
--   </pre>
module Text.Pandoc.Generic

-- | Applies a transformation on <tt>a</tt>s to matching elements in a
--   <tt>b</tt>, moving from the bottom of the structure up.
bottomUp :: (Data a, Data b) => (a -> a) -> b -> b

-- | Applies a transformation on <tt>a</tt>s to matching elements in a
--   <tt>b</tt>, moving from the top of the structure down.
topDown :: (Data a, Data b) => (a -> a) -> b -> b

-- | Like <a>bottomUp</a>, but with monadic transformations.
bottomUpM :: (Monad m, Data a, Data b) => (a -> m a) -> b -> m b

-- | Runs a query on matching <tt>a</tt> elements in a <tt>c</tt>. The
--   results of the queries are combined using <a>mappend</a>.
queryWith :: (Data a, Monoid b, Data c) => (a -> b) -> c -> b


-- | Functions for manipulating <a>Pandoc</a> documents or extracting
--   information from them by walking the <a>Pandoc</a> structure (or
--   intermediate structures like '[Block]' or '[Inline]'. These are faster
--   (by a factor of four or five) than the generic functions defined in
--   <tt>Text.Pandoc.Generic</tt>.
--   
--   Here's a simple example, defining a function that replaces all the
--   level 3+ headers in a document with regular paragraphs in ALL CAPS:
--   
--   <pre>
--   import Text.Pandoc.Definition
--   import Text.Pandoc.Walk
--   import Data.Char (toUpper)
--   
--   modHeader :: Block -&gt; Block
--   modHeader (Header n _ xs) | n &gt;= 3 = Para $ walk allCaps xs
--   modHeader x = x
--   
--   allCaps :: Inline -&gt; Inline
--   allCaps (Str xs) = Str $ map toUpper xs
--   allCaps x = x
--   
--   changeHeaders :: Pandoc -&gt; Pandoc
--   changeHeaders = walk modHeader
--   </pre>
--   
--   <a>query</a> can be used, for example, to compile a list of URLs
--   linked to in a document:
--   
--   <pre>
--   extractURL :: Inline -&gt; [Text]
--   extractURL (Link _ _ (u,_)) = [u]
--   extractURL (Image _ _ (u,_)) = [u]
--   extractURL _ = []
--   
--   extractURLs :: Pandoc -&gt; [Text]
--   extractURLs = query extractURL
--   </pre>
module Text.Pandoc.Walk
class Walkable a b

-- | <tt>walk f x</tt> walks the structure <tt>x</tt> (bottom up) and
--   replaces every occurrence of an <tt>a</tt> with the result of applying
--   <tt>f</tt> to it.
walk :: Walkable a b => (a -> a) -> b -> b

-- | A monadic version of <a>walk</a>.
walkM :: (Walkable a b, Monad m, Applicative m, Functor m) => (a -> m a) -> b -> m b

-- | <tt>query f x</tt> walks the structure <tt>x</tt> (bottom up) and
--   applies <tt>f</tt> to every <tt>a</tt>, appending the results.
query :: (Walkable a b, Monoid c) => (a -> c) -> b -> c

-- | Perform a query on elements nested below a <tt><a>Block</a></tt>
--   element by querying all directly nested lists of <tt>Inline</tt>s or
--   <tt>Block</tt>s.
queryBlock :: (Walkable a Citation, Walkable a [Block], Walkable a Row, Walkable a Caption, Walkable a TableHead, Walkable a TableBody, Walkable a TableFoot, Walkable a [Inline], Monoid c) => (a -> c) -> Block -> c

-- | Query the elements below a <a>Cell</a> element.
queryCaption :: (Walkable a [Block], Walkable a [Inline], Walkable a ShortCaption, Monoid c) => (a -> c) -> Caption -> c

-- | Query the elements below a <a>Row</a> element.
queryRow :: (Walkable a Cell, Monoid c) => (a -> c) -> Row -> c

-- | Query the elements below a <a>TableHead</a> element.
queryTableHead :: (Walkable a Row, Monoid c) => (a -> c) -> TableHead -> c

-- | Query the elements below a <a>TableBody</a> element.
queryTableBody :: (Walkable a Row, Monoid c) => (a -> c) -> TableBody -> c

-- | Query the elements below a <a>TableFoot</a> element.
queryTableFoot :: (Walkable a Row, Monoid c) => (a -> c) -> TableFoot -> c

-- | Query the elements below a <a>Cell</a> element.
queryCell :: (Walkable a [Block], Monoid c) => (a -> c) -> Cell -> c

-- | Perform a query on elements nested below a <tt><a>Citation</a></tt>
--   element by querying the prefix and postfix <tt>Inline</tt> lists.
queryCitation :: (Walkable a [Inline], Monoid c) => (a -> c) -> Citation -> c

-- | Perform a query on elements nested below an <tt><a>Inline</a></tt>
--   element by querying nested lists of <tt>Inline</tt>s, <tt>Block</tt>s,
--   or <tt>Citation</tt>s.
queryInline :: (Walkable a Citation, Walkable a [Block], Walkable a [Inline], Monoid c) => (a -> c) -> Inline -> c

-- | Perform a query on elements nested below a <tt><a>MetaValue</a></tt>
--   element by querying all directly nested lists of <tt>Inline</tt>s,
--   list of <tt>Block</tt>s, or lists or maps of <tt>MetaValue</tt>s.
queryMetaValue :: (Walkable a MetaValue, Walkable a [Block], Walkable a [Inline], Monoid c) => (a -> c) -> MetaValue -> c

-- | Perform a query on <tt><a>MetaValue</a></tt> elements nested below a
--   <tt><a>MetaValue</a></tt> element
queryMetaValue' :: Monoid c => (MetaValue -> c) -> MetaValue -> c

-- | Query a pandoc element by recursing first into its
--   <tt><a>Meta</a></tt> data and then append the result of recursing into
--   the list of <tt><a>Block</a></tt>s.
queryPandoc :: (Walkable a Meta, Walkable a [Block], Monoid c) => (a -> c) -> Pandoc -> c

-- | Helper method to walk to elements nested below <tt><a>Block</a></tt>
--   nodes.
--   
--   When walking a block with this function, only the contents of the
--   traversed block element may change. The element itself, i.e. its
--   constructor, its <tt><a>Attr</a></tt>, and its raw text value, will
--   remain unchanged.
walkBlockM :: (Walkable a [Block], Walkable a [Inline], Walkable a Row, Walkable a Caption, Walkable a TableHead, Walkable a TableBody, Walkable a TableFoot, Monad m, Applicative m, Functor m) => (a -> m a) -> Block -> m Block

-- | Helper method to walk the elements nested below <a>Caption</a> nodes.
walkCaptionM :: (Walkable a [Block], Walkable a [Inline], Monad m, Walkable a ShortCaption) => (a -> m a) -> Caption -> m Caption

-- | Helper method to walk the elements nested below <tt><a>Row</a></tt>
--   nodes. The <tt><a>Attr</a></tt> component is not changed by this
--   operation.
walkRowM :: (Walkable a Cell, Monad m) => (a -> m a) -> Row -> m Row

-- | Helper method to walk the elements nested below
--   <tt><a>TableHead</a></tt> nodes. The <tt><a>Attr</a></tt> component is
--   not changed by this operation.
walkTableHeadM :: (Walkable a Row, Monad m) => (a -> m a) -> TableHead -> m TableHead

-- | Helper method to walk the elements nested below
--   <tt><a>TableBody</a></tt> nodes. The <tt><a>Attr</a></tt> and
--   <tt><a>RowHeadColumns</a></tt> components are not changed by this
--   operation.
walkTableBodyM :: (Walkable a Row, Monad m) => (a -> m a) -> TableBody -> m TableBody

-- | Helper method to walk the elements nested below
--   <tt><a>TableFoot</a></tt> nodes. The <tt><a>Attr</a></tt> component is
--   not changed by this operation.
walkTableFootM :: (Walkable a Row, Monad m) => (a -> m a) -> TableFoot -> m TableFoot

-- | Helper method to walk the elements nested below <a>Cell</a> nodes.
--   Only the <tt>[<a>Block</a>]</tt> cell content is changed by this
--   operation.
walkCellM :: (Walkable a [Block], Monad m) => (a -> m a) -> Cell -> m Cell

-- | Helper method to walk to elements nested below
--   <tt><a>Citation</a></tt> nodes.
--   
--   The non-inline contents of a citation will remain unchanged during
--   traversal. Only the inline contents, viz. the citation's prefix and
--   postfix, will be traversed further and can thus be changed during this
--   operation.
walkCitationM :: (Walkable a [Inline], Monad m, Applicative m, Functor m) => (a -> m a) -> Citation -> m Citation

-- | Helper method to walk to elements nested below <tt><a>Inline</a></tt>
--   nodes.
--   
--   When walking an inline with this function, only the contents of the
--   traversed inline element may change. The element itself, i.e. its
--   constructor, cannot be changed.
walkInlineM :: (Walkable a Citation, Walkable a [Block], Walkable a [Inline], Monad m, Applicative m, Functor m) => (a -> m a) -> Inline -> m Inline

-- | Helper method to walk to elements nested below
--   <tt><a>MetaValue</a></tt> nodes.
--   
--   When walking a meta value with this function, only the contents of the
--   traversed meta value element may change. <tt>MetaBool</tt> and
--   <tt>MetaString</tt> will always remain unchanged.
walkMetaValueM :: (Walkable a MetaValue, Walkable a [Block], Walkable a [Inline], Monad f, Applicative f, Functor f) => (a -> f a) -> MetaValue -> f MetaValue

-- | Helper method to walk <tt><a>MetaValue</a></tt> nodes nested below
--   <tt><a>MetaValue</a></tt> nodes.
walkMetaValueM' :: (Monad f, Applicative f, Functor f) => (MetaValue -> f MetaValue) -> MetaValue -> f MetaValue

-- | Helper method to walk the components of a Pandoc element.
walkPandocM :: (Walkable a Meta, Walkable a [Block], Monad m, Applicative m, Functor m) => (a -> m a) -> Pandoc -> m Pandoc
instance (Data.Foldable.Foldable t, Data.Traversable.Traversable t, Text.Pandoc.Walk.Walkable a b) => Text.Pandoc.Walk.Walkable a (t b)
instance (Text.Pandoc.Walk.Walkable a b, Text.Pandoc.Walk.Walkable a c) => Text.Pandoc.Walk.Walkable a (b, c)
instance Text.Pandoc.Walk.Walkable Text.Pandoc.Definition.Inline Text.Pandoc.Definition.Inline
instance Text.Pandoc.Walk.Walkable [Text.Pandoc.Definition.Inline] [Text.Pandoc.Definition.Inline]
instance Text.Pandoc.Walk.Walkable [Text.Pandoc.Definition.Inline] Text.Pandoc.Definition.Inline
instance Text.Pandoc.Walk.Walkable Text.Pandoc.Definition.Inline Text.Pandoc.Definition.Block
instance Text.Pandoc.Walk.Walkable [Text.Pandoc.Definition.Inline] Text.Pandoc.Definition.Block
instance Text.Pandoc.Walk.Walkable Text.Pandoc.Definition.Block Text.Pandoc.Definition.Block
instance Text.Pandoc.Walk.Walkable [Text.Pandoc.Definition.Block] Text.Pandoc.Definition.Block
instance Text.Pandoc.Walk.Walkable [Text.Pandoc.Definition.Block] [Text.Pandoc.Definition.Block]
instance Text.Pandoc.Walk.Walkable Text.Pandoc.Definition.Block Text.Pandoc.Definition.Inline
instance Text.Pandoc.Walk.Walkable [Text.Pandoc.Definition.Block] Text.Pandoc.Definition.Inline
instance Text.Pandoc.Walk.Walkable Text.Pandoc.Definition.Block Text.Pandoc.Definition.Pandoc
instance Text.Pandoc.Walk.Walkable [Text.Pandoc.Definition.Block] Text.Pandoc.Definition.Pandoc
instance Text.Pandoc.Walk.Walkable Text.Pandoc.Definition.Inline Text.Pandoc.Definition.Pandoc
instance Text.Pandoc.Walk.Walkable [Text.Pandoc.Definition.Inline] Text.Pandoc.Definition.Pandoc
instance Text.Pandoc.Walk.Walkable Text.Pandoc.Definition.Meta Text.Pandoc.Definition.Pandoc
instance Text.Pandoc.Walk.Walkable Text.Pandoc.Definition.MetaValue Text.Pandoc.Definition.Pandoc
instance Text.Pandoc.Walk.Walkable Text.Pandoc.Definition.Pandoc Text.Pandoc.Definition.Pandoc
instance Text.Pandoc.Walk.Walkable Text.Pandoc.Definition.Meta Text.Pandoc.Definition.Meta
instance Text.Pandoc.Walk.Walkable Text.Pandoc.Definition.Inline Text.Pandoc.Definition.Meta
instance Text.Pandoc.Walk.Walkable [Text.Pandoc.Definition.Inline] Text.Pandoc.Definition.Meta
instance Text.Pandoc.Walk.Walkable Text.Pandoc.Definition.Block Text.Pandoc.Definition.Meta
instance Text.Pandoc.Walk.Walkable [Text.Pandoc.Definition.Block] Text.Pandoc.Definition.Meta
instance Text.Pandoc.Walk.Walkable Text.Pandoc.Definition.MetaValue Text.Pandoc.Definition.Meta
instance Text.Pandoc.Walk.Walkable Text.Pandoc.Definition.MetaValue Text.Pandoc.Definition.MetaValue
instance Text.Pandoc.Walk.Walkable Text.Pandoc.Definition.Inline Text.Pandoc.Definition.MetaValue
instance Text.Pandoc.Walk.Walkable [Text.Pandoc.Definition.Inline] Text.Pandoc.Definition.MetaValue
instance Text.Pandoc.Walk.Walkable Text.Pandoc.Definition.Block Text.Pandoc.Definition.MetaValue
instance Text.Pandoc.Walk.Walkable [Text.Pandoc.Definition.Block] Text.Pandoc.Definition.MetaValue
instance Text.Pandoc.Walk.Walkable Text.Pandoc.Definition.Inline Text.Pandoc.Definition.Row
instance Text.Pandoc.Walk.Walkable [Text.Pandoc.Definition.Inline] Text.Pandoc.Definition.Row
instance Text.Pandoc.Walk.Walkable Text.Pandoc.Definition.Block Text.Pandoc.Definition.Row
instance Text.Pandoc.Walk.Walkable [Text.Pandoc.Definition.Block] Text.Pandoc.Definition.Row
instance Text.Pandoc.Walk.Walkable Text.Pandoc.Definition.Inline Text.Pandoc.Definition.TableHead
instance Text.Pandoc.Walk.Walkable [Text.Pandoc.Definition.Inline] Text.Pandoc.Definition.TableHead
instance Text.Pandoc.Walk.Walkable Text.Pandoc.Definition.Block Text.Pandoc.Definition.TableHead
instance Text.Pandoc.Walk.Walkable [Text.Pandoc.Definition.Block] Text.Pandoc.Definition.TableHead
instance Text.Pandoc.Walk.Walkable Text.Pandoc.Definition.Inline Text.Pandoc.Definition.TableBody
instance Text.Pandoc.Walk.Walkable [Text.Pandoc.Definition.Inline] Text.Pandoc.Definition.TableBody
instance Text.Pandoc.Walk.Walkable Text.Pandoc.Definition.Block Text.Pandoc.Definition.TableBody
instance Text.Pandoc.Walk.Walkable [Text.Pandoc.Definition.Block] Text.Pandoc.Definition.TableBody
instance Text.Pandoc.Walk.Walkable Text.Pandoc.Definition.Inline Text.Pandoc.Definition.TableFoot
instance Text.Pandoc.Walk.Walkable [Text.Pandoc.Definition.Inline] Text.Pandoc.Definition.TableFoot
instance Text.Pandoc.Walk.Walkable Text.Pandoc.Definition.Block Text.Pandoc.Definition.TableFoot
instance Text.Pandoc.Walk.Walkable [Text.Pandoc.Definition.Block] Text.Pandoc.Definition.TableFoot
instance Text.Pandoc.Walk.Walkable Text.Pandoc.Definition.Inline Text.Pandoc.Definition.Caption
instance Text.Pandoc.Walk.Walkable [Text.Pandoc.Definition.Inline] Text.Pandoc.Definition.Caption
instance Text.Pandoc.Walk.Walkable Text.Pandoc.Definition.Block Text.Pandoc.Definition.Caption
instance Text.Pandoc.Walk.Walkable [Text.Pandoc.Definition.Block] Text.Pandoc.Definition.Caption
instance Text.Pandoc.Walk.Walkable Text.Pandoc.Definition.Inline Text.Pandoc.Definition.Cell
instance Text.Pandoc.Walk.Walkable [Text.Pandoc.Definition.Inline] Text.Pandoc.Definition.Cell
instance Text.Pandoc.Walk.Walkable Text.Pandoc.Definition.Block Text.Pandoc.Definition.Cell
instance Text.Pandoc.Walk.Walkable [Text.Pandoc.Definition.Block] Text.Pandoc.Definition.Cell
instance Text.Pandoc.Walk.Walkable Text.Pandoc.Definition.Inline Text.Pandoc.Definition.Citation
instance Text.Pandoc.Walk.Walkable [Text.Pandoc.Definition.Inline] Text.Pandoc.Definition.Citation
instance Text.Pandoc.Walk.Walkable Text.Pandoc.Definition.Block Text.Pandoc.Definition.Citation
instance Text.Pandoc.Walk.Walkable [Text.Pandoc.Definition.Block] Text.Pandoc.Definition.Citation


-- | Functions for serializing the Pandoc AST to JSON and deserializing
--   from JSON.
--   
--   Example of use: The following script (<tt>capitalize.hs</tt>) 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
--   
--   <pre>
--   pandoc -t json | runghc capitalize.hs | pandoc -f json
--   </pre>
--   
--   or (making capitalize.hs executable)
--   
--   <pre>
--   pandoc --filter ./capitalize.hs
--   </pre>
--   
--   <pre>
--   #!/usr/bin/env runghc
--   import Text.Pandoc.JSON
--   import Data.Char (toUpper)
--   
--   main :: IO ()
--   main = toJSONFilter capitalizeStrings
--   
--   capitalizeStrings :: Inline -&gt; Inline
--   capitalizeStrings (Str s) = Str $ map toUpper s
--   capitalizeStrings x       = x
--   </pre>
module Text.Pandoc.JSON

-- | <a>toJSONFilter</a> 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 <tt>a -&gt;
--   a</tt> or <tt>a -&gt; IO a</tt> where <tt>a</tt> = <a>Block</a>,
--   <a>Inline</a>, <a>Pandoc</a>, <a>Meta</a>, or <a>MetaValue</a>.
--   
--   If your transformation needs to be sensitive to the script's
--   arguments, use a function of type <tt>[String] -&gt; a -&gt; a</tt>
--   (with <tt>a</tt> constrained as above). The <tt>[String]</tt> will be
--   populated with the script's arguments.
--   
--   An alternative is to use the type <tt>Maybe Format -&gt; a -&gt;
--   a</tt>. 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.
class ToJSONFilter m a
toJSONFilter :: ToJSONFilter m a => a -> m ()
instance (Text.Pandoc.Walk.Walkable a Text.Pandoc.Definition.Pandoc, Control.Monad.IO.Class.MonadIO m) => Text.Pandoc.JSON.ToJSONFilter m (a -> a)
instance (Text.Pandoc.Walk.Walkable [a] Text.Pandoc.Definition.Pandoc, Control.Monad.IO.Class.MonadIO m) => Text.Pandoc.JSON.ToJSONFilter m (a -> [a])
instance (Text.Pandoc.Walk.Walkable a Text.Pandoc.Definition.Pandoc, Control.Monad.IO.Class.MonadIO m) => Text.Pandoc.JSON.ToJSONFilter m (a -> m a)
instance (Text.Pandoc.Walk.Walkable [a] Text.Pandoc.Definition.Pandoc, Control.Monad.IO.Class.MonadIO m) => Text.Pandoc.JSON.ToJSONFilter m (a -> m [a])
instance (Text.Pandoc.JSON.ToJSONFilter m a, Control.Monad.IO.Class.MonadIO m) => Text.Pandoc.JSON.ToJSONFilter m ([GHC.Base.String] -> a)
instance (Text.Pandoc.JSON.ToJSONFilter m a, Control.Monad.IO.Class.MonadIO m) => Text.Pandoc.JSON.ToJSONFilter m (GHC.Maybe.Maybe Text.Pandoc.Definition.Format -> a)
