💾 Archived View for gemini.panda-roux.dev › log › entry › 43 captured on 2023-06-14 at 13:58:26. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-01-29)

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

MoonGem 2.0.0 Released!

Posted on Thursday December 30, 2021

I'm pleased to announce that MoonGem 2 is all ready to go.

Read the most up-to-date README.md here on my Git page

Scripting Update

I'm normally loathe to take such a drastic step as incrementing a major version number like this. Considering that the scripting syntax has been completely overhauled in a non-backwards-compatible fashion, however, the SemVer gods demand that I do so.

A couple of months ago I made a post describing the syntax changes

This model has stuck around, and I'm quite pleased with how it's turned out.

As small example, here's the contents of the page I'm using to render my gemlog index:

# panda-roux's gemlog

Here I write about my personal projects, day-to-day life, and idle thoughts.

=> gemini://warmedal.se/~antenna This gemlog is actively updated on Antenna
=> gemini://calcuode.com/gmisub-aggregate.gmi Also a part of Callum's aggregator

=> /log/feed.xml Atom feed
=> / home

{{
local gemlog = require 'gemlog'
local db = gemlog:create()

for post in db:get_posts() do
  local date = os.date('%Y-%m-%d', post.timestamp)
  mg.link(
    string.format('/log/entry?%d', post.id),
    string.format('%s - %s', date, post.title))
end
}}

In the above, I'm using the script begin/end delimiters ('{{' and '}}') on their own lines, but it's not perfectly fine to mix them in-line with other gemtext:

The current time is: {{ return tostring(os.time()) }}

My hope is that this, in addition to the switch to using a single `mg` library table for all API methods, will make MoonGem significantly more developer-friendly. At least it will look more familiary to folks who are used to looking at Lua code.

Stuff only I care about

Aside from the scripting refactor, the most exciting part of this as far as I'm concerned is the switch to an asynchronous IO model courtesy of libevent2! I've also updated the URI handling to use proper PCRE, which has cleaned-up that part of the code nicely.

- panda-roux -

next: "I set up a Matrix instance"

prev: "Update"

Email me about this post

Leave a comment

[2021-12-30 09:48:51] panda-roux (ba929):

I wrote this way past my usual bedtime, so please excuse the typos... I'll fix em eventually.

[2021-12-30 11:49:09] a friend (e0d1a):

looks good, definitely better syntax

index

home