Skip to content

Feature request: Automatic paging for long text #30

Description

@sekika

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions