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

Feature request: Automatic paging for long text #30

Open
sekika opened this issue Aug 8, 2024 · 0 comments
Open

Feature request: Automatic paging for long text #30

sekika opened this issue Aug 8, 2024 · 0 comments

Comments

@sekika
Copy link

sekika commented Aug 8, 2024

I have created a script that automatically decides whether to print long text directly to the console or to use pypager for paginated display based on the length of the text and the terminal size.

Description

This script wraps the text to fit the terminal width and calculates the number of pages needed to display the text. If the text fits within a single page, it prints the text directly. If it spans multiple pages, it uses pypager to provide an easy-to-navigate paginated display.

Script

You can find the script in this Gist.

Example Usage

  1. Ensure you have pypager installed:

    pip install pypager
  2. Use the function with your text:

    from your_script import print_long
    long_text = "Your long text here..."
    print_long(long_text)

I believe this functionality could be a valuable addition to pypager. Would you consider integrating this feature into pypager?

Thank you for your consideration!

@sekika sekika changed the title Feature Request: Automatic paging for long text Feature request: Automatic paging for long text Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant