-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Haskell library for writing your own static site generator
@package rib
@version 0.2.0.0
-- | Helpers for working with Pandoc documents
module Rib.Pandoc
-- | Parse the source text as a Pandoc document
--
-- Supports the includeCode extension.
parse :: (ReaderOptions -> Text -> PandocIO Pandoc) -> Text -> IO Pandoc
-- | Pure version of parse
parsePure :: (ReaderOptions -> Text -> PandocPure Pandoc) -> Text -> Pandoc
-- | Render a Pandoc document as Lucid HTML
render :: Pandoc -> Html ()
-- | Render a list of Pandoc Inline values as Lucid HTML
--
-- Useful when working with Meta values from the document
-- metadata.
renderInlines :: [Inline] -> Html ()
-- | Get the metadata value for the given key in a Pandoc document.
--
-- It is recommended to call this function with type application
-- specifying the type of a.
--
-- MetaValue is parsed in accordance with the IsMetaValue
-- class constraint. Available instances:
--
--
-- - Html: parse value as a Pandoc document and convert to Lucid
-- Html
-- - Text: parse a raw value (Inline with one Str value)
-- - [a]: parse a list of values
-- - Read a => a: parse a raw value and then read it.
--
getMeta :: IsMetaValue a => String -> Pandoc -> Maybe a
-- | Add, or set, a metadata data key to the given Haskell value
setMeta :: Show a => String -> a -> Pandoc -> Pandoc
-- | Parse the metadata source as a Pandoc Meta value
parseMeta :: ByteString -> IO Meta
-- | Get the top-level heading as Lucid HTML
getH1 :: Pandoc -> Maybe (Html ())
-- | Get the first image in the document if one exists
getFirstImg :: Pandoc -> Maybe Text
instance Rib.Pandoc.IsMetaValue [Text.Pandoc.Definition.Inline]
instance Rib.Pandoc.IsMetaValue (Lucid.Base.Html ())
instance Rib.Pandoc.IsMetaValue Data.Text.Internal.Text
instance Rib.Pandoc.IsMetaValue a => Rib.Pandoc.IsMetaValue [a]
instance GHC.Read.Read a => Rib.Pandoc.IsMetaValue a
-- | Serve generated static files with HTTP
module Rib.Server
-- | Run a HTTP server to serve a directory of static files
--
-- Allow URLs of the form /foo/bar to serve
-- ${path}/foo/bar.html
serve :: Int -> FilePath -> IO ()
-- | Return the URL for the given .html file under serve directory
--
-- File path must be relative to the serve directory.
--
-- You may also pass source paths as long as they map directly to
-- destination path except for file extension.
getHTMLFileUrl :: FilePath -> Text
-- | CLI interface for Rib.
--
-- Typically you would call run passing your Shake build action.
module Rib.App
data App
Watch :: App
Serve :: Int -> Bool -> App
[port] :: App -> Int
[dontWatch] :: App -> Bool
Generate :: Bool -> App
[force] :: App -> Bool
-- | Run Rib using arguments passed in the command line.
run :: Action () -> IO ()
-- | Like run but with an explicitly passed App mode
runWith :: Action () -> App -> IO ()
-- | The path where static files will be generated.
--
-- Rib's server uses this directory when serving files.
ribOutputDir :: FilePath
-- | Directory from which source content will be read.
ribInputDir :: FilePath
instance GHC.Classes.Eq Rib.App.App
instance GHC.Show.Show Rib.App.App
instance Data.Data.Data Rib.App.App
-- | Combinators for working with Shake.
--
-- The functions in this module work with ribInputDir and
-- ribOutputDir.
--
-- See the source of buildAction for example usage.
module Rib.Shake
-- | Convert the given pattern of source files into their HTML.
buildHtmlMulti :: (FilePattern, ReaderOptions -> Text -> PandocIO Pandoc) -> ((FilePath, Pandoc) -> Html ()) -> Action [(FilePath, Pandoc)]
-- | Build a single HTML file with the given value
buildHtml :: FilePath -> Html () -> Action ()
-- | Read and parse a Pandoc source document
--
-- If an associated metadata file exists (same filename, with
-- .yaml as extension), use it to specify the metadata of the
-- document.
readPandoc :: (ReaderOptions -> Text -> PandocIO Pandoc) -> FilePath -> Action Pandoc
-- | Like readPandoc but operates on multiple files
readPandocMulti :: (FilePattern, ReaderOptions -> Text -> PandocIO Pandoc) -> Action [(FilePath, Pandoc)]
-- | Shake action to copy static files as is
buildStaticFiles :: [FilePattern] -> Action [FilePath]
-- | Sensible defaults for writing the most simple static site
module Rib.Simple
-- | Type of page to be generated
data Page
-- | Index page linking to a list of posts
Page_Index :: [(FilePath, Pandoc)] -> Page
-- | Individual post page
Page_Post :: (FilePath, Pandoc) -> Page
-- | Shake build action for the most simple static site
--
--
-- - Copies static/ as is.
-- - Builds *.md, *.rst and *.org as
-- HTML
-- - Builds an index.html of all pages unless draft
-- metadata is set to True.
--
buildAction :: (Page -> Html ()) -> Action ()
instance Data.Aeson.Types.ToJSON.ToJSON Rib.Simple.Page
instance Data.Aeson.Types.FromJSON.FromJSON Rib.Simple.Page
instance GHC.Show.Show Rib.Simple.Page
instance GHC.Generics.Generic Rib.Simple.Page