Helpful context manager that writes a paragraph, a heading, and the indents. :param name: the section name that is written as heading.
(self, name: str)
| 272 | |
| 273 | @contextmanager |
| 274 | def section(self, name: str) -> cabc.Generator[None]: |
| 275 | """Helpful context manager that writes a paragraph, a heading, |
| 276 | and the indents. |
| 277 | |
| 278 | :param name: the section name that is written as heading. |
| 279 | """ |
| 280 | self.write_paragraph() |
| 281 | self.write_heading(name) |
| 282 | self.indent() |
| 283 | try: |
| 284 | yield |
| 285 | finally: |
| 286 | self.dedent() |
| 287 | |
| 288 | @contextmanager |
| 289 | def indentation(self) -> cabc.Generator[None]: |
no test coverage detected