Skip to content

Commit 7a168a2

Browse files
plotskiAnonymous
and
Anonymous
authored
[docs] Fix typos and other small stuff (#3094)
* [docs.text] Fix typo ("follow" -> "following") * [docs.text] Fix ANSI/assemble examples * [rich.pretty] Make `python -m rich.pretty` from the examples work * [docs.progress] Fix typo ("updated" -> "setting") * [docs.progress] Fix reference to cp_progress.py * [docs.table] Fix typo ("show above" -> "shown above") * [docs.table] Add reference to "Padding" for "padding" argument --------- Co-authored-by: Anonymous <[email protected]>
1 parent e76f3c3 commit 7a168a2

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

Diff for: docs/source/progress.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ The ``total`` value associated with a task is the number of steps that must be c
5858
Updating tasks
5959
~~~~~~~~~~~~~~
6060

61-
When you call :meth:`~rich.progress.Progress.add_task` you get back a `Task ID`. Use this ID to call :meth:`~rich.progress.Progress.update` whenever you have completed some work, or any information has changed. Typically you will need to update ``completed`` every time you have completed a step. You can do this by updated ``completed`` directly or by setting ``advance`` which will add to the current ``completed`` value.
61+
When you call :meth:`~rich.progress.Progress.add_task` you get back a `Task ID`. Use this ID to call :meth:`~rich.progress.Progress.update` whenever you have completed some work, or any information has changed. Typically you will need to update ``completed`` every time you have completed a step. You can do this by setting ``completed`` directly or by setting ``advance`` which will add to the current ``completed`` value.
6262

6363
The :meth:`~rich.progress.Progress.update` method collects keyword arguments which are also associated with the task. Use this to supply any additional information you would like to render in the progress display. The additional arguments are stored in ``task.fields`` and may be referenced in :ref:`Column classes<Columns>`.
6464

@@ -234,7 +234,7 @@ Here's an example that reads a url from the internet::
234234

235235
If you expect to be reading from multiple files, you can use :meth:`~rich.progress.Progress.open` or :meth:`~rich.progress.Progress.wrap_file` to add a file progress to an existing Progress instance.
236236

237-
See `cp_progress.py <https://github.com/willmcgugan/rich/blob/master/examples/cp_progress.py>` for a minimal clone of the ``cp`` command which shows a progress bar as the file is copied.
237+
See `cp_progress.py <https://github.com/willmcgugan/rich/blob/master/examples/cp_progress.py>`_ for a minimal clone of the ``cp`` command which shows a progress bar as the file is copied.
238238

239239

240240
Multiple Progress

Diff for: docs/source/tables.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ Table Options
5050

5151
There are a number of keyword arguments on the Table constructor you can use to define how a table should look.
5252

53-
- ``title`` Sets the title of the table (text show above the table).
54-
- ``caption`` Sets the table caption (text show below the table).
53+
- ``title`` Sets the title of the table (text shown above the table).
54+
- ``caption`` Sets the table caption (text shown below the table).
5555
- ``width`` Sets the desired width of the table (disables automatic width calculation).
5656
- ``min_width`` Sets a minimum width for the table.
5757
- ``box`` Sets one of the :ref:`appendix_box` styles for the table grid, or ``None`` for no grid.
5858
- ``safe_box`` Set to ``True`` to force the table to generate ASCII characters rather than unicode.
59-
- ``padding`` An integer, or tuple of 1, 2, or 4 values to set the padding on cells.
59+
- ``padding`` An integer, or tuple of 1, 2, or 4 values to set the padding on cells (see :ref:`Padding`).
6060
- ``collapse_padding`` If True the padding of neighboring cells will be merged.
6161
- ``pad_edge`` Set to False to remove padding around the edge of the table.
6262
- ``expand`` Set to True to expand the table to the full available size.

Diff for: docs/source/text.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ Alternatively, you can construct styled text by calling :meth:`~rich.text.Text.a
2828

2929
If you would like to use text that is already formatted with ANSI codes, call :meth:`~rich.text.Text.from_ansi` to convert it to a ``Text`` object::
3030

31-
text = Text.from_ansi("\033[1mHello, World!\033[0m")
31+
text = Text.from_ansi("\033[1;35mHello\033[0m, World!")
3232
console.print(text.spans)
3333

34-
Since building Text instances from parts is a common requirement, Rich offers :meth:`~rich.text.Text.assemble` which will combine strings or pairs of string and Style, and return a Text instance. The follow example is equivalent to the code above::
34+
Since building Text instances from parts is a common requirement, Rich offers :meth:`~rich.text.Text.assemble` which will combine strings or pairs of string and Style, and return a Text instance. The following example is equivalent to the ANSI example above::
3535

36-
text = Text.assemble(("Hello", "bold magenta"), " World!")
36+
text = Text.assemble(("Hello", "bold magenta"), ", World!")
3737
console.print(text)
3838

3939
You can apply a style to given words in the text with :meth:`~rich.text.Text.highlight_words` or for ultimate control call :meth:`~rich.text.Text.highlight_regex` to highlight text matching a *regular expression*.

Diff for: rich/pretty.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -986,7 +986,7 @@ class StockKeepingUnit(NamedTuple):
986986

987987
from rich import print
988988

989-
# print(Pretty(data, indent_guides=True, max_string=20))
989+
print(Pretty(data, indent_guides=True, max_string=20))
990990

991991
class Thing:
992992
def __repr__(self) -> str:

0 commit comments

Comments
 (0)