package yocaml_mustache

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

Install

dune-project
 Dependency

Authors

Maintainers

Sources

yocaml-2.6.0.tbz
sha256=a006e9d52e520986d4262dfe7bfeba6a381f1423be32409494888d667d14ac73
sha512=8a25f1776e0bcd5e317484b681c67b0d6bb60952f0dd0942f44bf708fb3db03331522b4d8929e09c1926b213003bf14bb148468ddde35add0ad657b4d9237bd1

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.