Module Wodoc.Config
type entry = {label : string;(*visible text
*)path : string;(*href: relative to the version root (filled with base), unless it is absolute (
*)/…) or a URL (http(s)://…), which is emitted verbatimcurrent : string;(*data-wodoc-page id (highlighted on its own pages)
*)
}type 'tree item = | Link of entry| Group of 'tree group| Page_tree of 'tree(*
*)(page-tree [<index>]): the page tree odoc builds from the manual's directories (odoc-pages/<dir>/, ordered by@children_order), below the page<index>(defaultindex.html), as odoc_driver writes it insidebar.json, without its library and source entries. Expanded before rendering, so the left column follows the same tree as ocaml.org.
and 'tree group = {heading : string;index : string option;(*the page the heading links to (a directory of a page tree whose index page is clickable), relative to the version root
*)items : 'tree item list;
}a sub-heading (<h4>) and its nested items, one indent level deeper. Lets a manual nav reproduce a multi-level menu (sections, subsections, page links), as the old wikicréole menu expressed with ==/===.
type expanded = |type 'tree section = {heading : string;(*the
*)<h3>label of this left-nav blockapi : bool;(*
*)api-section-> class "api-nav"; else "api-nav manual-nav"items : 'tree item list;
}type blog = {dir : string;(*directory of post sources, named
*)YYYY-MM-DD-slug.mld(the date is the publication date; posts sort newest-first on it). Relative to the config file's directory. The posts are plain.mld(author from@author).out : string;(*output subdirectory under the version root, e.g. "blog": posts deploy as
*)<out>/blog/<slug>.htmlheading : string;(*the generated left-nav section
*)<h3>label, e.g. "Blog"latest : int;(*how many recent posts the
*){%wodoc:blog-latest%}marker expands to on the landing page
}an ultra-simple blog: a directory of dated .mld posts that wodoc builds like any other page, auto-listing them in a generated left-nav section and exposing the most recent ones to the landing via the {%wodoc:blog-latest%} marker. Generic (no project hardcoding); None when the project declares no (blog …).
type cs_side = {side : string;(*key, e.g. "server": body class
*)wodoc-server, switch idlib : string;(*odoc subtree dir /
*)Nav.api ~lib, e.g. "eliom.server"indexdoc : string;(*curated index path (relative to the build cwd)
*)heading : string;(*API-nav heading + switch-button label, e.g. "Server API"
*)wrapper : string;(*
*)Nav.api ~wrapper/ page wrapper module, e.g. "Eliom"skip : string list;(*section titles to omit (Nav.api ~skip)
*)
}one API "side" of a client/server project (eliom/toolkit/start): the <pkg>.server / <pkg>.client / <pkg>.ppx library, whose curated index becomes a section-grouped module nav (via Nav.api). The side also drives a body colour class (wodoc-<side>) and a switch button.
type t = {project : string;(*package / project id, e.g. "ocsipersist"
*)title : string;(*sub-project label by the logo, e.g. "Ocsipersist"
*)url_prefix : string;(*absolute URL path the site is published at, e.g. "/ocsipersist"; used by the version selector to switch versions
*)packages : string list;(*odoc output subtrees to assemble, in order
*)landing : string;(*index.html redirect target, e.g. "ocsipersist/index.html"
*)highlight : string option;(*project highlight.js to ship, if any
*)profile : string option;(*dune build profile (e.g. "release")
*)odoc_driver : string option;(*when set, build the API with
*)odoc_driver <pkg> --remap(the engine ocaml.org uses) instead ofdune build @doc: needed for a client/server package whose<pkg>.server/<pkg>.clientlibraries share module names and would collide underdune build @doc(eliom, ocsigen-toolkit, ocsigen-start).doc_manual : bool;(*also build the
*)@doc-manualalias (examples)manual_files : string option;(*package dir to receive manual/files (examples, images)
*)siblings : (string * string list) list;(*resolve-refs sibling table
*)client_server : cs_side list;(*when non-empty, the project is client/server: instead of one nav from
*)nav, wodoc builds a per-side API nav from each side's curated index, shows a client/server switch, and colours the body by side. The manual nav is shared, taken fromnav's manual ((section …)) blocks.hosted : (string * (string * Resolve.layout * string)) list;(*cross-project resolve-refs table (resolve-refs --hosted): package -> (deploy dir, layout, wrapper module). Rewrites sibling Ocsigen projects'
*)ocaml.orgxrefs to relative links into their wodoc docs. SeeResolve.layoutfor the layout token (multilib/root/subdir).manual_root : bool;(*deploy the package's pages at the version ROOT instead of under a
*)<package>/subdirectory: strip the leading<package>/segment from output paths, the landing and the nav links. Makes a single-packagedune build @docproject (ocsigenserver, i18n) match the layout of odoc-driver projects (eliom: manual at the version root, e.g./ocsigenserver/latest/config.html) so cross-project links resolve. The package's internal relative links are preserved (the same prefix is stripped from every page).mld_dir : string option;(*direct-mld build (a manual-only / archived project with no
*)dune build @doc): compile every.mldin this dir straight with odoc (preprocess -> compile -> link -> html-generate). The pages are the manual; the landingindex.htmlis a real page (no redirect).mld_package : string;(*odoc
*)--packagefor the direct-mld compile (the src subtree)flat : bool;(*assemble
*)--flat(content straddling odoc's preamble boundary)static_copy : (string * string) list;(*verbatim copies into the output: (source path, dest under <out>), e.g. a frozen API snapshot, or a manual image
*)blog : blog option;markdown : bool;(*emit the Markdown twin of every page + the
*)llms.txt/llms-full.txtindex (for AI/LLM consumption). On by default;(markdown false)turns it off.css : string list;(*stylesheet hrefs for the page
*)<head>. Each is emitted verbatim when absolute (/…) or a URL, else made per-page relative ({{base}}/…) and, when it names a file next to the config, copied into the output, so a project can ship a self-contained theme that works at any deploy path.[](the default) ships wodoc's built-in default theme aswodoc.css.
}val retired : (string * string) listval check_keys : where:string -> string list -> Sexp.t list -> unitval parse_siblings : Sexp.t list -> (string * string list) listval parse_hosted :
Sexp.t list ->
(string * (string * Resolve.layout * string)) listval check_static_dest : string -> stringval parse_static_copy : Sexp.t list -> (string * string) listval stanza_names : string listval of_string : string -> t