Link format string in docs to Python string formatting mini-language

See #2584.
This commit is contained in:
Dave Pearson 2023-01-18 14:11:33 +00:00
parent 9d4a1f302b
commit ef5dbf4828
No known key found for this signature in database
GPG Key ID: B413E0EF113D4ABF
1 changed files with 1 additions and 1 deletions

View File

@ -101,7 +101,7 @@ The progress bar(s) will use only as much of the width of the terminal as requir
Columns
~~~~~~~
You may customize the columns in the progress display with the positional arguments to the :class:`~rich.progress.Progress` constructor. The columns are specified as either a *format string* or a :class:`~rich.progress.ProgressColumn` object.
You may customize the columns in the progress display with the positional arguments to the :class:`~rich.progress.Progress` constructor. The columns are specified as either a `format string <https://docs.python.org/3/library/string.html#formatspec>`_ or a :class:`~rich.progress.ProgressColumn` object.
Format strings will be rendered with a single value `"task"` which will be a :class:`~rich.progress.Task` instance. For example ``"{task.description}"`` would display the task description in the column, and ``"{task.completed} of {task.total}"`` would display how many of the total steps have been completed. Additional fields passed via keyword arguments to `~rich.progress.Progress.update` are store in ``task.fields``. You can add them to a format string with the following syntax: ``"extra info: {task.fields[extra]}"``.