diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 066a3c7c5d..c91d372afd 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -833,6 +833,8 @@ OCaml: color: "#3be133" primary_extension: .ml extensions: + - .eliom + - .eliomi - .mli - .mll - .mly diff --git a/samples/OCaml/example.eliom b/samples/OCaml/example.eliom new file mode 100644 index 0000000000..df24934e62 --- /dev/null +++ b/samples/OCaml/example.eliom @@ -0,0 +1,48 @@ + +{shared{ + + open Eliom_content + open Html5.D + open Eliom_parameter + +}} + +{server{ + + module Example = + Eliom_registration.App + (struct + let application_name = "example" + end) + + let main = + Eliom_service.service + ~path:[] + ~get_params:unit + () + +}} + +{client{ + + let hello_popup () = + Dom_html.window##alert(Js.string ("Hello Popup!")) + +}} + +{server{ + + let _ = + + Example.register + ~service:main + (fun () () -> + Lwt.return + (html + (head (title (pcdata "Hello World of Ocsigen")) []) + (body [h1 [pcdata "Hello World!"]; + p [pcdata "Welcome to my first Ocsigen website."]; + h2 ~a:[a_onclick {{ hello_popup () }}] + [pcdata "Click me!"]]))) + +}}