rib-0.8.0.0: Static site generator using Shake

Safe HaskellNone
LanguageHaskell2010

Rib.Parser.Pandoc

Contents

Description

Helpers for working with Pandoc documents

Synopsis

Parsing

parse Source #

Arguments

:: (ReaderOptions -> Text -> PandocIO Pandoc)

The pandoc text reader function to use, eg: readMarkdown

-> Path Rel File 
-> Action Pandoc 

Parse a lightweight markup language using Pandoc

Rendering

render :: Monad m => Pandoc -> HtmlT m () Source #

Render a Pandoc document to HTML

renderPandocInlines :: Monad m => [Inline] -> HtmlT m () Source #

Render a list of Pandoc Inline values as Lucid HTML

Useful when working with Meta values from the document metadata.

Extracting information

extractMeta :: Pandoc -> Maybe (Either Text Value) Source #

Extract the Pandoc metadata as JSON value

getH1 :: Monad m => Pandoc -> Maybe (HtmlT m ()) Source #

Get the top-level heading as Lucid HTML

getToC :: Monad m => Pandoc -> HtmlT m () Source #

Get the document table of contents

getFirstImg Source #

Arguments

:: Pandoc 
-> Maybe Text

Relative URL path to the image

Get the first image in the document if one exists

Re-exports

data Pandoc #

Instances
Eq Pandoc 
Instance details

Defined in Text.Pandoc.Definition

Methods

(==) :: Pandoc -> Pandoc -> Bool #

(/=) :: Pandoc -> Pandoc -> Bool #

Data Pandoc 
Instance details

Defined in Text.Pandoc.Definition

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Pandoc -> c Pandoc #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Pandoc #

toConstr :: Pandoc -> Constr #

dataTypeOf :: Pandoc -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Pandoc) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Pandoc) #

gmapT :: (forall b. Data b => b -> b) -> Pandoc -> Pandoc #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Pandoc -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Pandoc -> r #

gmapQ :: (forall d. Data d => d -> u) -> Pandoc -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Pandoc -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Pandoc -> m Pandoc #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Pandoc -> m Pandoc #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Pandoc -> m Pandoc #

Ord Pandoc 
Instance details

Defined in Text.Pandoc.Definition

Read Pandoc 
Instance details

Defined in Text.Pandoc.Definition

Show Pandoc 
Instance details

Defined in Text.Pandoc.Definition

Generic Pandoc 
Instance details

Defined in Text.Pandoc.Definition

Associated Types

type Rep Pandoc :: Type -> Type #

Methods

from :: Pandoc -> Rep Pandoc x #

to :: Rep Pandoc x -> Pandoc #

Semigroup Pandoc 
Instance details

Defined in Text.Pandoc.Definition

Monoid Pandoc 
Instance details

Defined in Text.Pandoc.Definition

NFData Pandoc 
Instance details

Defined in Text.Pandoc.Definition

Methods

rnf :: Pandoc -> () #

ToJSON Pandoc 
Instance details

Defined in Text.Pandoc.Definition

FromJSON Pandoc 
Instance details

Defined in Text.Pandoc.Definition

HasMeta Pandoc 
Instance details

Defined in Text.Pandoc.Builder

Methods

setMeta :: ToMetaValue b => Text -> b -> Pandoc -> Pandoc #

deleteMeta :: Text -> Pandoc -> Pandoc #

Walkable Block Pandoc 
Instance details

Defined in Text.Pandoc.Walk

Methods

walk :: (Block -> Block) -> Pandoc -> Pandoc #

walkM :: (Monad m, Applicative m, Functor m) => (Block -> m Block) -> Pandoc -> m Pandoc #

query :: Monoid c => (Block -> c) -> Pandoc -> c #

Walkable Inline Pandoc 
Instance details

Defined in Text.Pandoc.Walk

Methods

walk :: (Inline -> Inline) -> Pandoc -> Pandoc #

walkM :: (Monad m, Applicative m, Functor m) => (Inline -> m Inline) -> Pandoc -> m Pandoc #

query :: Monoid c => (Inline -> c) -> Pandoc -> c #

Walkable Pandoc Pandoc 
Instance details

Defined in Text.Pandoc.Walk

Methods

walk :: (Pandoc -> Pandoc) -> Pandoc -> Pandoc #

walkM :: (Monad m, Applicative m, Functor m) => (Pandoc -> m Pandoc) -> Pandoc -> m Pandoc #

query :: Monoid c => (Pandoc -> c) -> Pandoc -> c #

Walkable [Block] Pandoc 
Instance details

Defined in Text.Pandoc.Walk

Methods

walk :: ([Block] -> [Block]) -> Pandoc -> Pandoc #

walkM :: (Monad m, Applicative m, Functor m) => ([Block] -> m [Block]) -> Pandoc -> m Pandoc #

query :: Monoid c => ([Block] -> c) -> Pandoc -> c #

Walkable [Inline] Pandoc 
Instance details

Defined in Text.Pandoc.Walk

Methods

walk :: ([Inline] -> [Inline]) -> Pandoc -> Pandoc #

walkM :: (Monad m, Applicative m, Functor m) => ([Inline] -> m [Inline]) -> Pandoc -> m Pandoc #

query :: Monoid c => ([Inline] -> c) -> Pandoc -> c #

type Rep Pandoc 
Instance details

Defined in Text.Pandoc.Definition

type Rep Pandoc = D1 (MetaData "Pandoc" "Text.Pandoc.Definition" "pandoc-types-1.20-lzfUc8G4Y8IiRaWHrGIBP" False) (C1 (MetaCons "Pandoc" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Meta) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Block])))