Write single-column text rows without two-column layout constraints. This is useful for "examples" or other content that should appear as simple indented text without the padding and wrapping behavior of write_dl. Parameters ---------- rows : Sequence[RowDef
(
self,
rows: Sequence[RowDefinition],
)
| 73 | super().write_dl(modified_rows, col_max=col_max, col_spacing=col_spacing) |
| 74 | |
| 75 | def write_text_rows( |
| 76 | self, |
| 77 | rows: Sequence[RowDefinition], |
| 78 | ) -> None: |
| 79 | """Write single-column text rows without two-column layout constraints. |
| 80 | |
| 81 | This is useful for "examples" or other content that should appear as simple |
| 82 | indented text without the padding and wrapping behavior of write_dl. |
| 83 | |
| 84 | Parameters |
| 85 | ---------- |
| 86 | rows : Sequence[RowDefinition] |
| 87 | Rows to write. Only the 'name' field and 'extra_row_modifiers' are used. |
| 88 | """ |
| 89 | for row in rows: |
| 90 | extra_row_modifiers = row.extra_row_modifiers or [] |
| 91 | modified_row = row |
| 92 | for row_modifier in self.modifiers + extra_row_modifiers: |
| 93 | modified_row = row_modifier.apply(row=modified_row, justification_length=self.left_justification_length) |
| 94 | # Write the content with current indentation, no padding |
| 95 | self.write(f"{'':>{self.current_indent}}{modified_row.name.rstrip()}\n") |
| 96 | |
| 97 | @contextmanager |
| 98 | def section(self, name: str) -> Iterator[None]: |
no test coverage detected