HTMell-0.1.0.0: Minimal filesystem powered markdown content management system
Copyright(c) 2021-2022 Mirko Westermeier
LicenseMIT
Safe HaskellSafe-Inferred
LanguageHaskell2010

HTMell.Content

Description

HTMell content related types and functions

Synopsis

The content type class

class HTMellContent c where #

Content stored in HTree trees. Instances must provide a function to read content from filesystem and extract metadata and HTML from a content value.

Methods

getContent :: FilePath -> IO (Maybe c) #

Extract content from a given file. The instance can ignore the file with Nothing, for example if it has the wrong extension.

metadata :: c -> Map String String #

Extract metadata from a given content value.

toHTML :: c -> Text #

Extract plain HTML Text from a given content value.

Predefined content types

newtype RawHTMLContent #

The simplest possible useful content type as the extracted HTML via toHTMLis just the file content. Ignores files that have no ".html" extension and extracts an empty metadata Map via metadata.

Constructors

RawHTMLContent Text