Re: [dev] reading an epub book with less: adventures in text processing

From: Greg Reagle <list_AT_speedpost.net>
Date: Mon, 11 Mar 2024 11:28:24 -0400

On Sat, Mar 9, 2024, at 4:06 PM, Georg Lehner wrote:
> Option 1: use w3m
[snip]

All great commands. Thank you.

> The reason you loose formatting when saving from less(1) or w3m is, that
> these programs on purpose do not save the terminal control characters
> which are doing the markup. Line breaks and terminal control are created
> on demand, depending on the type and size of the terminal (window) and
> will display different (weird) when any of this is different from the
> terminal you (would have) saved them to a file.

Yes I have noticed this. I would like to be able to tell programs to keep the formatting, but they decide automatically on their own to remove it. The automatic decision to keep or remove formatting based on terminal type is fine, but I find it very annoying that I cannot override this decision with many programs. GNU's ls is an exception (with the --color option). I would like to tell w3m or elinks to dump html and keep the formatting, which they cannot do (directly). There are ways around that cause extra steps.

> The -s option (--standalone) option for Pandoc is not required for man
> page output.

Well it definitely is for me, meaning the version of Pandoc that I use: 2.17.1.1-2~deb12u1 amd64
Received on Mon Mar 11 2024 - 16:28:24 CET

This archive was generated by hypermail 2.3.0 : Mon Mar 11 2024 - 16:36:09 CET