package yocaml_mustache

  1. Overview
  2. Docs
Yocaml plugin for using Mustache as a template language

Install

dune-project
 Dependency

Authors

Maintainers

Sources

yocaml-3.0.0.tbz
sha256=c5237c5f345f76c829fd9f4ec5fcd05051e6f4372b24ecf798a48c2649ce9a0e
sha512=babeab686e031160882b739f07773bf1a2ae94a10de8992a4d812b35a487a353c2d3d915ac17fe74b7961570984c62d022c9108aa72562b5d81f93829ef62576

doc/yocaml_mustache/Yocaml_mustache/index.html

Module Yocaml_mustacheSource

Plugin for describing templates using ocaml-mustache, an implementation of the logic-less templating engine Mustache.

Injection

Description of a pipeline for reading a template and injecting content.

Sourceval read_template : ?snapshot:bool -> ?strict:bool -> Yocaml.Path.t -> (unit, (module Yocaml.Required.DATA_INJECTABLE with type t = 'a) -> metadata:'a -> string -> string) Yocaml.Task.t

Return a function that apply ~metadata and ~content to a given template. Made the usage with applicative easier.

Sourceval read_templates : ?snapshot:bool -> ?strict:bool -> Yocaml.Path.t list -> (unit, (module Yocaml.Required.DATA_INJECTABLE with type t = 'a) -> metadata:'a -> string -> string) Yocaml.Task.t

Return a function that apply ~metadata and ~content to a list of templates (in sequential order). Made the usage with applicative easier.

Sourcemodule Pipeline : sig ... end

Describes the arrowized interface for reading a file as a template and injecting content and variables.

Data template

Describes the Yocaml_mustache module as a template engine. Allows the latter to be passed to any function requiring it.

The type that describes the template language.

Sourceval from : Yocaml.Data.t -> t

from data Transforms a normalized data representation (data) into an associative list of data that can be injected into a template.

Sourceval render : ?strict:bool -> (string * t) list -> string -> string

render ?strict parameters content injects parameters data into content and returns the result of the applied content. To inject metadata into a template.