1
0
mirror of https://github.com/taigrr/yq synced 2025-01-18 04:53:17 -08:00

Updated docs to include value parsing

This commit is contained in:
Mike Farah
2020-01-20 08:35:03 +11:00
parent b7148adf20
commit 8a65822b0b
16 changed files with 1502 additions and 555 deletions

View File

@@ -241,8 +241,8 @@
<li class="md-nav__item">
<a href="../read/" title="Read" class="md-nav__link">
Read
<a href="../path_expressions/" title="Path Expressions" class="md-nav__link">
Path Expressions
</a>
</li>
@@ -253,8 +253,20 @@
<li class="md-nav__item">
<a href="../path_expressions/" title="Path Expressions" class="md-nav__link">
Path Expressions
<a href="../value_parsing/" title="Value Parsing" class="md-nav__link">
Value Parsing
</a>
</li>
<li class="md-nav__item">
<a href="../read/" title="Read" class="md-nav__link">
Read
</a>
</li>
@@ -425,7 +437,7 @@
<h1>Convert</h1>
<h3 id="yaml-to-json">Yaml to Json<a class="headerlink" href="#yaml-to-json" title="Permanent link">&para;</a></h3>
<h2 id="yaml-to-json">Yaml to Json<a class="headerlink" href="#yaml-to-json" title="Permanent link">&para;</a></h2>
<p>To convert output to json, use the --tojson (or -j) flag. This is supported by all commands.</p>
<p>Each matching yaml node will be converted to json and printed out on a separate line.</p>
<p>Given a sample.yaml file of:</p>
@@ -457,7 +469,7 @@ bab:
{&quot;c&quot;:5}
</code></pre>
<h3 id="json-to-yaml">Json to Yaml<a class="headerlink" href="#json-to-yaml" title="Permanent link">&para;</a></h3>
<h2 id="json-to-yaml">Json to Yaml<a class="headerlink" href="#json-to-yaml" title="Permanent link">&para;</a></h2>
<p>To read in json, just pass in a json file instead of yaml, it will just work :)</p>
<p>e.g given a json file</p>
<pre><code class="json">{&quot;a&quot;:&quot;Easy! as one two three&quot;,&quot;b&quot;:{&quot;c&quot;:2,&quot;d&quot;:[3,4]}}