Questions about ``` lines

On Thu, May 21, 2020 at 08:31:19AM +0200, Katarina Eriksson wrote:
> Hello Geminauts

Hello!

> 1. Are ``` lines to be block markers or mode switches?
 
> >From the discussions on the the list, it seems like they are block markers.
> The current spec calls them "toggle lines" that toggle "pre-formatted mode
> being on or off" which suggests it's a mode switch.

They are definitely mode switches, as stated in the spec.

People tend to speak quite informally on the list - sometimes too
informally for my tastes!  I have noticed people referring to Gemini
sites/servers as websites or webservers which always stuns me a bit...

 
> The way I interpret the difference between the two is that blocks need to
> close before end-of-file to be valid and in the other case the file can end
> in any mode.

There's nothing invalid about a file ending with pre-formatted mode on
according to the current spec and I don't really see a need for this to
change.  Clients should set the value of pre-formatted mode to off
when they begin pasing a new document.

In general, there should be as few ways as possible for a text/gemini
file to be "invalid", it should be dirt simple.  To be honest, I'm kind
of surprised by all the discussion around some kind of
formatting/validating/linting tool for text/gemini.  It doesn't bother
me and people who want them can certainly write them, but to me it seems
like there is so little scope for messing things up writing it by hand
that tools like that feel unnecessary and cumbersome.
 
> 2. Is it desirable to close the window of extensibility?
> 
> When reading the archives, I noticed that ``` lines used to only work if
> they had no trailing characters. This was changed to be less surprising
> when someone writes
>     ```python
> as if it was a markdown code block.

That was the main motivation, but as a little side thing it also meant
it became true that all line types can be unambiguously recognised by
inspecting only their first 3 characters, and I liked having something
that simple apply without exception.  If nothing is allowed after the
 ``` you need to also check the line length to recognise toggles.

>     ``` Visual browsers will
>     ``` not display these lines.
>     ``` So as long as there are
>     ``` an even number of them,
>     ``` I can get away with using
>     ``` them as comment lines.

My first thought: Oh, cute!  Cute and neat...
 
>     ``` @embed image/png
>     ``` width=300 height=200
>     => path/to/image.png Alt. text

...followed by "Oh, dear God, no!" :O

This is a real and frightening way that clients can sneak in support for
arbitrarily complicated extra functionality, and it degrades absolutely
invisibly in non-supporting clients, so there is no incentive against
content authors using it.  I congratulate you for recognising this and
thank you for bringing it to our attention!  In some ways, this is the
logical conclusion of all the discussion around putting stuff for
clients to parse in that space.

> I don't think we need to close this window, but I also don't see a need to
> allow consecutive ``` lines.

I don't see a need to allow consecutive ``` lines either, but I am
really, really attached to the current property of text/gemini that you
can handle it correctly by handling each line independently of every
other line in a single top-to-bottom pass with very minimal internal
state.  Forbidding consecutive ``` lines would break that and require
the parser to remember the type of the previous line.

But I see no other way to close this window without reverting to toggle
lines being strictly three-characters only, and then we lose the
alt-text option.  To be honest, I could live without specifying
programming languages to enable syntax highlighting in text/gemini - I
get that that's *nice*, but it's not really essential.  But the alt-text
thing kind of feels important to me, because people are right now using
pre-formatted blocks to do things that ruin accessibility/searchability
without it, and those things matter.

I guess one could cynically ask "what makes you think people doing that
right now would use alt-text to fix the problem if you gave them the
means to?", and conclude that we just have to let people suffer the
consequences of not using text/gemini "cleanly"...
 
> These are real questions with added context and not opinions or rhetoric
> dressed as questions.

Definitely real food for thought in here.  Thanks again for this post.

Cheers,
Solderpunk

---

Previous in thread (2 of 6): 🗣️ plugd (plugd (a) thelambdalab.xyz)

Next in thread (4 of 6): 🗣️ James Tomasino (tomasino (a) lavabit.com)

View entire thread.