diff --git a/ocaml/cStatic.ml b/ocaml/cStatic.ml index b4c4c59..6baab17 100644 --- a/ocaml/cStatic.ml +++ b/ocaml/cStatic.ml @@ -13,8 +13,7 @@ let books = OhmPaging.Book.([ "tutorials/run.htm", "Module Ohm.Run" ; "tutorials/action.htm", "Adding new pages" ; "tutorials/html.htm", "HTML templates" ; - "tutorials/ohm.htm", "JSON serialization" ; - "tutorials/couch.htm", "Database storage" ; + "tutorials/json.htm", "JSON serialization" ; ] ]) diff --git a/static/tutorials/json.htm b/static/tutorials/json.htm index 3cc7357..7a8dab6 100644 --- a/static/tutorials/json.htm +++ b/static/tutorials/json.htm @@ -1,6 +1,6 @@
Understand the way Ohm helps you serialize data as JSON for sending to both the CouchDB database and the client-side code.
-JSON is a standard format for data serialization. A JSON value can be one of the following:
+JSON is a standard format for data serialization. A JSON value can be one of the following:
12
or 3.14
.In practice, you should never use the generated functions t_of_json
and json_of_t
yourself. Most Ohm modules and plugins expect you to provide them with either a format module, or a formatter value. Even when working on your own, using format modules is a superior way of doing things.
A format module provides a type t<.code> along with a handful of ways to serialize and unserialize a type. It includes functions
of_json
and to_json
(which let you use the formatter module as part of another type definition), function of_json_safe
which returns None
if parsing fails (instead of an exception), and a formatter value fmt
A format module provides a type t
along with a handful of ways to serialize and unserialize a type. It includes functions of_json
and to_json
(which let you use the formatter module as part of another type definition), function of_json_safe
which returns None
if parsing fails (instead of an exception), and a formatter value fmt
Building a format module is simple : use functor Ohm.Fmt.Make