Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add .eliom extension for Ocsigen (OCaml web framework)
- Loading branch information
1 parent
38b966a
commit 09c7624
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -822,6 +822,8 @@ OCaml: | |
- .mli | ||
- .mll | ||
- .mly | ||
- .eliom | ||
- .eliomi | ||
|
||
ObjDump: | ||
type: data | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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!"]]))) | ||
|
||
}} |