-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Static site generator using Shake
--
-- Haskell library for writing your own static site generator
@package rib
@version 0.5.0.0
module Rib.Document
-- | A document written in a lightweight markup language (LML)
--
-- The type variable repr indicates the representation type of
-- the Markup parser to be used.
data Document repr meta
-- | Parse, render to HTML and extract metadata from the given file.
--
-- Return the Document type containing converted values.
mkDocumentFrom :: forall m b repr meta. (MonadError DocumentError m, MonadIO m, Markup repr, FromJSON meta) => ("relpath" :! Path Rel File) -> ("path" :! Path b File) -> m (Document repr meta)
documentPath :: Document repr meta -> Path Rel File
documentVal :: Document repr meta -> repr
documentHtml :: Document repr meta -> Html ()
documentMeta :: Document repr meta -> meta
-- | 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.
documentUrl :: Document repr meta -> Text
instance (GHC.Show.Show repr, GHC.Show.Show meta) => GHC.Show.Show (Rib.Document.Document repr meta)
instance GHC.Generics.Generic (Rib.Document.Document repr meta)
instance GHC.Show.Show Rib.Document.DocumentError
module Rib.Markup.MMark
-- | Parse and render the markup directly to HTML
renderMarkdown :: Text -> Html ()
-- | Get the first image in the document if one exists
getFirstImg :: MMark -> Maybe URI
-- | Representation of complete markdown document. You can't look inside of
-- MMark on purpose. The only way to influence an MMark
-- document you obtain as a result of parsing is via the extension
-- mechanism.
data MMark
instance Rib.Markup.Markup Text.MMark.Type.MMark
-- | Helpers for working with Pandoc documents
module Rib.Markup.Pandoc
-- | Parse and render the markup directly to HTML
renderPandoc :: Path Rel File -> Text -> Html ()
-- | Render a list of Pandoc Inline values as Lucid HTML
--
-- Useful when working with Meta values from the document
-- metadata.
renderPandocInlines :: [Inline] -> Html ()
-- | 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
data Pandoc
instance GHC.Classes.Eq Rib.Markup.Pandoc.UnknownExtension
instance GHC.Show.Show Rib.Markup.Pandoc.UnknownExtension
instance GHC.Show.Show Rib.Markup.Pandoc.RibPandocError
instance Rib.Markup.Markup Text.Pandoc.Definition.Pandoc
-- | Combinators for working with Shake.
--
-- See the source of buildAction for example usage.
module Rib.Shake
-- | Convert the given pattern of source files into their HTML.
buildHtmlMulti :: forall repr meta. (Markup repr, FromJSON meta) => Path Rel File -> (Document repr meta -> Html ()) -> Action [Document repr meta]
-- | Build a single HTML file with the given value
buildHtml :: Path Rel File -> Html () -> Action ()
-- | Like readDoc' but operates on multiple files
readDocMulti :: forall repr meta. (Markup repr, FromJSON meta) => Path Rel File -> Action [Document repr meta]
-- | Shake action to copy static files as is
buildStaticFiles :: [Path Rel File] -> Action ()
data Dirs
Dirs :: (Path Rel Dir, Path Rel Dir) -> Dirs
-- | CLI interface for Rib.
--
-- Typically you would call run passing your Shake build action.
module Rib.App
-- | Application modes
--
-- The mode in which to run the Rib CLI
data App
-- | Generate static files once.
Generate :: Bool -> App
-- | Force a full generation of all files even if they were not
-- modified
[full] :: App -> Bool
-- | Watch for changes in the input directory and run Generate
WatchAndGenerate :: App
-- | Run a HTTP server serving content from the output directory
Serve :: Int -> Bool -> App
-- | Port to bind the server
[port] :: App -> Int
-- | Unless set run WatchAndGenerate automatically
[dontWatch] :: App -> Bool
-- | Run Rib using arguments passed in the command line.
run :: Path Rel Dir -> Path Rel Dir -> Action () -> IO ()
-- | Like run but with an explicitly passed App mode
runWith :: Path Rel Dir -> Path Rel Dir -> Action () -> App -> IO ()
instance GHC.Classes.Eq Rib.App.App
instance GHC.Show.Show Rib.App.App
instance Data.Data.Data Rib.App.App
module Rib
-- | 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 ()
-- | A document written in a lightweight markup language (LML)
--
-- The type variable repr indicates the representation type of
-- the Markup parser to be used.
data Document repr meta
documentPath :: Document repr meta -> Path Rel File
documentVal :: Document repr meta -> repr
documentHtml :: Document repr meta -> Html ()
documentMeta :: Document repr meta -> meta
-- | 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.
documentUrl :: Document repr meta -> Text
-- | Representation of complete markdown document. You can't look inside of
-- MMark on purpose. The only way to influence an MMark
-- document you obtain as a result of parsing is via the extension
-- mechanism.
data MMark
-- | Parse and render the markup directly to HTML
renderMarkdown :: Text -> Html ()
data Pandoc
-- | Parse and render the markup directly to HTML
renderPandoc :: Path Rel File -> Text -> Html ()