Skip to content

Commit

Permalink
Merge pull request #239 from db0company/master
Browse files Browse the repository at this point in the history
Add .eliom extension for Ocsigen (OCaml web framework)
  • Loading branch information
tnm committed Feb 22, 2013
2 parents 58a9b56 + e857b23 commit b998a5c
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/linguist/languages.yml
Expand Up @@ -833,6 +833,8 @@ OCaml:
color: "#3be133"
primary_extension: .ml
extensions:
- .eliom
- .eliomi
- .mli
- .mll
- .mly
Expand Down
48 changes: 48 additions & 0 deletions 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!"]])))

}}

0 comments on commit b998a5c

Please sign in to comment.