@@ -271,7 +271,9 @@ def from_markup(
271
271
272
272
Args:
273
273
text (str): A string containing console markup.
274
+ style (Union[str, Style], optional): Base style for text. Defaults to "".
274
275
emoji (bool, optional): Also render emoji code. Defaults to True.
276
+ emoji_variant (str, optional): Optional emoji variant, either "text" or "emoji". Defaults to None.
275
277
justify (str, optional): Justify method: "left", "center", "full", "right". Defaults to None.
276
278
overflow (str, optional): Overflow method: "crop", "fold", "ellipsis". Defaults to None.
277
279
end (str, optional): Character to end text with. Defaults to "\\ \\ n".
@@ -369,6 +371,7 @@ def assemble(
369
371
style (Union[str, Style], optional): Base style for text. Defaults to "".
370
372
justify (str, optional): Justify method: "left", "center", "full", "right". Defaults to None.
371
373
overflow (str, optional): Overflow method: "crop", "fold", "ellipsis". Defaults to None.
374
+ no_wrap (bool, optional): Disable text wrapping, or None for default. Defaults to None.
372
375
end (str, optional): Character to end text with. Defaults to "\\ \\ n".
373
376
tab_size (int): Number of spaces per tab, or ``None`` to use ``console.tab_size``. Defaults to None.
374
377
meta (Dict[str, Any], optional). Meta data to apply to text, or None for no meta data. Default to None
@@ -424,7 +427,7 @@ def spans(self, spans: List[Span]) -> None:
424
427
self ._spans = spans [:]
425
428
426
429
def blank_copy (self , plain : str = "" ) -> "Text" :
427
- """Return a new Text instance with copied meta data (but not the string or spans)."""
430
+ """Return a new Text instance with copied metadata (but not the string or spans)."""
428
431
copy_self = Text (
429
432
plain ,
430
433
style = self .style ,
@@ -505,7 +508,7 @@ def stylize_before(
505
508
def apply_meta (
506
509
self , meta : Dict [str , Any ], start : int = 0 , end : Optional [int ] = None
507
510
) -> None :
508
- """Apply meta data to the text, or a portion of the text.
511
+ """Apply metadata to the text, or a portion of the text.
509
512
510
513
Args:
511
514
meta (Dict[str, Any]): A dict of meta information.
@@ -634,9 +637,9 @@ def highlight_words(
634
637
"""Highlight words with a style.
635
638
636
639
Args:
637
- words (Iterable[str]): Worlds to highlight.
640
+ words (Iterable[str]): Words to highlight.
638
641
style (Union[str, Style]): Style to apply.
639
- case_sensitive (bool, optional): Enable case sensitive matchings . Defaults to True.
642
+ case_sensitive (bool, optional): Enable case sensitive matching . Defaults to True.
640
643
641
644
Returns:
642
645
int: Number of words highlighted.
@@ -823,8 +826,6 @@ def expand_tabs(self, tab_size: Optional[int] = None) -> None:
823
826
if tab_size is None :
824
827
tab_size = 8
825
828
826
- result = self .blank_copy ()
827
-
828
829
new_text : List [Text ] = []
829
830
append = new_text .append
830
831
@@ -899,6 +900,7 @@ def pad(self, count: int, character: str = " ") -> None:
899
900
900
901
Args:
901
902
count (int): Width of padding.
903
+ character (str): The character to pad with. Must be a string of length 1.
902
904
"""
903
905
assert len (character ) == 1 , "Character must be a string of length 1"
904
906
if count :
@@ -1005,6 +1007,9 @@ def append_text(self, text: "Text") -> "Text":
1005
1007
"""Append another Text instance. This method is more performant that Text.append, but
1006
1008
only works for Text.
1007
1009
1010
+ Args:
1011
+ text (Text): The Text instance to append to this instance.
1012
+
1008
1013
Returns:
1009
1014
Text: Returns self for chaining.
1010
1015
"""
@@ -1026,7 +1031,7 @@ def append_tokens(
1026
1031
"""Append iterable of str and style. Style may be a Style instance or a str style definition.
1027
1032
1028
1033
Args:
1029
- pairs (Iterable[Tuple[str, Optional[StyleType]]]): An iterable of tuples containing str content and style.
1034
+ tokens (Iterable[Tuple[str, Optional[StyleType]]]): An iterable of tuples containing str content and style.
1030
1035
1031
1036
Returns:
1032
1037
Text: Returns self for chaining.
@@ -1204,8 +1209,7 @@ def wrap(
1204
1209
1205
1210
Args:
1206
1211
console (Console): Console instance.
1207
- width (int): Number of characters per line.
1208
- emoji (bool, optional): Also render emoji code. Defaults to True.
1212
+ width (int): Number of cells available per line.
1209
1213
justify (str, optional): Justify method: "default", "left", "center", "full", "right". Defaults to "default".
1210
1214
overflow (str, optional): Overflow method: "crop", "fold", or "ellipsis". Defaults to None.
1211
1215
tab_size (int, optional): Default tab size. Defaults to 8.
0 commit comments