Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
Computing stog documents in preview server
type state = {
stog : Stog.Types.stog;
stog_modules : (module Stog.Engine.Module) list;
stog_errors : string list;
stog_warnings : string list;
doc_dates : float Stog.Path.Map.t;
busy : bool;
}
val watch :
Stog.Types.stog ->
state option Stdlib.ref ->
on_update:
(Stog.Types.stog ->
Stog.Types.stog ->
Stog.Types.Doc_set.elt ->
unit Lwt.t) ->
on_error:(errors:string list -> warnings:string list -> unit Lwt.t) ->
'a Lwt.t
Start a Lwt thread watching for changes on stog files, relaunching computations of documents and sending patches on document update.* using on_update
. on_error
is called with warnings and errors, if any.
val refresh :
(unit -> Stog.Types.stog) ->
state option Stdlib.ref ->
(Stog.Types.doc -> unit Lwt.t) ->
(string list -> unit Lwt.t) ->
unit Lwt.t
refresh load state send_doc on_error
reload stog structure from filesystem using load
, sends all documents to clients using send_doc
. In case of error, on_error
is called with the list of errors.