Supporting multi-line input without changing the specification

Katarina Eriksson gmym at coopdot.com
Tue Feb 23 00:40:36 GMT 2021
Since we're still getting proposals, I'm writing something I read somewhere
gemini related. I do not claim I invented this myself. (Except the codes at
the bottom.)

# Objective

Provide a way for users to send bigger chunks of text to the server.

# User experience

Support for regular status 10 input, CGI and client certificates assumed.

## Clients with multi-line support

The reader klicks a link. A text box, with a label from the meta part,
appears. The reader writes and sends the message.

## Clients without multi-line support

The reader klicks a link. An input field, with a label from the meta
part, appears.
The reader writes the first line, end the line with a marker character to
signal a wish to continue and sends the request. The server responds with a
new input until it doesn?t receive that marker character.

It should be easier to exit the loop than to continue.

## Servers

The writer puts a script (or a symlink to a script) in a reasonable
location and link to it in gemtext. The script handles the incoming texts.

# Behind the scenes

The server needs to indicate to the client that it expects a multi-line
text. One way is to send a new 1x status, like 12, but that is a spec
change. Other ways are to use a specific file name extension or a keyword
in the meta field.

I must admit I prefer the new status code over the others. Other options?

The client needs to indicate to the server that it wants to continue the
text in another request. I have chosen & since it doesn't need to be
escaped and doesn't have a specific meaning yet in gemini.

## Example

S: "10 New guest book entry (multi)\r\n"
C: "gemini://guestbook.example/new.multi?Neat%20that%20you%20can%20post%20
multi-line%20texts.&n\r\n"
S: "10 (more)\r\n"
C: "gemini://guestbook.example/new.multi?I%20wonder%20if%20clients%20will%20
adopt%20it.\r\n"

## Codes

I have written a script to experiment with user experience. These are the
codes I came up with:

* Input lines ending with "&n" indicates that the next request is a new
line.
* Input lines ending with just "&" indicates that the line continues
immediately in the next request. (Can be in the middle of a word.)
* Input lines ending with "&p" saves a round-trip when you want to insert a
blank line.
* Everything else indicates that it is the final line.

These codes are made to be typed by a human. A client translating a text
box could just put "%0a" to break a line and end the input with a "&" when
it reaches the maximum request length to continue in the next request.

-- 
Katarina
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailing-list-archive.gemi.dev/www/attachments/20210223/ed698236/attachment.htm>


Archive home | About this archive