💾 Archived View for gaazoh.flounder.online › devlog › 2022-03-03-gemtext.gmi captured on 2023-12-28 at 15:03:17. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2022-04-28)

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

Gemini client devlog 1: Parsing gemtext

I'm completely new to JavaScript, so I figured I'd familiarize myself with the easier task of parsing gemtext and converting gmi documents to HTML.

This feels like a very backwards thing to do.

Solderpunk: Hey y'all the web is bloated and HTML is a mess and JavaScript sucks so I invented gemini:// and gemtext to provide a minimal and sane alternative
me: cool I'll use JavaScript to turn it back into HTML

I kinda understand why seemingly no one has released something like this before. But, hey, given my goal of making a KaiOS browser, I don't really have much of an option, and a lot of people have done very similar things in order to proxy gemini content in HTML pages served on HTTP.

But that's beside the point. I build something in JavaScript and it works.

The gemtext format is straightforward enough that I barely had to think about the algorithm and could focus on how to write it. Yet I had a real thing to work towards that allowed me to do that, not just an artificial exercise as is often the case when getting familiar with a new language.

In the end, I have a parser that handle every bit of the spec, I squashed a few bugs on some edge cases and I don't believe there are any left, and I'm not as afraid as before at tackling the harder bits such as implementing the protocol.

I plan on releasing the code under a free license soon, but in the meantime I asked for a review on Code Review StackExchange (but didn't get an answer yet), so if you're interested you can have a peek at my code there.

Code review request on StackExchange

So far, I sort of get why JS has a bad reputations, but in an attempt to stay positive, I'll list what I did like programming in JavaScript:

In conclusion, JS is OK and I have a parser, yay! Now I just need to build a protocol library, a URL parser, a nice HTML/CSS wrapper, a settings system... Lots of fun times to come!