Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix docs indentation #68

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 25 additions & 25 deletions cylc/flow/cfgspec/globalcfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import os
from pathlib import Path
from sys import stderr
from textwrap import dedent, indent
from textwrap import dedent
from typing import List, Optional, Tuple, Any, Union

from contextlib import suppress
Expand Down Expand Up @@ -590,34 +590,34 @@
COMMA_SEPARATED_SECTION_NOTE = '''


.. note::
.. note::

This section can be a comma separated list.
This section can be a comma separated list.

.. spoiler:: Example
.. spoiler:: Example

For example:
For example:

.. code-block:: cylc
.. code-block:: cylc

[a, b]
setting = x
[a]
another_setting = y
[a, b]
setting = x
[a]
another_setting = y

Will become:
Will become:

.. code-block:: cylc
.. code-block:: cylc

[a]
setting = x
[b]
setting = x
[a]
another_setting = y
[a]
setting = x
[b]
setting = x
[a]
another_setting = y

Which will then be combined according to
:ref:`the rules for Cylc config syntax<syntax>`.
Which will then be combined according to
:ref:`the rules for Cylc config syntax<syntax>`.

'''

Expand Down Expand Up @@ -1165,9 +1165,9 @@ def default_for(

.. versionadded:: 8.0.0
"""):
with Conf('<install target>', desc="""
with Conf('<install target>', desc=dedent("""
:ref:`Host <Install targets>` on which to create the symlinks.
""" + COMMA_SEPARATED_SECTION_NOTE):
""") + COMMA_SEPARATED_SECTION_NOTE):
Comment on lines +1168 to +1170
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is how it's done elsewhere:

with Conf('job', desc=REPLACED_BY_PLATFORMS + dedent('''
This section configures the means by which cylc submits task
job scripts to run.
''')):

Conf('run', VDR.V_STRING, None, desc="""
Alternative location for the run dir.

Expand Down Expand Up @@ -1243,7 +1243,7 @@ def default_for(

.. versionadded:: 8.0.0
'''):
with Conf('<platform name>', desc=f'''
with Conf('<platform name>', desc=dedent('''
Configuration defining a platform.

Many of these settings have replaced those of the same name from
Expand All @@ -1253,7 +1253,7 @@ def default_for(
Platform names can be regular expressions: If you have a set of
compute resources such as ``bigmachine1, bigmachine2`` or
``desktop0000, .., desktop9999`` one would define platforms with
names ``[[bigmachine[12]]]`` and ``[[desktop[0-9]{{4}}]]``.
names ``[[bigmachine[12]]]`` and ``[[desktop[0-9]{4}]]``.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(As I've made it not an f-string anymore)


Cylc searches for a matching platform in the reverse
of the definition order to allow user defined platforms
Expand Down Expand Up @@ -1289,7 +1289,7 @@ def default_for(

.. versionadded:: 8.0.0

''' + indent(COMMA_SEPARATED_SECTION_NOTE, ' ' * 3)) as Platform:
''') + COMMA_SEPARATED_SECTION_NOTE) as Platform:
with Conf('meta', desc=PLATFORM_META_DESCR):
Conf('<custom metadata>', VDR.V_STRING, '', desc='''
Any user-defined metadata item.
Expand Down
Loading