dillonkearns/elm-rss/2.0.0

NOTE: the latest version is 2.0.5

Rss

{ title : String
, description : String
, url : String
, lastBuildTime : Posix
, generator : Maybe String
, items : List Item
, siteUrl : String
}
-> String

Generate an RSS feed from feed metadata and a list of Rss.Items.

type alias Item =
{ title : String
, description : String
, url : String
, categories : List String
, author : String
, pubDate : DateOrTime
, content : Maybe String
, contentEncoded : Maybe String
, enclosure :
Maybe
{ url : String
, mimeType : String
, bytes : Maybe Int
}
}

Data representing an RSS feed item.

contentEncoded - Use this to add HTML content in a <content:encoded> tag in the RSS feed. Some feed readers will use this field if present to render HTML. Note that Elm doesn't provide a way to turn Html.Html values into a String.

You can use zwilias/elm-html-string to render HTML using a drop-in replacement API and then turn that into a String.

Here's an example that shows how to render to an HTML String using dillonkearns/elm-markdown.

https://demo.ghost.io/author/lewis/rss/

Encoding

enclosure - link to an attached file

https://www.rssboard.org/rss-enclosures-use-case

= Date Date
| DateTime Posix

Can be one of:

  • Rss.Date - a Date value from justinmimbs/date, or
  • Rss.DateTime - a Time.Posix from elm/time.

If you pass in an Rss.Date, it will format it at 00:00:00 GMT on the given date (start of day). If you pass in an Rss.DateTime, it will format the time in UTC.

type alias Enclosure =
{ url : String
, mimeType : String
, bytes : Maybe Int
}