From 49bb35cc09d0e7a537a4d1f545b872ae19703535 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Proust?= Date: Tue, 28 Aug 2018 11:04:12 +0800 Subject: [PATCH] Doc: minor grammar fixes and improvements --- docs/index.rst | 4 ++-- docs/tutorials/data_encoding.rst | 17 +++++++++-------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index d1a929d5e..e372bb2bd 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -29,13 +29,13 @@ The source code of Tezos is placed under the MIT Open Source License. The Community ------------- -- Several community built block explorers are available: +- Several community-built block explorers are available: - http://tzscan.io - https://tezos.id - https://tezex.info -- A few community run websites collect useful Tezos links: +- A few community-run websites collect useful Tezos links: - https://www.tezos.help - https://tezos.rocks diff --git a/docs/tutorials/data_encoding.rst b/docs/tutorials/data_encoding.rst index e557d094d..0ed1e808e 100644 --- a/docs/tutorials/data_encoding.rst +++ b/docs/tutorials/data_encoding.rst @@ -37,7 +37,7 @@ For example, an encoding that represents a 31 bit integer has type Encoding an object ~~~~~~~~~~~~~~~~~~ -Encoding a single integer is fairly uninteresting. The `Dataencoding` +Encoding a single integer is fairly uninteresting. The `Data_encoding` library provides a number of combinators that can be used to build more complicated objects. Consider the type that represents an interval from the first number to the second: @@ -54,7 +54,8 @@ We can define an encoding for this type as: Data_encoding.(obj2 (req "min" int64) (req "max" int64)) In the example above we construct a new value ``interval_encoding`` by -combining two `int64` integers using the ``obj2`` constructor. +combining two `int64` integers using the ``obj2`` (object with two fields) +constructor. The library provides different constructors, i.e. for objects that have no data (``Data_encoding.empty``), constructors for object up to 10 @@ -67,7 +68,7 @@ as a JSON object with field names. Lists, arrays, and options ~~~~~~~~~~~~~~~~~~~~~~~~~~ -List, Arrays and options types can by built on top of ground data types. +List, arrays and options types can by built on top of ground data types. .. code:: ocaml @@ -112,7 +113,7 @@ Encoding for this types can be expressed as: (fun s -> S s) ]) This variant encoding is a bit more complicated. Let’s look at the parts -of the type: +of the encoding: - We include an optimization hint to the binary encoding to inform it of the number of elements we expect in the tag. In most cases, we can @@ -150,7 +151,7 @@ First we define an untyped JSON AST: | `Null | `String of string ] -This is then parsed into a typed AST ( we eliminate several cases for +This is then parsed into a typed AST (we eliminate several cases for clarity): .. code:: ocaml @@ -183,9 +184,9 @@ clarity): | Def : { name : string ; encoding : 'a t } -> 'a desc -- The first set of constructors define all ground types. +- The first few constructors define all ground types. - The constructors for ``Bytes``, ``String`` and ``String_enum`` - includes a length fields in order to provide safe binary + include a length field in order to provide safe binary serialization. - The constructors for ``Array`` and ``List`` are used by the combinators we saw earlier. @@ -203,4 +204,4 @@ The library also provides various wrappers and convenience functions to make constructing these objects easier. Reading the documentation in the `mli file <../api/odoc/tezos-data-encoding/Tezos_data_encoding/Data_encoding/index.html>`__ -should orient you on how to use these functions and their purposes. +should orient you on how to use these functions.