-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Shake-based technical documentation generator; HTML & PDF -- -- Shakebook is a documentation generator aimed at covering all the bases -- for mathematical, technical and scientific diagrams and typesetting. -- Shakebook provides combinators for taking markdown files and combining -- them into documents, but allowing the user to control how. Shakebook -- provides general combinators for templating single pages, cofree -- comonads for representing tables of contents, and zipper comonads for -- representing pagers. @package shakebook @version 0.3.0.0 module Shakebook.Mustache -- | A compiled Template with metadata. data Template -- | Build a single page straight from a template. buildPageAction :: MonadAction m => Path Rel File -> Value -> Path Rel File -> m () buildPageActionWithin :: MonadAction m => Within Rel (Path Rel File) -> Value -> Within Rel (Path Rel File) -> m () compileTemplate' :: MonadAction m => Path Rel File -> m Template module Shakebook.Pandoc -- | Natural transformation from PandocIO to a MonadAction runPandocA :: (MonadAction m, MonadThrow m) => PandocIO a -> m a data PandocActionException PandocActionException :: String -> PandocActionException -- | Read a markdown file as an Action. readMDFile :: (MonadAction m, MonadThrow m) => ReaderOptions -> Path Rel File -> m Pandoc -- | Read a markdown file as an Action. readMDFileIn :: (MonadAction m, MonadThrow m) => ReaderOptions -> Path Rel Dir -> Path Rel File -> m Pandoc -- | Like readMDFile but accepts a Within readMDFileWithin :: (MonadAction m, MonadThrow m) => ReaderOptions -> Within Rel (Path Rel File) -> m Pandoc -- | Find all the images in a Pandoc data structure and call -- need on them. needPandocImagesIn :: (MonadAction m, MonadThrow m) => Path Rel Dir -> Pandoc -> m () -- | Make a pdflatex in an Action. makePDFLaTeX :: (MonadAction m, MonadThrow m) => WriterOptions -> Pandoc -> m (Either ByteString ByteString) -- | Precarious function that demotes Header numbers within the Pandoc -- according to its depth in the Cofree. This is so that Headers that H1s -- that would correctly display for an HTML page will be lower in the -- table of contents in the PDF equivalent. progressivelyDemoteHeaders :: Cofree [] Pandoc -> Cofree [] Pandoc -- | For a list of file extensions, replace the images with an Inline based -- on its src path. replaceUnusableImages :: MonadThrow m => [String] -> (Text -> Inline) -> Pandoc -> m Pandoc prefixAllImages :: Path Rel Dir -> Pandoc -> Pandoc instance GHC.Classes.Eq Shakebook.Pandoc.PandocActionException instance GHC.Show.Show Shakebook.Pandoc.PandocActionException instance GHC.Exception.Type.Exception Shakebook.Pandoc.PandocActionException module Shakebook.Data newtype PathDisplay a t PathDisplay :: Path a t -> PathDisplay a t newtype WithinDisplay a t WithinDisplay :: Within a t -> WithinDisplay a t data SbConfig SbConfig :: Path Rel Dir -> Path Rel Dir -> Text -> ReaderOptions -> WriterOptions -> Int -> (Value -> Value) -> SbConfig [sbSrcDir] :: SbConfig -> Path Rel Dir [sbOutDir] :: SbConfig -> Path Rel Dir [sbBaseUrl] :: SbConfig -> Text [sbMdRead] :: SbConfig -> ReaderOptions [sbHTWrite] :: SbConfig -> WriterOptions [sbPPP] :: SbConfig -> Int [sbGlobalApply] :: SbConfig -> Value -> Value data ShakebookEnv ShakebookEnv :: LogFunc -> SbConfig -> ShakebookEnv [logFunc] :: ShakebookEnv -> LogFunc [sbConfig] :: ShakebookEnv -> SbConfig class HasSbConfig a sbConfigL :: HasSbConfig a => Lens' a SbConfig -- | View the "src-path" field of a JSON Value. viewSrcPath :: Value -> Text -- | Add "src-path" field based on input Text. withSrcPath :: Text -> Value -> Value -- | View the "base-url" of a JSON Value. viewBaseUrl :: Value -> Text -- | Add "base-url" field from input Text. withBaseUrl :: Text -> Value -> Value -- | View the "full-url" of a JSON Value. viewFullUrl :: Value -> Text -- | Add "full-url" field from input Text. withFullUrl :: Text -> Value -> Value -- | View the "image" field of a JSON vaule. viewImage :: Value -> Text -- | View the "url" field of a JSON Value. viewUrl :: Value -> Text -- | Add "url" field from input Text. withUrl :: Text -> Value -> Value -- | Assuming a "url" field, enrich via a baseURL enrichFullUrl :: Text -> Value -> Value -- | Assuming a 'src-path' field, enrich using withUrl using a Text -> -- Text transformation. enrichUrl :: (Text -> Text) -> Value -> Value leadingSlash :: Path Abs Dir withHtmlExtension :: MonadThrow m => Path Rel File -> m (Path Rel File) withMarkdownExtension :: MonadThrow m => Path Rel File -> m (Path Rel File) withHaskellExtension :: MonadThrow m => Path Rel File -> m (Path Rel File) generateSupposedUrl :: MonadThrow m => Path Rel File -> m (Path Abs File) enrichSupposedUrl :: (MonadReader r m, HasSbConfig r, MonadThrow m) => Value -> m Value -- | Get a JSON Value of Markdown Data with markdown body as "contents" -- field and the srcPath as "srcPath" field. loadMarkdownAsJSON :: (MonadReader r m, HasSbConfig r, MonadAction m, MonadThrow m) => Within Rel (Path Rel File) -> m Value immediateShoots :: Cofree [] a -> [a] instance Shakebook.Data.HasSbConfig Shakebook.Data.ShakebookEnv instance RIO.Prelude.Logger.HasLogFunc Shakebook.Data.ShakebookEnv instance RIO.Prelude.Display.Display t => RIO.Prelude.Display.Display (Shakebook.Data.WithinDisplay a t) instance RIO.Prelude.Display.Display t => RIO.Prelude.Display.Display [Shakebook.Data.WithinDisplay a t] instance RIO.Prelude.Display.Display (Shakebook.Data.PathDisplay a t) -- | Conventions used for common shakebook projects, lenses, enrichments, -- affixes. module Shakebook.Conventions -- | View the "content" field of a JSON Value. viewContent :: Value -> Text -- | View the "date" field of a JSON Value as a UTCTime. viewPostTime :: Value -> UTCTime -- | View the "date" field of a JSON Value as Text. viewPostTimeRaw :: Value -> Text -- | View the "src-path" field of a JSON Value. viewSrcPath :: Value -> Text -- | View the "tags" field of a JSON Value as a list. viewTags :: Value -> [Text] -- | View the "title" field of a JSON Value. viewTitle :: Value -> Text -- | View all post tags for a list of posts. viewAllPostTags :: [Value] -> [Text] -- | View all posts times for a list of posts. viewAllPostTimes :: [Value] -> [UTCTime] -- | Add "highlighting-css" field from input Style. withHighlighting :: Style -> Value -> Value -- | Add "next" field from input Value. withNext :: Maybe Value -> Value -> Value -- | Add "pages" field from input [Value]. withPages :: [Value] -> Value -> Value -- | Add "prettydate" field using input Text. withPrettyDate :: Text -> Value -> Value -- | Add "previous" field using input Value. withPrevious :: Maybe Value -> Value -> Value -- | Add "posts" field based on input [Value]. withPosts :: [Value] -> Value -> Value -- | Add "recent-posts" field using input Value. withRecentPosts :: [Value] -> Value -> Value -- | Add "social-links" field based on input [Value]. withSocialLinks :: [Value] -> Value -> Value -- | Add "site-title" field from input Text. withSiteTitle :: Text -> Value -> Value -- | Add "subsections" field based on input [Value]. withSubsections :: [Value] -> Value -> Value -- | Add "tag-index" field based on input [Value]. withTagIndex :: [Value] -> Value -> Value -- | Add "tag-links" field based on input [Value]. withTagLinks :: [Value] -> Value -> Value -- | Add "teaser" field based on input Text. withTeaser :: Text -> Value -> Value -- | Add "title" field based on input Text. withTitle :: Text -> Value -> Value -- | Assuming a "date" field, enrich using withPrettyDate and a format -- string. enrichPrettyDate :: (UTCTime -> String) -> Value -> Value -- | Assuming a "tags" field, enrich using withTagLinks. enrichTagLinks :: (Text -> Text) -> Value -> Value -- | Assuming a "content" field with a spitter section, enrich using -- withTeaser enrichTeaser :: Text -> Value -> Value -- | Extend a Zipper of JSON Values to add "next" objects. extendNext :: Zipper [] Value -> Zipper [] Value -- | Extend a Zipper of JSON Values to add "previous" objects. extendPrevious :: Zipper [] Value -> Zipper [] Value -- | Add both "next" and "previous" fields using withPostNext and -- withPostPrevious extendNextPrevious :: Zipper [] Value -> Zipper [] Value extendPageNeighbours :: Int -> Zipper [] Value -> Zipper [] Value -- | Create a blog navbar object for a posts section, with layers "toc1", -- "toc2", and "toc3". genBlogNavbarData :: Text -> Text -> (UTCTime -> Text) -> (UTCTime -> Text) -> [Value] -> Value genIndexPageData :: (MonadReader r m, HasSbConfig r, MonadThrow m) => [Value] -> Text -> (Text -> Text) -> Int -> m (Zipper [] Value) -- | Create link data object with fields "id" and "url" using an id and a -- function | transforming an id into a url. genLinkData :: Text -> Text -> Value genPageData :: Text -> (Text -> Text) -> Zipper [] [Value] -> Value -- | Create a toc navbar object for a docs section, with layers "toc1", -- "toc2" and "toc3". genTocNavbarData :: Cofree [] Value -> Value -- | Sort a lists of posts by date. dateSortPosts :: [Value] -> [Value] monthFilterPosts :: UTCTime -> [Value] -> [Value] -- | Check whether two posts were posted in the same month. sameMonth :: UTCTime -> UTCTime -> Bool -- | Filter a lists of posts by tag. tagFilterPosts :: Text -> [Value] -> [Value] module Shakebook.Feed -- | Convert a Post to an Atom Entry asAtomEntry :: Value -> Entry -- | Build an Atom Feed from a list of posts. buildFeed :: MonadAction m => Text -> Text -> [Value] -> Path Rel File -> m () module Shakebook.Defaults defaultMonthUrlFormat :: UTCTime -> String defaultPrettyMonthFormat :: UTCTime -> String defaultPrettyTimeFormat :: UTCTime -> String defaultMonthUrlFragment :: UTCTime -> Text defaultEnrichPost :: Value -> Value defaultMarkdownReaderOptions :: ReaderOptions defaultHtml5WriterOptions :: WriterOptions defaultLatexWriterOptions :: WriterOptions defaultVideoReplacement :: Text -> Text -> Inline buildPDF :: (MonadThrow m, MonadAction m, MonadReader r m, HasSbConfig r) => Cofree [] (Path Rel File) -> Path Rel File -> FilePath -> m () module Shakebook