From 09c76246f6de1fbf94cec5d7bc38294ed5615ddc Mon Sep 17 00:00:00 2001 From: db0 Date: Mon, 27 Aug 2012 11:41:43 +0200 Subject: [PATCH 1/2] Add .eliom extension for Ocsigen (OCaml web framework) --- lib/linguist/languages.yml | 2 ++ samples/OCaml/example.eliom | 48 +++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 samples/OCaml/example.eliom diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 1fbc38b6..7b8b772a 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -822,6 +822,8 @@ OCaml: - .mli - .mll - .mly + - .eliom + - .eliomi ObjDump: type: data diff --git a/samples/OCaml/example.eliom b/samples/OCaml/example.eliom new file mode 100644 index 00000000..df24934e --- /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!"]]))) + +}} From e857b234295602f3826fa7a73186a454c34935db Mon Sep 17 00:00:00 2001 From: db0 Date: Mon, 27 Aug 2012 12:16:47 +0200 Subject: [PATCH 2/2] .eliom extension in OCaml extensions properly sorted --- lib/linguist/languages.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 7b8b772a..ac9853ed 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -819,11 +819,11 @@ OCaml: color: "#3be133" primary_extension: .ml extensions: + - .eliom + - .eliomi - .mli - .mll - .mly - - .eliom - - .eliomi ObjDump: type: data