Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 321a5d1590
Fetching contributors…

Cannot retrieve contributors at this time

43 lines (35 sloc) 1.334 kb
open Nethtml
let concat_path p f =
if p = "" then f
else if p.[String.length p - 1] = '/' then p ^ f
else p ^ "/" ^ f
let separation_arrow url_base =
Element("span", ["class", "separation"],
[Element("img", ["src", url_base ^ "images/right_arrow.png";
"alt", ">"], [])])
let rec transform_path sep p = match p with
| [] -> []
| [(a, _)] -> [sep; Data a]
| (a, rev) :: tl ->
let el = Element("a", ["href", rev], [Data a]) in
sep :: el :: transform_path sep tl
let stylesheet tpl ?(rel_base=true) url =
Set.stylesheet tpl begin fun t ->
let url = if rel_base then concat_path (Get.url_base t) url else url in
let s = Element("link", ["rel", "stylesheet"; "type", "text/css";
"media","all"; "href", url],
[]) in
[s]
end
let javascript tpl ?(rel_base=true) url =
Set.javascript tpl begin fun t ->
let url = if rel_base then concat_path (Get.url_base t) url else url in
[Element("script", ["type", "text/javascript"; "src", url], [])]
end
let navigation tpl path =
Set.navigation_bar tpl begin fun t ->
let sep = separation_arrow (Get.url_base t) in
transform_path sep path
end
let navigation_of_path tpl ?(prefix=[]) p =
navigation tpl (prefix @ Template.Path.navigation p)
Jump to Line
Something went wrong with that request. Please try again.