package stog
Module Stog.Engine
Rewrite engine.
module XR = Xtmpl.RewriteException 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 ... endA 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_stateval generate :
?use_cache:bool ->
?gen_cache:bool ->
?default_style:XR.tree list ->
?only_docs:string list ->
Types.stog ->
(module Module) list ->
unitGenerate 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_outfield 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 -> stringBuild the final file where the given document will be generated.
val doc_url : Types.stog -> Types.doc -> Url.tBuild the final url of the given document.
val env_of_used_mods :
Types.stog ->
?env:'a XR.env ->
Types.Str_set.t ->
'a XR.envtype 'a stog_doc_rules =
Types.stog ->
Types.doc_id ->
(XR.name * 'a XR.callback) listval get_in_env : 'a -> 'a XR.env -> Stog.Types.Xml.name -> 'a * XR.tree listval opt_in_env :
'a ->
'a XR.env ->
Stog.Types.Xml.name ->
'a * XR.tree list optionval get_in_args_or_env :
'a ->
'a XR.env ->
XR.attributes ->
Stog.Types.Xml.name ->
'a * XR.tree listget_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.pathSame 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.envval apply_stog_env_doc :
Types.stog ->
Types.stog XR.env ->
Types.doc_id ->
Types.stogval apply_stog_data_env_doc :
(Types.stog * 'a) ->
(Types.stog * 'a) XR.env ->
Types.doc_id ->
Types.stog * 'aval apply_data_env_doc :
(Types.stog * 'a) ->
'a XR.env ->
Types.doc_id ->
Types.stog * 'aval fun_apply_stog_doc_rules : Types.stog stog_doc_rules -> 'a level_funval fun_apply_stog_data_doc_rules :
(Types.stog * 'a) stog_doc_rules ->
'a level_funval fun_apply_data_doc_rules : 'a stog_doc_rules -> 'a level_funval get_languages : 'a -> 'a XR.env -> 'a * string listRegistering modules
type module_fun = Types.stog -> (module Module)val modules : unit -> (string * module_fun) listval register_module : string -> module_fun -> unitval module_by_name : string -> module_fun option