rib-0.5.0.0: Static site generator using Shake

Safe HaskellNone
LanguageHaskell2010

Rib.Document

Contents

Synopsis

Document type

data Document repr meta Source #

A document written in a lightweight markup language (LML)

The type variable repr indicates the representation type of the Markup parser to be used.

Instances
(Show repr, Show meta) => Show (Document repr meta) Source # 
Instance details

Defined in Rib.Document

Methods

showsPrec :: Int -> Document repr meta -> ShowS #

show :: Document repr meta -> String #

showList :: [Document repr meta] -> ShowS #

Generic (Document repr meta) Source # 
Instance details

Defined in Rib.Document

Associated Types

type Rep (Document repr meta) :: Type -> Type #

Methods

from :: Document repr meta -> Rep (Document repr meta) x #

to :: Rep (Document repr meta) x -> Document repr meta #

type Rep (Document repr meta) Source # 
Instance details

Defined in Rib.Document

type Rep (Document repr meta) = D1 (MetaData "Document" "Rib.Document" "rib-0.5.0.0-inplace" False) (C1 (MetaCons "Document" PrefixI True) ((S1 (MetaSel (Just "_document_path") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Path Rel File)) :*: S1 (MetaSel (Just "_document_val") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 repr)) :*: (S1 (MetaSel (Just "_document_html") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Html ())) :*: S1 (MetaSel (Just "_document_meta") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 meta))))

mkDocumentFrom Source #

Arguments

:: (MonadError DocumentError m, MonadIO m, Markup repr, FromJSON meta) 
=> ("relpath" :! Path Rel File)

File path, used only to identify (not access) the document

-> ("path" :! Path b File)

Actual file path, for access and reading

-> m (Document repr meta) 

Parse, render to HTML and extract metadata from the given file.

Return the Document type containing converted values.

Document properties

documentVal :: Document repr meta -> repr Source #

documentHtml :: Document repr meta -> Html () Source #

documentMeta :: Document repr meta -> meta Source #

documentUrl :: Document repr meta -> Text Source #

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.