<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://air.imag.fr/index.php?action=history&amp;feed=atom&amp;title=VT2020-Jsonnet-Demo</id>
	<title>VT2020-Jsonnet-Demo - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://air.imag.fr/index.php?action=history&amp;feed=atom&amp;title=VT2020-Jsonnet-Demo"/>
	<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=VT2020-Jsonnet-Demo&amp;action=history"/>
	<updated>2026-06-19T12:59:45Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.17</generator>
	<entry>
		<id>https://air.imag.fr/index.php?title=VT2020-Jsonnet-Demo&amp;diff=48460&amp;oldid=prev</id>
		<title>Alexandra.Chaton at 13:32, 16 November 2020</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=VT2020-Jsonnet-Demo&amp;diff=48460&amp;oldid=prev"/>
		<updated>2020-11-16T13:32:31Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 13:32, 16 November 2020&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 46:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 46:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Commande pour générer le fichier json : &lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Commande pour générer le fichier json : &lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;jsonnet conditionals.jsonnet -o cond.json&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;jsonnet conditionals.jsonnet -o cond.json&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;code&amp;gt;-o&amp;lt;/code&amp;gt; permet de spécifier le fichier de sortie sinon les données &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;s’affiche&lt;/del&gt; dans le terminal&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;code&amp;gt;-o&amp;lt;/code&amp;gt; permet de spécifier le fichier de sortie sinon les données &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;s’affichent&lt;/ins&gt; dans le terminal&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Fichier multiple_output.jsonnet==&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Fichier multiple_output.jsonnet==&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Alexandra.Chaton</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=VT2020-Jsonnet-Demo&amp;diff=48430&amp;oldid=prev</id>
		<title>Alexandra.Chaton: /* Démonstration */</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=VT2020-Jsonnet-Demo&amp;diff=48430&amp;oldid=prev"/>
		<updated>2020-11-15T20:16:53Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Démonstration&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 20:16, 15 November 2020&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 8:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 8:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=Démonstration=&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=Démonstration=&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;La démonstration porte sur l’exécution des scripts suivants afin d’observer la syntaxe d’un fichier jsonnet, les différences entre les fichiers json et jsonnet ainsi que comment générer des fichiers json à partir d’un fichier jsonnet.&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;La démonstration porte sur l’exécution des scripts suivants afin d’observer la syntaxe d’un fichier jsonnet, les différences entre les fichiers json et jsonnet ainsi que comment générer des fichiers json à partir d’un fichier jsonnet.&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[https://drive.google.com/file/d/1SaKGshnfiWDp0eU41RU3fgXJtpObQBiD/view?usp=sharing Lien vers la vidéo de démonstration]&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[https://drive.google.com/file/d/1SaKGshnfiWDp0eU41RU3fgXJtpObQBiD/view?usp=sharing Lien vers la vidéo de démonstration]&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Alexandra.Chaton</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=VT2020-Jsonnet-Demo&amp;diff=48429&amp;oldid=prev</id>
		<title>Alexandra.Chaton at 20:16, 15 November 2020</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=VT2020-Jsonnet-Demo&amp;diff=48429&amp;oldid=prev"/>
		<updated>2020-11-15T20:16:25Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 20:16, 15 November 2020&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 8:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 8:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=Démonstration=&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=Démonstration=&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;La démonstration porte sur l’exécution des scripts suivants afin d’observer la syntaxe d’un fichier jsonnet, les différences entre les fichiers json et jsonnet ainsi que comment générer des fichiers json à partir d’un fichier jsonnet.&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;La démonstration porte sur l’exécution des scripts suivants afin d’observer la syntaxe d’un fichier jsonnet, les différences entre les fichiers json et jsonnet ainsi que comment générer des fichiers json à partir d’un fichier jsonnet.&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[https://drive.google.com/file/d/1SaKGshnfiWDp0eU41RU3fgXJtpObQBiD/view?usp=sharing Lien vers la vidéo de démonstration]&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Fichier conditionnals.jsonnet==&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Fichier conditionnals.jsonnet==&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Alexandra.Chaton</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=VT2020-Jsonnet-Demo&amp;diff=48427&amp;oldid=prev</id>
		<title>Alexandra.Chaton: Created page with &quot;Cette page héberge la démonstration en lien avec la fiche Jsonnet dans le cadre du cours de Veille Technologique 2020.  =Installation= L...&quot;</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=VT2020-Jsonnet-Demo&amp;diff=48427&amp;oldid=prev"/>
		<updated>2020-11-15T20:14:22Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Cette page héberge la démonstration en lien avec la fiche &lt;a href=&quot;/index.php/VT2020-Jsonnet-Fiche&quot; title=&quot;VT2020-Jsonnet-Fiche&quot;&gt;Jsonnet&lt;/a&gt; dans le cadre du cours de &lt;a href=&quot;/index.php/VT2020&quot; title=&quot;VT2020&quot;&gt;Veille Technologique 2020&lt;/a&gt;.  =Installation= L...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Cette page héberge la démonstration en lien avec la fiche [[VT2020-Jsonnet-Fiche|Jsonnet]] dans le cadre du cours de [[VT2020|Veille Technologique 2020]].&lt;br /&gt;
&lt;br /&gt;
=Installation=&lt;br /&gt;
L’exécution des codes servant à la démonstration ci-dessous nécessite l’installation de [https://jsonnet.org/ Jsonnet] et de [https://fr.wikipedia.org/wiki/C%2B%2B C++] ou [https://fr.wikipedia.org/wiki/Go_(langage) Go].&lt;br /&gt;
* [https://github.com/google/jsonnet Installer Jsonnet via C++]&lt;br /&gt;
* [https://github.com/google/go-jsonnet Installer Jsonnet via Go]&lt;br /&gt;
&lt;br /&gt;
=Démonstration=&lt;br /&gt;
La démonstration porte sur l’exécution des scripts suivants afin d’observer la syntaxe d’un fichier jsonnet, les différences entre les fichiers json et jsonnet ainsi que comment générer des fichiers json à partir d’un fichier jsonnet.&lt;br /&gt;
&lt;br /&gt;
==Fichier conditionnals.jsonnet==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
local Gateau(fruit=false, large=false) = {&lt;br /&gt;
&lt;br /&gt;
  local factor = if large then 2 else 1,&lt;br /&gt;
&lt;br /&gt;
  ingredients: [&lt;br /&gt;
    {&lt;br /&gt;
      kind: &amp;#039;Sucre&amp;#039;,&lt;br /&gt;
      action: &amp;#039;ajouter&amp;#039;,&lt;br /&gt;
      qty: 6 * factor,&lt;br /&gt;
      unit: &amp;#039;grammes&amp;#039;,&lt;br /&gt;
    },&lt;br /&gt;
  ] + (&lt;br /&gt;
    if !fruit then [] else [&lt;br /&gt;
      { kind: &amp;#039;Fraise&amp;#039;, qty: 2 * factor },&lt;br /&gt;
    ]&lt;br /&gt;
  ) + [&lt;br /&gt;
    { kind: &amp;#039;Farine&amp;#039;, qty: 0.5 * factor },&lt;br /&gt;
    { kind: &amp;#039;Beurre&amp;#039;, qty: 0.5 * factor },&lt;br /&gt;
  ],&lt;br /&gt;
  // Returns null if not large.&lt;br /&gt;
  garnish: if large then &amp;#039;crème chantilly&amp;#039;,&lt;br /&gt;
  served: &amp;#039;Avec un chocolat chaud&amp;#039;,&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
  Gateau: Gateau(),&lt;br /&gt;
  &amp;#039;Gateau aux fraises&amp;#039;: Gateau(fruit=true),&lt;br /&gt;
  &amp;quot;Gateau d&amp;#039;anniversaire&amp;quot;: Gateau(large=true),&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Commande pour générer le fichier json : &lt;br /&gt;
&amp;lt;pre&amp;gt;jsonnet conditionals.jsonnet -o cond.json&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-o&amp;lt;/code&amp;gt; permet de spécifier le fichier de sortie sinon les données s’affiche dans le terminal&lt;br /&gt;
&lt;br /&gt;
==Fichier multiple_output.jsonnet==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    local factor = 6,&lt;br /&gt;
    &amp;quot;a.json&amp;quot;:{&lt;br /&gt;
        x: 1,&lt;br /&gt;
        y: $[&amp;quot;b.json&amp;quot;].y *  factor,&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;b.json&amp;quot;:{&lt;br /&gt;
        x: $[&amp;quot;a.json&amp;quot;].x,&lt;br /&gt;
        y: 2,&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;c.json&amp;quot;:{&lt;br /&gt;
        //Comparaison between a.y et b.y&lt;br /&gt;
        commentaireY: if $[&amp;quot;b.json&amp;quot;].y &amp;gt; $[&amp;quot;a.json&amp;quot;].y then &amp;#039;Valeur de b.y &amp;gt; a.y&amp;#039;&lt;br /&gt;
        else [if $[&amp;quot;b.json&amp;quot;].y &amp;lt; $[&amp;quot;a.json&amp;quot;].y then &amp;#039;Valeur de b.y &amp;lt; a.y&amp;#039; else &amp;quot; b.y = a.y&amp;quot;],&lt;br /&gt;
    },&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Commande pour générer les fichiers json : &lt;br /&gt;
&amp;lt;pre&amp;gt;jsonnet -m . multiple_output.jsonnet&amp;lt;/pre&amp;gt;&lt;br /&gt;
Les fichiers générés seront : a.json, b.json, c.json&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Sources==&lt;br /&gt;
* [https://jsonnet.org/ Site officiel Jsonnet]&lt;br /&gt;
* [https://github.com/google/jsonnet GitHub Jsonnet via C++]&lt;/div&gt;</summary>
		<author><name>Alexandra.Chaton</name></author>
	</entry>
</feed>