Pure OCaml Yaml 1.2 reader and writer using Bytesrw

fix

+2 -5
+1 -2
doc/index.html
··· 29 29 "name": "Alice", age: 30 30 30 "age": 30, active: true 31 31 "active": true 32 - }</pre><p>The YAML version is cleaner for humans to read and write.</p><h2 id="setup"><a href="#setup" class="anchor"></a>Setup</h2><p>First, let's set up our environment. The library is loaded with:</p><div class="x-ocaml-wrapper"><x-ocaml>#require "yamlrw";; 33 - open Yamlrw;;</x-ocaml></div><h2 id="basic-parsing"><a href="#basic-parsing" class="anchor"></a>Basic Parsing</h2><p>The simplest way to parse YAML is with <code>Yamlrw.of_string</code>:</p><div class="x-ocaml-wrapper"><x-ocaml>let simple = of_string "hello";;</x-ocaml></div><p>YAML automatically recognizes different data types:</p><div class="x-ocaml-wrapper"><x-ocaml>of_string "42";; 32 + }</pre><p>The YAML version is cleaner for humans to read and write.</p><h2 id="setup"><a href="#setup" class="anchor"></a>Setup</h2><p>First, let's set up our environment. The library is loaded with:</p><div class="x-ocaml-wrapper"><x-ocaml>open Yamlrw;;</x-ocaml></div><h2 id="basic-parsing"><a href="#basic-parsing" class="anchor"></a>Basic Parsing</h2><p>The simplest way to parse YAML is with <code>Yamlrw.of_string</code>:</p><div class="x-ocaml-wrapper"><x-ocaml>let simple = of_string "hello";;</x-ocaml></div><p>YAML automatically recognizes different data types:</p><div class="x-ocaml-wrapper"><x-ocaml>of_string "42";; 34 33 of_string "3.14";; 35 34 of_string "true";; 36 35 of_string "null";;</x-ocaml></div><p>Note that integers are stored as floats in the JSON-compatible <code>Yamlrw.value</code> type, matching the behavior of JSON parsers.</p><h3 id="boolean-values"><a href="#boolean-values" class="anchor"></a>Boolean Values</h3><p>YAML recognizes many forms of boolean values:</p><div class="x-ocaml-wrapper"><x-ocaml>of_string "yes";;
+1 -2
doc/tutorial.html
··· 4 4 &quot;name&quot;: &quot;Alice&quot;, age: 30 5 5 &quot;age&quot;: 30, active: true 6 6 &quot;active&quot;: true 7 - }</pre><p>The YAML version is cleaner for humans to read and write.</p><h2 id="setup"><a href="#setup" class="anchor"></a>Setup</h2><p>First, let's set up our environment. The library is loaded with:</p><pre class="language-ocaml"><code># #require &quot;yamlrw&quot;;; 8 - # open Yamlrw;;</code></pre><h2 id="basic-parsing"><a href="#basic-parsing" class="anchor"></a>Basic Parsing</h2><p>The simplest way to parse YAML is with <code>Yamlrw.of_string</code>:</p><pre class="language-ocaml"><code># let simple = of_string &quot;hello&quot;;; 7 + }</pre><p>The YAML version is cleaner for humans to read and write.</p><h2 id="setup"><a href="#setup" class="anchor"></a>Setup</h2><p>First, let's set up our environment. The library is loaded with:</p><pre class="language-ocaml"><code># open Yamlrw;;</code></pre><h2 id="basic-parsing"><a href="#basic-parsing" class="anchor"></a>Basic Parsing</h2><p>The simplest way to parse YAML is with <code>Yamlrw.of_string</code>:</p><pre class="language-ocaml"><code># let simple = of_string &quot;hello&quot;;; 9 8 val simple : value = `String &quot;hello&quot;</code></pre><p>YAML automatically recognizes different data types:</p><pre class="language-ocaml"><code># of_string &quot;42&quot;;; 10 9 - : value = `Float 42. 11 10 # of_string &quot;3.14&quot;;;
-1
doc/tutorial.mld
··· 38 38 First, let's set up our environment. The library is loaded with: 39 39 40 40 {@ocaml[ 41 - # #require "yamlrw";; 42 41 # open Yamlrw;; 43 42 ]} 44 43