Text reflow woes (or: I want bullets back!)y

solderpunk solderpunk at SDF.ORG
Sun Jan 12 18:43:41 GMT 2020
Okay, I have started to re-engage with this endless discussion -
slowly and, I have to admit, reluctantly.  When I think about how many
details there are to consider here, how many different options we have
to choose among, and how absolutely incredible the power-to-weight
ratio is of verbatim fixed-width text with a predefined width (I
mean, really, you can:

Left align text,
                             center text,
                                                 even right align text

without the client having to even know what those things are!), it's
incredibly tempting to echo the "reflowed text be damned!" sentiment
recently expressed at mozz.us[1] and spec 40 character fixed text and
just move on.

But I know that'd be rash.  These days I have been worrying less about
catering to small-screened mobile devices and thinking more about the
ability for Gemini to be self-documenting.  Granted, the text/gemini
format is pretty darned simple by design, but nevertheless, having
really nice and clear instructions for beginners, many of whom may
conceivably never have written either web or gopher content before in
their life, will be important to the widespread adoption of the
protocol.

Imagine how much harder it would be to learn HTML if websites couldn't
actually contain any code that you could copy and paste!  This is
exactly where Gemini is today.  Yes, okay, you could put a single
space at the start of a link line so it would be displayed as-is rather
than treated as a link, and that would be mostly fine.  But it would
interfere with the ability to simply copy and paste a block of example
links and have it work as-is, because the spaces at the front of at
least some of the lines would get copied as well.

Gopher is better than the current Gemini spec in this regard, because
you can put gophermap lines in an item type 0 text file no problem and
they'll just be displayed as-is.  But copying and pasting that
gophermap is not guaranteed to go smoothly.  With terminal-based
applications, the tabs would stand a good chance of being transformed
into consecutive spaces, which would actually break them.  Let's be
better than that!  Let's make it possible to display, copy and paste 
Gemini links inside of Gemini documents, to facilitate teaching and
talking about Gemini over Gemini.  It seems quite natural that this
should be possible.

Even if text/gemini were specced at 40 fixed-width characters with no
reflow, meeting this goal would require some syntax comparable to
<pre> tags in HTML, to switch off processing of Gemini links.  If
we're going to have that anyway, we may as well have reflowed text be
the default and this <pre> syntax can do double duty by also enabling
non-reflowed text for source code, poetry, etc.

I remain as commited as ever to the idea that any text/gemini markup
should have the property that simple clients can just dump it right to
stdout verbatim and that should be very usable.  As I argued
previously, this rules out any kind of syntax where <pre> lines are
indicated by some per-line prefix, as that prefix would break
copy-and-pastability for simple clients dumping things to stdout.
This is one more reason not to use the "leading whitespace" system
proposed by Sean[2] (whose detailed spec remains a very nice and
useful precise definition of lots of fuzzy concepts being slung around
here).

So, given this, I am pretty much settled on using an easily
recognisable line to toggle this mode on or off, say:

```

This is the syntax used in the simplified Markdown proposal at
mozz.us[3], and in ratfactor's "Text Junior" format[4], which others
on this list have argued is a good candidate for Gemini syntax.

I have experimented with supporting this syntax, and allowing
reflowing of text not enclosed by ``` lines to an arbitrary
user-specified width in AV-98 (not pushed to tildegit yet, but expect
it soon).  It really is not too difficult to do, so I don't think
complexity of implementation is a good argument against this.

Does anybody know of a programming language where lines consisting only
of three consecutive single quotes happen to occur frequently?

To address briefly some other points raised in this thread:

Somebody suggested that the ``` syntax or similar be used to toggle on
reflowed text, with fixed text being the default.  I have to admit
this feels really backwards to me.  There are many obvious and common
use cases for wanting to embed small fragments of fixed text inside a
document that one would otherwise want flowed.  I can't think of any
case where I'd want the reverse, but of course if people can I'm happy
to hear them.

I am not crazy about the idea of having text/gemini "source code"
consist of extremely long lines of text which are then brutally
wrapped to a given width by a user's terminal.  Some editors might be
smart enough to present that long line wrapped at word boundaries to
the author, but many won't be and this will result in a very ugly
editing environment.  And I'm not aware of any terminal emulator which
wraps long lines at word boundaries, so this will result in an ugly
reading experience for *all* sized screens.

I also really don't like the idea of supporting colour in Gemini
documents.  I see no way to do this with a syntax which would degrade
gracefully when simply dumped to stdout.  This would also open the
possibility of obnoxious pages with gratuitous use of colour.  No,
thanks!

Cheers,
Solderpunk

[1] gemini://mozz.us/journal/2019-12-05.txt
[2] gemini://gemini.conman.org/gRFC/0004
[3] gemini://mozz.us/markdown/
[4] gopher://sdf.org:70/0/users/ratfactor/phlog/2019-04-21-text-junior


Archive home | About this archive