Draw a line with optional centered title. Args: title (str, optional): Text to render over the rule. Defaults to "". characters (str, optional): Character(s) to form the line. Defaults to "─". style (str, optional): Style of line. Defaults to "rule.line".
(
self,
title: TextType = "",
*,
characters: str = "─",
style: Union[str, Style] = "rule.line",
align: AlignMethod = "center",
)
| 1587 | return renderables |
| 1588 | |
| 1589 | def rule( |
| 1590 | self, |
| 1591 | title: TextType = "", |
| 1592 | *, |
| 1593 | characters: str = "─", |
| 1594 | style: Union[str, Style] = "rule.line", |
| 1595 | align: AlignMethod = "center", |
| 1596 | ) -> None: |
| 1597 | """Draw a line with optional centered title. |
| 1598 | |
| 1599 | Args: |
| 1600 | title (str, optional): Text to render over the rule. Defaults to "". |
| 1601 | characters (str, optional): Character(s) to form the line. Defaults to "─". |
| 1602 | style (str, optional): Style of line. Defaults to "rule.line". |
| 1603 | align (str, optional): How to align the title, one of "left", "center", or "right". Defaults to "center". |
| 1604 | """ |
| 1605 | from .rule import Rule |
| 1606 | |
| 1607 | rule = Rule(title=title, characters=characters, style=style, align=align) |
| 1608 | self.print(rule) |
| 1609 | |
| 1610 | def control(self, *control: Control) -> None: |
| 1611 | """Insert non-printing control codes. |