mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Merge pull request #916 from davep/css-docs-review-actions
CSS docs review - Actions
This commit is contained in:
@@ -50,7 +50,7 @@ Action strings have the following format:
|
||||
|
||||
### Parameters
|
||||
|
||||
If the action strings contains parameters, these must be valid Python literals. Which means you can include numbers, strings, dicts, lists etc. but you can't include variables or references to any other python symbols.
|
||||
If the action string contains parameters, these must be valid Python literals. Which means you can include numbers, strings, dicts, lists etc. but you can't include variables or references to any other python symbol.
|
||||
|
||||
Consequently `"set_background('blue')"` is a valid action string, but `"set_background(new_color)"` is not — because `new_color` is a variable and not a literal.
|
||||
|
||||
@@ -71,7 +71,7 @@ The following example mounts simple static text with embedded action links.
|
||||
```{.textual path="docs/examples/guide/actions/actions03.py"}
|
||||
```
|
||||
|
||||
When you click any of the links, Textual runs the `"set_background"` action to change the background to the given color and plays the terminals bell.
|
||||
When you click any of the links, Textual runs the `"set_background"` action to change the background to the given color and plays the terminal's bell.
|
||||
|
||||
## Bindings
|
||||
|
||||
|
||||
@@ -483,7 +483,7 @@ class App(Generic[ReturnType], DOMNode):
|
||||
self.dark = not self.dark
|
||||
|
||||
def action_screenshot(self, filename: str | None, path: str = "~/") -> None:
|
||||
"""Save an SVG "screenshot". This action will save a SVG file containing the current contents of the screen.
|
||||
"""Save an SVG "screenshot". This action will save an SVG file containing the current contents of the screen.
|
||||
|
||||
Args:
|
||||
filename (str | None, optional): Filename of screenshot, or None to auto-generate. Defaults to None.
|
||||
@@ -492,7 +492,7 @@ class App(Generic[ReturnType], DOMNode):
|
||||
self.save_screenshot(filename, path)
|
||||
|
||||
def export_screenshot(self, *, title: str | None = None) -> str:
|
||||
"""Export a SVG screenshot of the current screen.
|
||||
"""Export an SVG screenshot of the current screen.
|
||||
|
||||
Args:
|
||||
title (str | None, optional): The title of the exported screenshot or None
|
||||
@@ -519,7 +519,7 @@ class App(Generic[ReturnType], DOMNode):
|
||||
path: str = "./",
|
||||
time_format: str = "%Y-%m-%d %X %f",
|
||||
) -> str:
|
||||
"""Save a SVG screenshot of the current screen.
|
||||
"""Save an SVG screenshot of the current screen.
|
||||
|
||||
Args:
|
||||
filename (str | None, optional): Filename of SVG screenshot, or None to auto-generate
|
||||
|
||||
Reference in New Issue
Block a user