Skip to content

Commit

Permalink
Merge pull request #4942 from TomJGooding/docs-fix-typos-and-spelling
Browse files Browse the repository at this point in the history
docs: fix typos and spelling
  • Loading branch information
willmcgugan authored Aug 27, 2024
2 parents 376cf0f + 2b64b6e commit 46a300e
Show file tree
Hide file tree
Showing 25 changed files with 43 additions and 43 deletions.
4 changes: 2 additions & 2 deletions docs/examples/guide/css/nesting02.tcss
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
padding: 1 2;
margin: 1 2;
text-align: center;
border: heavy $panel;
border: heavy $panel;

/* Style the Yes button */
&.affirmative {
border: heavy $success;
border: heavy $success;
}

/* Style the No button */
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/guide/reactivity/set_reactive01.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class NameApp(App):
CSS = """
Screen {
align: center middle;
}
}
"""
greeting_no: var[int] = var(0)
BINDINGS = [("space", "greeting")]
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/guide/reactivity/set_reactive02.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class NameApp(App):
CSS = """
Screen {
align: center middle;
}
}
"""
greeting_no: var[int] = var(0)
BINDINGS = [("space", "greeting")]
Expand Down
10 changes: 5 additions & 5 deletions docs/examples/guide/screens/questions01.tcss
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
QuestionScreen {
layout: grid;
grid-size: 2 2;
grid-size: 2 2;
align: center bottom;
}

QuestionScreen > Label {
margin: 1;
margin: 1;
text-align: center;
column-span: 2;
column-span: 2;
width: 1fr;
}

QuestionScreen Button {
margin: 2;
width: 1fr;
margin: 2;
width: 1fr;
}
2 changes: 1 addition & 1 deletion docs/examples/styles/hatch.tcss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.hatch {
height: 1fr;
border: solid $secondary;

&.cross {
hatch: cross $success;
}
Expand Down
6 changes: 3 additions & 3 deletions docs/examples/styles/keyline.tcss
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ Grid {
keyline: heavy green;
}
Placeholder {
height: 1fr;
height: 1fr;
}
.hidden {
visibility: hidden;
}
}
#foo {
column-span: 2;
}
#bar {
row-span: 2;
row-span: 2;
}
#baz {
column-span:3;
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ Textual uses the following scheme to map messages classes on to a Python method.

Messages have a namespace if they are defined as a child class of a Widget.
The namespace is the name of the parent class.
For instance, the builtin `Input` class defines it's `Changed` message as follow:
For instance, the builtin `Input` class defines its `Changed` message as follows:

```python
class Input(Widget):
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ As mentioned earlier, widgets expand to fill the _width_ of their parent contain
They do not, however, expand to fill the container's height.
Thus, we need explicitly assign `height: 100%` to achieve this.

A consequence of this "horizontal growth" behaviour is that if we remove the width restriction from the above example (by deleting `width: 1fr;`), each child widget will grow to fit the width of the screen,
A consequence of this "horizontal growth" behavior is that if we remove the width restriction from the above example (by deleting `width: 1fr;`), each child widget will grow to fit the width of the screen,
and only the first widget will be visible.
The other two widgets in our layout are offscreen, to the right-hand side of the screen.
In the case of `horizontal` layout, Textual will _not_ automatically add a scrollbar.
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/reactivity.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ The color is parsed in `on_input_submitted` and assigned to `self.color`. Becaus

Textual only calls watch methods if the value of a reactive attribute _changes_.
If the newly assigned value is the same as the previous value, the watch method is not called.
You can override this behaviour by passing `always_update=True` to `reactive`.
You can override this behavior by passing `always_update=True` to `reactive`.


### Dynamically watching reactive attributes
Expand Down
2 changes: 1 addition & 1 deletion docs/styles/links/link_background_hover.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ If not provided, a Textual action link will have `link-background-hover` set to

## Example

The example below shows some links that have their background colour changed when the mouse moves over it and it shows that there is a default color for `link-background-hover`.
The example below shows some links that have their background color changed when the mouse moves over it and it shows that there is a default color for `link-background-hover`.

It also shows that `link-background-hover` does not affect hyperlinks.

Expand Down
2 changes: 1 addition & 1 deletion docs/styles/links/link_color_hover.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ If not provided, a Textual action link will have `link-color-hover` set to `whit

## Example

The example below shows some links that have their colour changed when the mouse moves over it.
The example below shows some links that have their color changed when the mouse moves over it.
It also shows that `link-color-hover` does not affect hyperlinks.

=== "Output"
Expand Down
2 changes: 1 addition & 1 deletion docs/styles/links/link_style_hover.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ If not provided, a Textual action link will have `link-style-hover` set to `bold

## Example

The example below shows some links that have their colour changed when the mouse moves over it.
The example below shows some links that have their color changed when the mouse moves over it.
It also shows that `link-style-hover` does not affect hyperlinks.

=== "Output"
Expand Down
4 changes: 2 additions & 2 deletions docs/widgets/text_area.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ the cursor, selection, gutter, and more.

#### Default theme

The default `TextArea` theme is called `css`, which takes it's values entirely from CSS.
The default `TextArea` theme is called `css`, which takes its values entirely from CSS.
This means that the default appearance of the widget fits nicely into a standard Textual application,
and looks right on both dark and light mode.

Expand Down Expand Up @@ -292,7 +292,7 @@ This immediately updates the appearance of the `TextArea`:
```{.textual path="docs/examples/widgets/text_area_custom_theme.py" columns="42" lines="8"}
```

### Tab and Escape behaviour
### Tab and Escape behavior

Pressing the ++tab++ key will shift focus to the next widget in your application by default.
This matches how other widgets work in Textual.
Expand Down
2 changes: 1 addition & 1 deletion examples/code_browser.tcss
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ CodeBrowser.-show-tree #tree-view {
#code-view {
overflow: auto scroll;
min-width: 100%;
hatch: right $primary;
hatch: right $primary;
}
#code {
width: auto;
Expand Down
2 changes: 1 addition & 1 deletion examples/dictionary.tcss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Input {

#results {
width: 100%;
height: auto;
height: auto;
}

#results-container {
Expand Down
10 changes: 5 additions & 5 deletions examples/merlin.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ class LabelSwitch(Widget):
DEFAULT_CSS = """
LabelSwitch Label {
text-align: center;
width: 1fr;
text-style: bold;
width: 1fr;
text-style: bold;
}
LabelSwitch Label#label-5 {
Expand Down Expand Up @@ -101,7 +101,7 @@ class MerlinApp(App):

CSS = """
Screen {
align: center middle;
align: center middle;
}
Screen.-win {
Expand All @@ -110,8 +110,8 @@ class MerlinApp(App):
Screen.-win Timer {
color: $success;
}
}
Grid {
width: auto;
height: auto;
Expand Down
2 changes: 1 addition & 1 deletion src/textual/_compositor.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ def add_widget(
Args:
widget: The widget to add.
virtual_region: The Widget region relative to it's container.
virtual_region: The Widget region relative to its container.
region: The region the widget will occupy.
order: Painting order information.
layer_order: The order of the widget in its layer.
Expand Down
2 changes: 1 addition & 1 deletion src/textual/_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
@dataclass
class DockArrangeResult:
placements: list[WidgetPlacement]
"""A `WidgetPlacement` for every widget to describe it's location on screen."""
"""A `WidgetPlacement` for every widget to describe its location on screen."""
widgets: set[Widget]
"""A set of widgets in the arrangement."""
scroll_spacing: Spacing
Expand Down
2 changes: 1 addition & 1 deletion src/textual/css/_style_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ def __get__(
Returns:
A ``tuple[EdgeType, Style]`` containing the string type of the box and
it's style. Example types are "rounded", "solid", and "dashed".
its style. Example types are "rounded", "solid", and "dashed".
"""
return obj.get_rule(self.name) or ("", self._default_color) # type: ignore[return-value]

Expand Down
8 changes: 4 additions & 4 deletions src/textual/document/_document_navigator.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class DocumentNavigator:
may move your cursor to a position further along the current raw document line,
rather than on to the next line in the raw document.
The DocumentNavigator class manages that behaviour.
The DocumentNavigator class manages that behavior.
Given a cursor location in the unwrapped document, and a cursor movement action,
this class can inform us of the destination the cursor will move to considering
Expand Down Expand Up @@ -49,9 +49,9 @@ class DocumentNavigator:
document-space line. This is a codepoint index, rather than a visual offset.
In "ABCDEF" with wrapping at width 3, there is a single wrap offset of 3.
"Smart home" refers to a modification of the "home" key behaviour. If smart home is
"Smart home" refers to a modification of the "home" key behavior. If smart home is
enabled, the first non-whitespace character is considered to be the home location.
If the cursor is currently at this position, then the normal home behaviour applies.
If the cursor is currently at this position, then the normal home behavior applies.
This is designed to make cursor movement more useful to end users.
"""

Expand Down Expand Up @@ -389,7 +389,7 @@ def get_location_home(
Args:
location: The location to consider.
smart_home: Enable/disable 'smart home' behaviour.
smart_home: Enable/disable 'smart home' behavior.
Returns:
The home location, relative to the given location.
Expand Down
8 changes: 4 additions & 4 deletions src/textual/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ def allow_focus(self) -> bool:
"""Check if the widget is permitted to focus.
The base class returns [`can_focus`][textual.widget.Widget.can_focus].
This method maybe overridden if additional logic is required.
This method may be overridden if additional logic is required.
Returns:
`True` if the widget may be focused, or `False` if it may not be focused.
Expand All @@ -650,7 +650,7 @@ def allow_focus_children(self) -> bool:
"""Check if a widget's children may be focused.
The base class returns [`can_focus_children`][textual.widget.Widget.can_focus_children].
This method maybe overridden if additional logic is required.
This method may be overridden if additional logic is required.
Returns:
`True` if the widget's children may be focused, or `False` if the widget's children may not be focused.
Expand Down Expand Up @@ -1813,7 +1813,7 @@ def container_viewport(self) -> Region:

@property
def virtual_region(self) -> Region:
"""The widget region relative to it's container (which may not be visible,
"""The widget region relative to its container (which may not be visible,
depending on scroll offset).
Expand Down Expand Up @@ -2845,7 +2845,7 @@ def scroll_to_widget(
scrolled = True

# Adjust the region by the amount we just scrolled it, and convert to
# it's parent's virtual coordinate system.
# its parent's virtual coordinate system.

region = (
(
Expand Down
2 changes: 1 addition & 1 deletion src/textual/widgets/_data_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ def __init__(
cursor_type: The type of cursor to be used when navigating the data table
with the keyboard.
cell_padding: The number of cells added on each side of each column. Setting
this value to zero will likely make your table very heard to read.
this value to zero will likely make your table very hard to read.
name: The name of the widget.
id: The ID of the widget in the DOM.
classes: The CSS classes for the widget.
Expand Down
2 changes: 1 addition & 1 deletion src/textual/widgets/_directory_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ async def watch_path(self) -> None:
await self.reload()

def process_label(self, label: TextType) -> Text:
"""Process a str or Text into a label. Maybe overridden in a subclass to modify how labels are rendered.
"""Process a str or Text into a label. May be overridden in a subclass to modify how labels are rendered.
Args:
label: Label.
Expand Down
2 changes: 1 addition & 1 deletion src/textual/widgets/_toggle_button.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class ToggleButton(Static, can_focus=True):
text-style: underline;
}
/* Base button colours (including in dark mode). */
/* Base button colors (including in dark mode). */
ToggleButton > .toggle--button {
color: $background;
Expand Down
2 changes: 1 addition & 1 deletion src/textual/widgets/_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ def last_line(self) -> int:
def process_label(self, label: TextType) -> Text:
"""Process a `str` or `Text` value into a label.
Maybe overridden in a subclass to change how labels are rendered.
May be overridden in a subclass to change how labels are rendered.
Args:
label: Label.
Expand Down

0 comments on commit 46a300e

Please sign in to comment.