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: Export to plain text file #489

Open
pachpict opened this issue Sep 27, 2023 · 4 comments
Open

Feature request: Export to plain text file #489

pachpict opened this issue Sep 27, 2023 · 4 comments

Comments

@pachpict
Copy link

Proposal

Would it be possible to export the output od the terminal display to a plain text file?

Example: If I open a 80x20 terminal window and run brow.sh enter monotone mode ([alt]+m) and open bbc.co.uk and hit the export key ([ctrl]+p?) it would create a file (./2023-09-27-1908-bbc.co.uk.txt?) which was 80 characters wide and as many lines long as needed.

Would that be relatively simple to do by using an existing library?

Context

I am integrating brow.sh into a multiline refreshable Braille display (Canute Console).

It would be a great benefit for blind developers, we hope, to get a spacial layout of a web page. As it stands brow.sh is not quite suitable for browsing on the Canute Braille display. There are some changes to navigation and interaction in brow.sh that I will be looking into and hopefully can propose them or submit code. But, meanwhile, exporting to plain text would be comparatively simpler and come with major benefits for Braille readers.

@tombh
Copy link
Member

tombh commented Oct 3, 2023

This is actually already possible with "server mode": https://www.brow.sh/docs/in-browser-usage/

Usage example: curl --header "X-Browsh-Raw-Mode: PLAIN" localhost:4333/https://google.com

@11100010
Copy link

11100010 commented Oct 9, 2023

it would be great if it had a flag like --dump to get the text-only output

@pachpict
Copy link
Author

pachpict commented Nov 9, 2023

Hi there @tombh, thanks for the suggestion. I tried your example and got the source code for sites. What I was referring to was getting a snapshot of the ascii output the browsh writes to the terminal window and saving that as a plain text file. For example if I open browsh oin xfce4-terminal there is an xfce4-terminal option to 'Save Contents' to a txt file. Of course it only captures the lines on the screen and doesn't handle the images very well, but that's the kind of thing I'm thinking about.

@tombh
Copy link
Member

tombh commented Nov 9, 2023

What about https://asciinema.org? Or the underlying it technology it uses?

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

3 participants