.TH "Eliom_tools.Xhtml" 3o 2012-06-11 OCamldoc ""
.SH NAME
Eliom_tools.Xhtml \- Menu and hierarchical site for XHTML
.SH Module
Module Eliom_tools.Xhtml
.SH Documentation
.sp
Module
.BI "Xhtml"
:
.B sig end
.sp
Menu and hierarchical site for XHTML
.sp
.sp
.sp
.sp
.PP
.B ===
.B Menus
.B ===
.PP
.I val menu
:
.B ?classe:Xhtml_types.nmtoken list ->
.B ?id:string ->
.B ([< Eliom_service.get_service_kind ] as 'a,
.B [< Eliom_service.registrable ] as 'b,
.B [< Eliom_registration.non_caml_service ] as 'c)
.B Eliom_tools.one_page * Xhtml_types.a_content Eliom_content.Xhtml.F.elt list ->
.B (('a, 'b, 'c) Eliom_tools.one_page *
.B Xhtml_types.a_content Eliom_content.Xhtml.F.elt list)
.B list ->
.B ?service:('a, 'b, 'c) Eliom_tools.one_page ->
.B unit -> [> `Ul ] Eliom_content.Xhtml.F.elt
.sp
The function
.B menu first_elt elts ()
, where
.B first_elt::elts
is a list of pair
.B (service, content)
, creates a list of link
towards the
.B service
s\&. See the Eliom manual for an \&.
.sp
The optional parameter
.B service
is used to find which item(s)
to highlight (by adding the class
.B eliomtools_current
to the
corresponding
.B
node)\&. The default is to highlight the item
corresponding to the current url\&.
.sp
The optional parameters
.B id
and
.B classe
allow to specify the
corresponding attributes in the generated
.B
node\&. The
default class for the
.B
node is
.B eliomtools_menu
\&.
.sp
.sp
.PP
.B ===
.B Hierchical sites
.B ===
.PP
.I val hierarchical_menu_depth_first
:
.B ?classe:Xhtml_types.nmtoken list ->
.B ?id:string ->
.B ?whole_tree:bool ->
.B ([< Eliom_service.get_service_kind ] as 'a,
.B [< Eliom_service.registrable ] as 'b,
.B Xhtml_types.a_content Eliom_content.Xhtml.F.elt list)
.B Eliom_tools.hierarchical_site ->
.B ?service:('a, 'b, [< Eliom_registration.non_caml_service ])
.B Eliom_tools.one_page ->
.B unit -> [> `Ul ] Eliom_content.Xhtml.F.elt list
.sp
The function
.B hierarchical_menu_depth_first site ()
constructs
a hierarchical menu by exploring the hierarchical
.B site
description using a depth\-first algorithm: the first menu item
will be displayed, followed by the whole sub\-menu for this item,
then the second menu item with its sub\-menu, and so on\&.
.sp
By default, only the sub\-menus for to the url corresponding to
the optional argument
.B service
are displayed, others sub\-menu
are collapsed\&. If you want all the sub\-menus to be displayed,
specify
.B ~whole_tree:true
\&. If the optional parameter
.B service
is not given, the current page is used\&.
.sp
See
.B Eliom_tools\&.Xhtml\&.menu
for a description of the optional parameters
.B id
and
.B classe
\&.
.sp
.sp
.I val hierarchical_menu_breadth_first
:
.B ?classe:Xhtml_types.nmtoken list ->
.B ?id:string ->
.B ([< Eliom_service.get_service_kind ] as 'a,
.B [< Eliom_service.registrable ] as 'b,
.B Xhtml_types.a_content Eliom_content.Xhtml.F.elt list)
.B Eliom_tools.hierarchical_site ->
.B ?service:('a, 'b, [< Eliom_registration.non_caml_service ])
.B Eliom_tools.one_page ->
.B unit -> [> `Ul ] Eliom_content.Xhtml.F.elt list
.sp
The function
.B hierarchical_menu_breadth_first site ()
constructs a hierarchical menu by exploring the hierarchical
.B site
description using a breadth_first algorithm: the whole
menu for one level will be displayed, followed by the sub\-menu
leading to the current service, and so one\&.
.sp
By default the current service correspond to the current
url\&. The optional parameter
.B service
allow to override the
current service\&.
.sp
See
.B Eliom_tools\&.Xhtml\&.menu
for a description of the optional parameters
.B id
and
.B classe
\&.
.sp
.sp
.I val structure_links
:
.B ([< Eliom_service.get_service_kind ] as 'a,
.B [< Eliom_service.registrable ] as 'b,
.B Xhtml_types.a_content Eliom_content.Xhtml.F.elt list)
.B Eliom_tools.hierarchical_site ->
.B ?service:('a, 'b, [< Eliom_registration.non_caml_service ])
.B Eliom_tools.one_page ->
.B unit -> [> `Link ] Eliom_content.Xhtml.F.elt list
.sp
The function
.B structure_links site ()
returns the tags
.B
and
.B
for the
given hierarchical
.B site
\&.
.sp
By default the current service correspond to the current
url\&. The optional parameter
.B service
allow to override the
current service\&.
.sp
.sp
.I val head
:
.B title:string ->
.B ?css:string list list ->
.B ?js:string list list -> unit -> Xhtml_types.head Eliom_content.Xhtml.F.elt
.sp
An auxiliary function for creating an HTML head elements\&. Resources (JS,
CSS) are taken from the static directory\&.
.sp
.sp