package ojs_base

  1. Overview
  2. Docs
Base library for developing OCaml web apps based on websockets and js_of_ocaml

Install

Dune Dependency

Authors

Maintainers

Sources

ojs-base-0.7.0.tar.bz2
md5=85b8a0746e9be8c20cf082f2573b5895
sha512=ec707820ff69ddbf9c631cf6a1c8748e82346daded1a4f73c5702128d07858f915e62d529e5fec01e99263f33eefb1586067341c058535806e0092b9d040644a

doc/src/ojs_base.server/tmpl.ml.html

Source file tmpl.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
(*********************************************************************************)
(*                Ojs-base                                                       *)
(*                                                                               *)
(*    Copyright (C) 2014-2021 INRIA. All rights reserved.                        *)
(*                                                                               *)
(*    This program is free software; you can redistribute it and/or modify       *)
(*    it under the terms of the GNU General Public License as                    *)
(*    published by the Free Software Foundation, version 3 of the License.       *)
(*                                                                               *)
(*    This program is distributed in the hope that it will be useful,            *)
(*    but WITHOUT ANY WARRANTY; without even the implied warranty of             *)
(*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the               *)
(*    GNU Library General Public License for more details.                       *)
(*                                                                               *)
(*    You should have received a copy of the GNU General Public                  *)
(*    License along with this program; if not, write to the Free Software        *)
(*    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA                   *)
(*    02111-1307  USA                                                            *)
(*                                                                               *)
(*    As a special exception, you have permission to link this program           *)
(*    with the OCaml compiler and distribute executables, as long as you         *)
(*    follow the requirements of the GNU GPL in regard to all of the             *)
(*    software in the executable aside from the OCaml compiler.                  *)
(*                                                                               *)
(*    Contact: Maxence.Guesdon@inria.fr                                          *)
(*                                                                               *)
(*********************************************************************************)

(** *)

module X = Xtmpl.Rewrite

let script_js = [%xtmpl "templates/script_js.xml"]
let html_page = [%xtmpl "templates/html_page.xml"]
let link_css url =
  let atts = X.atts_of_list
    [
      ("","href"), [ X.cdata url ] ;
      ("","rel"), [ X.cdata "stylesheet" ] ;
      ("","type"), [ X.cdata  "text/css" ] ;
    ]
  in
  X.node ("","link") ~atts []
OCaml

Innovation. Community. Security.