Convert unwrapped paragraphs to hard wrapped paragraphs when there's no blank lines.
Linux for blind general discussion
blinux-list at redhat.com
Fri Mar 27 16:25:32 UTC 2020
Hi,
On Fri, 27 Mar 2020 15:30:29 +0000
Linux for blind general discussion <blinux-list at redhat.com> wrote:
> Okay, this isn't strictly an accessibility question, but I can't think
> of any better place to ask and Google didn't help much.
>
> I occasionally purchase eBooks from Smash Words as they're the only
> eBook Store I know of that offers plain text along side the far too
> prevalent for my liking PDF, ePub, and Kindle formats.
>
> Problem is, their plain text eBooks are typically long enough Firefox
> and Orca simply choke on them and they have paragraphs that are
> unwrapped, which makes reading them with nano and SBL cumbersome.
> Normally, I'd just use nano's justify command to hard wrap thewhole
> file, but they lack blank lines between paragraphs, so Nano would
> think the whole book a single paragraph.
>
> So, does anyone know a way to automate inserting blank lines before
> and after each line in a file that's too long to fit on the screen all
> at once and then hard wrap those long lines?
>
I don't understand how paragraphs start and end in these files. Otherwise you
can try using one of the text processing tools mentioned here:
* https://www.shlomifish.org/open-source/resources/text-processing-tools/
* https://www.computerhope.com/unix/ufold.htm
* https://en.wikipedia.org/wiki/Fmt_(Unix)
* https://en.wikipedia.org/wiki/Par_(command)
Note that you may have better luck converting EPUBs (assuming they lack
https://en.wikipedia.org/wiki/Digital_rights_management ) to plaintext using
tools such as https://pandoc.org/ ,
https://metacpan.org/search?q=html%3A%3Awikiconverter&size=20 , etc.
Regards,
Shlomi Fish
>
> _______________________________________________
> Blinux-list mailing list
> Blinux-list at redhat.com
> https://www.redhat.com/mailman/listinfo/blinux-list
>
--
Shlomi Fish https://www.shlomifish.org/
https://is.gd/MQHVF3 - The Atom Text Editor edits a 2,000,001B file
Real programmers use a nice editor and a nice programming language and get it
done in less than O(N!).
— vanguard on Freenode’s ##programming
Please reply to list if it's a mailing list post - http://shlom.in/reply .
More information about the Blinux-list
mailing list