package yocaml_syndication

  1. Overview
  2. Docs

Module Yocaml_syndication.AtomSource

Implementation of the ATOM specification, documented here: specs.

Types

Types that briefly describe the Atom specification.

Sourcetype text_construct

A Text construct contains human-readable text, usually in small quantities. The content of Text constructs is Language-Sensitive.

Define the kind of a link. Formally the rel attribute.

Defines a reference from an entry or feed to a Web resource. This specification assigns no meaning to the content (if any) of this element.

Sourcetype source

If an entry is copied from one feed into another feed, then the source feed's metadata (all child elements of feed other than the atom:entry elements) MAY be preserved within the copied entry by adding an source child element, if it is not already present in the entry, and including some or all of the source feed's Metadata elements as the source element's children. Such metadata SHOULD be preserved if the source feed contains any of the child elements author, contributor, rights, or category and those child elements are not present in the source entry.

Sourcetype content

The content element either contains or links to the content of the entry. The content of atom:content is Language-Sensitive.

Sourcetype entry

The "entry" element represents an individual entry, acting as a container for metadata and data associated with the entry. This element can appear as a child of the feed element, or it can appear as the document (i.e., top-level) element of a stand-alone Atom Entry Document.

Sourcetype updated_strategy

Defines how the feed's updated field will be calculated.

Construction of elements

Text Construct

A Text construct contains human-readable text, usually in small quantities. The content of Text constructs is Language-Sensitive.

Sourceval text : string -> text_construct

text s constructs an element of type text_construct textual.

Sourceval html : string -> text_construct

html s constructs an element of type text_construct HTML.

Sourceval xhtml : ?need_prefix:bool -> Xml.node -> text_construct

xhtml ?need_prefix s constructs an element of type text_construct XHTML. If need_prefix is true, every children of the given node will be prefixed by the xhtml namespace.

Defines a reference from an entry or feed to a Web resource. This specification assigns no meaning to the content (if any) of this element.

Constructs a link (an external source).

Sourceval alternate : ?media_type:Media_type.t -> ?hreflang:string -> ?length:int -> ?title:string -> string -> link

alternate is link ~rel:Alternate.

related is link ~rel:related.

Sourceval self : ?media_type:Media_type.t -> ?hreflang:string -> ?length:int -> ?title:string -> string -> link

self is link ~rel:Self.

Sourceval enclosure : ?media_type:Media_type.t -> ?hreflang:string -> ?length:int -> ?title:string -> string -> link

enclosure is link ~rel:enclosure.

Sourceval via : ?media_type:Media_type.t -> ?hreflang:string -> ?length:int -> ?title:string -> string -> link

via is link ~rel:Via.

Source

If an entry is copied from one feed into another feed, then the source feed's metadata (all child elements of feed other than the entry elements) MAY be preserved within the copied entry by adding an source child element, if it is not already present in the entry, and including some or all of the source feed's Metadata elements as the source element's children. Such metadata SHOULD be preserved if the source feed contains any of the child elements author, contributor, rights, or category and those child elements are not present in the source entry.

Sourceval source : ?subtitle:text_construct -> ?contributors:Person.t list -> ?categories:Category.t list -> ?generator:Generator.t option -> ?icon:string -> ?logo:string -> ?links:link list -> ?rights:text_construct -> ?updated:Datetime.t -> ?title:text_construct -> ?authors:Person.t list -> ?id:string -> unit -> source

Construct a source.

Content

The content element either contains or links to the content of the entry. The content of content is Language-Sensitive.

Sourceval content_text : string -> content

content_text s constructs a textual content.

Sourceval content_html : string -> content

content_html s constructs an HTML content.

Sourceval content_xhtml : ?need_prefix:bool -> Xml.node -> content

content_xhtml ?need_prefix s constructs an XHTML content (like xhtml).

Sourceval content_mime : ?media_type:Media_type.t -> string -> content

content_mime ?media_type value constructs a mime content.

Sourceval content_src : ?media_type:Media_type.t -> string -> content

content_src ?media_type uri constructs a source content.

Entry

The "entry" element represents an individual entry, acting as a container for metadata and data associated with the entry. This element can appear as a child of the feed element, or it can appear as the document (i.e., top-level) element of a stand-alone Atom Entry Document.

Sourceval entry : ?authors:Person.t list -> ?contributors:Person.t list -> ?links:link list -> ?categories:Category.t list -> ?published:Datetime.t -> ?rights:text_construct -> ?source:source -> ?summary:text_construct -> ?content:content -> title:text_construct -> id:string -> updated:Datetime.t -> unit -> entry

Constructs an entry.

Building a feed

Sourceval updated_from_entries : ?default_value:Datetime.t -> unit -> updated_strategy

Uses entries to describe the last update date. If no entry is provided, the date provisioned by default_value will be used.

Sourceval updated_given : Datetime.t -> updated_strategy

Use a fixed updated value.

Sourceval feed : ?encoding:string -> ?standalone:bool -> ?subtitle:text_construct -> ?contributors:Person.t list -> ?categories:Category.t list -> ?generator:Generator.t option -> ?icon:string -> ?logo:string -> ?links:link list -> ?rights:text_construct -> updated:updated_strategy -> title:text_construct -> authors:Person.t Yocaml.Nel.t -> id:string -> ('a -> entry) -> 'a list -> Xml.t

Arrows for building a feed

Sourceval from : ?encoding:string -> ?standalone:bool -> ?subtitle:text_construct -> ?contributors:Person.t list -> ?categories:Category.t list -> ?generator:Generator.t option -> ?icon:string -> ?logo:string -> ?links:link list -> ?rights:text_construct -> updated:updated_strategy -> title:text_construct -> authors:Person.t Yocaml.Nel.t -> id:string -> ('a -> entry) -> ('a list, string) Yocaml.Task.t

An arrow that build a feed that from an arbitrary list.

Sourceval from_articles : ?encoding:string -> ?standalone:bool -> ?subtitle:text_construct -> ?contributors:Person.t list -> ?categories:Category.t list -> ?generator:Generator.t option -> ?icon:string -> ?logo:string -> ?links:link list -> ?rights:text_construct -> ?updated:updated_strategy -> ?id:string -> site_url:string -> feed_url:string -> title:text_construct -> authors:Person.t Yocaml.Nel.t -> unit -> ((Yocaml.Path.t * Yocaml.Archetype.Article.t) list, string) Yocaml.Task.t

An arrow that build a feed that fit with Yocaml.Archetype.Articles.fetch. link is concatenate with the given path to compute the url of an item.

OCaml

Innovation. Community. Security.