shakebook-0.8.1.0: Shake-based technical documentation generator; HTML & PDF

Safe HaskellNone
LanguageHaskell2010

Shakebook.Pandoc

Synopsis

Documentation

runPandocA :: (MonadAction m, MonadThrow m) => PandocIO a -> m a Source #

Natural transformation from PandocIO to a MonadAction

readMDFile :: (MonadAction m, MonadThrow m) => ReaderOptions -> Path Rel File -> m Pandoc Source #

Read a markdown file as an Action.

readMDFileIn :: (MonadAction m, MonadThrow m) => ReaderOptions -> Path Rel Dir -> Path Rel File -> m Pandoc Source #

Read a markdown file as an Action.

needPandocImagesIn :: (MonadAction m, MonadThrow m) => Path Rel Dir -> Pandoc -> m () Source #

Find all the images in a Pandoc data structure and call need on them.

makePDFLaTeX :: (MonadAction m, MonadThrow m) => WriterOptions -> Pandoc -> m ByteString Source #

Make a pdflatex in an Action.

progressivelyDemoteHeaders :: Cofree [] Pandoc -> Cofree [] Pandoc Source #

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.

replaceUnusableImages :: MonadThrow m => [String] -> (Text -> Inline) -> Pandoc -> m Pandoc Source #

For a list of file extensions, replace the images with an Inline based on its src path.

prefixAllImages :: Path Rel Dir -> Pandoc -> Pandoc Source #

Prefix all images in a Pandoc with a directory.

flattenMeta :: MonadAction m => (Pandoc -> PandocIO Text) -> Meta -> m Value Source #

Flatten a pandoc Meta object to a Value.

viewContent :: ToJSON a => a -> Text Source #

View the "content" field of a JSON value.

viewSrcPath :: ToJSON a => a -> Text Source #

View the "src-path" field of a JSON Value.

viewUrl :: ToJSON a => a -> Text Source #

View the "url" field of a JSON Value.

loadMarkdownAsJSON :: (MonadAction m, MonadThrow m) => ReaderOptions -> WriterOptions -> Within Rel (Path Rel File) -> m Value Source #

Get a JSON Value of Markdown Data with markdown body as "contents" field and the srcPath as "srcPath" field.