107 lines
1.6 KiB
Markdown
107 lines
1.6 KiB
Markdown
# rp
|
|
|
|
Rich print files — markdown, JSON, code, and more — beautifully in your terminal.
|
|
|
|
## Features
|
|
|
|
- **Syntax highlighting** for 500+ languages via Pygments
|
|
- **Markdown rendering** with headings, code blocks, tables, and links
|
|
- **JSON formatting** with syntax highlighting
|
|
- **Pager integration** with mouse scrolling support
|
|
- **Stdin support** for piping content
|
|
|
|
## Installation
|
|
|
|
### Install globally with uv
|
|
|
|
```bash
|
|
uv tool install .
|
|
```
|
|
|
|
### Run directly with uv
|
|
|
|
```bash
|
|
uv run rp <file>
|
|
```
|
|
|
|
## Usage
|
|
|
|
### Basic file input
|
|
|
|
```bash
|
|
rp README.md
|
|
rp config.json
|
|
rp script.py
|
|
```
|
|
|
|
### Read from stdin
|
|
|
|
```bash
|
|
cat data.json | rp
|
|
echo '{"status": "ok"}' | rp
|
|
curl -s https://api.example.com | rp
|
|
```
|
|
|
|
### Force file type
|
|
|
|
```bash
|
|
rp --type python script.txt
|
|
rp -t json data.txt
|
|
```
|
|
|
|
### Pager control
|
|
|
|
```bash
|
|
rp --pager README.md # Force pager
|
|
rp --no-pager file.py # Disable pager
|
|
```
|
|
|
|
The pager prefers `less -R --mouse` for mouse scrolling when available, otherwise falls back to the system pager.
|
|
|
|
### Show version
|
|
|
|
```bash
|
|
rp --version
|
|
```
|
|
|
|
## Development
|
|
|
|
### Setup
|
|
|
|
```bash
|
|
uv sync
|
|
```
|
|
|
|
### Testing
|
|
|
|
```bash
|
|
uv run pytest # Run all tests
|
|
uv run pytest -v # Verbose output
|
|
uv run pytest tests/test_detect.py # Single file
|
|
```
|
|
|
|
### Linting & Type Checking
|
|
|
|
```bash
|
|
uv run ruff check src/
|
|
uv run ruff format src/
|
|
uv run mypy src/
|
|
```
|
|
|
|
### Build
|
|
|
|
```bash
|
|
uv build
|
|
```
|
|
|
|
## Workflow
|
|
|
|
- `main` — stable release branch
|
|
- `dev` — integration branch for day-to-day work
|
|
- Short-lived branches: `feature/<topic>`, `fix/<topic>`, `docs/<topic>`
|
|
- Open PRs into `dev` (squash merge); merge `dev` to `main` for releases
|
|
|
|
## License
|
|
|
|
MIT
|