2 Commits

Author SHA1 Message Date
f32da588fb Bump version to 0.2.3 2026-04-01 23:59:55 -07:00
0e7f30d6c3 Add padding around rendered output 2026-04-01 23:59:34 -07:00
4 changed files with 8 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
[project] [project]
name = "rp" name = "rp"
version = "0.2.2" version = "0.2.3"
description = "Rich print files — markdown, JSON, code, and more — beautifully in your terminal" description = "Rich print files — markdown, JSON, code, and more — beautifully in your terminal"
readme = "README.md" readme = "README.md"
license = "MIT" license = "MIT"

View File

@@ -2,6 +2,6 @@
from __future__ import annotations from __future__ import annotations
__version__ = "0.2.2" __version__ = "0.2.3"
__author__ = "Yunxiao Xu" __author__ = "Yunxiao Xu"
__license__ = "MIT" __license__ = "MIT"

View File

@@ -7,6 +7,7 @@ from dataclasses import dataclass
from rich.console import Console, RenderableType from rich.console import Console, RenderableType
from rich.json import JSON as RichJSON from rich.json import JSON as RichJSON
from rich.markdown import Markdown from rich.markdown import Markdown
from rich.padding import Padding
from rich.syntax import Syntax from rich.syntax import Syntax
from rp.pager import MousePager from rp.pager import MousePager
@@ -75,8 +76,10 @@ def render(
content, "text", theme=options.theme, line_numbers=line_numbers content, "text", theme=options.theme, line_numbers=line_numbers
) )
padded = Padding(renderable, (1, 2))
if use_pager: if use_pager:
with console.pager(pager=MousePager(), styles=True): with console.pager(pager=MousePager(), styles=True):
console.print(renderable) console.print(padded)
else: else:
console.print(renderable) console.print(padded)

2
uv.lock generated
View File

@@ -198,7 +198,7 @@ wheels = [
[[package]] [[package]]
name = "rp" name = "rp"
version = "0.2.1" version = "0.2.3"
source = { editable = "." } source = { editable = "." }
dependencies = [ dependencies = [
{ name = "rich" }, { name = "rich" },