From ef5dbf4828592e93e147237f5c1c0135430a94e5 Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Wed, 18 Jan 2023 14:11:33 +0000 Subject: [PATCH] Link format string in docs to Python string formatting mini-language See #2584. --- docs/source/progress.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/progress.rst b/docs/source/progress.rst index 256e57f6..6a6d449b 100644 --- a/docs/source/progress.rst +++ b/docs/source/progress.rst @@ -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 `_ 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]}"``.