Skip to content

Commit 09ace0f

Browse files
committed
Build: (6d4e919) Bump python dependencies to fix CI
CI got broken as the sphinxcontrib.applehelp extension was changed to require Sphinx version 5.0.0+ in patch bump here: sphinx-doc/sphinxcontrib-applehelp#15 Dependencies have been bumped to fix this. This slightly changes some styling, file name styling in code block captions is a little broken, will need to fix later. Did not do much in-depth investigation if anything else is broken, but skimmed through most pages and they look fine.
1 parent 5974e2e commit 09ace0f

File tree

171 files changed

+16414
-26494
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

171 files changed

+16414
-26494
lines changed

.buildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: 4203a9fd4b5a3d4c38cd7dd868f6c03a
3+
config: 6808c5459bda6c2ce747e66caf2fcc26
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

_images/nested-maps.png

3.82 KB
Loading

_sources/config/development/config-data.rst.txt

Lines changed: 49 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,13 @@ many cases you need to explicitly tell Terra what type you want to use.
3131
A piece of data defined in a config is something we will call an
3232
**object**. All objects can be categorized by having a type, which is
3333
determined by how it is defined in the config. Config files always
34-
define a single object, which is what we will call the **top level
35-
object**.
34+
define a single object.
3635

3736
Integers
3837
--------
3938

4039
To put this information to use, let's create create a new config file in
41-
YAML and define our top level object. For our type let's use something
42-
called an ``Integer``.
40+
YAML. For our type let's use the ``Integer`` type.
4341

4442
Integers represent whole numbers and as such, are
4543
written as whole numbers like so:
@@ -62,8 +60,7 @@ written as whole numbers like so:
6260
6361
42
6462
65-
We have now created a config that defines an ``Integer`` as the top
66-
level object, which represents the number ``42``, simple right?
63+
We have now created a config that defines an ``Integer``, which represents the number ``42``.
6764

6865
Floats
6966
------
@@ -194,15 +191,12 @@ By themselves, integers, floats, and strings aren't too useful, until we
194191
start assigning labels to them. We can do that using a type called a
195192
``Map``.
196193

197-
.. _key-value-pair:
194+
- A map is a *collection of objects*.
195+
- Each object in the collection is called a **value**.
196+
- Each **value** is identified by another object called a **key**.
198197

199-
A map is a *collection of objects*, referred to individually as
200-
**values**, where each **value** in the collection is identified by
201-
another unique object called a **key**. A key and a value together are
202-
called a **key-value pair**.
203-
204-
Here we will make a new config where the *top level object* is of type
205-
``Map``, and both the *key* and *value* are of type ``String``:
198+
Here we will make a new config with type ``Map``, and both the
199+
key and value are of type ``String``:
206200

207201
.. tab-set::
208202

@@ -224,7 +218,7 @@ Here we will make a new config where the *top level object* is of type
224218
"this is a key": "this is a value"
225219
}
226220
227-
Since maps are *collections* of objects, we can list multiple key value
221+
Since maps are collections of objects, we can list multiple key value
228222
pairs within the map like so:
229223

230224
.. tab-set::
@@ -251,10 +245,33 @@ pairs within the map like so:
251245
"meaning-of-life": 42
252246
}
253247
254-
This is useful because as explained above, configs only contain *one*
255-
top level object. By using maps, we are capable of defining more than
256-
one object within a config, as well as being able to identify what each
257-
of those objects are using keys.
248+
This is useful because as explained above, configs only contain one main object.
249+
By using maps, we are capable of defining multiple objects within a map,
250+
as well as being able to identify each of those objects with keys.
251+
252+
Each key within the same map must be unique, the following is invalid:
253+
254+
.. tab-set::
255+
256+
.. tab-item:: YAML
257+
258+
.. code-block:: yaml
259+
:caption: config.yml
260+
:linenos:
261+
262+
duplicated key: value A
263+
duplicated key: value B
264+
265+
.. tab-item:: JSON
266+
267+
.. code-block:: json
268+
:caption: config.json
269+
:linenos:
270+
271+
{
272+
"duplicated key": "value A",
273+
"duplicated key": "value B"
274+
}
258275
259276
.. _map-ordering:
260277

@@ -316,16 +333,12 @@ Lists
316333
-----
317334

318335
In addition to maps, we can also use a type called a ``List`` to
319-
indicate a collection of data. Lists differ from maps in that each
320-
object (called an **item**) in a list is not assigned a unique key, but
321-
is instead identified by It's position in the list. Because of this,
336+
define a collection of objects. Lists differ from maps in that each
337+
**item** (the term for an object in a list) is not assigned a unique key, but
338+
is instead identified by its position in the list. Because of this,
322339
*the order in which you define each object is significant*, unlike maps.
323340

324-
Another thing to note is generally, every item contained within a list
325-
will be of the same type.
326-
327-
Here is a config where the *top level object* is a ``List``, which
328-
contains multiple ``String``\ s:
341+
Here is a config with type ``List``, which contains multiple ``String``\ s:
329342

330343
.. tab-set::
331344

@@ -354,7 +367,7 @@ contains multiple ``String``\ s:
354367
Nesting Objects
355368
===============
356369

357-
Because values in maps and items in lists can be of any type, It's
370+
Because values in maps and items in lists can be of any type, it's
358371
possible to nest maps in maps, lists in lists, lists in maps, and so on.
359372

360373
.. tip::
@@ -374,7 +387,7 @@ possible to nest maps in maps, lists in lists, lists in maps, and so on.
374387
key: 42
375388
376389
Types that can span multiple lines, such as maps and lists won't fit
377-
on a single line. For example you man want the following map which spans
390+
on a single line. For example you may want the following map which spans
378391
multiple lines to be a value within another map:
379392

380393
.. code-block:: yaml
@@ -402,7 +415,7 @@ possible to nest maps in maps, lists in lists, lists in maps, and so on.
402415
- item 1
403416
- item 2
404417
405-
Multiple 'levels of indentation' can be used, for example here is the prior map further
418+
Multiple levels of indentation can be used, for example here is the prior map further
406419
nested under (as the value for the key) ``qux``:
407420

408421
.. code-block:: yaml
@@ -412,6 +425,10 @@ possible to nest maps in maps, lists in lists, lists in maps, and so on.
412425
foo: a
413426
bar: b
414427
428+
Each map can be visualized by drawing boxes like so:
429+
430+
.. image:: /img/config/development/nested-maps.png
431+
415432
.. tab-item:: JSON
416433

417434
Example of a ``Map`` defined in a ``Map``:
@@ -453,7 +470,7 @@ For example the following is invalid:
453470
key: foo
454471
baz: bar
455472
456-
The reason this is invalid is because there are two competing values being
473+
This is invalid is because there are two competing values being
457474
assigned to ``key``, which are ``foo`` and the map containing ``baz: bar``.
458475

459476
Deleting one of the values would make this valid YAML:
@@ -555,7 +572,7 @@ appointments using everything we have covered thus far:
555572
]
556573
}
557574
558-
In this example, our top level object is of type ``Map``, which contains
575+
In this example, the config is of type ``Map``, which contains
559576
two keys ``shopping-list`` and ``appointments``. The value of both keys
560577
are of type ``List``, where each *item* in each list contains a ``Map``.
561578

_sources/config/development/index.rst.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Config Development
1010
config-files
1111
config-data
1212
config-system
13+
meta-configuration
1314

1415
pack-from-scratch/index
1516

0 commit comments

Comments
 (0)