Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --pager flag for juv cat #45

Merged
merged 8 commits into from
Nov 5, 2024
Merged

Add --pager flag for juv cat #45

merged 8 commits into from
Nov 5, 2024

Conversation

manzt
Copy link
Owner

@manzt manzt commented Nov 5, 2024

This PR introduces a --pager flag to the juv cat command, allowing users to specify a custom pager tool for displaying the notebook’s contents. If the --pager flag is not provided, juv cat will default to the JUV_PAGER environment variable (if set).

When JUV_PAGER (or --pager) is set to bat, additional flags are automatically added to improve formatting, including syntax highlighting with an inferred file type based on notebook content (e.g., markdown or script).

This setup achieves the same effect as manually piping to bat if installed:

juv cat Untitled.ipynb | bat --language md --file-name 'Untitled.md'

or

juv cat Untitled.ipynb --script | bat --langugage py --file-name 'Untitled.py'

@manzt manzt changed the title Enable piping cat through bat Add --pager flag for juv cat Nov 5, 2024
@manzt manzt merged commit df8dda1 into main Nov 5, 2024
13 checks passed
@manzt manzt added the enhancement New feature or request label Nov 5, 2024
@manzt manzt deleted the manzt/bat branch November 8, 2024 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant