This page describes how to edit pages on the wiki using Gemini and Titan. At the moment, editing via the web is enabled everywhere, so if you're on the web, all you need know is that all page edits require a “token”. Currently, the token is “hello”. It might change in the future.

If you're a developer and would like to learn more about the Titan protocol used to edit pages on this wiki, there's more information on the Titan page.

Titan

Using Lagrange

How does it work on this wiki?

In order to edit the page you just wrote, simply click “Upload Page with Titan” again. The old text should still be there.

If not, follow the link to the “Raw text” at the bottom and use “Copy Page Source” from the context menu before you click “Upload Page with Titan”. If you use the page source of a regular page, you'll also get the page header and footer into your clipboard.

Get Lagrange from skyjake's page:

Lagrange

WebDAV

If you have access to a command line client like cadaver, connect to “https://transjovian.org:1965/test”. You will be asked for credentials if you try to make changes in the “/raw” or “/file” folders. Provide any username you want (it is ignored) and the token “hello” as the password. Make sure you have the EDITOR environment variable set if you want to use the “edit” command inside cadaver.

If you are using Gnome Files, your first URL must already authenticate you. Use “davs://transjovian.org:1965/test/login”. Provide any username you want (it is ignored) and the token “hello” as the password.

Every wiki space comes with the same folders:

At the top level, you also have a link to all the wiki spaces.

Note that currently the HTML files don’t have the .html extension and the gemtext files don’t have the .gmi extension. I’m still trying to get this to work correctly. Previously, when I tried it, new files would end up getting .gmi.gmi as an extension and that was not cool, either.

Using WebDAV to edit the wiki

Perl

Here's option that make it as simple as copying a file on the command line: get the gemini (download) and titan (upload) scripts from the Phoebe repository and install them in your PATH somewhere, such as ~/.local/bin. Both are written using Perl 5.

gemini

titan

App::phoebe on CPAN

Use gemini to download the Gemtext using the raw URL:

gemini gemini://transjovian.org/test/raw/testing > testing.txt

Make some changes using your favourite text editor and upload it again:

titan titan://transjovian.org/test/raw/testing --token=hello testing.txt

Vim or any other editor

Here’s a little script called edit-gemini which takes a URL, downloads it (using openssl), calls your $EDITOR (quite likely to be vim), and when you’re done it asks you whether you want to upload it. Perfect! 🚀👍

edit-gemini

To see what $EDITOR you have, run:

echo "$EDITOR"

You may want to change it to a different program. You can also set it to graphical editors.

Emacs

Alternatively, if you're into Emacs, you can use Elpher (from MELPA) and some glue code to edit pages.

The Gemini Write glue code that allows Elpher to edit pages

A video demonstrating what it looks like

OpenSSL

Save the page content without the header line into a file, e.g. test.txt:

echo "gemini://transjovian.org/test/raw/testing" \
  | openssl s_client --quiet --connect transjovian.org:1965 2>/dev/null \
  | tail --lines=+2 > test.txt

Upload the test.txt file again:

echo "titan://transjovian.org/test/raw/testing;mime=text/plain;size="`wc --bytes < test.txt`";token=hello" \
  | cat - test.txt \
  | openssl s_client --quiet --connect transjovian.org:1965 2>/dev/null

In short, the URL must contain three parameters:

Bash

This repository defines gemini and titan as two Bash functions.

https://alexschroeder.ch/cgit/gemini-titan/about/

As you can see from the examples, the argument handling in these shell functions is a bit different compared to how the Perl scripts linked above handle it. I don't think I'll continue to maintain these shell functions. If you're into Bash, please take over! 😃