Add padding around rendered output
This commit is contained in:
@@ -7,6 +7,7 @@ from dataclasses import dataclass
|
||||
from rich.console import Console, RenderableType
|
||||
from rich.json import JSON as RichJSON
|
||||
from rich.markdown import Markdown
|
||||
from rich.padding import Padding
|
||||
from rich.syntax import Syntax
|
||||
|
||||
from rp.pager import MousePager
|
||||
@@ -75,8 +76,10 @@ def render(
|
||||
content, "text", theme=options.theme, line_numbers=line_numbers
|
||||
)
|
||||
|
||||
padded = Padding(renderable, (1, 2))
|
||||
|
||||
if use_pager:
|
||||
with console.pager(pager=MousePager(), styles=True):
|
||||
console.print(renderable)
|
||||
console.print(padded)
|
||||
else:
|
||||
console.print(renderable)
|
||||
console.print(padded)
|
||||
|
||||
Reference in New Issue
Block a user