{-# LANGUAGE OverloadedStrings #-}
module Text.XML.DublinCore.Conduit.Render (
renderElementContributor,
renderElementCoverage,
renderElementCreator,
renderElementDate,
renderElementDescription,
renderElementFormat,
renderElementIdentifier,
renderElementLanguage,
renderElementPublisher,
renderElementRelation,
renderElementRights,
renderElementSource,
renderElementSubject,
renderElementTitle,
renderElementType,
) where
import Text.XML.DublinCore
import Conduit
import Data.Text
import Data.Time.Clock
import Data.Time.LocalTime
import Data.Time.RFC3339
import Data.XML.Types
import Text.XML.Stream.Render
dcName :: Text -> Name
dcName :: Text -> Name
dcName Text
string = Text -> Maybe Text -> Maybe Text -> Name
Name Text
string (forall a. a -> Maybe a
Just Text
"http://purl.org/dc/elements/1.1/") (forall a. a -> Maybe a
Just Text
namespacePrefix)
renderElementContributor :: Monad m => Text -> ConduitT () Event m ()
renderElementContributor :: forall (m :: * -> *). Monad m => Text -> ConduitT () Event m ()
renderElementContributor = forall (m :: * -> *) i.
Monad m =>
Name
-> Attributes -> ConduitT i Event m () -> ConduitT i Event m ()
tag (Text -> Name
dcName Text
"contributor") forall a. Monoid a => a
mempty forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) i. Monad m => Text -> ConduitT i Event m ()
content
renderElementCoverage :: Monad m => Text -> ConduitT () Event m ()
renderElementCoverage :: forall (m :: * -> *). Monad m => Text -> ConduitT () Event m ()
renderElementCoverage = forall (m :: * -> *) i.
Monad m =>
Name
-> Attributes -> ConduitT i Event m () -> ConduitT i Event m ()
tag (Text -> Name
dcName Text
"coverage") forall a. Monoid a => a
mempty forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) i. Monad m => Text -> ConduitT i Event m ()
content
renderElementCreator :: Monad m => Text -> ConduitT () Event m ()
renderElementCreator :: forall (m :: * -> *). Monad m => Text -> ConduitT () Event m ()
renderElementCreator = forall (m :: * -> *) i.
Monad m =>
Name
-> Attributes -> ConduitT i Event m () -> ConduitT i Event m ()
tag (Text -> Name
dcName Text
"creator") forall a. Monoid a => a
mempty forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) i. Monad m => Text -> ConduitT i Event m ()
content
renderElementDate :: Monad m => UTCTime -> ConduitT () Event m ()
renderElementDate :: forall (m :: * -> *). Monad m => UTCTime -> ConduitT () Event m ()
renderElementDate = forall (m :: * -> *) i.
Monad m =>
Name
-> Attributes -> ConduitT i Event m () -> ConduitT i Event m ()
tag (Text -> Name
dcName Text
"date") forall a. Monoid a => a
mempty forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) i. Monad m => Text -> ConduitT i Event m ()
content forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t. TextualMonoid t => ZonedTime -> t
formatTimeRFC3339 forall b c a. (b -> c) -> (a -> b) -> a -> c
. TimeZone -> UTCTime -> ZonedTime
utcToZonedTime TimeZone
utc
renderElementDescription :: Monad m => Text -> ConduitT () Event m ()
renderElementDescription :: forall (m :: * -> *). Monad m => Text -> ConduitT () Event m ()
renderElementDescription = forall (m :: * -> *) i.
Monad m =>
Name
-> Attributes -> ConduitT i Event m () -> ConduitT i Event m ()
tag (Text -> Name
dcName Text
"description") forall a. Monoid a => a
mempty forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) i. Monad m => Text -> ConduitT i Event m ()
content
renderElementFormat :: Monad m => Text -> ConduitT () Event m ()
renderElementFormat :: forall (m :: * -> *). Monad m => Text -> ConduitT () Event m ()
renderElementFormat = forall (m :: * -> *) i.
Monad m =>
Name
-> Attributes -> ConduitT i Event m () -> ConduitT i Event m ()
tag (Text -> Name
dcName Text
"format") forall a. Monoid a => a
mempty forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) i. Monad m => Text -> ConduitT i Event m ()
content
renderElementIdentifier :: Monad m => Text -> ConduitT () Event m ()
renderElementIdentifier :: forall (m :: * -> *). Monad m => Text -> ConduitT () Event m ()
renderElementIdentifier = forall (m :: * -> *) i.
Monad m =>
Name
-> Attributes -> ConduitT i Event m () -> ConduitT i Event m ()
tag (Text -> Name
dcName Text
"identifier") forall a. Monoid a => a
mempty forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) i. Monad m => Text -> ConduitT i Event m ()
content
renderElementLanguage :: Monad m => Text -> ConduitT () Event m ()
renderElementLanguage :: forall (m :: * -> *). Monad m => Text -> ConduitT () Event m ()
renderElementLanguage = forall (m :: * -> *) i.
Monad m =>
Name
-> Attributes -> ConduitT i Event m () -> ConduitT i Event m ()
tag (Text -> Name
dcName Text
"language") forall a. Monoid a => a
mempty forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) i. Monad m => Text -> ConduitT i Event m ()
content
renderElementPublisher :: Monad m => Text -> ConduitT () Event m ()
renderElementPublisher :: forall (m :: * -> *). Monad m => Text -> ConduitT () Event m ()
renderElementPublisher = forall (m :: * -> *) i.
Monad m =>
Name
-> Attributes -> ConduitT i Event m () -> ConduitT i Event m ()
tag (Text -> Name
dcName Text
"publisher") forall a. Monoid a => a
mempty forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) i. Monad m => Text -> ConduitT i Event m ()
content
renderElementRelation :: Monad m => Text -> ConduitT () Event m ()
renderElementRelation :: forall (m :: * -> *). Monad m => Text -> ConduitT () Event m ()
renderElementRelation = forall (m :: * -> *) i.
Monad m =>
Name
-> Attributes -> ConduitT i Event m () -> ConduitT i Event m ()
tag (Text -> Name
dcName Text
"relation") forall a. Monoid a => a
mempty forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) i. Monad m => Text -> ConduitT i Event m ()
content
renderElementRights :: Monad m => Text -> ConduitT () Event m ()
renderElementRights :: forall (m :: * -> *). Monad m => Text -> ConduitT () Event m ()
renderElementRights = forall (m :: * -> *) i.
Monad m =>
Name
-> Attributes -> ConduitT i Event m () -> ConduitT i Event m ()
tag (Text -> Name
dcName Text
"rights") forall a. Monoid a => a
mempty forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) i. Monad m => Text -> ConduitT i Event m ()
content
renderElementSource :: Monad m => Text -> ConduitT () Event m ()
renderElementSource :: forall (m :: * -> *). Monad m => Text -> ConduitT () Event m ()
renderElementSource = forall (m :: * -> *) i.
Monad m =>
Name
-> Attributes -> ConduitT i Event m () -> ConduitT i Event m ()
tag (Text -> Name
dcName Text
"source") forall a. Monoid a => a
mempty forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) i. Monad m => Text -> ConduitT i Event m ()
content
renderElementSubject :: Monad m => Text -> ConduitT () Event m ()
renderElementSubject :: forall (m :: * -> *). Monad m => Text -> ConduitT () Event m ()
renderElementSubject = forall (m :: * -> *) i.
Monad m =>
Name
-> Attributes -> ConduitT i Event m () -> ConduitT i Event m ()
tag (Text -> Name
dcName Text
"subject") forall a. Monoid a => a
mempty forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) i. Monad m => Text -> ConduitT i Event m ()
content
renderElementTitle :: Monad m => Text -> ConduitT () Event m ()
renderElementTitle :: forall (m :: * -> *). Monad m => Text -> ConduitT () Event m ()
renderElementTitle = forall (m :: * -> *) i.
Monad m =>
Name
-> Attributes -> ConduitT i Event m () -> ConduitT i Event m ()
tag (Text -> Name
dcName Text
"title") forall a. Monoid a => a
mempty forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) i. Monad m => Text -> ConduitT i Event m ()
content
renderElementType :: Monad m => Text -> ConduitT () Event m ()
renderElementType :: forall (m :: * -> *). Monad m => Text -> ConduitT () Event m ()
renderElementType = forall (m :: * -> *) i.
Monad m =>
Name
-> Attributes -> ConduitT i Event m () -> ConduitT i Event m ()
tag (Text -> Name
dcName Text
"type") forall a. Monoid a => a
mempty forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) i. Monad m => Text -> ConduitT i Event m ()
content