-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Static site generator using Shake -- -- Haskell static site generator that aims to reuse existing libraries -- instead of reinventing the wheel @package rib @version 0.8.0.0 -- | Some commonly useful CSS styles module Rib.Extra.CSS -- | Stock CSS for the kbd element -- -- Based on the MDN demo at, -- https://developer.mozilla.org/en-US/docs/Web/HTML/Element/kbd mozillaKbdStyle :: Css -- | Include the specified Google Fonts googleFonts :: Monad m => [Text] -> HtmlT m () -- | Include the specified stylesheet URL stylesheet :: Monad m => Text -> HtmlT m () -- | Meta tags for The Open Graph protocol: https://ogp.me/ module Rib.Extra.OpenGraph data OpenGraph OpenGraph :: Text -> Maybe URI -> Maybe Text -> Maybe Text -> Text -> Maybe OGType -> Maybe URI -> OpenGraph [_openGraph_title] :: OpenGraph -> Text [_openGraph_url] :: OpenGraph -> Maybe URI [_openGraph_author] :: OpenGraph -> Maybe Text [_openGraph_description] :: OpenGraph -> Maybe Text [_openGraph_siteName] :: OpenGraph -> Text [_openGraph_type] :: OpenGraph -> Maybe OGType [_openGraph_image] :: OpenGraph -> Maybe URI data OGType OGType_Article :: Article -> OGType OGType_Website :: OGType data Article Article :: Maybe Text -> Maybe UTCTime -> Maybe UTCTime -> Maybe UTCTime -> [Text] -> Article [_article_section] :: Article -> Maybe Text [_article_modifiedTime] :: Article -> Maybe UTCTime [_article_publishedTime] :: Article -> Maybe UTCTime [_article_expirationTime] :: Article -> Maybe UTCTime [_article_tag] :: Article -> [Text] instance GHC.Show.Show Rib.Extra.OpenGraph.OpenGraph instance GHC.Classes.Eq Rib.Extra.OpenGraph.OpenGraph instance GHC.Show.Show Rib.Extra.OpenGraph.OGType instance GHC.Classes.Eq Rib.Extra.OpenGraph.OGType instance GHC.Show.Show Rib.Extra.OpenGraph.Article instance GHC.Classes.Eq Rib.Extra.OpenGraph.Article instance Lucid.Base.ToHtml Rib.Extra.OpenGraph.OpenGraph instance Lucid.Base.ToHtml Rib.Extra.OpenGraph.OGType instance Lucid.Base.ToHtml Rib.Extra.OpenGraph.Article module Rib.Settings -- | The settings with which Rib is run -- -- RibSettings is initialized with the values passed to run data RibSettings RibSettings :: Path Rel Dir -> Path Rel Dir -> Verbosity -> Bool -> RibSettings [_ribSettings_inputDir] :: RibSettings -> Path Rel Dir [_ribSettings_outputDir] :: RibSettings -> Path Rel Dir -- | Shake verbosity level [_ribSettings_verbosity] :: RibSettings -> Verbosity -- | Whether we must try to generate all files even if they have not been -- modified since last generation. [_ribSettings_fullGen] :: RibSettings -> Bool -- | Combinators for working with Shake. module Rib.Shake -- | Shake action to copy static files as is. buildStaticFiles :: [Path Rel File] -> Action () -- | Run the given action when any file matching the patterns changes forEvery :: [Path Rel File] -> (Path Rel File -> Action a) -> Action [a] -- | Write the given file but only when it has been modified. -- -- Also, always writes under ribOutputDir writeFileCached :: Path Rel File -> String -> Action () -- | Input directory containing source files -- -- This is same as the first argument to run ribInputDir :: Action (Path Rel Dir) -- | Output directory where files are generated -- -- This is same as the second argument to run ribOutputDir :: Action (Path Rel Dir) -- | Like getDirectoryFiles but works with Path getDirectoryFiles' :: Typeable b => Path b Dir -> [Path Rel File] -> Action [Path Rel File] -- | Type-safe routes for static sites. module Rib.Route -- | A route is a GADT which represents the individual routes in a static -- site. -- -- r represents the data used to render that particular route. class IsRoute (r :: Type -> Type) -- | Return the filepath (relative to ribInputDir) where the -- generated content for this route should be written. routeFile :: (IsRoute r, MonadThrow m) => r a -> m (Path Rel File) -- | The absolute URL to this route (relative to site root) routeUrl :: IsRoute r => r a -> Text -- | The relative URL to this route routeUrlRel :: IsRoute r => r a -> Text -- | Write the content s to the file corresponding to the given -- route. -- -- This is similar to writeFileCached, but takes a route instead -- of a filepath as its argument. writeRoute :: (IsRoute r, ToString s) => r a -> s -> Action () -- | Helpers for working with Pandoc documents module Rib.Parser.Pandoc -- | Parse a lightweight markup language using Pandoc parse :: (ReaderOptions -> Text -> PandocIO Pandoc) -> Path Rel File -> Action Pandoc -- | Pure version of parse parsePure :: (ReaderOptions -> Text -> PandocPure Pandoc) -> Text -> Pandoc -- | Render a Pandoc document to HTML render :: Monad m => Pandoc -> HtmlT m () -- | Render a list of Pandoc Inline values as Lucid HTML -- -- Useful when working with Meta values from the document -- metadata. renderPandocInlines :: Monad m => [Inline] -> HtmlT m () -- | Extract the Pandoc metadata as JSON value extractMeta :: Pandoc -> Maybe (Either Text Value) -- | Get the top-level heading as Lucid HTML getH1 :: Monad m => Pandoc -> Maybe (HtmlT m ()) -- | Get the document table of contents getToC :: Monad m => Pandoc -> HtmlT m () -- | Get the first image in the document if one exists getFirstImg :: Pandoc -> Maybe Text data Pandoc -- | Parsing Markdown using the mmark parser. module Rib.Parser.MMark -- | Parse Markdown using mmark parse :: Path Rel File -> Action MMark -- | Pure version of parse parsePure :: FilePath -> Text -> Either Text MMark -- | Like parse but takes a custom list of MMark extensions parseWith :: [Extension] -> Path Rel File -> Action MMark -- | Like parsePure but takes a custom list of MMark extensions parsePureWith :: [Extension] -> FilePath -> Text -> Either Text MMark defaultExts :: [Extension] -- | Render a MMark document as HTML render :: Monad m => MMark -> HtmlT m () -- | Get the first image in the document if one exists getFirstImg :: MMark -> Maybe URI -- | Get the first paragraph text of a MMark document. -- -- Useful to determine "preview" of your notes. getFirstParagraphText :: MMark -> Maybe Text -- | Extract contents of an optional YAML block that may have been parsed. projectYaml :: MMark -> Maybe Value -- | 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 -- | Parser for Dhall configuration files. -- -- Use makeHaskellTypes to create the Haskell type first. And then -- call parse from your Shake action. module Rib.Parser.Dhall -- | Parse a Dhall file as Haskell type. parse :: FromDhall a => [Path Rel File] -> Path Rel File -> Action a -- | Filesystem watching using fsnotify module Rib.Watch -- | Recursively monitor the contents of the given path and invoke the -- given IO action for every event triggered. -- -- If multiple events fire rapidly, the IO action is invoked only once, -- taking those multiple events as its argument. onTreeChange :: Path b t -> ([Event] -> IO ()) -> IO () -- | CLI interface for Rib. -- -- Mostly you would only need run, passing it your Shake build -- action. module Rib.App -- | Rib CLI commands data Command OneOff :: Command -- | Generate the site once. Generate :: Bool -> Command -- | Force a full generation of all files even if they were not -- modified [full] :: Command -> Bool -- | Watch for changes in the input directory and run Generate Watch :: Command -- | Run a HTTP server serving content from the output directory Serve :: Int -> Bool -> Command -- | Port to bind the server [port] :: Command -> Int -- | Unless set run WatchAndGenerate automatically [dontWatch] :: Command -> Bool -- | Commandline parser Parser for the Rib CLI commandParser :: Parser Command -- | 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 Command runWith :: Path Rel Dir -> Path Rel Dir -> Action () -> Command -> IO () instance GHC.Generics.Generic Rib.App.Command instance GHC.Classes.Eq Rib.App.Command instance GHC.Show.Show Rib.App.Command module Rib -- | 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 data Pandoc