Library
Module
Module type
Parameter
Class
Class type
Rewrite engine.
module XR = Xtmpl.Rewrite
Exception raised when a cache file of a loaded plugin could not be open.
type 'a level_fun =
| Fun_stog of Types.stog XR.env -> Types.stog -> Types.Doc_set.t -> Types.stog
| Fun_data of 'a XR.env -> (Types.stog * 'a) -> Types.Doc_set.t -> Types.stog * 'a
| Fun_stog_data of (Types.stog * 'a) XR.env -> (Types.stog * 'a) -> Types.Doc_set.t -> Types.stog * 'a
A function associated to a level. All functions take in parameter the environment, the stog and structure and the list of documents to rewrite. They return the new stog structure. Some function (Fun_data
, Fun_stog_data
) also handle an additional data structure: the callbacks in the environment also handle it, and the function returns it with the stog structure.
A structure containing data and functions associated to levels. Contains also the module name.
module type Module = sig ... end
A module.
type stog_state = {
st_stog : Types.stog;
st_modules : (module Module) list;
st_docs : Types.Doc_set.t;
}
val run :
?use_cache:bool ->
?default_style:XR.tree list ->
stog_state ->
stog_state
val generate :
?use_cache:bool ->
?gen_cache:bool ->
?default_style:XR.tree list ->
?only_docs:string list ->
Types.stog ->
(module Module) list ->
unit
Generate the target files, with the following steps:
- create the output directory,
- build the base environment from the site global attributes,
- compute by-topic, by-keyword and by-month documents,
- compute documents,
- for each level, for each document, apply level functions on the document
- output
Types.doc.doc_out
field in the destination file. @use_cache reuse documents from cache, default istrue
@gen_cache update cache, default istrue
val doc_dst_file : Types.stog -> Types.doc -> string
Build the final file where the given document will be generated.
val doc_url : Types.stog -> Types.doc -> Url.t
Build the final url of the given document.
val env_of_used_mods :
Types.stog ->
?env:'a XR.env ->
Types.Str_set.t ->
'a XR.env
type 'a stog_doc_rules =
Types.stog ->
Types.doc_id ->
(XR.name * 'a XR.callback) list
val get_in_env : 'a -> 'a XR.env -> Stog.Types.Xml.name -> 'a * XR.tree list
val opt_in_env :
'a ->
'a XR.env ->
Stog.Types.Xml.name ->
'a * XR.tree list option
val get_in_args_or_env :
'a ->
'a XR.env ->
XR.attributes ->
Stog.Types.Xml.name ->
'a * XR.tree list
get_in_args_or_env env args s
returns the value associated to s
in args
of else return the result of get_in_env env s
.
get_path env
returns the path associated to "doc-path"
in env
.
val get_path_in_args_or_env :
'a ->
'a XR.env ->
XR.attributes ->
'a * Path.path
Same as get_path
but first looks for "doc-path"
attribute in the given args.
val doc_env : 'a -> 'a XR.env -> Types.stog -> Types.doc -> 'a * 'a XR.env
val apply_stog_env_doc :
Types.stog ->
Types.stog XR.env ->
Types.doc_id ->
Types.stog
val apply_stog_data_env_doc :
(Types.stog * 'a) ->
(Types.stog * 'a) XR.env ->
Types.doc_id ->
Types.stog * 'a
val apply_data_env_doc :
(Types.stog * 'a) ->
'a XR.env ->
Types.doc_id ->
Types.stog * 'a
val fun_apply_stog_doc_rules : Types.stog stog_doc_rules -> 'a level_fun
val fun_apply_stog_data_doc_rules :
(Types.stog * 'a) stog_doc_rules ->
'a level_fun
val fun_apply_data_doc_rules : 'a stog_doc_rules -> 'a level_fun
val get_languages : 'a -> 'a XR.env -> 'a * string list
Registering modules
type module_fun = Types.stog -> (module Module)
val modules : unit -> (string * module_fun) list
val register_module : string -> module_fun -> unit
val module_by_name : string -> module_fun option