~adnano/gemini

9 7

[ANN] twinwiki, a Gemini wiki edited with sed commands

Details
Message ID
<CANmFPemKtTiYrC+=w7aq6qgXMHbhzb4O_axSnsB624fuiUEV2g@mail.gmail.com>
DKIM signature
missing
Download raw message
Hi!

I'm announcing my first proper piece of Gemini software: twinwiki!

The general idea is that a single line of input[1] works for very few text
editing interfaces, yet most of us know one: sed. Mostly people use a very
small subset of sed. Here I've implemented a slightly larger subset and I
feel you could actually edit pages quite well if the browser showed line
numbers.

To get a feel, please try out this test instance:
gemini://hannuhartikainen.fi/twinwiki

Feel free to create new pages and edit the existing ones. All page changes
can be reverted. Pages cannot be deleted. I.e. if you're able to break
something, it's my fault.

The basic wiki features exist: you can edit, create pages, view history,
see an index of pages and read help.

Some caveats:
- Navigating back to a /_edit?<sed_command> URL will redo the edit, which
is mostly not what you tried to do. This will probably be an issue on many
gemini applications; browsers will need to consider it if applications
become a thing.
- The sed syntax is not fully POSIX even for the implemented parts:
whitespace after commands is taken literally; regex syntax is the one from
the Rust regex crate.

The project page (git repo, mailing lists, ticket tracker) is at
https://sr.ht/~dancek/twinwiki/

Any comments, contributions etc. are welcome. I hope this will give other
people other ideas about possible user interfaces.

-Hannu

[1] A sed command containing newlines will probably work, too, as long as
it's percent-encoded properly (ie. \n = %0A). However, the Gemini spec
suggests that the input should not contain newlines: "The requested
resource accepts a line of textual user input." Is it a bad sin to send
multiple lines?
Details
Message ID
<C3Z28BTHDR5A.3NW4VJZOIO9UP@freebsd.lan>
In-Reply-To
<CANmFPemKtTiYrC+=w7aq6qgXMHbhzb4O_axSnsB624fuiUEV2g@mail.gmail.com> (view parent)
DKIM signature
missing
Download raw message
On Sun Jul 5, 2020 at 9:49 PM EDT, Hannu Hartikainen wrote:
> The general idea is that a single line of input[1] works for very few
> text
> editing interfaces, yet most of us know one: sed. Mostly people use a
> very
> small subset of sed. Here I've implemented a slightly larger subset and
> I
> feel you could actually edit pages quite well if the browser showed line
> numbers.

I really like the idea of using sed for a wiki interface. Nice work.

int 80h
Details
Message ID
<fea1ec2a-945d-c883-ab1c-c6a1fef5dcea@ryliejamesthomas.net>
In-Reply-To
<C3Z28BTHDR5A.3NW4VJZOIO9UP@freebsd.lan> (view parent)
DKIM signature
missing
Download raw message
On 6/7/20 8:56 am, int 80h wrote:
> On Sun Jul 5, 2020 at 9:49 PM EDT, Hannu Hartikainen wrote:
>> The general idea is that a single line of input[1] works for very few
>> text
>> editing interfaces, yet most of us know one: sed. Mostly people use a
>> very
>> small subset of sed. Here I've implemented a slightly larger subset and
>> I
>> feel you could actually edit pages quite well if the browser showed line
>> numbers.
> 
> I really like the idea of using sed for a wiki interface. Nice work.
> 
> int 80h
> 

Same, what a beautiful idea!
Frederick Yin <fkfd@macaw.me>
Details
Message ID
<6F6A614B-08D2-4906-B741-6A492E485BB3@macaw.me>
In-Reply-To
<CANmFPemKtTiYrC+=w7aq6qgXMHbhzb4O_axSnsB624fuiUEV2g@mail.gmail.com> (view parent)
DKIM signature
missing
Download raw message
On July 5, 2020 10:49:55 PM UTC, Hannu Hartikainen <hannu.hartikainen+gemini at gmail.com> wrote:
>- Navigating back to a /_edit?<sed_command> URL will redo the edit,
>which
>is mostly not what you tried to do. This will probably be an issue on
>many
>gemini applications; browsers will need to consider it if applications
>become a thing.

Maybe we could try adding a volatile session token assigned to each edit request. Then, reject any other edit with the same (and other unauthorized) token.

For example:
* Client requests /twinwiki/Sandbox/_edit
* Server generates session token, a random hex string, valid for this page and this ten minutes only
* Client gets redirected to /twinwiki/Sandbox/_edit/<session_token> 
* Client asks user for sed command.
* User fills in sed command, sends request to <session_token>?<sed_command>.
* Server checks validity of token. Once verified, apply change and destroy token. Otherwise, reject.

Overall, twinwiki is way cooler than I could have imagined. If we are to continue this conversation we should probably move to the sr.ht list instead.


~fkfd
Details
Message ID
<0f155c37-88fa-dd26-21ab-4a81027c1e02@systemli.org>
In-Reply-To
<CANmFPemKtTiYrC+=w7aq6qgXMHbhzb4O_axSnsB624fuiUEV2g@mail.gmail.com> (view parent)
DKIM signature
missing
Download raw message
I tried opening the test instance, but none of my clients can handle it. 
Kristall says it violates protocol by using CRLF, Castor crashes, 
Alrisha shows an error, Moonlander error, asuka crashes, diohsc says the 
header is malformed, etc.

I think I finally got it to open with AV98. AV98 don't care. :D

-- 
gemini://kwiecien.us/
Details
Message ID
<CANmFPekW0mJScu7T7S6xL5YwezuO9q30pPHegLT1NEdAaot_nQ@mail.gmail.com>
In-Reply-To
<0f155c37-88fa-dd26-21ab-4a81027c1e02@systemli.org> (view parent)
DKIM signature
missing
Download raw message
Oops! I didn't really read the spec thoroughly and just used println! for
the header lines. I changed all header lines to use CRLF. It should work
now.

-Hannu
Details
Message ID
<NA0Ai3TFDQxX0-lqxQPjrrs-l_67u9Q8kKADMi9OC8nkuQKvJW9di8vZJPk97VyN8Pz_Ar7bvKk1yHtTqyOiJ5ZnkXmSM7OtvR0PEiX5v3c=@protonmail.com>
In-Reply-To
<CANmFPekW0mJScu7T7S6xL5YwezuO9q30pPHegLT1NEdAaot_nQ@mail.gmail.com> (view parent)
DKIM signature
missing
Download raw message
Ok with Geminaut.

"Edit mode" should display the document with line number :-)

freD.
Details
Message ID
<K9Dmbtd7v_5C4BmN7bAQHQAg2ywPlDkasFWCJEuIPHYLYr_MMw0BdRKGV5EGIats-c184mYmbZUW3qdtKi0gLbTBah0ZfS-ED7_vaEwA10I=@protonmail.com>
In-Reply-To
<NA0Ai3TFDQxX0-lqxQPjrrs-l_67u9Q8kKADMi9OC8nkuQKvJW9di8vZJPk97VyN8Pz_Ar7bvKk1yHtTqyOiJ5ZnkXmSM7OtvR0PEiX5v3c=@protonmail.com> (view parent)
DKIM signature
missing
Download raw message
and edit CGI should prevent multiple execution of the same command :-)

freD.
Details
Message ID
<567a8c09-666a-35b0-3fdd-59d8d50faf74@systemli.org>
In-Reply-To
<CANmFPekW0mJScu7T7S6xL5YwezuO9q30pPHegLT1NEdAaot_nQ@mail.gmail.com> (view parent)
DKIM signature
missing
Download raw message
On 7/6/20 12:26 PM, Hannu Hartikainen wrote:
> I changed all header lines to use CRLF. It should work now.

Looks good! Works perfectly in Kristall now

-- 
gemini://kwiecien.us/
Details
Message ID
<C40I64YJ29HC.306D6VQSHM4O0@stilgar>
In-Reply-To
<CANmFPemKtTiYrC+=w7aq6qgXMHbhzb4O_axSnsB624fuiUEV2g@mail.gmail.com> (view parent)
DKIM signature
missing
Download raw message
On Mon Jul 6, 2020 at 12:49 AM CEST, Hannu Hartikainen wrote:
> Hi!
>
> I'm announcing my first proper piece of Gemini software: twinwiki!
>
> The general idea is that a single line of input[1] works for very few
> text
> editing interfaces, yet most of us know one: sed. Mostly people use a
> very
> small subset of sed. Here I've implemented a slightly larger subset and
> I
> feel you could actually edit pages quite well if the browser showed line
> numbers.

Kiitos t??st?!  Eritt?in kiva idee.  Obviously this sed-based approach
is viable for a narrow slice of people, but in general this is a mindset
that I would like to see become part of "Gemini culture", i.e. embracing
constraints and coming up with creative ways to work within them.

I've added this to the software list, and while I was at it, broke all
CGI applications (at least the ones I recognised as being CGI
applications) out into their own section.  If you've written a CGI tool
for Gemini and I don't have it listed, please let me know.

Cheers,
Solderpunk
Reply to thread Export thread (mbox)