Apply metadata to the text, or a portion of the text. Args: meta (Dict[str, Any]): A dict of meta information. start (int): Start offset (negative indexing is supported). Defaults to 0. end (Optional[int], optional): End offset (negative indexing is suppo
(
self, meta: Dict[str, Any], start: int = 0, end: Optional[int] = None
)
| 507 | self._spans.insert(0, Span(start, min(length, end), style)) |
| 508 | |
| 509 | def apply_meta( |
| 510 | self, meta: Dict[str, Any], start: int = 0, end: Optional[int] = None |
| 511 | ) -> None: |
| 512 | """Apply metadata to the text, or a portion of the text. |
| 513 | |
| 514 | Args: |
| 515 | meta (Dict[str, Any]): A dict of meta information. |
| 516 | start (int): Start offset (negative indexing is supported). Defaults to 0. |
| 517 | end (Optional[int], optional): End offset (negative indexing is supported), or None for end of text. Defaults to None. |
| 518 | |
| 519 | """ |
| 520 | style = Style.from_meta(meta) |
| 521 | self.stylize(style, start=start, end=end) |
| 522 | |
| 523 | def on(self, meta: Optional[Dict[str, Any]] = None, **handlers: Any) -> "Text": |
| 524 | """Apply event handlers (used by Textual project). |