package yocaml

  1. Overview
  2. Docs

An article is a specialization of a page to describe blog posts (associated with a title, synopsis and date). It's the minimal archetype for describing a blog post.

Type

type t

A type describing an article.

Accessors

val page : t -> Page.t
val title : t -> string
val synopsis : t -> string option
val date : t -> Datetime.t
val with_toc : t -> string option -> t

Deal with Article as Metadata

An article can be parsed and injected.

An article is also a page, so any data readable from a page is also readable from an article. If no value is given for page_title, the metadata will use the article's title. The same applies to description and synopsis.

val entity_name : string

Assigns a name to an entity (a set of metadata).

val neutral : (t, Required.provider_error) Stdlib.result

Describes a neutral element, as a fallback in the absence of metadata. The function can return an error if the request is mandatory.

validate raw_data Validates a data item represented by type Yocaml.Data.t and projects it into a value of type t.

As an article is also a page, article-normalized data includes article-normalized data with additional fields. As with optional fields, synopsis has a has_synopsis version.

val normalize : t -> (string * Data.t) list

Converts a value of type t into a value of type Yocaml.Data.t.

OCaml

Innovation. Community. Security.