Stog library reference documentation : Stog_types
sig
  type date = { year : int; month : int; day : int; }
  type body = Xtmpl.tree list
  type human_id = { hid_path : string list; hid_absolute : bool; }
  val string_of_human_id : Stog_types.human_id -> string
  val human_id_of_string : string -> Stog_types.human_id
  type def = Xmlm.name * Xmlm.attribute list * Stog_types.body
  val get_def :
    Stog_types.def list ->
    Xmlm.name -> (Xmlm.attribute list * Stog_types.body) option
  module Str_map :
    sig
      type key = string
      type +'a t
      val empty : 'a t
      val is_empty : 'a t -> bool
      val mem : key -> 'a t -> bool
      val add : key -> '-> 'a t -> 'a t
      val singleton : key -> '-> 'a t
      val remove : key -> 'a t -> 'a t
      val merge :
        (key -> 'a option -> 'b option -> 'c option) -> 'a t -> 'b t -> 'c t
      val compare : ('-> '-> int) -> 'a t -> 'a t -> int
      val equal : ('-> '-> bool) -> 'a t -> 'a t -> bool
      val iter : (key -> '-> unit) -> 'a t -> unit
      val fold : (key -> '-> '-> 'b) -> 'a t -> '-> 'b
      val for_all : (key -> '-> bool) -> 'a t -> bool
      val exists : (key -> '-> bool) -> 'a t -> bool
      val filter : (key -> '-> bool) -> 'a t -> 'a t
      val partition : (key -> '-> bool) -> 'a t -> 'a t * 'a t
      val cardinal : 'a t -> int
      val bindings : 'a t -> (key * 'a) list
      val min_binding : 'a t -> key * 'a
      val max_binding : 'a t -> key * 'a
      val choose : 'a t -> key * 'a
      val split : key -> 'a t -> 'a t * 'a option * 'a t
      val find : key -> 'a t -> 'a
      val map : ('-> 'b) -> 'a t -> 'b t
      val mapi : (key -> '-> 'b) -> 'a t -> 'b t
    end
  module Str_set :
    sig
      type elt = string
      type t
      val empty : t
      val is_empty : t -> bool
      val mem : elt -> t -> bool
      val add : elt -> t -> t
      val singleton : elt -> t
      val remove : elt -> t -> t
      val union : t -> t -> t
      val inter : t -> t -> t
      val diff : t -> t -> t
      val compare : t -> t -> int
      val equal : t -> t -> bool
      val subset : t -> t -> bool
      val iter : (elt -> unit) -> t -> unit
      val fold : (elt -> '-> 'a) -> t -> '-> 'a
      val for_all : (elt -> bool) -> t -> bool
      val exists : (elt -> bool) -> t -> bool
      val filter : (elt -> bool) -> t -> t
      val partition : (elt -> bool) -> t -> t * t
      val cardinal : t -> int
      val elements : t -> elt list
      val min_elt : t -> elt
      val max_elt : t -> elt
      val choose : t -> elt
      val split : elt -> t -> t * bool * t
    end
  type elt = {
    elt_human_id : Stog_types.human_id;
    elt_type : string;
    elt_body : Stog_types.body;
    elt_date : Stog_types.date option;
    elt_title : string;
    elt_keywords : string list;
    elt_topics : string list;
    elt_published : bool;
    elt_defs : Stog_types.def list;
    elt_src : string;
    elt_sets : string list;
    elt_lang_dep : bool;
    elt_xml_doctype : string option;
    elt_out : Stog_types.body option;
    elt_used_mods : Stog_types.Str_set.t;
  }
  type elt_id = Stog_types.elt Stog_tmap.key
  val make_elt :
    ?typ:string -> ?hid:Stog_types.human_id -> unit -> Stog_types.elt
  val today : unit -> Stog_types.date
  module Hid_map :
    sig
      type symbol = string
      type path = symbol list
      type 'a t
      exception Already_present of path
      val empty : 'a t
      val add : path -> '-> 'a t -> 'a t
      val find : path -> 'a t -> 'a list
    end
  module Elt_set :
    sig
      type elt = elt_id
      type t
      val empty : t
      val is_empty : t -> bool
      val mem : elt -> t -> bool
      val add : elt -> t -> t
      val singleton : elt -> t
      val remove : elt -> t -> t
      val union : t -> t -> t
      val inter : t -> t -> t
      val diff : t -> t -> t
      val compare : t -> t -> int
      val equal : t -> t -> bool
      val subset : t -> t -> bool
      val iter : (elt -> unit) -> t -> unit
      val fold : (elt -> '-> 'a) -> t -> '-> 'a
      val for_all : (elt -> bool) -> t -> bool
      val exists : (elt -> bool) -> t -> bool
      val filter : (elt -> bool) -> t -> t
      val partition : (elt -> bool) -> t -> t * t
      val cardinal : t -> int
      val elements : t -> elt list
      val min_elt : t -> elt
      val max_elt : t -> elt
      val choose : t -> elt
      val split : elt -> t -> t * bool * t
    end
  module Int_map :
    sig
      type key = int
      type +'a t
      val empty : 'a t
      val is_empty : 'a t -> bool
      val mem : key -> 'a t -> bool
      val add : key -> '-> 'a t -> 'a t
      val singleton : key -> '-> 'a t
      val remove : key -> 'a t -> 'a t
      val merge :
        (key -> 'a option -> 'b option -> 'c option) -> 'a t -> 'b t -> 'c t
      val compare : ('-> '-> int) -> 'a t -> 'a t -> int
      val equal : ('-> '-> bool) -> 'a t -> 'a t -> bool
      val iter : (key -> '-> unit) -> 'a t -> unit
      val fold : (key -> '-> '-> 'b) -> 'a t -> '-> 'b
      val for_all : (key -> '-> bool) -> 'a t -> bool
      val exists : (key -> '-> bool) -> 'a t -> bool
      val filter : (key -> '-> bool) -> 'a t -> 'a t
      val partition : (key -> '-> bool) -> 'a t -> 'a t * 'a t
      val cardinal : 'a t -> int
      val bindings : 'a t -> (key * 'a) list
      val min_binding : 'a t -> key * 'a
      val max_binding : 'a t -> key * 'a
      val choose : 'a t -> key * 'a
      val split : key -> 'a t -> 'a t * 'a option * 'a t
      val find : key -> 'a t -> 'a
      val map : ('-> 'b) -> 'a t -> 'b t
      val mapi : (key -> '-> 'b) -> 'a t -> 'b t
    end
  type edge_type = Date | Topic of string | Keyword of string | Ref
  module Graph :
    sig
      type key = elt_id
      type edge_data = edge_type
      type t
      val create : unit -> t
      val marshal : t -> string
      val unmarshal : string -> t
      val succ : t -> key -> (key * edge_data) list
      val pred : t -> key -> (key * edge_data) list
      val add : t -> key * key * edge_data -> t
      val rem : t -> key * key -> (edge_data -> bool) -> t
      val rem_all : t -> key * key -> t
      val isolate : t -> key -> t
      val remove_node : t -> key -> t
      val pred_roots : ?ignore_deps:edge_data list -> t -> key list
      val succ_roots : t -> key list
      val recursive_succs : t -> ?pred:(edge_data -> bool) -> key -> key list
      val recursive_preds : t -> ?pred:(edge_data -> bool) -> key -> key list
      val reverse : t -> t
      val fold_succ :
        t -> (key -> (key * edge_data) list -> '-> 'a) -> '-> 'a
      val fold_pred :
        t -> (key -> (key * edge_data) list -> '-> 'a) -> '-> 'a
      val iter_succ : t -> (key -> (key * edge_data) list -> unit) -> unit
      val iter_pred : t -> (key -> (key * edge_data) list -> unit) -> unit
      val dot_of_graph :
        ?f_edge:(edge_data -> string * (string * string) list) ->
        f_node:(key -> string * string * (string * string) list) ->
        t -> string
      val nodes_by_pred_order : t -> key list
      val shortest_path :
        t ->
        (t -> key * key -> (float * edge_data) option) ->
        key * key -> (key * edge_data * key) list
    end
  type file_tree = {
    files : Stog_types.Str_set.t;
    dirs : Stog_types.file_tree Stog_types.Str_map.t;
  }
  type stog_mod = {
    mod_requires : Stog_types.Str_set.t;
    mod_defs : Stog_types.def list;
  }
  type stog = {
    stog_dir : string;
    stog_elts : (Stog_types.elt, Stog_types.elt) Stog_tmap.t;
    stog_elts_by_human_id : Stog_types.elt_id Stog_types.Hid_map.t;
    stog_defs : Stog_types.def list;
    stog_tmpl_dir : string;
    stog_cache_dir : string;
    stog_title : string;
    stog_desc : Stog_types.body;
    stog_graph : Stog_types.Graph.t;
    stog_elts_by_kw : Stog_types.Elt_set.t Stog_types.Str_map.t;
    stog_elts_by_topic : Stog_types.Elt_set.t Stog_types.Str_map.t;
    stog_archives :
      Stog_types.Elt_set.t Stog_types.Int_map.t Stog_types.Int_map.t;
    stog_base_url : Neturl.url;
    stog_email : string;
    stog_rss_length : int;
    stog_lang : string option;
    stog_outdir : string;
    stog_main_elt : Stog_types.elt_id option;
    stog_files : Stog_types.file_tree;
    stog_modules : Stog_types.stog_mod Stog_types.Str_map.t;
    stog_used_mods : Stog_types.Str_set.t;
    stog_depcut : bool;
  }
  val url_of_string : string -> Neturl.url
  val string_of_url : Neturl.url -> string
  val url_concat : Neturl.url -> string -> Neturl.url
  val create_stog : string -> Stog_types.stog
  val stog_md5 : Stog_types.stog -> string
  val elt : Stog_types.stog -> Stog_types.elt Stog_tmap.key -> Stog_types.elt
  val elts_by_human_id :
    ?typ:string ->
    Stog_types.stog ->
    Stog_types.human_id -> (Stog_types.elt_id * Stog_types.elt) list
  val elt_by_human_id :
    ?typ:string ->
    Stog_types.stog ->
    Stog_types.human_id -> Stog_types.elt_id * Stog_types.elt
  val set_elt :
    Stog_types.stog ->
    Stog_types.elt Stog_tmap.key -> Stog_types.elt -> Stog_types.stog
  val add_hid :
    Stog_types.stog ->
    Stog_types.human_id -> Stog_types.elt_id -> Stog_types.stog
  val add_elt : Stog_types.stog -> Stog_types.elt -> Stog_types.stog
  val sort_elts_by_date : Stog_types.elt list -> Stog_types.elt list
  val sort_ids_elts_by_date :
    ('a * Stog_types.elt) list -> ('a * Stog_types.elt) list
  val sort_ids_elts_by_rules :
    string list ->
    ('a * Stog_types.elt * Xtmpl.env) list -> ('a * Stog_types.elt) list
  val elt_list :
    ?by_date:bool ->
    ?set:string ->
    Stog_types.stog -> (Stog_types.elt Stog_tmap.key * Stog_types.elt) list
  val merge_stogs : Stog_types.stog list -> Stog_types.stog
  val make_human_id : Stog_types.stog -> string -> string list
  val find_block_by_id : Stog_types.elt -> string -> Xtmpl.tree option
end