webls/atom

Types

pub type AtomEntry {
  AtomEntry(
    id: String,
    title: Text,
    updated: timestamp.Timestamp,
    authors: List(Person),
    content: option.Option(Text),
    link: option.Option(Link),
    summary: option.Option(Text),
    categories: List(Category),
    contributors: List(Person),
    published: option.Option(timestamp.Timestamp),
    rights: option.Option(Text),
    source: option.Option(Source),
  )
}

Constructors

pub type AtomFeed {
  AtomFeed(
    id: String,
    title: Text,
    updated: timestamp.Timestamp,
    authors: List(Person),
    link: option.Option(Link),
    categories: List(Category),
    contributors: List(Person),
    generator: option.Option(Generator),
    icon: option.Option(String),
    logo: option.Option(String),
    rights: option.Option(Text),
    subtitle: option.Option(String),
    entries: List(AtomEntry),
  )
}

Constructors

pub type Category {
  Category(
    term: String,
    scheme: option.Option(String),
    label: option.Option(String),
  )
}

Constructors

pub type Generator {
  Generator(
    uri: option.Option(String),
    version: option.Option(String),
  )
}

Constructors

pub type Link {
  Link(
    href: String,
    rel: option.Option(String),
    content_type: option.Option(String),
    hreflang: option.Option(String),
    title: option.Option(String),
    length: option.Option(Int),
  )
}

Constructors

pub type Person {
  Person(
    name: String,
    email: option.Option(String),
    uri: option.Option(String),
  )
}

Constructors

pub type Source {
  Source(id: String, title: String, updated: timestamp.Timestamp)
}

Constructors

pub type Text {
  PlainText(value: String)
  Html(value: String)
  XHtml(value: String)
}

Constructors

  • PlainText(value: String)
  • Html(value: String)
  • XHtml(value: String)

Values

pub fn category(term: String) -> Category
pub fn entry(
  id: String,
  title: Text,
  updated: timestamp.Timestamp,
) -> AtomEntry
pub fn feed(
  id: String,
  title: Text,
  updated: timestamp.Timestamp,
) -> AtomFeed
pub fn html(input: String) -> Text
pub fn link(href: String) -> Link
pub fn person(name: String) -> Person
pub fn plain_text(input: String) -> Text
pub fn to_string(feed: AtomFeed) -> String

Converts an Atom feed to a string of a valid Atom 1.0 feed

pub fn with_category_label(
  category: Category,
  label: String,
) -> Category
pub fn with_category_scheme(
  category: Category,
  scheme: String,
) -> Category
pub fn with_entry_authors(
  entry: AtomEntry,
  authors: List(Person),
) -> AtomEntry
pub fn with_entry_categories(
  entry: AtomEntry,
  categories: List(Category),
) -> AtomEntry
pub fn with_entry_content(
  entry: AtomEntry,
  content: Text,
) -> AtomEntry
pub fn with_entry_contributors(
  entry: AtomEntry,
  contributors: List(Person),
) -> AtomEntry
pub fn with_entry_id(entry: AtomEntry, id: String) -> AtomEntry
pub fn with_entry_link(entry: AtomEntry, link: Link) -> AtomEntry
pub fn with_entry_published(
  entry: AtomEntry,
  published: timestamp.Timestamp,
) -> AtomEntry
pub fn with_entry_rights(
  entry: AtomEntry,
  rights: Text,
) -> AtomEntry
pub fn with_entry_source(
  entry: AtomEntry,
  source: Source,
) -> AtomEntry
pub fn with_entry_summary(
  entry: AtomEntry,
  summary: Text,
) -> AtomEntry
pub fn with_entry_title(
  entry: AtomEntry,
  title: Text,
) -> AtomEntry
pub fn with_entry_updated(
  entry: AtomEntry,
  updated: timestamp.Timestamp,
) -> AtomEntry
pub fn with_feed_author(
  feed: AtomFeed,
  author: Person,
) -> AtomFeed
pub fn with_feed_authors(
  feed: AtomFeed,
  authors: List(Person),
) -> AtomFeed
pub fn with_feed_categories(
  feed: AtomFeed,
  categories: List(Category),
) -> AtomFeed
pub fn with_feed_category(
  feed: AtomFeed,
  category: Category,
) -> AtomFeed
pub fn with_feed_contributor(
  feed: AtomFeed,
  contributor: Person,
) -> AtomFeed
pub fn with_feed_contributors(
  feed: AtomFeed,
  contributors: List(Person),
) -> AtomFeed
pub fn with_feed_entries(
  feed: AtomFeed,
  entries: List(AtomEntry),
) -> AtomFeed
pub fn with_feed_entry(
  feed: AtomFeed,
  entry: AtomEntry,
) -> AtomFeed
pub fn with_feed_generator(
  feed: AtomFeed,
  generator: Generator,
) -> AtomFeed
pub fn with_feed_icon(feed: AtomFeed, icon: String) -> AtomFeed
pub fn with_feed_link(feed: AtomFeed, link: Link) -> AtomFeed
pub fn with_feed_logo(feed: AtomFeed, logo: String) -> AtomFeed
pub fn with_feed_rights(feed: AtomFeed, rights: Text) -> AtomFeed
pub fn with_feed_subtitle(
  feed: AtomFeed,
  subtitle: String,
) -> AtomFeed
pub fn with_link_content_type(
  link: Link,
  content_type: String,
) -> Link
pub fn with_link_hreflang(link: Link, hreflang: String) -> Link
pub fn with_link_length(link: Link, length: Int) -> Link
pub fn with_link_rel(link: Link, rel: String) -> Link
pub fn with_link_title(link: Link, title: String) -> Link
pub fn with_person_email(person: Person, email: String) -> Person
pub fn with_person_uri(person: Person, uri: String) -> Person
pub fn xhtml(input: String) -> Text
Search Document