Edit links (proposal)

This is a propsed extension to the Titan specification.

The Titan Specification

If the server is a site that heads header or footer to pages, then people are tempted to edit the page including header and footer, and if the edit succeeds, the site then adds a second header and footer. Such sites need a link to a “raw” version of the page somewhere, containing just the page text to be edited.

If the server is a site that allows editing by multiple people, locking resources might be something to consider. In order for the server to know that a user is attempting to lock a page for editing, a “lock” URL has to be requested in order to lock a page.

One way to provide both is to define a new set of parameters for the Titan URL. Client and server do the usual TLS handshake and then the client sends the Titan URL:

“titan://example.org/test/testing;edit\r\n”

That is, the target URL, followed by exactly one parameter: “edit”.

The response to this request is the content you need to edit the page. What you save is going to change the response to a Gemini request of the same URL without the “edit” parameter:

“gemini://example.org/test/testing\r\n”

That is to say, the “raw” page without headers or footers or post-processing. It the content an author would need to make a change. Note that this doesn’t necessarily need to be text. The MIME type depends on the resource the user wants to edit. The original is not necessarily “text/gemini”.

The server is free to lock a page for editing or do anything else it wants to do knowing that the user intends to edit the page.

No mechanism is defined to remove the edit lock, so servers must necessarily use a timeout.

If a server uses edit locks and a user saves a page from the client and “goes back” the client might need to request the same URL again, using the Titan URL with the “edit” parameter, in order to create the edit lock. Whether this is mandatory or not is not defined.

If a server uses edit locks and the same IP requests the edit lock, it’s up to the server to decide whether it wants to treat this request as the same person trying to edit the page and that therefore this should succeed.

If a server uses edit locks and another user requests the Titan URL with the “edit” parameter for a page that is already locked, a 40 TEMPORARY FAILURE status with the <META> line explaining that the page is currently locked for editing.