Skip to content

Commit

Permalink
Fri 29 Nov 2024 03:38:52 PM CST
Browse files Browse the repository at this point in the history
  • Loading branch information
ingydotnet committed Nov 29, 2024
1 parent 4453250 commit 1f25fa9
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion blog/index.html

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions feed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3935,10 +3935,6 @@ variable there.</p>
indent the data you are applying the function to.</p>
<p>YAMLScript lets you put a function in a tag if you prefix it with a<code>:</code>:</p>
<pre class="language-yaml"><code class="language-yaml"><span class="token key atrule">--- !yamlscript/v0</span><span class="token punctuation">:</span><br>map1 =<span class="token punctuation">:</span><span class="token punctuation">:</span><br> <span class="token key atrule">name</span><span class="token punctuation">:</span> Bobbi Datamon<br><span class="token key atrule">list1 =</span><span class="token punctuation">:</span> load("big<span class="token punctuation">-</span>list.yaml")<br><br><span class="token key atrule">person</span><span class="token punctuation">:</span> <span class="token tag">!:merge</span><br><span class="token punctuation">-</span> <span class="token tag">!</span> map1<br><span class="token punctuation">-</span> likes<span class="token punctuation">:</span><span class="token punctuation">:</span> list1</code></pre>
<p>In this case we can simplify it even more by adding <code>:</code> to the <em>end</em> of the tag,
thus switching to code mode:</p>
<pre class="language-yaml"><code class="language-yaml"><span class="token key atrule">person</span><span class="token punctuation">:</span> <span class="token tag">!:</span><span class="token key atrule">merge</span><span class="token punctuation">:</span> <span class="token punctuation">-</span><span class="token punctuation">[</span>map1<span class="token punctuation">,</span> <span class="token punctuation">{</span>'likes' list1<span class="token punctuation">}</span><span class="token punctuation">]</span></code></pre>
<p>But I digress…</p>
<h2>Conditional Insertions in Mappings and Sequences</h2>
<p>A big missing feature (and one definitely needed for Helm charts) was the
ability to conditionally insert key/value pairs into mappings depending on some
Expand Down
2 changes: 1 addition & 1 deletion index.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions posts/2024-11-29/index.html

Large diffs are not rendered by default.

Loading

0 comments on commit 1f25fa9

Please sign in to comment.