flexibeast.space - gemlog - 2021-06-25
Re: Reformatting gemini text
Gemini prescribes putting whole paragraphs in single line. I find it extremely unfortunate, since it places burden of textwrapping on client instead of server.
Which is, in my opinion, exactly where it should be. Clients know the width of the device they're running on, and can reflow text appropriately. This point is explicit in the Gemini FAQ:
Text in Gemini documents is wrapped by the client to fit the device's viewport, rather than being "hard wrapped" at ~80 characters with newline characters. This means content displays equally well on phones, tablets, laptops and desktops.
On my Android phone, i use the excellent Ariane client[a]. At its default font size, my screen is ~44 characters wide; with the “Large Gemtext” accessibility option turned on, it's ~32 characters.
i'm not sure what the “burden” of textwrapping is for the client. Processing power? Well, Gemini requires TLS, and my guess is that the amount of processing power required for TLS is greater than that required for wrapping text. Extra lines of code? Well, as far as i can tell, if paragraphs were hard-wrapped internally, then any client that has to deal with a viewport less than the wrap width (which could be a mobile device, or a desktop window sized thus) would have to first unwrap the paragraph in order to be able to eventually present the user with appropriately flowed text[b].
Personally - and as someone who's been using computers since the early 80s - i'm glad that gemtext doesn't use the column width of an IBM punch card as its lowest common denominator.
Regarding other parts of the “Reformatting gemini text” post:
Wrapping text is art
i'm not sure what is meant by this. Unless i'm writing poetry or code - both of which are handled by gemtext preformatted blocks - i don't want to have to think about wrapping, which is semantically irrelevant to what i'm writing. If for some reason i have to hard-wrap text within paragraphs, then in Emacs, i'll just be using M-q to fill-paragraph up to the appropriate value of fill-column.
smashing whole paragraph into single line is one shell command
As is reflowing a single-line paragraph using fmt(1) or (on POSIX-only systems) fold(1), at least one of which will surely be available on any system that has sed(1):
$ fmt -w 72 file.txt
☙
☙
[a] “Ariane”
[b] By which i mean, text which doesn't contain some lines consisting of at most a few orphaned words.