Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Document repr meta
- 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
- documentUrl :: Document repr meta -> Text
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 # | |
Generic (Document repr meta) Source # | |
type Rep (Document repr meta) Source # | |
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)))) |
:: (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.