Skip to content

Commit 0a6f394

Browse files
committed
Improve nested config shorthand docs.
1 parent 4c627c2 commit 0a6f394

File tree

4 files changed

+30
-28
lines changed

4 files changed

+30
-28
lines changed

src/7-to-8/summary.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ take action on any warnings.
4646
.. TODO Add ref to breaking changes section within Major changes, once created,
4747
including optional ouputs.
4848
49+
.. note::
50+
51+
Validation warnings use a :ref:`shorthand notation<config_item_shorthand>`
52+
to refer to nested configuration settings on a single line, like this:
53+
``[section][sub-section]item``.
4954

5055

5156
New Web and Terminal UIs

src/reference/config/file-format.rst

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -158,23 +158,19 @@ Include-files
158158
:ref:`Jinja2's <Jinja>` template inclusion mechanism can be used with Cylc
159159
too.
160160

161+
.. _config_item_shorthand:
161162

162163
Shorthand
163164
---------
164165

165-
Throughout the documentation we refer to configuration settings in the
166-
following way:
167-
168-
``[section]``
169-
An entire section.
170-
``[section]setting``
171-
A setting within a section.
172-
``[section]setting=value``
173-
The value of a setting within a section.
174-
``[section][sub-section]another-setting``
175-
A setting within a sub-section.
176-
177-
.. warning::
178-
We only use one set of square brackets at each level when writing nested
179-
sections on one line like this. But in the file, each sub-section
180-
gets additional square brackets as shown above.
166+
.. include:: shorthand.rst
167+
168+
.. code-block:: cylc
169+
170+
# This:
171+
# [runtime][task-a][environment]FOO = foo
172+
# Means:
173+
[runtime]
174+
[[task-a]]
175+
[[[environment]]]
176+
FOO = foo

src/reference/config/shorthand.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
We often use a compact single-line notation to refer to nested config items:
2+
3+
``[section]``
4+
An entire section.
5+
``[section]setting``
6+
A setting within a section.
7+
``[section]setting=value``
8+
The value of a setting within a section.
9+
``[section][sub-section]another-setting``
10+
A setting within a sub-section.
11+
12+
In the file, however, section headings need additional brackets at each level.

src/tutorial/scheduling/graphing.rst

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,7 @@ Example
5858
Shorthand
5959
^^^^^^^^^
6060

61-
Throughout this tutorial we will refer to configuration settings in the following ways:
62-
63-
``[section]``
64-
An entire section.
65-
``[section]key``
66-
A specific config item, within a section.
67-
``[section]key=value``
68-
The value of a specific config item, within a section.
69-
``[section][sub-section]another-key``
70-
Note we only use one set of square brackets per section heading when
71-
writing on one line like this. In the config file each nested level
72-
gets another set of square brackets.
61+
.. include:: ../../reference/config/shorthand.rst
7362

7463
Duplicate Items
7564
^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)