New Software, hot off the press | |
2019-06-29 2pm | |
I have not had much time to code at home with the new baby, which | |
is as it should be. However, I have pecked together a few things | |
while the wife and baby have been asleep (such as right now). | |
Both were worked on as little side projects. Since I have been | |
sleepy I ahve not wanted to work on Bombadillo (dont want to | |
mess anything up out of carelessness). | |
The first if 'gfu', or Gophermap Format Utility. At the moment it | |
does what many servers will already do for you: it will take a | |
file as input and convert any lines that are not valid gopher | |
links into item type "i" links. There is a flag "-d" to reverse | |
this process. This should make it easier for users on Colorfield | |
Space to maintain their gopher hole while using chalk, the text | |
editor in use here. I believe gophernicus will already do this | |
for you, though I am not sure all the syntax. So if using a local | |
program to do this feels comfortable: go for it! I will also be | |
adding the ability to add a header or footer from a filepath to | |
a gophermap. Again, largely a thing that a server can do for you | |
but may be nice to be able to maintain yourself. I like static | |
files rather than dynamic generation on the fly when possible. | |
The second bit of software I have forked on is a port of the | |
Python3 mailcap library to Golang. Apparently Golang does not | |
have an easy way of working with mailcap files and the Python | |
code was in the ballpark of clear so I thought I would port it. | |
The reason for the interest in working with mailcap files is to | |
support the | |
gemini protocol | |
a number of people in the gopher community are working on | |
(solderpunk is the organizer; definitely get involved!). Since | |
its request response model uses mime types I would like to be | |
able to code a client in golang and be able to have files that | |
will not be served natively by the client (images, sound, video) | |
be opened by an appropriate piece of software on a user's system. | |
I have made good progress with the port. I have it in a working | |
state to be able to take an action (view, edit, etc) based on | |
a mimetype and file or filepath and have the correct program | |
open it (or at least an applicable program). The code is NOT | |
the cleanest I ahve ever written, it is downright sloppy in | |
some places but I partially blame the Python lib for that as I | |
took very few liberties while porting. I plan to go back through | |
and try to make it cleaner and more idiomatically go-like. It | |
was a big pain to figure out how to get golang to run a terminal | |
program. the os/exec package at first seems like the one to do | |
so... but alas, it would not. Eventually I landed on syscall | |
and everything got better from there. | |
I'll post a link to the port soon, as well as some thoughts on | |
the gemini project. In the meantime, you can grab | |
gfu | |
on tildegit. | |