package stog

  1. Overview
  2. Docs

Interface for plugins.

Even if all modules are accessible from dynamically loaded code, this Plug module should remain compatible from one release to another.

module XR = Xtmpl.Rewrite
module Xml = Xtmpl.Xml
val plugin_config_file : Types.stog -> string -> string

plugin_config_file stog plugin_name returns the configuration file for this plugin name, for consistency purpose.

val register_lang : Intl.lang_abbrev -> Intl.lang_data -> unit
val register_html_base_rule : Xml.name -> Types.stog XR.callback -> unit

register_html_base_rule name f registers a new function associated to name in the set of base rules of the "html" predefined module.

val doc_by_href : ?typ:string -> ?src_doc:Types.doc -> Types.stog -> 'a -> 'a XR.env -> ?loc:Xml.loc -> string -> 'a * (Types.doc * string * string option) option

doc_by_href ?typ ?src_doc stog env href returns the document, path and optional if matching the given href string, of the form path[#id]. Return None if the document could not be found, of the id could not be found, and an error is issued.

  • parameter src_doc

    can be used to specify the source document, to improve the error message.

val mk_block_node : id:string -> ?label:XR.tree list -> ?clas:string -> title:XR.tree list -> ?counter:string -> short_fmt:XR.tree list -> long_fmt:XR.tree list -> XR.tree list -> XR.tree

mk_block_node ... creates a <block ... with the given information.

Dependencies

type dependency = Types.doc Types.dependency
val add_dep : Types.stog -> Types.doc -> dependency -> Types.stog

For a given document, add a dependency on a file or another document.