Method: rich.markdown.Heading.__rich_console__
Calls: 13, Exceptions: 0, Paths: 3Back
Path 1: 8 calls (0.62)
Console (8)
ConsoleOptions (8)
Text (8) None (8)
1def __rich_console__(
2 self, console: Console, options: ConsoleOptions
3 ) -> RenderResult:
4 text = self.text
5 text.justify = "center"
6 if self.level == 1:
7 # Draw a border around h1s
8 yield Panel(
9 text,
10 box=box.DOUBLE,
11 style="markdown.h1.border",
12 )
13 else:
14 # Styled text for h2 and beyond
15 if self.level == 2:
16 yield Text("")
17 yield text
Path 2: 3 calls (0.23)
Console (3)
ConsoleOptions (3)
Panel (3) None (3)
1def __rich_console__(
2 self, console: Console, options: ConsoleOptions
3 ) -> RenderResult:
4 text = self.text
5 text.justify = "center"
6 if self.level == 1:
7 # Draw a border around h1s
8 yield Panel(
9 text,
10 box=box.DOUBLE,
11 style="markdown.h1.border",
12 )
13 else:
14 # Styled text for h2 and beyond
15 if self.level == 2:
16 yield Text("")
17 yield text
Path 3: 2 calls (0.15)
Console (2)
ConsoleOptions (2)
Text (4) None (2)
1def __rich_console__(
2 self, console: Console, options: ConsoleOptions
3 ) -> RenderResult:
4 text = self.text
5 text.justify = "center"
6 if self.level == 1:
7 # Draw a border around h1s
8 yield Panel(
9 text,
10 box=box.DOUBLE,
11 style="markdown.h1.border",
12 )
13 else:
14 # Styled text for h2 and beyond
15 if self.level == 2:
16 yield Text("")
17 yield text