-- Leo's gemini proxy

-- Connecting to gemini.hitchhiker-linux.org:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini;lang=en-US

Capsule Migration

2022-03-30

I spent my little bit of free time the last two days doing some code cleanup and documentation passes on Vostok. I'm sure that it's not "fully baked" yet, but it was close enough to migrate the capsule over this morning. Overall, I'm pretty well pleased with the result. The actual migration probably only took about 20 minutes, involving initializing the capsule, and then adding the relevant metadata to each post in order to recreate things as close as possible after running vostok build.


There is still a lot to document before I would want anyone else to use it. I've pretty much finished with the rustdoc comments, but I want to write a bit of a guid to it's usage. The cli is actually pretty nicely self documenting, but some things won't be obvious if you didn't write the code. Example, on the main index page, the string {% posts %} will get replaced with a section of links to the most recent gemlog posts. I've tried to keep things like this to a minimum and didn't want anything like an html template engine, but for some things that sort of simple string replacement just makes things nice and flexible.


There's also a couple of papercuts to clean up. The main site index and gemlog index must be created manually, and have to exist or the capsule will fail to build. I'm going to change this behavior so that the main index gets created when the capsule is initialized, and so that the gemlog itself is entirely optional. Basically when this part is complete running vostok build will render the gemlog if the "gemlog" subdirectory exists and has at least one post, and create a generic index if no index page exists.


I was giving some thought to parallelizing the application, but considering how quickly the build completes I think it would essentially be a waste of effort. On a Raspberry Pi 4 it completed basically instantaneously, and I had to check to be sure it did in fact generate anything (it did). That's a nice testament to how easy it is to write nice, efficient Rust, because I'm not particularly great at it..


Another nicety was my recent discovery of the clap-complete crate. Adding this along with clap as a build dependency allowed me to have cargo generate shell completions as part of the build during compilation. The generated completions are also quite good. The only thing I feel they are currently missing, is that I would love to be able to tab complete when I'm typing in a path. But that's a minor issue. Currently it's making completions for Bash, Zsh, Fish and PowerShell. This has worked out well enough that I went in and added the same feature to gfret.

clap-complete on crates.io

I have a small list of features that I want to work on in the future. This is the running list, kind of for my own future reference.

Create a build/packaging script which packages the binary and shell completions into a platform appropriate directory layout

Add subtitles

Optionally print the publication date as text on each page

Optionally prepend the publication date to the generated file's path for gemlog posts

Allow use of an ascii art banner to be used as a page header, if the file "banner.txt" exists in the capsule root

The aforementioned tweaks to capsule initialization

And for my own personal use of Vostok

Create some webhooks to rebuild the site when I push a new post to the git repo


Tags for this page

announcements

vostok

programming


Home

All posts


All content for this site is licensed as CC BY-SA.

© 2022 by JeanG3nie

Finger

Contact

-- Response ended

-- Page fetched on Mon May 20 08:30:43 2024