💾 Archived View for gemi.dev › gemini-mailing-list › 000278.gmi captured on 2024-03-21 at 17:17:09. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-12-28)

-=-=-=-=-=-=-

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

1. Hannu Hartikainen (hannu.hartikainen+gemini (a) gmail.com)

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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.orbitalfox.eu/archives/gemini/attachments/20200706/b713
b8ec/attachment.htm>

Link to individual message.

2. int 80h (int (a) 80h.dev)

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

Link to individual message.

3. rjt (lists (a) ryliejamesthomas.net)

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!

Link to individual message.

4. Frederick Yin (fkfd (a) macaw.me)

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:

and this ten minutes only

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

Link to individual message.

5. Ben (benulo (a) systemli.org)

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/

Link to individual message.

6. Hannu Hartikainen (hannu.hartikainen+gemini (a) gmail.com)

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.orbitalfox.eu/archives/gemini/attachments/20200706/1280
9d88/attachment.htm>

Link to individual message.

7. defdefred (defdefred (a) protonmail.com)

Ok with Geminaut.

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

freD.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.orbitalfox.eu/archives/gemini/attachments/20200706/094d
de1b/attachment.htm>

Link to individual message.

8. defdefred (defdefred (a) protonmail.com)

and edit CGI should prevent multiple execution of the same command :-)

freD.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.orbitalfox.eu/archives/gemini/attachments/20200706/85ce
323a/attachment.htm>

Link to individual message.

9. Ben (benulo (a) systemli.org)

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/

Link to individual message.

10. Solderpunk (solderpunk (a) posteo.net)

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

Link to individual message.

---

Previous Thread: Hacker News again

Next Thread: Geminaut