;; Declarative wodoc config for the Eliom documentation (client/server project).
;;   wodoc build --config doc/wodoc --out <dir>/<label> --label <v> \
;;               --menu https://ocsigen.org/doc/menu.html [--local]
;;
;; Eliom ships its server and client APIs as two libraries of the SAME package
;; (eliom.server / eliom.client) with the SAME module names, so `dune build @doc`
;; collides. wodoc therefore builds the API with `odoc_driver eliom --remap` (the
;; engine ocaml.org uses) on the INSTALLED package — i.e. the documented version
;; is whatever the build switch has installed. Each side gets its own API nav
;; (from a curated index), a body colour and a switch button; the manual nav is
;; shared. Cross-references to sibling Ocsigen projects are rewritten from
;; ocaml.org to relative links by (hosted ...); other deps stay on ocaml.org.
(project eliom)
(title Eliom)
(url-prefix /eliom)
(css /css/style.css /css/ocsigen-odoc.css)  ; shared Ocsigen theme (wodoc css default changed)
(landing overview.html)

;; The shared manual nav (the manual .mld are built with the package by
;; odoc_driver; this only orders them into the left column). Only `dev` is ever
;; rebuilt, so this static nav always matches the current manual; released
;; versions keep the nav they were frozen with.
(nav
 (section "Eliom's Reference manual"
  (link "Introduction" intro.html intro)
  (group "Server-side programming"
   (group "Services"
    (link "The different types of services" server-services.html server-services)
    (link "Typing service parameters" server-params.html server-params)
    (link "Service handlers" server-outputs.html server-outputs)
    (link "Creating links and forms" server-links.html server-links))
   (link "Sessions and server side state" server-state.html server-state)
   (link "Security" server-security.html server-security))
  (group "Client-server programming"
   (link "Eliom applications" clientserver-applications.html clientserver-applications)
   (link "Multi-tier programming" ppx-syntax.html ppx-syntax)
   (link "Generating HTML" clientserver-html.html clientserver-html)
   (link "Communication" clientserver-communication.html clientserver-communication)
   (link "Client-side services" clientserver-services.html clientserver-services)
   (link "Shared reactive programming" clientserver-react.html clientserver-react)
   (link "Caching data and off-line applications" clientserver-cache.html clientserver-cache)
   (link "Custom wrapping" clientserver-wrapping.html clientserver-wrapping))
  (group "Workflows"
   (link "Distillery" workflow-distillery.html workflow-distillery)
   (link "Mobile apps" mobile-apps.html mobile-apps)
   (link "Configuration & running" workflow-configuration.html workflow-configuration)
   (link "Scalability" scalability.html scalability))))

(client-server
  (server (lib eliom.server) (indexdoc doc/server.indexdoc) (heading "Server API"))
  (client (lib eliom.client) (indexdoc doc/client.indexdoc) (heading "Client API")))

;; Sibling Ocsigen projects whose ocaml.org xrefs are rewritten to relative
;; links into their wodoc docs:  (pkg deploy-dir layout wrapper-module)
;; layout = true/multilib (<dir>.<side>/) | false/root (modules at version
;; root) | subdir (each opam package under its own <pkg>/, whole family).
(hosted
  (eliom           eliom           true  Eliom)
  (ocsigen-toolkit ocsigen-toolkit true  Ot)
  (ocsigen-start   ocsigen-start   true  Os)
  (ocsigenserver   ocsigenserver   false Ocsigen)
  (js_of_ocaml     js_of_ocaml     subdir)
  (tyxml           tyxml           subdir)
  (lwt             lwt             subdir)
  (reactiveData    reactiveData    root))
